From 22dc032a5c9a7cbff6b3584649331d22a375b047 Mon Sep 17 00:00:00 2001 From: grunch Date: Fri, 16 Jan 2026 11:00:58 -0300 Subject: [PATCH] Add separate event kinds for ratings, info, and disputes - Orders: kind 38383 (unchanged) - Ratings: kind 38384 - Info: kind 38385 - Disputes: kind 38386 Updated all documentation to reflect the new event kinds and added reference tables in overview.md and order_event.md. --- src/admin_cancel_order.md | 2 +- src/admin_settle_order.md | 2 +- src/dispute.md | 4 ++-- src/list_disputes.md | 6 +++--- src/order_event.md | 13 +++++++++++++ src/other_events.md | 2 +- src/overview.md | 11 ++++++++++- src/user_rating.md | 3 ++- 8 files changed, 33 insertions(+), 10 deletions(-) diff --git a/src/admin_cancel_order.md b/src/admin_cancel_order.md index 5380af3..f0b8aa4 100644 --- a/src/admin_cancel_order.md +++ b/src/admin_cancel_order.md @@ -74,7 +74,7 @@ The second event updates the addressable dispute event with status `seller-refun "id": "098e8622eae022a79bc793984fccbc5ea3f6641bdcdffaa031c00d3bd33ca5a0", "pubkey": "", "created_at": 1703274022, - "kind": 38383, + "kind": 38386, "tags": [ ["d", "efc75871-2568-40b9-a6ee-c382d4d6de01"], ["s", "seller-refunded"], diff --git a/src/admin_settle_order.md b/src/admin_settle_order.md index c71ac4d..245673d 100644 --- a/src/admin_settle_order.md +++ b/src/admin_settle_order.md @@ -46,7 +46,7 @@ Mostro updates the addressable dispute event with status `settled`: "id": "098e8622eae022a79bc793984fccbc5ea3f6641bdcdffaa031c00d3bd33ca5a0", "pubkey": "", "created_at": 1703274022, - "kind": 38383, + "kind": 38386, "tags": [ ["d", "efc75871-2568-40b9-a6ee-c382d4d6de01"], ["s", "settled"], diff --git a/src/dispute.md b/src/dispute.md index dd0b141..097b898 100644 --- a/src/dispute.md +++ b/src/dispute.md @@ -68,7 +68,7 @@ Here is an example of the event sent by Mostro: "id": "", "pubkey": "", "created_at": 1703016565, - "kind": 38383, + "kind": 38386, "tags": [ ["d", ""], ["s", "initiated"], @@ -159,7 +159,7 @@ Also Mostro will broadcast a new addressable dispute event to update the dispute "id": "", "pubkey": "", "created_at": 1703020540, - "kind": 38383, + "kind": 38386, "tags": [ ["d", ""], ["s", "in-progress"], diff --git a/src/list_disputes.md b/src/list_disputes.md index 00406f3..3a35d03 100644 --- a/src/list_disputes.md +++ b/src/list_disputes.md @@ -1,6 +1,6 @@ # Listing Disputes -Mostro publishes new disputes with event kind `38383` and status `initiated`: +Mostro publishes new disputes with event kind `38386` and status `initiated`: ```json [ @@ -10,7 +10,7 @@ Mostro publishes new disputes with event kind `38383` and status `initiated`: "id": "", "pubkey": "", "created_at": 1703016565, - "kind": 38383, + "kind": 38386, "tags": [ ["d", ""], ["s", "initiated"], @@ -23,4 +23,4 @@ Mostro publishes new disputes with event kind `38383` and status `initiated`: ] ``` -Clients can query this events by nostr event kind `38383`, nostr event author, dispute status (`s`), type (`z`) +Clients can query these events by nostr event kind `38386`, nostr event author, dispute status (`s`), type (`z`) diff --git a/src/order_event.md b/src/order_event.md index 6fabb01..10a5ca1 100644 --- a/src/order_event.md +++ b/src/order_event.md @@ -1,5 +1,18 @@ # Peer-to-peer Order events. NIP-69 +## Mostro Event Kinds + +Mostro uses different event kinds for different types of data: + +| Event Type | Kind | Document (`z` tag) | +|------------|-------|--------------------| +| Orders | 38383 | `order` | +| Ratings | 38384 | `rating` | +| Info | 38385 | `info` | +| Disputes | 38386 | `dispute` | + +This document focuses on the **Order** event (kind `38383`), which is used for the P2P order book. + ## Abstract Peer-to-peer (P2P) platforms have seen an upturn in recent years, while having more and more options is positive, in the specific case of p2p, having several options contributes to the liquidity split, meaning sometimes there's not enough assets available for trading. If we combine all these individual solutions into one big pool of orders, it will make them much more competitive compared to centralized systems, where a single authority controls the liquidity. diff --git a/src/other_events.md b/src/other_events.md index 38cc48b..f69b595 100644 --- a/src/other_events.md +++ b/src/other_events.md @@ -13,7 +13,7 @@ This event contains specific data about a Mostro instance. The instance is ident { "id": "", "pubkey": "", - "kind": 38383 + "kind": 38385, "tags": [ [ "d", diff --git a/src/overview.md b/src/overview.md index 7f25815..cb3d8a3 100644 --- a/src/overview.md +++ b/src/overview.md @@ -1,6 +1,15 @@ ## Overview -In order to have a shared order's book, Mostro daemon send [Addressable Events](https://github.com/nostr-protocol/nips/blob/master/01.md#kinds) with `38383` as event `kind`, you can find more details about that specific event [here](./order_event.md) +Mostro uses [Addressable Events](https://github.com/nostr-protocol/nips/blob/master/01.md#kinds) to publish different types of information. Each event type has its own `kind`: + +| Event Type | Kind | Description | +|------------|-------|-------------| +| Orders | 38383 | P2P order events for the shared order book | +| Ratings | 38384 | User rating events | +| Info | 38385 | Mostro instance status and information | +| Disputes | 38386 | Dispute events | + +You can find more details about the order event [here](./order_event.md) ## The Message diff --git a/src/user_rating.md b/src/user_rating.md index 63cca27..65dc1b7 100644 --- a/src/user_rating.md +++ b/src/user_rating.md @@ -64,7 +64,7 @@ Mostro updates the addressable rating event, in this event the `d` tag will be t "id": "", "pubkey": "", "created_at": 1702637077, - "kind": 38383, + "kind": 38384, "tags": [ ["d", ""], ["total_reviews", "1"], @@ -72,6 +72,7 @@ Mostro updates the addressable rating event, in this event the `d` tag will be t ["last_rating", "1"], ["max_rate", "2"], ["min_rate", "5"], + ["y", "mostro"], ["z", "rating"] ], "content": "",