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

offers: add merkle selective-disclosure primitives

Public commit record

What the developer wrote

Authored by Vincenzo Palazzo

73/100 · Adequate
offers: add merkle selective-disclosure primitives

Extend the BOLT 12 merkle module with selective-disclosure support: build
the full merkle tree from a TLV stream, compute the omitted-TLV markers and
the minimal set of missing hashes for omitted subtrees, and reconstruct the
merkle root from a partial disclosure. These are the primitives a payer proof
is built on.

Co-Authored-By: Rusty Russell <rusty@rustcorp.com.au>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Co-Authored-By: OpenAI Codex <codex@openai.com>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit adds new code to support BOLT 12 "selective disclosure" payer proofs in the Lightning Dev Kit. It lets someone prove they have a valid signed invoice without revealing every field. The change is a feature addition, not a fix for a known bug, and the commit message and diff do not describe any security vulnerability. However, cryptographic merkle-tree code like this is security-critical because any mistake in how hashes are combined or how omitted fields are reconstructed could let an attacker forge a proof or hide data. The patch includes tests and validation, but because it is brand-new, complex code, it deserves careful review.

Recommended action

Treat this as a high-risk feature addition requiring focused cryptographic review. Verify that the DFS left-to-right missing-hash ordering exactly matches the BOLT 12 PR 1295 spec, that branch hashing always sorts children consistently, that omitted-marker validation cannot be bypassed to produce a non-minimal proof, and that reconstruction rejects extra missing hashes and malformed inputs. Run differential tests against reference implementations if available before exposing the module as public API.

Security signals we found

01

New cryptographic merkle-tree code for BOLT 12 payer proofs

02

Refactors existing TLV hashing to share primitives between signing and selective disclosure

03

Adds omitted-marker validation to prevent non-minimized or out-of-order marker sequences

04

Adds reconstruction error handling for mismatched nonce/hash counts and insufficient missing hashes

05

No security relevance disclosed by vendor in commit message or diff

06

No independent researcher attribution or vendor acknowledgment of a vulnerability

Risk score

Why this scored 25/100

Our methodology →
Potential impact 5/30
Exploitability 4/25
Stealth signal 3/15
Affected reach 4/15
Confidence 6/10
Evidence quality 3/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.