-
Notifications
You must be signed in to change notification settings - Fork 16
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
Unsigned transactions cannot be parsed by bitcoind #129
Comments
So, when a transaction has an unsigned input, the serialized script is It looks like garbage indeed. |
The code is confusing, because of all the branching. It seems that unsigned transactions get through an "estimate_size" branch, in which a blank pubkey ("210000...") and a blank Schnorr signature ("410000...") are used in the serialization. But simply forcing the other branch (estimate_size=Falase) does not produce a raw tx that works for "decoderawtransaction" either. |
This could be the issue: https://github.com/Bitcoin-ABC/ElectrumABC/blob/master/electroncash/transaction.py#L673 There is additional (non standard) data added to each input when unsigned transactions are generated. So my initial assessment was wrong, it is not causes by dummy signatures being added. Related discussions: |
Confirmed: if I comment out that block, the hex is a proper unsigned tx that can be decoded by the node. |
Thanks for doing a proper investigation. Looking forward to the fix. |
Steps to reproduce
bitcoin-cli decoderawtransaction <raw-tx-hex>
Expected output
(note empty script sig)
Actual output
Investigation at a glance
The raw hex output by ElectrumABC appears to fill in some garbage in the scriptSig instead of the scriptSig byte length expected to be 0 (which will give output like in the Expected Output section above). The expected output was generated using
createrawtransaction
(see example here: https://developer.bitcoin.org/examples/transactions.html#simple-raw-transaction ) and comparing its output fed back intodecoderawtransaction
against the output from ElectrumABC.The text was updated successfully, but these errors were encountered: