diff --git a/bip-0077.md b/bip-0077.md index d45da9829a..e0129d0cf1 100644 --- a/bip-0077.md +++ b/bip-0077.md @@ -110,31 +110,33 @@ mutually exclusive and only one can be confirmed. Messages are buffered in the directory, allowing both parties to tolerate temporary disconnections and resume communication by polling. -### Sequence Diagram - -```mermaid -sequenceDiagram - title Async Payjoin Sequence Diagram - participant R as Receiver - participant D as Directory - participant S as Sender - participant N as Network - - R-)S: Payjoin URI (BIP 21) out of band - - R-->>D: Poll GET Requests
for Original PSBT - activate D  - S->>D: POST Request
Original PSBT - D->>R: GET Response
Original PSBT - deactivate D - - S-->>D: Poll GET Requests
for Proposal PSBT - activate D - R->>D: POST Request
Proposal PSBT - D->>S: GET Response
Proposal PSBT - deactivate D - - S->>N: Broadcast Payjoin +### Async Payjoin Directory Mediated Sequence Diagram + +```text + +----------+ +------------+ +----------+ +----------+ + | Receiver | | Directory | | Sender | | Network | + +----+-----+ +-----+------+ +----+-----+ +----+-----+ + | | | | + | Payjoin URI (BIP21), out-of-band | | + +------------------------------------------------>| | + | | | | + | Poll GET: original PSBT (repeat until available) | + +- - - - - - - - - - - ->+ | | + | # POST: original PSBT | | + | #<-----------------------+ | + | 200 OK: original PSBT # | | + |<-----------------------+ | | + | | | | + | | Poll GET: proposal PSBT (repeat until available) + | +<- - - - - - - - - - - -+ | + | POST: proposal PSBT # | | + +-----------------------># | | + | # 200 OK: proposal PSBT | | + | +----------------------->| | + | | | | + | | | Broadcast payjoin | + | | +---------------------->| + | | | | ``` ## Specification @@ -470,23 +472,34 @@ to mailbox endpoint URLs for backwards compatibility with BIP 78 senders. #### OHTTP Sequence Diagram -```mermaid -sequenceDiagram - title OHTTP Sequence Diagram - participant C as Client - participant R as OHTTP Relay - - box PaleVioletRed Payjoin Directory - participant G as OHTTP Gateway - participant D as HTTP Resource - end - - C->>R: Relay Request
FROM: Client IP
[+ Encapsulated Request] - R->>G: Gateway Request
FROM: Relay IP
[+ Encapsulated Request] - G->>D: Request - D->>G: Response - G->>R: Gateway Response
TO: Relay IP
[+ Encapsulated Response] - R->>C: Relay Response
TO: Client IP
[+ Encapsulated Response] +```text + .-------------------------------------------. + | Payjoin Directory | + +--------+ +-----------+ | +-------------+ +--------------+ | + | Client | | OHTTP | | | OHTTP | | HTTP | | + | | | Relay | | | Gateway | | Resource | | + +---+----+ +------+----+ | +-----+-------+ +------+-------+ | + | | `--------|-----------------------|----------' + | Relay Request | | | + | [ + Encapsulated | | | + | Request ] | | | + +------------------->| Gateway Request | | + | | [ + Encapsulated | | + | | Request ] | | + | +------------------->| Request | + | | +---------------------->| + | | | | + | | | Response | + | | Gateway |<----------------------+ + | | Response | | + | | [ + Encapsulated | | + | | Response ] | | + | Relay |<-------------------+ | + | Response | | | + | [ + Encapsulated | | | + | Response ] | | | + |<-------------------+ | | + | | | | ``` ### Relay/Directory interactions