Skip to content

Validate Taproot script-path commitments before local verdicts - #243

Merged
RobinLinus merged 1 commit into
solving-bitcoin:mainfrom
adrienlacombe:codex/taproot-commitment-preflight
Sep 28, 2026
Merged

RobinLinus merged 1 commit into
solving-bitcoin:mainfrom
adrienlacombe:codex/taproot-commitment-preflight

Conversation

@adrienlacombe

Copy link
Copy Markdown
Contributor

The local leaf profiles accept a revealed script even when its Taproot control-block parity bit is wrong. Bitcoin Core rejects that funded spend with Witness program hash mismatch. This adds a host-side commitment preflight for the complete script-path witness and P2TR prevout, then gates the fixture's combined local verdict on it. The leaf result remains visible as a separate diagnostic.

The preflight handles an optional final annex, checks the control block with rust-bitcoin's Taproot commitment verifier, and distinguishes commitment failures from unsupported or absent contexts. It verifies only the revealed script's commitment; transaction validity and relay policy remain Core's responsibility. The existing depth-zero parity mutation now agrees with pinned Core v30.3, bringing the 44-fixture report to 88/88 combined local/Core comparisons. Two isolated Core runs produced byte-identical reports (SHA256 83b59980d332d8da78fe0850a9bc54aba6352bbc6f79f5f073a7210a27aa4010). Depth-one, annex, key/script/sibling mutations, malformed controls, and future leaf versions have focused local tests; those cases are not claimed as Core differentials.

Validation: python3 tools/kb.py validate; cargo fmt --check; 12 offline Core-runner tests; focused commitment and fixture tests; cargo test --locked -- --skip fields::; and two pinned Core regtest runs.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@RobinLinus
RobinLinus merged commit d4559b3 into solving-bitcoin:main Sep 28, 2026
3 checks passed
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.

2 participants