Validate Taproot primitives against pinned Bitcoin Core - #1
Open
adrienlacombe wants to merge 5 commits into
Open
Validate Taproot primitives against pinned Bitcoin Core#1adrienlacombe wants to merge 5 commits into
adrienlacombe wants to merge 5 commits into
Conversation
This was referenced Sep 10, 2026
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Local fragment success did not establish complete Taproot validity: resource checks were incomplete, some signatures were misclassified or panicked, and PRINCEv2 assumed caller-validated plaintext nibbles. This adds explicit consensus/policy fragment profiles, narrowly tested interpreter repairs, a checked PRINCEv2 computation leaf, and complete funded transactions validated against hash-pinned Bitcoin Core v30.3 (
49faec4f87f5cd19c88db01a82e5c68b087c8227).Three independent experiment harnesses now cover 84 fixtures:
prince_verify(key, ciphertext)requires exactly 16 canonical nibbles, performs encryption, compares all 16 ciphertext nibbles and leaves one true item. Three independent upstream-C vectors pass consensus and default policy; 17 invalid count/encoding/range/ciphertext cases reject. All 40 local profile/Core comparisons match. Two fresh-node reports are identical; a separate optimized-host reproduction is identical too.The checked PRINCE leaves measure 6,426 bytes for the zero key and 6,582 for the published key. Complete Taproot witnesses are 6,480 / 6,496 / 6,651 bytes; combined stack peaks are 633 / 633 / 685; transaction weights are 6,858 / 6,874 / 7,029 WU. Every honest invocation has 16 simultaneous entry data items, zero hint items and 18 complete witness items. The whole leaf is compiled once through repository policy for execution, metrics and commitment. Static opcode counts are recorded separately; executed counts remain unavailable because validation has branches. These public-key computation predicates provide no transaction authorization or plaintext secrecy. Deployment evidence applies only to the exact recorded spends.
The original 6,136-byte PRINCE fragment and every historical metric/report remain unchanged. The Winternitz complete fixture remains 1,599 leaf bytes, 2,432 witness bytes and 2,810 WU, with 70 entry data items, zero hints and peak 119. Signature fixtures retain explicit data/full-witness counts and zero hints; two ordinary padding items keep them away from incomplete local full-witness budget framing. Complete local commitment/annex validation and budget initialization remain open. Missing SIGHASH_SINGLE output ordering has local regression coverage and pinned Core source inspection, outside the funded signature corpus.
Fresh Rust reports now derive dependency identities from the binary's embedded
Cargo.lockthroughsupport::provenance. The utility rejects missing, ambiguous, malformed or non-Git identities. It replaces copied interpreter pins and the signature generator's duplicate parser; an old binary retains its embedded identity after the on-disk lock changes. This identifies resolved Git source, not local edits in a Cargo checkout. Existing fixture JSON is byte-identical after the refactor.CI now separates formatting/knowledge/Python, non-field Rust, and the three Core experiments. It runs fixture example tests explicitly, preserves
--skip fields::, pins action commits, verifies cached Core archives and uploads fresh reports as artifacts. Host dev/test optimization preserves assertions and Script compilation policy. The setup action preserves Cargo warning behavior rather than applying its default-D warningsto existing research warnings.The immutable Cargo patch uses integration
702544c9for both the lab andbitcoin-script-stack. It combines resource/index/minimal-push PRs #18, #19, #20, Sander Bosma's existing CODESEPARATOR fix #16 with additional tests, and empty-signature #21 / signature-error #22 repairs. These contributions remain unmerged. Compiler and other dependency pins are unchanged; the independently submitted compiler performance experiment remains separate.Local validation on macOS ARM64:
CARGO_PROFILE_TEST_OPT_LEVEL=1 CARGO_TARGET_DIR=target/nonfield-opt1 cargo test --locked -- --skip fields::: 460 passed, 24 existing ignored, 143 field tests filtered.Reproduction and scope:
knowledge/prince-core-validation.md,knowledge/tapscript-signature-validation.md,knowledge/core-validation.md,src/support/README.md, and the separate raw reports undertests/data/. Remote CI results should be assessed from the PR checks; the validation above was run locally.GitHub created upstream run 34459059905 for head
396c6f5e9d28c266c41318c93f420062fed33158with conclusionaction_requiredand no jobs. This account has read-only upstream permissions; remote CI has not executed.