Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid tx when spending only to change output #14

Open
libitx opened this issue May 6, 2022 · 0 comments
Open

Invalid tx when spending only to change output #14

libitx opened this issue May 6, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@libitx
Copy link
Contributor

libitx commented May 6, 2022

// Assume a utxo object like the following
const utxo = { txid, vout, satoshis, script }

tx = new nimble.Transaction()
tx.from(utxo).change(address).sign(privkey)

Broadcasting the above results in network error:

16: mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation)]

I think there is an issue with the incorrect value being on the output, which would mean the preimage is wrong. eg, sign() should probably call this._calculateChange() before it generates the preimage and sig. But even when we do that the above error persists which suggests something else is afoot.

@libitx libitx added the bug Something isn't working label May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant