Zap Request (Kind 5520)
To initiate a payment across the open network, a client generates a Kind 5520 (Zap Request) event.
This extends the standard NIP-57 ↗ Zap Request (Kind 9734 ↗) with two key changes that motivated new event kinds:
- The
ptag allows targeting legacy identities by accepting a ConnectionKey instead of strictly requiring a Nostr pubkey. The 3rd parameter denotes the provider (e.g.,discord). If the 3rd parameter is empty or omitted, it defaults safely back to a nativenostrpubkey. - Settlement is coin-agnostic, supporting any energy-backed asset routable over the Lightning Network — not limited to Bitcoin.
Event Structure
A Zap Request is created and signed by the sender's client.
{
"kind": 5520,
"content": "Here is 1000 loki! Great post.",
"tags": [
["e", "<optional_target_event_id>"],
["a", "<optional_kind:pubkey:d_tag>"],
["k", "<optional_target_event_kind>"],
["p", "<recipient_pubkey_or_ConnectionKey>", "<optional_lidp_name>"],
["amount", "1000000"],
["chain", "flokicoin"],
["lnurl", "lnurl1..."],
["relays", "wss://relay.ohstr.com", "wss://nos.lol"]
],
"pubkey": "<sender_pubkey>",
"created_at": "<unix_timestamp>",
"id": "...",
"sig": "..."
}
Required Tags
| Tag | Format | Description |
|---|---|---|
p | ["p", "<hex_or_ConnectionKey>", "<optional_lidp_name>"] | The target of the Zap. Can be a native Nostr 64-character hex key or a ConnectionKey. The 3rd element denotes the provider (e.g., discord). If omitted or empty, it defaults to nostr (pubkey). |
relays | ["relays", "<url1>", "<url2>"] | An array of relay URLs where the provider should publish the resulting Zap Receipt. |
amount | ["amount", "<milli-units>"] | The requested payment amount in milli-units (e.g., mloki, msats). |
chain | ["chain", "<string>"] | The network context, e.g., flokicoin or bitcoin. |
lnurl | ["lnurl", "<string>"] | The encoded LNURL the sender is requesting an invoice from. |
Optional Tags
| Tag | Format | Description |
|---|---|---|
e | ["e", "<hex>"] | Used if the Zap is in response to a specific Nostr event (e.g., tipping a specific note). |
a | ["a", "<kind>:<pubkey>:<d_tag>"] | Used if the Zap is in response to a parameterized replaceable event (e.g., tipping an article or badge). |
k | ["k", "<kind_number>"] | The stringified kind of the target event being zapped (e.g., "1", "30023"). |
Validation Rules
When a service or LN provider receives a Kind 5520 via an LNURL callback, it must strictly validate:
- Signature: The event signature must be mathematically valid for the
pubkey. - Amount: The
amounttag must match theamountquery parameter sent in the HTTP request. - LNURL: The
lnurltag must match the target being requested. - Chain Gating: The requested
chaintag must match the provider's allowed routing chains.
If these conditions are met, the provider generates a Lightning invoice with the hash of this encoded JSON event embedded in the invoice's description hash (per LUD-11).