Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions src/dispute.md
Original file line number Diff line number Diff line change
@@ -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
[
Expand Down Expand Up @@ -56,7 +56,7 @@ And here is the message to the buyer:

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.

## 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:

Expand Down Expand Up @@ -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
[
Expand Down
49 changes: 49 additions & 0 deletions src/dispute_chat.md
Original file line number Diff line number Diff line change
@@ -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