Skip to content

12.x: plan: add Plan::tap_sighash_default accessor#950

Open
evanlinjin wants to merge 1 commit into
rust-bitcoin:release-12.xfrom
evanlinjin:12.x-plan-tap-sighash-default
Open

12.x: plan: add Plan::tap_sighash_default accessor#950
evanlinjin wants to merge 1 commit into
rust-bitcoin:release-12.xfrom
evanlinjin:12.x-plan-tap-sighash-default

Conversation

@evanlinjin
Copy link
Copy Markdown
Contributor

@evanlinjin evanlinjin commented May 17, 2026

Summary

12.x backport of #951.

Adds a public accessor on Plan that exposes the existing per-Schnorr-placeholder size assumption — recorded when the plan was built from TaprootCanSign::sighash_default — as a single Option<bool>.

impl Plan {
    /// Returns whether the witness was sized assuming `SIGHASH_DEFAULT` (the
    /// 64-byte Taproot signature encoding).
    pub fn tap_sighash_default(&self) -> Option<bool>;
}

See #951 for full rationale and the test.

Test plan

🤖 Generated with Claude Code

Backport of rust-bitcoin#949 (target: release-13.x) to the 12.x line.

Exposes the existing per-Schnorr-placeholder size assumption — recorded
when the plan was built from `TaprootCanSign::sighash_default` — as a
single `Option<bool>` on the Plan.

Callers constructing a PSBT can use this to populate
`PSBT_IN_SIGHASH_TYPE` consistently with the witness-size assumption
baked into `Plan::satisfaction_weight`.
@evanlinjin evanlinjin marked this pull request as draft May 17, 2026 08:09
@evanlinjin evanlinjin marked this pull request as ready for review May 17, 2026 08:23
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.

1 participant