BIP352: clarify input-sum accumulation — tolerate intermediate point at infinity - #2264
Open
SatsAndSports wants to merge 1 commit into
Open
BIP352: clarify input-sum accumulation — tolerate intermediate point at infinity#2264SatsAndSports wants to merge 1 commit into
SatsAndSports wants to merge 1 commit into
Conversation
SatsAndSports
force-pushed
the
bip352-intermediate-infinity
branch
from
August 19, 2026 22:11
a1d8524 to
36dbdd7
Compare
Member
|
cc BIP authors @josibake @RubenSomsen @theStack for feedback here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BIP352 defines
A = A₁ + … + Aₙon the receiving side anda = a₁ + … + aₙon the sending side, and it says what to do when the total is the identity (receiver: skip; sender: fail). It does not say what happens when an intermediate partial sum equals the point at infinity during accumulation. This pins the intended behavior normatively:This is a clarification, not a behavior change: the reference implementation (
secp256k1labGE.sum) already tolerates intermediate infinity, and the officialsend_and_receive_test_vectors.jsonalready contains the intermediate-cancellation (zero-sum) case. It also matches the text's existing claim — the sum is a group operation, whose identity element is the point at infinity.Why reachable, not theoretical
For any private key
awithP = a·G, the negated public key−P = (n − a)·Gis also spendable by the same holder. Consequently a transaction whose input-key list contains an intermediate cancellation (e.g.[P, −P, Q]summing toQ, non-infinite total) is ordinary, consensus-valid, and cheap — reachable by construction, with ordering as the knob. An implementation that errors on intermediate cancellation becomes input-order-dependent, dropping or mis-deriving payments that conformant implementations accept, and receiver software scans arbitrary on-chain transactions containing any of the eligible input types (P2TR, P2WPKH, P2SH-P2WPKH, P2PKH).Evidence (backend contracts differ at today’s public pins)
secp256k1labGE.sum); the official vectors already contain that case.go-libsecp256k1.PubKeyAdderrors withinvalid public key: [0,0] not on secp256k1 curveon an intermediate infinity — the index then silently drops the transaction depending on input ordering.InvalidPublicKeySum/InvalidTweakon the same case in the Rust silent-payments crates (rust-silentpayments / spdk) — send aborts, receive errors, both diverging from the reference verdict.secp256k1_ge/gejops), while serialized-pubkey helpers (secp256k1_ec_pubkey_combine) reject it — so wrappers inherit either behavior depending on which API layer they call.Cross-implementation divergence on this clause was found during a public differential of open implementations against the BIP's own official vectors; the fix is to pin the reference semantics in prose, and no vector changes are needed.