diff --git a/src/SUMMARY.md b/src/SUMMARY.md index 465382c..0f77092 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -20,6 +20,7 @@ - [Rate user](./user_rating.md) - [Cancel](./cancel.md) - [Dispute](./dispute.md) +- [Dispute Chat](./dispute_chat.md) - [Peer-to-peer Chat](./chat.md) - [List disputes](./list_disputes.md) - [Admin Settle order](./admin_settle_order.md) diff --git a/src/dispute.md b/src/dispute.md index 11e332e..ac22a75 100644 --- a/src/dispute.md +++ b/src/dispute.md @@ -1,6 +1,6 @@ # Dispute -A use can start a dispute in an order with status `active` or `fiat-sent` sending action `dispute`, here is an example where the seller initiates a dispute: +A user can start a dispute in an order with status `active` or `fiat-sent` sending action `dispute`, here is an example where the seller initiates a dispute: ```json [ @@ -56,7 +56,7 @@ And here is the message to the buyer: Mostro will not update the addressable event with `d` tag `` to change the status to `dispute`, this is because the order is still active, the dispute is just a way to let the admins and the other party know that there is a problem with the order. -## Mostro send a addressable event to show the dispute +## Mostro sends an addressable event to show the dispute Here is an example of the event sent by Mostro: @@ -128,7 +128,7 @@ Mostro will send a confirmation message to the admin with the order details: ] ``` -Then mostrod send messages to each trade participat, the buyer and seller for them to know the pubkey of the admin who took the dispute, that way the client can start listening events from that specific pubkey, by default clients should discard any messages received from any pubkey different than Mostro node or dispute solver, the message looks like this: +Then mostrod send messages to each trade participant, the buyer and seller for them to know the pubkey of the admin who took the dispute, that way the client can start listening events from that specific pubkey, by default clients should discard any messages received from any pubkey different than Mostro node or dispute solver, the message looks like this: ```json [ diff --git a/src/dispute_chat.md b/src/dispute_chat.md new file mode 100644 index 0000000..ee5e190 --- /dev/null +++ b/src/dispute_chat.md @@ -0,0 +1,49 @@ +# Dispute Chat + +Once an admin takes a dispute, both the admin and the involved parties (buyer and seller) can communicate through an encrypted chat using Gift Wrap messages (NIP-59). + +## Sending a message + +Users and admins send messages using action `send-dm`. The message content is wrapped in a Gift Wrap event (kind 1059) to ensure privacy and encryption. + +### User sending a message + +Here is an example of a user sending a message to the admin: + +```json +[ + { + "dm": { + "version": 1, + "action": "send-dm", + "payload": { + "text_message": "Hello, I need help with this order" + } + } + }, + null +] +``` + +### Admin sending a message + +Admins use the same format to send messages to users: + +```json +[ + { + "dm": { + "version": 1, + "action": "send-dm", + "payload": { + "text_message": "I'm reviewing the evidence, please wait" + } + } + }, + null +] +``` + +## Receiving messages + +Clients must subscribe to kind 1059 events with a `p` tag matching their pubkey. The Gift Wrap protocol (NIP-59) ensures that only the intended recipient can decrypt and read the messages, while preserving the sender's identity through the SEAL layer