Skip to content

Commit 33100c6

Browse files
authored
Merge pull request #23 from AndreaDiazCorreia/feat/dispute-chat-docs
docs: Add dispute chat documentation
2 parents 23d7501 + 89a66c7 commit 33100c6

3 files changed

Lines changed: 53 additions & 3 deletions

File tree

src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
- [Rate user](./user_rating.md)
2121
- [Cancel](./cancel.md)
2222
- [Dispute](./dispute.md)
23+
- [Dispute Chat](./dispute_chat.md)
2324
- [Peer-to-peer Chat](./chat.md)
2425
- [List disputes](./list_disputes.md)
2526
- [Admin Settle order](./admin_settle_order.md)

src/dispute.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Dispute
22

3-
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:
3+
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:
44

55
```json
66
[
@@ -56,7 +56,7 @@ And here is the message to the buyer:
5656

5757
Mostro will not update the addressable event with `d` tag `<Order Id>` 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.
5858

59-
## Mostro send a addressable event to show the dispute
59+
## Mostro sends an addressable event to show the dispute
6060

6161
Here is an example of the event sent by Mostro:
6262

@@ -128,7 +128,7 @@ Mostro will send a confirmation message to the admin with the order details:
128128
]
129129
```
130130

131-
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:
131+
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:
132132

133133
```json
134134
[

src/dispute_chat.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Dispute Chat
2+
3+
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).
4+
5+
## Sending a message
6+
7+
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.
8+
9+
### User sending a message
10+
11+
Here is an example of a user sending a message to the admin:
12+
13+
```json
14+
[
15+
{
16+
"dm": {
17+
"version": 1,
18+
"action": "send-dm",
19+
"payload": {
20+
"text_message": "Hello, I need help with this order"
21+
}
22+
}
23+
},
24+
null
25+
]
26+
```
27+
28+
### Admin sending a message
29+
30+
Admins use the same format to send messages to users:
31+
32+
```json
33+
[
34+
{
35+
"dm": {
36+
"version": 1,
37+
"action": "send-dm",
38+
"payload": {
39+
"text_message": "I'm reviewing the evidence, please wait"
40+
}
41+
}
42+
},
43+
null
44+
]
45+
```
46+
47+
## Receiving messages
48+
49+
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

0 commit comments

Comments
 (0)