Setting Up NIP-57 for Dummies (me)

What is NIP-57

NIP-57 defines two new note types of kind 9734 and 9735 (9735 is the default port for a lightning node). 9734 is the zap request which is a Nostr note that you send with a lightning payment. 9735 is the zap note which the person who got Zapped (tipped) sends to relays in order to display the zap in a Nostr client.

The NIP itself defines all this but to simplify it a little bit, NIP-57 allows your Zap (a lightning tip) to show up in a Nostr client. You can see an example here from Damus:


Lightning tips have been available on Damus and other clients as well for a while now. But, Zaps actually show up in your notifications and on the post itself on many clients.


In order for the Nostr client to display these it needs to receive a note, signed by you. That's the Zap Note of kind 9735.

But, how can you send a note from someone else who zapped you? That's what the Zap Request note of kind 9734 is for.

Embedding a Nostr Note in a Lightning Invoice

On most Nostr clients you can add a Lightning Address to your profile, mine is for example. Adding this to your profile is what enables the Lightning Tip button you have probably seen before on multiple clients:


This button uses the Lightning Address to open your Lightning wallet and make a payment. But, these payments don't show up on Nostr because there is nothing tying them to you or the person who tipped you.

If you're not familiar with the regular Lightning Address flow, check out this post I wrote on setting that up with Core Lightning:

Setting up Lightning Addresss with Core Lightning

The way Zaps are different is that the BOLT-11 invoice that is created for the person tipping you to pay has a Nostr note in the description.

In the normal flow you only pass the amount you want to pay when you want to tip someone, NIP-57 adds a note as well to that request as a query parameter.

The zap request note is what is embedded in the description of the BOLT-11 invoice. Other than that the flow would be that same as a normal Lightning payment.

Responding to a Zap Request in a Paid Invoice

When someone pays an invoice you created, your lightning node will be notified. In my case (Using Core Lightning) there is an rpc method called waitanyinvoice. This does what it sounds like, it basically blocks until an invoice is paid.

In order to know that you've been zapped you have to watch for paid invoices and check their description for a Nostr note.

Doing this part requires some process you run that watches this for you. In my case I used the cln-nostr-zapper to handle it.

It just runs all the time watching for paid invoices, checks the description, if it is a valid JSON object, and a kind 9734 note, then you know you've been zapped.

You can see here in cln-nostr-zapper where it checks the description for a valid note of the right kind:

function get_zapreq(desc) {
	if (!desc)
		return null

	if (desc.kind === 9734)
		return desc

	return null

So at this point, you know you've been paid, and you know it's a Zap. But, how do you send a Note to your relay and subsequently your client indicating that?

Sending the Zap Note


Here is an example of a kind 9735 zap note (containing the kind 9734 zap request note, in the description field):

    "id": "67b48a14fb66c60c8f9070bdeb37afdfcc3d08ad01989460448e4081eddda446",
    "pubkey": "9630f464cca6a5147aa8a35f0bcdd3ce485324e732fd39e09233b1d848238f31",
    "created_at": 1674164545,
    "kind": 9735,
    "tags": [
    "content": "",
    "sig": "b0a3c5c984ceb777ac455b2f659505df51585d5fd97a0ec1fdb5f3347d392080d4b420240434a3afd909207195dac1e2f7e3df26ba862a45afd8bfe101c2b1cc"

This is the note your Zapper (in my case cln-nostr-zapper) sends to relays (signed by you this time). The relays that the person sending the zap cares about are embedded in the zap request note so you can send the event to those to ensure they will see it.

After you send the note, if your client supports it, you will see the zap in a notification or on the event itself.


Zaps are a modification of the Lightning Address flow which sends a Nostr event from the tipper to the person being tipped. The person being tipped watches to see a paid invoice and if there is one they pass along the note they got. In this way the person being tipped has control over whether or not they want to transmit the event that they've been zapped.

Clients that support displaying kind 9735 events will display this as a Zap.


I hope this clarifies some things for anyone trying to add support for this themselves. I actually added some support for it on my own blog here, you can see my Zaps listed here

If you enjoyed this you can follow me on Nostr.

If you want to try something meta you can Zap my post where I share this and then see your Zap on the tip page, check it out here: Note sharing this article

FYI, if your username doesn't show up right away, reload the page. There is a cache of public keys to usernames that I populate on the backed.


Leave a tip