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

silentpayments: respect per-group recipients protocol limit (K_max=2323)

Public commit record

What the developer wrote

Authored by Sebastian Falbesoner

73/100 · Adequate
silentpayments: respect per-group recipients protocol limit (K_max=2323)

This affects both the sending and scanning API functions:
* Sending fails if any group is exceeding the limit.
* Scanning doesn't look beyond the limit.

Also add a recommendation to the API docs to shuffle the
`tx_outputs` input array, which improves the worst-case by ~2x.

Co-authored-by: nymius <155548262+nymius@users.noreply.github.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 fixes the libsecp256k1 Silent Payments implementation so it respects the protocol-defined maximum of 2,323 recipients that share the same scan public key. Previously, the code had a TODO warning about unbounded scanning that could lead to quadratic runtime and possible missed outputs. Now, sending fails if any group exceeds the limit, and scanning stops at the limit. It also documents a recommendation to shuffle transaction outputs to improve worst-case performance.

Recommended action

Review downstream callers to ensure they handle the new sender failure mode and consider shuffling tx_outputs before scanning as recommended. No immediate emergency response is indicated; this is a correctness/performance hardening change.

Security signals we found

01

Unbounded loop bounded to protocol limit to prevent quadratic scanning cost

02

Sender-side enforcement prevents creating outputs recipients may not find

03

New public constant documents protocol limit (BIP-352 K_max=2323)

04

Memory clearing of shared secret on new early-exit path

05

API documentation updated to describe limit and recommend input shuffling

Risk score

Why this scored 38/100

Our methodology →
Potential impact 8/30
Exploitability 6/25
Stealth signal 5/15
Affected reach 7/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.