Skip to content

satisfy: change lookup_tap_key_spend_sig to take the public key #827

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

Merged
merged 3 commits into from
Jun 12, 2025

Conversation

apoelstra
Copy link
Member

There is only one public key possible, but this makes the API more consistent between keyspends and script-spends, and makes it much easier for users who have a key->sig lookup table to implement satisfiers.

Fixes #825

Currently we have ugly and repeated code self.psbt.input[self.index].
Replace this with an accessor function which is easier to read and
easier to use outside of the module.
We don't need access to the internals anywhere, and this is just a POD
type with two Copy objects inside so the user can just keep them around
after construction if they need access.

Add an accessor for the PSBT anyway since it might be convenient.

Making these fields private does not break compilation at all.
There is only one public key possible, but this makes the API more
consistent between keyspends and script-spends, and makes it much
easier for users who have a key->sig lookup table to implement
satisfiers.

Fixes rust-bitcoin#825
Copy link
Member Author

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On 1c2800e successfully ran local tests

@apoelstra
Copy link
Member Author

Because this is API-breaking I can't backport it to 12.x. It will be available in rust-miniscript 13.

Copy link
Member

@sanket1729 sanket1729 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 1c2800e.

I am not excited by this change. But I can see how this helps ergonomics. ACK

@apoelstra apoelstra merged commit 5b862b5 into rust-bitcoin:master Jun 12, 2025
31 checks passed
@apoelstra apoelstra deleted the 2025-06_sat_api branch June 12, 2025 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Satisfier::lookup_tap_key_spend_sig(&self) should take the pubkey as an argument
2 participants