From 0469145ac7cd0555512d5628e74b929a6610b90e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Calder=C3=B3n?= Date: Tue, 19 Dec 2023 16:00:47 -0300 Subject: [PATCH] Documentation: npub to hex --- book/src/cancel.md | 2 +- book/src/dispute.md | 2 +- book/src/fiatsent.md | 26 +++++++++++++++++++++----- book/src/new_order.md | 7 +++---- book/src/overview.md | 12 +++++++++++- book/src/release.md | 2 +- book/src/take_buy.md | 18 +++++++++++++++++- book/src/take_sell.md | 8 +++----- book/src/user_rating.md | 4 ++-- 9 files changed, 60 insertions(+), 21 deletions(-) diff --git a/book/src/cancel.md b/book/src/cancel.md index 58715384..b57223f6 100644 --- a/book/src/cancel.md +++ b/book/src/cancel.md @@ -7,7 +7,7 @@ A user can cancel an Order created by himself and with status `Pending` sending "Order": { "version": "1", "id": "ede61c96-4c13-4519-bf3a-dcf7f1e9d842", - "pubkey": "npub1qqqt938cer4dvlslg04zwwf66ts8r3txp6mv79cx2498pyuqx8uq0c7qkj", + "pubkey": "00000ba40c5795451705bb9c165b3af93c846894d3062a9cd7fcba090eb3bf78", "action": "Cancel", "content": null } diff --git a/book/src/dispute.md b/book/src/dispute.md index c6e2153c..8bebf49d 100644 --- a/book/src/dispute.md +++ b/book/src/dispute.md @@ -7,7 +7,7 @@ A use can start a dispute in an order with status `Pending` or `FiatSent` sendin "Order": { "version": "1", "id": "ede61c96-4c13-4519-bf3a-dcf7f1e9d842", - "pubkey": "npub1qqqt938cer4dvlslg04zwwf66ts8r3txp6mv79cx2498pyuqx8uq0c7qkj", + "pubkey": "00000ba40c5795451705bb9c165b3af93c846894d3062a9cd7fcba090eb3bf78", "action": "Dispute", "content": null } diff --git a/book/src/fiatsent.md b/book/src/fiatsent.md index 7bd63dab..7ac2a8ca 100644 --- a/book/src/fiatsent.md +++ b/book/src/fiatsent.md @@ -7,13 +7,29 @@ After the buyer sends the fiat money to the seller, the buyer should send a mess "Order": { "version": "1", "id": "ede61c96-4c13-4519-bf3a-dcf7f1e9d842", - "pubkey": null, + "pubkey": "0000147e939bef2b81c27af4c1b702c90c3843f7212a34934bff1e049b7f1427", "action": "FiatSent", "content": null } } ``` +The event to send to Mostro would look like this: + +```json +{ + "id": "cade205b849a872d74ba4d2a978135dbc05b4e5f483bb4403c42627dfd24f67d", + "kind": 4, + "pubkey": "9a42ac72d6466a6dbe5b4b07a8717ee13e55abb6bdd810ea9c321c9a32ee837b", + "content": "base64-encoded-aes-256-cbc-encrypted-JSON-serialized-string", + "tags": [ + ["p", "dbe0b1be7aafd3cfba92d7463edbd4e33b2969f61bd554d37ac56f032e13355a"] + ], + "created_at": 1234567890, + "sig": "a21eb195fe418613aa9a3a8a78039b090e50dc3f9fb06b0f3fe41c63221adc073a9317a1f28d9db843a43c28d860ba173b70132ca85b0e706f6487d43a57ee82" +} +``` + ## Mostro response Mostro send a messages to both parties confirming `FiatSent` action and sending again the counterpart pubkey, here an example of the message to the buyer: @@ -23,11 +39,11 @@ Mostro send a messages to both parties confirming `FiatSent` action and sending "Order": { "version": "1", "id": "ede61c96-4c13-4519-bf3a-dcf7f1e9d842", - "pubkey": "npub1qqqt938cer4dvlslg04zwwf66ts8r3txp6mv79cx2498pyuqx8uq0c7qkj", + "pubkey": "0000147e939bef2b81c27af4c1b702c90c3843f7212a34934bff1e049b7f1427", "action": "FiatSent", "content": { "Peer": { - "pubkey": "npub1qqqxssz4k6swex94zdg5s4pqx3uqlhwsc2vdzvhjvzk33pcypkhqe9aeq2" + "pubkey": "00000ba40c5795451705bb9c165b3af93c846894d3062a9cd7fcba090eb3bf78" } } } @@ -41,11 +57,11 @@ And here an example of the message from Mostro to the seller: "Order": { "version": "1", "id": "ede61c96-4c13-4519-bf3a-dcf7f1e9d842", - "pubkey": "npub1qqqxssz4k6swex94zdg5s4pqx3uqlhwsc2vdzvhjvzk33pcypkhqe9aeq2", + "pubkey": "00000ba40c5795451705bb9c165b3af93c846894d3062a9cd7fcba090eb3bf78", "action": "FiatSent", "content": { "Peer": { - "pubkey": "npub1qqqt938cer4dvlslg04zwwf66ts8r3txp6mv79cx2498pyuqx8uq0c7qkj" + "pubkey": "0000147e939bef2b81c27af4c1b702c90c3843f7212a34934bff1e049b7f1427" } } } diff --git a/book/src/new_order.md b/book/src/new_order.md index cb7d85d1..6a2c2417 100644 --- a/book/src/new_order.md +++ b/book/src/new_order.md @@ -6,7 +6,7 @@ To create a new sell order the user should send a Nostr event kind 4 (an encrypt { "Order": { "version": "1", - "pubkey": "npub1qqq...", + "pubkey": "00000ba40c5795451705bb9c165b3af93c846894d3062a9cd7fcba090eb3bf78", // Seller's real pubkey "action": "NewOrder", "content": { "Order": { @@ -38,7 +38,7 @@ The event to send to Mostro would look like this: { "id": "cade205b849a872d74ba4d2a978135dbc05b4e5f483bb4403c42627dfd24f67d", "kind": 4, - "pubkey": "1f5bb148a25bca31506594722e746b10acf2641a12725b12072dcbc46ade544d", + "pubkey": "1f5bb148a25bca31506594722e746b10acf2641a12725b12072dcbc46ade544d", // Seller's ephemeral pubkey "content": "base64-encoded-aes-256-cbc-encrypted-JSON-serialized-string", "tags": [ ["p", "dbe0b1be7aafd3cfba92d7463edbd4e33b2969f61bd554d37ac56f032e13355a"] // Mostro's pubkey @@ -57,8 +57,7 @@ Mostro will send back a nip04 event as a confirmation message to the user like t "Order": { "version": "1", "id": "ede61c96-4c13-4519-bf3a-dcf7f1e9d842", - "pubkey": "npub1qqq...", - "action": "NewOrder", + "pubkey": "00000ba40c5795451705bb9c165b3af93c846894d3062a9cd7fcba090eb3bf78", "content": { "Order": { "id": "ede61c96-4c13-4519-bf3a-dcf7f1e9d842", diff --git a/book/src/overview.md b/book/src/overview.md index bff4ac79..05da81ce 100644 --- a/book/src/overview.md +++ b/book/src/overview.md @@ -20,9 +20,19 @@ These fields are relative to the wrapper, here an example of a `FiatSent` Order "Order": { "version": "1", "id": "ede61c96-4c13-4519-bf3a-dcf7f1e9d842", - "pubkey": "npub1qqq...", + "pubkey": "0001be6bd50247846a28cce439a10470a39b1b6c81d5c3be2475156a413e1e3a", "action": "FiatSent", "content": null } } ``` + +## Keys + +For all examples the participants will use this keys: + +- Mostro's pubkey `dbe0b1be7aafd3cfba92d7463edbd4e33b2969f61bd554d37ac56f032e13355a` +- Seller's real pubkey `00000ba40c5795451705bb9c165b3af93c846894d3062a9cd7fcba090eb3bf78` +- Seller's ephemeral pubkey `1f5bb148a25bca31506594722e746b10acf2641a12725b12072dcbc46ade544d` +- Buyer's real pubkey `0000147e939bef2b81c27af4c1b702c90c3843f7212a34934bff1e049b7f1427` +- Buyer's ephemeral pubkey `9a42ac72d6466a6dbe5b4b07a8717ee13e55abb6bdd810ea9c321c9a32ee837b` diff --git a/book/src/release.md b/book/src/release.md index 7123fea0..95fa4c28 100644 --- a/book/src/release.md +++ b/book/src/release.md @@ -7,7 +7,7 @@ After confirming the buyer sent the fiat money, the seller should send a message "Order": { "version": "1", "id": "ede61c96-4c13-4519-bf3a-dcf7f1e9d842", - "pubkey": "npub1qqqxssz4k6swex94zdg5s4pqx3uqlhwsc2vdzvhjvzk33pcypkhqe9aeq2", + "pubkey": "00000ba40c5795451705bb9c165b3af93c846894d3062a9cd7fcba090eb3bf78", "action": "Release", "content": null } diff --git a/book/src/take_buy.md b/book/src/take_buy.md index 76740e64..0160b099 100644 --- a/book/src/take_buy.md +++ b/book/src/take_buy.md @@ -6,7 +6,7 @@ To take an order the seller will send to Mostro a message with the following con { "Order": { "version": "1", - "pubkey": "npub1qqqxssz4k6swex94zdg5s4pqx3uqlhwsc2vdzvhjvzk33pcypkhqe9aeq2", + "pubkey": "00000ba40c5795451705bb9c165b3af93c846894d3062a9cd7fcba090eb3bf78", "id": "ede61c96-4c13-4519-bf3a-dcf7f1e9d842", "action": "TakeBuy", "content": null @@ -14,6 +14,22 @@ To take an order the seller will send to Mostro a message with the following con } ``` +The event to send to Mostro would look like this: + +```json +{ + "id": "cade205b849a872d74ba4d2a978135dbc05b4e5f483bb4403c42627dfd24f67d", + "kind": 4, + "pubkey": "1f5bb148a25bca31506594722e746b10acf2641a12725b12072dcbc46ade544d", // Seller's ephemeral pubkey + "content": "base64-encoded-aes-256-cbc-encrypted-JSON-serialized-string", + "tags": [ + ["p", "dbe0b1be7aafd3cfba92d7463edbd4e33b2969f61bd554d37ac56f032e13355a"] // Mostro's pubkey + ], + "created_at": 1234567890, + "sig": "a21eb195fe418613aa9a3a8a78039b090e50dc3f9fb06b0f3fe41c63221adc073a9317a1f28d9db843a43c28d860ba173b70132ca85b0e706f6487d43a57ee82" +} +``` + ## Mostro response Mostro respond to the seller with a message with the following content: diff --git a/book/src/take_sell.md b/book/src/take_sell.md index b34d34a6..31b7a95e 100644 --- a/book/src/take_sell.md +++ b/book/src/take_sell.md @@ -7,25 +7,23 @@ If the order amount is `0` the buyer don't know the exact amount to create the i "Order": { "version": "1", "id": "ede61c96-4c13-4519-bf3a-dcf7f1e9d842", - "pubkey": "npub1qqq...", + "pubkey": "0000147e939bef2b81c27af4c1b702c90c3843f7212a34934bff1e049b7f1427", "action": "TakeSell", "content": null } } ``` -This event would look like this: - The event to send to Mostro would look like this: ```json { "id": "cade205b849a872d74ba4d2a978135dbc05b4e5f483bb4403c42627dfd24f67d", "kind": 4, - "pubkey": "1f5bb148a25bca31506594722e746b10acf2641a12725b12072dcbc46ade544d", + "pubkey": "9a42ac72d6466a6dbe5b4b07a8717ee13e55abb6bdd810ea9c321c9a32ee837b", "content": "base64-encoded-aes-256-cbc-encrypted-JSON-serialized-string", "tags": [ - ["p", "dbe0b1be7aafd3cfba92d7463edbd4e33b2969f61bd554d37ac56f032e13355a"] // Mostro's pubkey + ["p", "dbe0b1be7aafd3cfba92d7463edbd4e33b2969f61bd554d37ac56f032e13355a"] ], "created_at": 1234567890, "sig": "a21eb195fe418613aa9a3a8a78039b090e50dc3f9fb06b0f3fe41c63221adc073a9317a1f28d9db843a43c28d860ba173b70132ca85b0e706f6487d43a57ee82" diff --git a/book/src/user_rating.md b/book/src/user_rating.md index 1c657e94..4af479a4 100644 --- a/book/src/user_rating.md +++ b/book/src/user_rating.md @@ -46,7 +46,7 @@ If Mostro received the correct message, it will send back a confirmation message } ``` -Mostro updates the nip 33 rating event, in this event the `d` tag will be the user pubkey `npub1qqqt938cer4dvlslg04zwwf66ts8r3txp6mv79cx2498pyuqx8uq0c7qkj` and looks like this: +Mostro updates the nip 33 rating event, in this event the `d` tag will be the user pubkey `00000ba40c5795451705bb9c165b3af93c846894d3062a9cd7fcba090eb3bf78` and looks like this: ```json [ @@ -58,7 +58,7 @@ Mostro updates the nip 33 rating event, in this event the `d` tag will be the us "created_at": 1702637077, "kind": 38383, "tags": [ - ["d", "npub1qqqt938cer4dvlslg04zwwf66ts8r3txp6mv79cx2498pyuqx8uq0c7qkj"], + ["d", "00000ba40c5795451705bb9c165b3af93c846894d3062a9cd7fcba090eb3bf78"], ["total_reviews", "1"], ["total_rating", "2"], ["last_rating", "1"],