Repository navigation
Validate reduced four-mode Binohash pinning under Core - #344
adrienlacombe wants to merge 1 commit into
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6d38b3ca52
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return (len(bytes.fromhex(tx["hex"])) == tx["total_bytes"] and | ||
| decoded["txid"] == tx["txid"] and decoded["weight"] == tx["weight"] and | ||
| decoded["vsize"] == tx["vsize"] and decoded["size"] == tx["total_bytes"]) |
There was a problem hiding this comment.
Derive checked identities from raw transaction hex
consistent() accepts a transaction whenever the raw hex has the advertised byte count and separately stored decoded fields match separately stored metadata; it never derives a txid or wtxid from the hex. Consequently, changing any nibble in a valid, mutation, wrong-size, or funding transaction while preserving its length still makes report_passed() return true, although the Core verdict and transaction ID now refer to a different spend. This lets the checked report lose the transaction-to-Core comparison while retaining differentially-validated; hash or parse each raw transaction during validation.
AGENTS.md reference: AGENTS.md:L31-L32
Useful? React with 👍 / 👎.
| items, zero hint items, and zero serialized witness | ||
| bytes**. All four signature items coexist at script entry. The script has 15 | ||
| static non-push opcodes, including the three separators. Its opcode-level | ||
| combined main-plus-alt-stack bound is five items for this input shape; an |
There was a problem hiding this comment.
Include the target push in the stack bound
With the four signature items live at script entry, the first OP_SIZE produces a fifth stack item and the following 71 data push produces a sixth before OP_EQUALVERIFY consumes the two size values. The advertised five-item combined bound is therefore one item too low for this input shape; report six (or measure the executed peak) so the resource result is accurate.
AGENTS.md reference: AGENTS.md:L55-L56
Useful? React with 👍 / 👎.
Question
Can the four ordered legacy sighash modes used for transaction pinning coexist in one funded spend, with later field choices preserving earlier signatures?
Change
Add a policy-compiled bare-legacy, two-input Core fixture with four cheap exact-size signature predicates. It signs in the order
NONE|ANYONECANPAY,NONE,ALL|ANYONECANPAY,ALL, then compares six one-field mutations and four shortened-signature controls under pinned Core v30.3. The checked report includes complete funding and spending transactions, signature attempts, digests, byte and opcode costs, consensus/policy verdicts, and negative report mutations.The valid 159-byte locking script enters a block in a 439-byte / 1,756-WU spend. Each field mutation fails at input 1; each shortened signature fails its size predicate. Default relay policy rejects the bare input. This is a reduced four-mode composition test with public keys and a low work factor; it does not establish the full Binohash protocol or security estimate.
Validation
cargo test --locked --example binohash_four_mode_pinning(1 passed)cargo test --locked --test primitive_metrics binohash_four_mode(1 passed)python3 tools/binohash_four_mode_pinning_regtest.py(pinned Core report passed)python3 -m unittest tools/test_binohash_four_mode_pinning_regtest.py(passed, 15 negative report mutations)python3 tools/kb.py validate;cargo fmt --all -- --check;git diff --check