AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Informational 15 Bitcoin

unit-tests: drive the BIP-322 tests from the BIP's pinned test vectors

Public commit record

What the developer wrote

Authored by Ruben Waterman

91/100 · Strong
unit-tests: drive the BIP-322 tests from the BIP's pinned test vectors

Replace the two hand-copied cases with the "tx_hashes" table of
bip-0322/basic-test-vectors.json, vendored verbatim in specs/bip322/
(pinned to bips commit d77863fb, 2026-05-06) and rendered into
unit-tests/bip322_vectors.inc.c by specs/bip322/gen.py. The generator
recomputes every hash independently before emitting anything, and CI
now runs its --check alongside the BIP388 one, in the workflow renamed
to codegen-check.yml.

This adds the UTF-8 vector that was missing, and covers the to_sign
txid of each vector on top of the to_spend one.

Also check, for every vector, that the message hashes to the vector's
message_hash with bip322_message_hash_init().

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KAfA54Ci4gLkZnxHa6qrgV
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit is a routine improvement to the project's automated tests. It replaces two hand-copied BIP-322 test cases with a larger set of official, pinned test vectors (including a new UTF-8 message case) and adds a code generator plus CI check to keep the generated test data in sync. It does not change the actual Bitcoin app code that users run, so it cannot directly affect device security or user funds.

Recommended action

No security action required. Review the generator and CI check as normal code-quality/test-coverage improvements if desired.

Security signals we found

No strong security signals were identified.

Risk score

Why this scored 15/100

Our methodology →
Potential impact 0/30
Exploitability 0/25
Stealth signal 0/15
Affected reach 0/15
Confidence 10/10
Evidence quality 5/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.