You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🤖 Notes for the payment confirmations spin-off, from working through the current text (psbt-concurrent.md L172-L192 at 5e02e908, the section the #78 rewrite removed) against a formal model.
Semantics to state explicitly
GRANT messages notify a peer of an interactive payment. They are not netted; they are the input to netting. Interactive payments are distinct from on-chain outputs. External payments made via outputs are verified by their payer and excluded from the interactive balance (see this review reply).
CONFIRM is a unit message: it only ever means yes. It is netted between neighbouring peers. In an arbitrary graph it is netted through the peeling argument below. Both sides already know the amount from the GRANTs.
In practice a CONFIRM should commit to that amount and to the set of GRANT messages, which need idempotence IDs.
It should also commit to the same data as the SIGHASH_ALL sighash, not only the output set. That way a confirmation is for exactly the transaction that gets signed.
CONFIRM and SIGN are separate gates. A sender signs only after every one of its receivers has confirmed.
Peeling replaces the cycle paragraph
Instead of "net positive receivers can safely initiate", the argument is an induction:
In any non-empty set of remaining participants, the residual balances (incoming minus outgoing, over the remaining participants only) sum to zero. So some participant has a non-negative residual balance.
That participant validates its own outputs directly and confirms all of its incoming edges.
Delete it and repeat until no one is left.
Each deleted participant is willing to sign once all of its own receivers' confirmations arrive. Peeling is a proof device, not a protocol step. The protocol needs no global coordination, and the order exists without anyone computing it.
The induction shows that some order always exists. Safety does not depend on following it, though. A sender that adds an input is protected by its own signing gate, so it can confirm by direct validation whatever its residual balance (see below).
Gap: a sender that contributes no inputs has no veto
The current rule lets every receiver whose net balance is non-negative confirm immediately (L180). That is unsafe for a receiver that is also a sender and adds no input.
Example: A GRANTs B 10 and B GRANTs C 10. B nets to 0, so it adds nothing.
A transaction lacks C's output. Either A substituted an output of its own, keeping the fee correct, or C's output simply hasn't arrived yet.
B has no outputs of its own to check, so B confirms to A.
A's only receiver is B, so A signs.
The transaction is valid without any signature from B.
C is unpaid, and B has released A while still owing C 10. Committing the CONFIRM to the full transaction doesn't help: B cannot tell that the missing output was C's.
A sender's protection is withholding its signature (L178). A sender with no input in the transaction has no signature to withhold. Its only leverage is its CONFIRM.
Suggested rules
Default assumption: every party making payments adds at least one input. This is also needed for payment security towards third parties, and it improves counterparty privacy. Under it, CONFIRM only needs direct validation: the participant's own outputs and inputs are present, and it expects the transaction to complete only with its signature.
Exception: a sender with no input in the transaction must withhold its CONFIRM to its senders until its own receivers' confirmations cover what it owes. In the simplest case that means all of them. It can check this locally, since it knows its own outpoints. Its residual balance is irrelevant.
Don't keep residual balance as a gate on top of this. Example: A GRANTs B 3, B GRANTs C 2 and C GRANTs A 1, and only A adds an input.
A's residual is −2, so A fails the numeric test.
B and C each wait on their receiver, so nothing can proceed.
If A instead confirms by direct validation, C, then B, then A's signature all follow.
What can still block: completion needs only the input owners' signatures. It can stall only on a cycle of participants without inputs that some input owner depends on through its receivers. A cycle of participants without inputs that no input owner depends on doesn't block signing. Any participant on a blocking cycle adding an input resolves it.
The gap also covers the TODO at L190 ("an example with a receiver that contributes no inputs").
Activity
yuval-block commentedon Nov 14, 2026
🤖 Notes for the payment confirmations spin-off, from working through the current text (psbt-concurrent.md L172-L192 at 5e02e908, the section the #78 rewrite removed) against a formal model.
Semantics to state explicitly
Peeling replaces the cycle paragraph
Instead of "net positive receivers can safely initiate", the argument is an induction:
Each deleted participant is willing to sign once all of its own receivers' confirmations arrive. Peeling is a proof device, not a protocol step. The protocol needs no global coordination, and the order exists without anyone computing it.
The induction shows that some order always exists. Safety does not depend on following it, though. A sender that adds an input is protected by its own signing gate, so it can confirm by direct validation whatever its residual balance (see below).
Gap: a sender that contributes no inputs has no veto
The current rule lets every receiver whose net balance is non-negative confirm immediately (L180). That is unsafe for a receiver that is also a sender and adds no input.
Example: A GRANTs B 10 and B GRANTs C 10. B nets to 0, so it adds nothing.
C is unpaid, and B has released A while still owing C 10. Committing the CONFIRM to the full transaction doesn't help: B cannot tell that the missing output was C's.
A sender's protection is withholding its signature (L178). A sender with no input in the transaction has no signature to withhold. Its only leverage is its CONFIRM.
Suggested rules
The gap also covers the TODO at L190 ("an example with a receiver that contributes no inputs").