-
Notifications
You must be signed in to change notification settings - Fork 41
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
Change Signer::sign_tx_input to Signer::sign_psbt_input #172
Conversation
Mmm I'll have to sit on this one for a bit. I'm actually experimenting with taproot DLC now I'll let you know once I've got a better understanding of the issue. |
Okay, FWIW, I couldn't sign a funding tx with taproot inputs without this but now was able to. https://mutinynet.com/tx/58688201c22b27fb390b89656bad670fddad8322a2d3a6bec1d485a33c1cfd9e |
I'm not sure I see the advantage of using a PSBT compared to just passing say an array of |
You could just pass the txouts and scripts but i imagine most people will just make it into a PSBT, most wallets and libraries just use PSBTs for negotiating all this information. |
Would like to see this make it's way through. If most users, like myself, are using BDK it makes the API a lot easier. |
I'm not convinced that the PSBT should be created within the library. It's easy to create it if people want to use it, but it adds many lines of codes to the library (creating and unpacking it after it gets signed). |
Created #184 but tbh this still feels like a better approach |
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.
I personally much prefer #184. @luckysori any opinion on this?
7770236
to
8400a91
Compare
Sorry I took so long to get to this. #184 is nice because the change set is smaller and clearer. But I can see why this PR might make things easier for others. Also, I would assume most people using We're not currently affected by this, so I don't feel strongly about this. |
I can't speak to how much this change will make life easier for signing taproot transactions but in general I'm in favor of using PSBTs on the API level. It's very likely that developers using As @luckysori already said, we're currently not affected by this, so I neithert feel strongly about this (: |
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.
Alright I'll try to put my PSBTphobia aside, let's go with this. Couple of things to fix and then LGTM.
0e71ed8
to
d841f2a
Compare
5f98784
to
a1ec1c5
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.
Two minor comments.
a1ec1c5
to
1aa67fe
Compare
5b34da2
to
07a4018
Compare
Fixed |
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.
Some small stuffs left
With the previous API, signing taproot inputs comes with a lot of problems. Taproot signatures commit to the previous txo of all the inputs so to be able to construct a signature, you need to have all of them available. The previous API would require the user to look up the outputs themself which does not really work for mobile clients and it is a bad practice. This changes it to a PSBT so we can give all the necessary info to the user directly.
07a4018
to
9b4b450
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.
LGTM 🎉
With the previous API, signing taproot inputs comes with a lot of problems. Taproot signatures commit to the previous txo of all the inputs so to be able to construct a signature, you need to have all of them available. The previous API would require the user to look up the outputs themself which does not really work for mobile clients and it is a bad practice. This changes it to a PSBT so we can give all the necessary info to the user directly.