Skip to content

docs(blake3): record keyed mode boundary - #72

Merged
RobinLinus merged 3 commits into
solving-bitcoin:mainfrom
brenorb:docs/blake3-keyed-boundary
Sep 28, 2026
Merged

RobinLinus merged 3 commits into
solving-bitcoin:mainfrom
brenorb:docs/blake3-keyed-boundary

Conversation

@brenorb

@brenorb brenorb commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • record that the local BLAKE3 generators expose unkeyed mode only
  • add a deterministic keyed-vs-unkeyed boundary probe
  • document the missing key-word/flag pricing frontier as NR-047 and OP-023

Validation

  • cargo fmt --check
  • git diff --check
  • python3 tools/kb.py validate
  • cargo run --quiet --example blake3_keyed_boundary
  • cargo test --locked hashes::blake3::tests::test_official_test_vectors -- --exact

The full repository test suite was not run.

Copy link
Copy Markdown
Contributor

Review: hold pending the changes below.

Fold this into the BLAKE3 scope package with #65/#69/#77. Before publishing its size measurements, compile through compile_with_policy() and measure the resulting ScriptBuf; the example currently uses Script.len(), which is not the required final policy-produced byte count. The current example runs, but that does not fix this measurement boundary.

Historical local validation (September 11, at this unchanged PR head): python3 tools/kb.py validate passed; the boundary example ran successfully.

Rebase on current main, address the specific gaps above, and run the affected correctness and active metric checks. Broad/full-repository runs are not requested.

Reviewed commit: 7e39a60304d170e1113b65d1e036f71f8a971716.

@brenorb
brenorb force-pushed the docs/blake3-keyed-boundary branch from 7e39a60 to a691e8a Compare September 19, 2026 03:10
@brenorb

brenorb commented Sep 19, 2026

Copy link
Copy Markdown
Contributor Author

Updated in commit a691e8a and rebased onto current main. The keyed-mode boundary probe now imports the repository ScriptCompilation policy, compiles blake3_short_compute_script(32) with compile_with_policy(), and reports the resulting ScriptBuf length: 59534 bytes. It no longer measures the raw Script directly. The BLAKE3 scope package is preserved with fresh current IDs NR-064 and OP-027, because OP-023 through OP-026 are already used on current main for parent-tree, XOF, derive-key, and compressed-shift work. Focused checks passed: cargo run --locked --example blake3_keyed_boundary, cargo test --locked --lib hashes::blake3::tests (19 passed), cargo test --locked --test primitive_metrics (105 passed, 1 ignored), cargo fmt --all -- --check, python3 tools/kb.py validate, and git diff --cached --check.

Copy link
Copy Markdown
Contributor

Review of a691e8a10aa11931ac9dfdcd08de721080f13905:

The probe now measures compile_with_policy() output, addressing the previous measurement issue. Preserve the existing negative-result entries alongside this keyed-mode boundary, then rerun the example and KB validation. The unkeyed-only scope is correctly presented as an interface limitation.

Current integration conflicts: knowledge/negative-results/index.md. These must be resolved and the integrated result validated before merging.

Validation scope: source/diff and existing CI review; no new full-repository or field-arithmetic test run was requested.

brenorb and others added 2 commits September 28, 2026 01:36
…result to NR-069

Integrate origin/main (3d1001f) into the BLAKE3 keyed-mode boundary PR.

- knowledge/negative-results/index.md: keep main's file byte-identical
  (NR-001..NR-066, NR-071) and append the keyed-mode entry under its
  assigned ID NR-069 instead of the colliding NR-064. Entry text is
  otherwise unchanged; no PR-side link referenced the old anchor.
- src/arithmetic/u4/mod.rs: take main's sorted module list; the PR side
  only reordered declarations and every PR-side module is present on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
OP-027 is assigned to PR solving-bitcoin#92. Move the BLAKE3 keyed-mode frontier to its
assigned ID OP-028 and update every PR-side reference: the open-problems
heading, both BLAKE3 catalog records' open_problems lists, the NR-069
entry, and the keyed-mode negative-result page link/anchor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@brenorb

brenorb commented Sep 28, 2026

Copy link
Copy Markdown
Contributor Author

