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

zpay32: assert why each fixed BOLT 11 vector is rejected

Public commit record

What the developer wrote

Authored by Olaoluwa Osuntokun

100/100 · Strong
zpay32: assert why each fixed BOLT 11 vector is rejected

In this commit, we make the tests show that each of the new decoder
rules is what rejects its invalid invoice, rather than any error.

The vector test only checked that an invalid vector failed, so a vector
rejected for the wrong reason still passed. That hid a real gap: the
spec's high-S vector also repeats its `s` field, so it's rejected as a
duplicate payment address before the signature is ever checked, and no
test exercised `ErrHighSSignature` at all.

We now map each vector this PR fixes to the sentinel error it must
produce, and add `TestDecodeHighSWithDestination`, which decodes the
same invoice (with a single `s` field) once with a high-S and once with
a low-S signature. A duplicate `s` case joins `TestParseTaggedFields`.
Dropping or breaking any of the three new checks now fails a test aimed
at it.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification✓ Names security-relevant behavior explicitly
The short version

What changed, and why it matters

This commit only improves and expands test code for the BOLT 11 invoice decoder. It makes existing tests verify the exact reason each invalid test invoice is rejected, and adds a new test specifically for high-S signature rejection. No production code is changed, so it cannot introduce or fix a runtime security vulnerability on its own.

Recommended action

No security action needed; this is a test-quality improvement. Review the related decoder rules in the same PR for actual security relevance.

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.