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

lnwire: add bounded introNode BlindedPath codec

Public commit record

What the developer wrote

Authored by bitromortac

68/100 · Adequate
lnwire: add bounded introNode BlindedPath codec

Introduce the canonical lnwire.BlindedPath / BlindedPaths codec with a
sealed IntroductionNode sum-type covering both the BOLT 4 pubkey and
sciddir variants. The codec gates every variable-length subfield against
an io.LimitedReader. It fails closed on the encoder side so invalid
input never hits the wire.

This commit is a pure addition: no existing caller changes. Subsequent
commits migrate OnionMessagePayload and the bolt12 message structs to
consume the new codec.
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit adds a new, self-contained code module for encoding and decoding 'blinded paths' used in the Lightning Network protocol. It does not change any existing code paths or callers. The new code is designed defensively: it rejects malformed input, limits memory allocations, and validates cryptographic points before use. There is no indication this commit fixes a known vulnerability or introduces one.

Recommended action

No immediate action required. Treat as routine defensive code addition. When subsequent commits migrate OnionMessagePayload and bolt12 structs to this codec, review those changes for correct integration and any relaxation of these bounds.

Security signals we found

01

Defensive input validation added for BOLT 4 blinded path encoding/decoding

02

io.LimitedReader used to bound variable-length decoder allocations

03

Fail-closed encoder rejects invalid data before bytes hit the wire

04

On-curve checks for public keys during encode and decode

05

Allocation guards prevent oversize num_hops or enclen from causing large memory allocation

Risk score

Why this scored 12/100

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