Addressed in 13bf557ffc6348f9352370a196ec67ccfc1c1d47 (merge ab8950c471909df9c854aa700c3b6c7564fd614d of current main 3d1001fc, plus one ID-renumbering commit). The keyed-mode boundary is preserved alongside every existing negative-result entry.

  • Conflicts: main has moved from e9d5a66 to 3d1001fc since the review. Against current main, git merge --no-ff origin/main conflicts in knowledge/negative-results/index.md (as you reported) and also in src/arithmetic/u4/mod.rs. The PR side of u4/mod.rs only re-sorted module declarations, and main already contains every one of those modules in sorted order. I took main's file, and cargo fmt --check passes. knowledge/catalog.json and knowledge/open-problems.md merged automatically. The catalog record-set comparison is main 117 records / 283 configurations, PR 101 / 244, merged 117 / 283. Both main and the PR are subsets of the merged catalog, with no duplicate ids. The only catalog change relative to main is this PR's two BLAKE3 limitations lines and open_problems entries.
  • Negative-result ID collision: the PR appended ## NR-064: BLAKE3 keyed mode is outside the current generator contract. Main already has ## NR-064: Data-only signature budgets falsely reject complete spends (line 1646), which knowledge/tapscript-budget-validation.md links to. The keyed-mode entry is now NR-069. Its text is otherwise identical. No PR-side link pointed at the old anchor.
  • Main's entries preserved: the merged index.md is main's file byte-for-byte (a cmp of the main-length prefix is identical), followed by NR-069. It has 68 NR headings: main's 67 plus NR-069. grep -o '^## NR-[0-9]*' knowledge/negative-results/index.md | sort | uniq -d is empty. A link check over all Markdown files resolved 34 of 34 #nr-… anchors to headings in the index. This includes the NR-064 link in tapscript-budget-validation.md, which still reaches the budget entry. I temporarily renamed NR-069 back to NR-064: the grep reported ## NR-064, while python3 tools/kb.py validate still passed (117/283). So the KB validator does not detect duplicate NR ids, and the grep does. The mutant was reverted.
  • Open-problem ID: OP-027 is assigned to docs(research): record signed-window schedule frontier #92, so the keyed-mode frontier is now OP-028. I updated the heading, both BLAKE3 catalog open_problems lists, the NR-069 text, and the link and anchor in blake3-keyed-mode.md. No OP-027 reference remains. The only duplicate OP heading is OP-019, which already exists twice on main (PRINCEv2 M-hat and signed-window decoding). This PR does not touch it. A link check resolved 21 of 21 open-problems.md#op-… anchors, including #op-028--blake3-keyed-mode-frontier. With the heading temporarily renamed to OP-026, the grep reported ## OP-026. kb.py validate failed only because OP-028 was now missing, not because of the duplicate. The mutant was reverted.
  • Probe / policy compilation: cargo run --locked --example blake3_keyed_boundary prints current_compute_script_bytes=59534 from blake3_short_compute_script(32).compile_with_policy(). This matches the blake3_short_32 README metric and catalog value. The example has no assertion on the size. Its only assertion is assert_ne!(unkeyed, keyed). I did not add a size assertion. The number is informational, and the metric fixture already owns it. Two temporary mutants were run and reverted:
    • Using Hasher::new() in place of Hasher::new_keyed(&key) makes that assertion fire: assertion left != right failed, with both sides e528e957…fb56c65.
    • Routing the size through compile_with_options(CompileOptions::NONE) prints the same 59534. The script is above the 32 KiB optimizer cutoff, so the policy output is the unoptimized serialization.
  • Scope wording: the unkeyed-only / interface-limitation wording is unchanged in NR-069, blake3-keyed-mode.md, the README, and the catalog. It is described as an interface boundary, not an impossibility proof.

Validation on the committed HEAD with a clean tree:

  • python3 tools/kb.py validate: valid, 117 records / 283 configurations.
  • python3 -m unittest discover -s tools -p 'test_*.py': 49 passed.
  • cargo fmt --all -- --check: passed; no conflict markers.
  • cargo test --locked --lib hashes::blake3: 25 passed, 3 ignored.
  • cargo test --locked --test primitive_metrics: 133 passed, 1 ignored (the expensive README regeneration).
  • cargo test --locked --no-run: passed.
  • The example: ran as shown above.

No metric values changed. Evidence remains locally-reproduced and deployment is unclassified. No Bitcoin Core or relay-policy validation is claimed.

@RobinLinus
RobinLinus merged commit 043c3c1 into solving-bitcoin:main Sep 28, 2026
3 checks passed
@brenorb
brenorb deleted the docs/blake3-keyed-boundary branch October 28, 2026 02:57
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