-
Notifications
You must be signed in to change notification settings - Fork 152
psbt: satisfy any ToPublicKey key #137
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
Conversation
Signed-off-by: Antoine Poinsot <[email protected]>
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.
As discussed on IRC, we probably need to implement Satisfier on a structure that also has information for (nSequence, nLocktime) etc. The current implementation on psbt::Input
does not have sufficient information to implement the satisfier for after
and older
.
We require the complete psbt to get the nSequence, nLockTime fields.
I guess this PR is independent of the above issue, we can merge this |
I'm actually gonna concept NACK this, because it plays badly with Rust's trait coherency rules. It prevents users from implementing |
@darosior why do you say it "could not be reimplemented for a more generalistic key downstream"? |
IIRC: As it's implemented for |
Right, if you try to implement it for all |
@apoelstra Why do you think that that downstream user would need another implementation of |
Oh, oops, I misread this PR. I thought we were implementing on |
concept ACK then :) |
:) More generally, what about we either:
As the middle ground seems confusing to me (you likely don't need a specific implem for just one key type but rather for all |
Is the first option what's being proposed in this PR? |
Conceptually, i think so. Was not the original motivation though. |
The satisfier was only implemented for
bitcoin::PublicKey
and could not be reimplemented for a more generalistic key downstream.Also, it makes sense after #131 (i have a rebased version for my own needs here https://github.com/darosior/rust-miniscript/commits/satisfy_xpubs). All signatures are looked for by raw public key, and thus should be added to the mapping with
to_public_key()
(which derives the one pointed by theDescriptorPublicKey
in #131).Could have rebased it on #131 to add a test xpub-descriptor, but seemed overkill as the change is pretty straightforward.