Skip to content

Commit 89a66c7

Browse files
docs: simplify dispute chat documentation
1 parent 778d8ab commit 89a66c7

1 file changed

Lines changed: 2 additions & 94 deletions

File tree

src/dispute_chat.md

Lines changed: 2 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Once an admin takes a dispute, both the admin and the involved parties (buyer an
44

55
## Sending a message
66

7-
Users and admins send messages using action `send-dm`. The message must be wrapped in a Gift Wrap event (kind 1059) to ensure privacy and encryption.
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.
88

99
### User sending a message
1010

@@ -25,8 +25,6 @@ Here is an example of a user sending a message to the admin:
2525
]
2626
```
2727

28-
This content is wrapped in a RUMOR (kind 1, unsigned), then encrypted in a SEAL (kind 13), and finally wrapped in a Gift Wrap event (kind 1059) before being published to the relays.
29-
3028
### Admin sending a message
3129

3230
Admins use the same format to send messages to users:
@@ -46,96 +44,6 @@ Admins use the same format to send messages to users:
4644
]
4745
```
4846

49-
## Gift Wrap structure
50-
51-
The Gift Wrap protocol (NIP-59) provides three layers of encryption:
52-
53-
### Layer 1: RUMOR (kind 1)
54-
55-
The original unsigned message containing the actual content:
56-
57-
```json
58-
{
59-
"kind": 1,
60-
"content": "[{\"dm\": {\"version\": 1, \"action\": \"send-dm\", \"payload\": {\"text_message\": \"Hello\"}}}, null]",
61-
"pubkey": "<Sender's trade pubkey>",
62-
"created_at": 1234567890,
63-
"tags": []
64-
}
65-
```
66-
67-
### Layer 2: SEAL (kind 13)
68-
69-
The RUMOR encrypted with NIP-44:
70-
71-
```json
72-
{
73-
"id": "<Seal event id>",
74-
"kind": 13,
75-
"content": "<Encrypted RUMOR with NIP-44>",
76-
"pubkey": "<Sender's trade pubkey>",
77-
"created_at": 1234567890,
78-
"tags": [],
79-
"sig": "<Signature>"
80-
}
81-
```
82-
83-
### Layer 3: GIFT WRAP (kind 1059)
84-
85-
The final layer using an ephemeral key:
86-
87-
```json
88-
{
89-
"id": "<Gift wrap event id>",
90-
"kind": 1059,
91-
"content": "<Encrypted SEAL with NIP-44>",
92-
"pubkey": "<Ephemeral pubkey>",
93-
"created_at": 1234567890,
94-
"tags": [
95-
["p", "<Receiver's pubkey>"]
96-
],
97-
"sig": "<Signature>"
98-
}
99-
```
100-
10147
## Receiving messages
10248

103-
To receive messages, clients must:
104-
105-
1. Subscribe to kind 1059 events with a `p` tag matching their pubkey
106-
2. Decrypt the Gift Wrap using their private key and the ephemeral pubkey
107-
3. Decrypt the SEAL using their private key and the sender's pubkey from the SEAL
108-
4. Extract the RUMOR content and parse the message
109-
110-
The sender's identity is preserved in the SEAL's pubkey field, allowing the receiver to identify who sent the message (admin or user) while maintaining privacy through the ephemeral key in the Gift Wrap layer.
111-
112-
## Message flow
113-
114-
```
115-
User writes message
116-
117-
Create RUMOR (kind 1)
118-
119-
Encrypt into SEAL (kind 13) with sender's key
120-
121-
Encrypt into Gift Wrap (kind 1059) with ephemeral key
122-
123-
Publish to relays
124-
125-
Receiver gets kind 1059 event
126-
127-
Decrypt Gift Wrap → SEAL
128-
129-
Decrypt SEAL → RUMOR
130-
131-
Parse and display message
132-
```
133-
134-
## Privacy features
135-
136-
The Gift Wrap protocol provides:
137-
138-
- **Double encryption**: SEAL + Gift Wrap layers
139-
- **Sender anonymity**: Ephemeral keys hide the real sender from relay observers
140-
- **Metadata obfuscation**: Randomized timestamps (±2 days)
141-
- **End-to-end encryption**: Only sender and receiver can read messages
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)