Skip to content

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
heap-coder added a commit to heap-coder/rust-miniscript that referenced this pull request Sep 27, 2025
…ey_spend_sig` to take the public key

1c2800e2c5eeb96ae779fb5d1f506e6d53bffdd0 satisfy: change `lookup_tap_key_spend_sig` to take the public key (Andrew Poelstra)
97ef17ab50f4f2303e2d53b1eb6df696d0fff690 psbt: make PsbtInputSatisfier internals private (Andrew Poelstra)
8a93d0695b868382f9ed78929fd1bd4a11e0f80b psbt: add accessor to PsbtInputSatisfier for the input it holds (Andrew Poelstra)

Pull request description:

  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

ACKs for top commit:
  sanket1729:
    ACK 1c2800e2c5eeb96ae779fb5d1f506e6d53bffdd0.

Tree-SHA512: c1d1a8128823e4fa70f2dd671400825c7d3ee5d45d35b19a60cce221379373bd6ad099847246d93d62f6f10886e84e5c09a57a2f00435257af4cc8ee97348395
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