Skip to content

Add exact canonical HORS index verifier - #348

Open
adrienlacombe wants to merge 2 commits into
solving-bitcoin:mainfrom
adrienlacombe:codex/hors-exact-index
Open

adrienlacombe wants to merge 2 commits into
solving-bitcoin:mainfrom
adrienlacombe:codex/hors-exact-index

Conversation

@adrienlacombe

Copy link
Copy Markdown
Contributor

Question

Can a HORS opening bind the exact raw index sequence that a Binohash consumer would read, instead of upper-clamping oversized indices?

Change

Add hors_exact_index_locking_script alongside the existing clamped helper. It checks canonical ScriptNum bytes, 0..n range, and strictly increasing order inside Script, including when MINIMALDATA is disabled. Strict local execution tests cover valid openings, out-of-range and negative values, nonminimal encodings, duplicates, reordering, wrong preimages, and extra/missing items.

At n=32,t=8, the exact verifier uses 914 policy-produced script bytes, the same 280-byte representative 16-item data witness, zero hints, a 51-item combined stack peak, and 164 executed non-push opcodes. This PR also corrects the old HORS opcode metric: the local tapscript interpreter's ExecStats::opcode_count counts all parsed instructions, including pushes (145/250); the final straight-line scripts have 88/164 non-push opcodes. The helper does not derive indices from a message or enforce one-time key use. Evidence remains local tapscript execution, unclassified for deployment; a funded Core spend and Binohash composition remain open.

Validation

  • cargo test --locked hors --lib (20 passed)
  • cargo test --locked --lib signatures::hors::tests::exact_indices_bind_range_order_and_preimages -- --exact (passed after metric correction)
  • UPDATE_PRIMITIVE_METRICS=1 cargo test --locked --test primitive_metrics hors_ (3 passed)
  • python3 tools/kb.py validate (203 records, 783 configurations)
  • cargo fmt --all -- --check; git diff --check
  • Full non-field Rust suite will run in CI.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T19:50:29.350592Z a064557 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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