PSBTs, Meet the HSM - #3762
Merged
cdecker merged 13 commits intoJun 23, 2020
Merged
Conversation
niftynei
force-pushed
the
nifty/psbt-hsm-withdraw
branch
from
June 12, 2020 20:57
0ffd4fb to
984d4a6
Compare
cdecker
reviewed
Jun 15, 2020
cdecker
left a comment
Member
There was a problem hiding this comment.
Travis doesn't really seem to be happy with this PR, other than that I have only minor comments.
Collaborator
Author
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. |
Merged
niftynei
force-pushed
the
nifty/psbt-hsm-withdraw
branch
from
June 17, 2020 21:28
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
niftynei
force-pushed
the
nifty/psbt-hsm-withdraw
branch
from
June 22, 2020 18:08
54f513e to
4513600
Compare
fixes for p2sh-p2wpkh sigs in libwally etc
niftynei
force-pushed
the
nifty/psbt-hsm-withdraw
branch
from
June 22, 2020 18:29
4513600 to
37811fd
Compare
Member
|
Reviewed based on this range-diff ACK 37811fd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
signpsbtcommand (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