Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 55 additions & 42 deletions bip-0077.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<br/>for Original PSBT
activate D 
S->>D: POST Request<br/>Original PSBT
D->>R: GET Response<br/>Original PSBT
deactivate D

S-->>D: Poll GET Requests<br/>for Proposal PSBT
activate D
R->>D: POST Request<br/>Proposal PSBT
D->>S: GET Response<br/>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
Expand Down Expand Up @@ -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<br/>FROM: Client IP<br/>[+ Encapsulated Request]
R->>G: Gateway Request<br/>FROM: Relay IP<br/>[+ Encapsulated Request]
G->>D: Request
D->>G: Response
G->>R: Gateway Response<br/>TO: Relay IP<br/>[+ Encapsulated Response]
R->>C: Relay Response<br/>TO: Client IP<br/>[+ 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
Expand Down
Loading