Skip to main content

Zap Request (Kind 5520)

To initiate a payment in the Zapf ecosystem, a client generates a Kind 5520 (Zap Request) event.

This extends the standard NIP-57 Zap Request (Kind 9734) but explicitly targets Zapf's identity and custodial architecture. The primary distinction is the routing capability when zapping users who do not yet have wallets (the Fallback Address model).

Event Structure

A Zap Request is created and signed by the sender's client.

{
"kind": 5520,
"content": "Here is 1000 sats! Great post.",
"tags": [
["p", "<recipient_pubkey_or_placeholder_hash>"],
["relays", "wss://relay.ohstr.com", "wss://nos.lol"],
["amount", "1000000"],
["lnurl", "lnurl1..."],
["e", "<optional_target_event_id>"]
],
"pubkey": "<sender_pubkey>",
"created_at": 1709424000,
"id": "...",
"sig": "..."
}

Required Tags

TagFormatDescription
p["p", "<hex>"]The target of the Zap. If the recipient has a known Nostr pubkey, this is their 64-character hex key. If zapping a strictly off-chain identity (e.g., An Email address), this is the SHA-256 hash of the lidp:identifier string.
relays["relays", "<url1>", "<url2>"]An array of relay URLs where the provider should publish the resulting Zap Receipt.
amount["amount", "<millisats>"]The requested payment amount in millisatoshis.
lnurl["lnurl", "<string>"]The encoded LNURL the sender is requesting an invoice from.

Optional Tags

TagFormatDescription
e["e", "<hex>"]Used if the Zap is in response to a specific Nostr event (e.g., tipping a specific note or article).

Validation Rules

When a Zapf IA or LN provider receives a Kind 5520 via an LNURL callback, it must strictly validate:

  1. Signature: The event signature must be mathematically valid for the pubkey.
  2. Amount: The amount tag must match the amount query parameter sent in the HTTP request.
  3. LNURL: The lnurl tag must match the target being requested.

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).