Create sequence diagrams with simple online tool

Swimlanes.io is a free webapp for making sequence diagrams. You simply edit the text on the left and the diagram is updated in real time. You can download your sequence diagrams as images or distribute with a link.

title: BRC-121: Simple 402 Payments order: Client Wallet, Client, Server, Server Wallet _: **Initial Request** Client -> Server: GET /somepage Server -> Client: **402 Payment Required** note: Headers returned * **x-bsv-sats** `<amount>` * **x-bsv-server** `<pubkey>` _: **Payment Construction** Client -> Client: BRC-29 BKDS note:* **nonce** `<base64>` (random) * **time** `<unix timestamp>` (now) ``` getPublicKey({ protocolID: BRC29, keyID: nonce + ' ' + time, counterparty: serverPubKey. ) ``` returns publicKey which is hashed and used in an P2PKH output for payment. Client -> Client Wallet: createAction Client Wallet --> Client: tx _: **Paid Request** Client -> Server: GET /articles/some-slug note: * **x-bsv-beef** `<base64 BEEF>` * **x-bsv-sender** `<identityKey>` * **x-bsv-nonce** `<base64>` * **x-bsv-time** `<unix timestamp>` * **x-bsv-vout** `0` _: **Payment Validation** Server -> Server: Verify note: * all headers present * correctly formatted * time is within last 30s * transaction vout satoshis meet needs Server -> Server Wallet: internalizeAction() if: Valid payment Server Wallet -> Server: Success (tx good & KDF works) Server -> Client: **200 OK** *(protected content)* else: Invalid payment Server Wallet -x Server: Error (tx bad or seen already) Server -> Client: **402 Payment Required** end