Skip to content

Commit 7cb7ec2

Browse files
committed
Split semi-honest overview into two
Move everything that is a commonality into honest overview.
1 parent e4ff9fc commit 7cb7ec2

2 files changed

Lines changed: 179 additions & 146 deletions

File tree

honest.md

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
2+
# Overview: Multiparty PayJoin for honest peer threat model
3+
4+
The following is a concrete description of the honest multiparty PayJoin protocol. To understand why certain choices design were made, it is recommended to read the [overview document](./00_overview.md) first.
5+
6+
## Motivation
7+
8+
This protocol is best understood as a collaborative transaction construction protocol for mutually trusting parties. Its purpose is to let participants jointly build a transaction with potentially better privacy properties and cost savings than a unilateral construction.
9+
10+
Concretly peers are trusted with:
11+
12+
* Liveness: peers are expected to follow the protocol flow and remain reachable. As a result, timeout-based progress assumptions implicitly rely on timely communication.
13+
14+
* Privacy: peers are trusted not to leak or retain their sensitive observations learned during the protocol, including timing, message ordering, and transport metadata (for example IP-layer linkability data) beyond what is needed to complete the session.
15+
16+
Importantly, fund safety does not depend on peer honesty. Each participant signs only a transaction they locally validate and accept under `SIGHASH_ALL`. Therefore, malformed or economically unacceptable constructions are treated as liveness failures, not fund-loss safety failures.
17+
18+
## Roles
19+
20+
### Initiator and Responder
21+
22+
The Initiator signals willingness to batch to their counterparty over a bidirectional channel. In this document, signaling `mppj=1` via BIP21 is treated as one practical bootstrap example, not a normative long-term mechanism. Either BIP-77 receiver or sender may be the Initiator.
23+
24+
For multiparty deployments, the preferred direction is richer payment instructions that can support post-quantum HPKE choices, sender-initiated interactions, and long-lived/reusable authenticated channels.
25+
// TODO: elaborate more on payment instructions
26+
27+
The Responder is the counterparty who receives this signal. If a peer does not support the chosen multiparty signaling mechanism, it falls back to standard BIP77 behavior. If it does support the mechanism, it waits for a session to be created.
28+
29+
Two timeouts govern the phase of the whole protocol:
30+
31+
* `T_intent`: the absolute expiration time After which if no session is created within `T_intent`, both parties must fall back to standard BIP77 over their existing bidirectional channel. Since the intent can be delivered over a async. channel this is an absolute expiration not a relative duration.
32+
* `T_session`: the duration of the multiparty session itself, after which the session is considered expired.
33+
34+
`T_session` is defined by the `SessionCreator` while `T_intent` is defined by the `Initiator`.
35+
36+
// TODO: specify a concrete signaling/payment-instructions format once requirements for PQ HPKE, sender initiation, and reusable authenticated channels are finalized
37+
38+
### SessionCreator
39+
40+
Either an `Initiator` or a `Responder` may create the session. The party that does so is the `SessionCreator`.
41+
The `SessionCreator` is responsible to creating session parameters (defined below), bootstrapping the transport mechanism and disseminating session information to the rest of the peers to the best of their capabilities. `SessionCreator` holds no special authority once the session is live. They simply become a participant.
42+
43+
### Participant
44+
45+
Once a party joins a session they become a `Participant`. All participants share the same obligations as outlined below in the phases section.
46+
47+
### Diagrams
48+
49+
Single receiver, two senders. Receiver is `Initiator` for both senders and becomes the `SessionCreator`.
50+
51+
```mermaid
52+
sequenceDiagram
53+
participant R as Receiver (Initiator)
54+
participant S1 as Sender 1 (Responder)
55+
participant S2 as Sender 2 (Responder)
56+
57+
R->>S1: BIP21 URI (mppj=1)
58+
R->>S2: BIP21 URI (mppj=1)
59+
60+
R->>S1: session invitation (s, session params)
61+
R->>S2: session invitation (s, session params)
62+
```
63+
64+
Sender 1 is the `Initiator` to the receiver who is an `Initiator` to sender 2. The receiver at time 3 becomes the `SessionCreator`.
65+
66+
```mermaid
67+
sequenceDiagram
68+
participant S1 as Sender 1 (Initiator)
69+
participant R as Receiver (Responder / Initiator / SessionCreator)
70+
participant S2 as Sender 2 (Responder)
71+
72+
S1->>R: BIP21 URI (mppj=1)
73+
R->>S2: BIP21 URI (mppj=1)
74+
75+
R->>S1: session invitation (s, session params)
76+
R->>S2: session invitation (s, session params)
77+
```
78+
79+
## Session Parameters
80+
81+
The `SessionCreator` fixes the following parameters before the session opens. All participants must verify that the final transaction conforms to the relevant parameters before signing. Size limit cannot be enforced. The `SessionCreator` only knows their immediate neighborhood of peers but those peers may invite others.
82+
83+
* **Global transaction fields**: `nVersion`, `locktype` (time or height based)
84+
* **Feerate**: each participant contributes fees proportional to the weight of their inputs and outputs
85+
* **Input constraints**: `nSequence`
86+
* **Timeout**: `T_session` (see Roles)
87+
88+
## PSBT CRDT
89+
90+
### Join Semantics
91+
92+
Participants learn transaction fragments in arbitrary order and accumulate them as they arrive. In the honest setting there are no conflicting writes: global fields are fixed by the session parameters and each participant controls disjoint inputs and outputs. Any two valid fragments can therefore be always merged.
93+
94+
For this document, `balance` means the running value equation over the accumulated transaction view:
95+
96+
`balance = sum(inputs) - sum(outputs) - sum(pseudo outputs)`
97+
98+
where pseudo outputs default to zero until any are declared.
99+
100+
If the accumulated transaction does not balance, or any fragment violates the session parameters, a participant can refuse to sign and abandon the session.
101+
102+
// TODO: refer to nothingmuch's document
103+
104+
## Communication model
105+
106+
The protocol assumes an abstract session-scoped broadcast channel for disseminating PSBT fragments.
107+
108+
Required channel properties:
109+
110+
All participants can publish protocol messages to the same session channel, with messages authenticated and kept confidential within the participant set. Each participant is able to read and merge messages from all others into their own local transaction view. While message delivery may be delayed or received out of order, the protocol ensures eventual dissemination and reconciliation of all messages within the session window `T_session` if all parties behave honestly.
111+
112+
Candidate instantiations include [Iroh gossip + set reconciliation](https://docs.iroh.computer/connecting/gossip), [MDK](https://github.com/marmot-protocol/mdk), or a shared append-only mailbox like a [BIP-77 Directory](https://github.com/bitcoin/bips/blob/master/bip-0077.md). These are examples, not normative requirements.
113+
114+
This setting does not require transport-layer metadata privacy as a protocol requirement. Participants are already mutually trusted with privacy in the honest model, including trust not to retain or misuse linkability information learned during the session. As a result, unlike the [semi-honest](./semi-honest.md) setting, the protocol does not depend on anonymous transport primitives to maintain the intended privacy properties within the participant set.
115+
116+
// TODO refine this
117+
However, transport-level metadata privacy is still important against external observers. Content encryption alone does not prevent traffic analysis.
118+
119+
In this honest setting, a separate agreement protocol is not required for the success path. Gossip dissemination plus deterministic transaction construction is sufficient: if participants receive the same valid fragments, they converge to the same unsigned transaction. Any temporary view differences are primarily a liveness concern (delay or retry), not a fund-safety concern.
120+
121+
### Message Reconciliation
122+
123+
The channel must support message reconciliation for peers that temporarily disconnect or miss messages. A participant with an incomplete view can otherwise fail to converge on the unsigned transaction and will refuse to sign.
124+
125+
Different instantiations provide this in different ways: replayable append-only logs, set-reconciliation overlays, etc... The protocol only requires the property that missed valid messages can be recovered during the session window; the mechanism is transport-specific.
126+
127+
## Protocol Phases
128+
129+
Input and output registration can be sent in any order. Ordering semantics must be defined a priori.
130+
One possible definition is to use the hash of the protocol transcript as a salt to sort the inputs and outputs.
131+
132+
All messages are raw binary encoded PSBT fragments.
133+
134+
### Input Registration
135+
136+
Each participant submits the transaction inputs they control. Inputs must be posted as independent messages.
137+
Global passive observers should not be able to determine which inputs originate from the same party.
138+
139+
### Psuedo Outputs
140+
141+
A pseudo output is an declaration of fee contribution above the session-mandated minimum. It participates in the balance equation like a real output but does not appear in the final transaction. Participants must post a pseudo output only when their intended fee contribution exceeds what the session parameters require. A psuedo output may be encoded as a txout in a PSBT fragment where the scriptpubkey (spk) is set to empty bytes. This will fail standardness checks but pass consensus. Consensus invalid spk would introduce additional overhead -- such as creating as an output >= 10KB size limit.
142+
143+
### Output Registration
144+
145+
Both output and pseudo output messages must carry a unique identifier to prevent double accounting. E.g a peer may read an output message multiple times. Since `TxOut`'s are not uniquely indentifiable that peer would have no ability to de-duplicate.
146+
147+
To signal their intent to back out of the session, a participant can deliberately post outputs that exceed their input contribution, causing the transaction balance to overflow. This action makes the balance equation unsatisfiable and prompts all other participants to refuse to sign.
148+
149+
When the `balance` reaches zero, every participant can independently verify the transaction is balanced and proceed declare ready-to-sign.
150+
151+
### Ready-to-sign (RTS) declarations
152+
153+
For each input they control, participants post a RTS declaration. This signals that they accept the current transaction template and are prepared to sign it.
154+
Only once all inputs have corresponding ready signals does the protocol advance. This ensures that all participants have finished contributing transaction fragments.
155+
156+
When the global sum of inputs minus outputs minus pseudo outputs fee declarations hits zero, every participant can independently verify the transaction is balanced and sign.
157+
158+
### Witness provision
159+
160+
Participants provide witnesses for the inputs they control. Once all witnesses are available, any participant can serve as the [BIP-174 combiner role](https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki#user-content-Combiner), assemble the fully signed transaction and broadcast it to the Bitcoin network.

0 commit comments

Comments
 (0)