Repository navigation
Conversation
5abe5ae to
9d07b3e
Compare
9d07b3e to
c1c00f1
Compare
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: c1c00f1293
ℹ️ 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".
| The maximum canonical NAF data witnesses at these fixed widths are 18 and 28 | ||
| bytes respectively: one item-count byte, three bytes for the scalar claim, and |
There was a problem hiding this comment.
Include scalar sign padding in the width-16 witness maximum
For a width-16 opening, the valid NAF [0,1] repeated eight times represents 43690, whose canonical ScriptNum encoding is aa aa 00: three payload bytes because of sign padding. Under the stated serialization boundary, its data witness occupies 1 + (1 + 3) + 16 + 8 = 29 bytes. The published 28-byte maximum, also copied into the knowledge page and catalog's witness_bytes_max, therefore understates the supported-domain bound. Keep 28 for the measured 21845 fixture, but update the maximum to 29 and cover this sign-boundary case.
AGENTS.md reference: AGENTS.md:L55-L56
Useful? React with 👍 / 👎.
Summary
Adds
verify_scriptnum_naf(width), a table-free verifier for a canonical nonnegative ScriptNum and its retained non-adjacent-form (NAF) opening.{-1,0,1};scalar = Σ digit[i]·2^i;Measured complete leaves
Each NAF leaf includes validation, exact comparisons of every retained item, and terminal
OP_TRUE. The scalar-only baseline checks the same canonical nonnegative value and retained scalar, without asking for a decomposition. Witness byte counts include scalar/digit item counts and CompactSize lengths, but not Taproot framing or transaction context.The NAF side validates and retains a digit stream; the plain side does not. No scalar-compression or scalar-multiplication win is claimed. NR-112 records the baseline tradeoff and rejected source-depth variants. OP-067 tracks a consuming schedule.
Review corrections
2^31−1 = -1 + 2^31, exposed intermediate overflow. Negative reconstruction now forms2a−1asa+(a−1), with an explicit regression test.Evidence and gates
locally-reproduced; executionunclassified.python3 tools/kb.py validate: 204 records, 784 configurations.c1c00f1293bf2fa866ea2d6c48d0240beffecfbe, including locked non-field tests and pinned repository Core comparisons.No new-fragment Bitcoin Core differential, relay-policy, deployability, or cryptographic-security claim is made. Repository Core harness checks cover existing fixtures rather than differentially validating this primitive.