-
Notifications
You must be signed in to change notification settings - Fork 913
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
PSBTs, Meet the HSM #3762
PSBTs, Meet the HSM #3762
Conversation
0ffd4fb
to
984d4a6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Travis doesn't really seem to be happy with this PR, other than that I have only minor comments.
Travis is unhappy because we require ElementsProject/libwally-core#203 to be merged -- there's a number of P2SH-P2WPKH bugs in the existing libwally-psbt implementation, that we now hit. |
984d4a6
to
54f513e
Compare
Re-uses code from what was the bitcoin_tx_to_psbt_b64
This lets us parse invalid/bad psbt data from user input without crashing
We're not using the change_outnum for withdraw tx's (and the way we were calculating it was broken as of the addition of 'multiple outputs'). This removes the change output knowhow from withdraw_tx entirely, and pushes the responsibility up to the caller to include the change output in the output set if desired. Consequently, we also remove the change output knowhow from hsmd.
PSBT's dont' serialize / unserialize if there's any sig info set on the global transaction
instead return a boolean indicating the success/failure of a sig set
will either use a temporary psbt (and not munge the passed in psbt) or will finalize in place -- finalization erases most of the signature metadata from the psbt struct
our code generators expect the serialization name to match the struct type
this will allow us to add inputs that aren't ours to a tx that we sign and finalize
54f513e
to
4513600
Compare
fixes for p2sh-p2wpkh sigs in libwally etc
4513600
to
37811fd
Compare
Reviewed based on this range-diff ACK 37811fd |
Updates the HSM withdrawal to take a PSBT and utxo set. We sign the inputs that we've got utxos for, and return a psbt with the attached signatures.
This 'fully' integrates the PSBTs with our HSM for the first time, and gets us ready for a
signpsbt
command (coming soon).Note that this is built atop #3740
(new content begins at
965014d), and requires ElementsProject/libwally-core#203 to be merged in order to pass tests (as there's a number of P2SH-P2WPKH bugs in the existing libwally-psbt implementation)
Changelog-None