Skip to main content

Zap Receipt (Kind 5521)

A Kind 5521 (Zap Receipt) is published by a Lightning Network provider after a Lightning invoice has been successfully paid.

It serves as the definitive, cryptographic proof on the Nostr network that funds were settled against a specific Zap Request.

Event Structure

The receipt is signed by the provider's key (the node that received the funds) and is published to the relays specified in the original Zap Request.

{
"kind": 5521,
"content": "",
"tags": [
["e", "<optional_target_event_id>"],
["p", "<recipient_pubkey_or_connectionKey>"],
["P", "<sender_pubkey>"],
["bolt11", "lnbc10u1..."],
["description", "<json_string_of_zap_request>"],
["preimage", "<32_byte_hex_string>"]
],
"pubkey": "<provider_pubkey>",
"created_at": "<unix_timestamp>",
"id": "...",
"sig": "..."
}

Required Tags

TagFormatDescription
e["e", "<hex>"]Used if the Zap is in response to a specific Nostr event (copied from request).
p["p", "<hex>"]The recipient. For direct users, this is their Nostr pubkey. For custodial (Fallback Address) flows, this is the connectionKeySHA256(lidp_name:lidp_id).
P["P", "<hex>"]Originating from NIP-57, this is the pubkey of the Sender (extracted from the Zap Request).
bolt11["bolt11", "<string>"]The exact Lightning invoice that was paid.
description["description", "<json>"]The raw JSON string of the original Kind 5520 Zap Request.
preimage["preimage", "<hex>"]The cryptographic proof of payment (32-byte hex string) proving the invoice was settled.

Custodial Receipts

When a payment is made via the Fallback Address model (the recipient has no wallet), the p tag is set to the connectionKey rather than a user's Nostr pubkey. This connectionKey is the deterministic hash SHA256(lidp_name:lidp_id) that maps to the target LIDP account.

The receipt is stored internally by the server, indexed by this connectionKey, as a pending custodial balance. When the user later authenticates and connects a wallet, the server matches their verified LIDP identity to the connectionKey and sweeps the funds to their wallet.