Draft spec: BCH payment address from a Nostr npub (Cashonize #405)

Cashonize issue #405 asks for a way to pay a Nostr identity (npub) from a BCH wallet, and says it would follow “a CHIP or NIP that defines how a BCH payment target is found from an npub, implemented by at least one other wallet”. I wrote a short draft spec for that. Feedback wanted before anyone builds on it.

Update (Nov 21): the draft has been revised to v2 after ABLA’s review below (dedicated replaceable kind instead of NIP-78 kind 30078, Paytaca’s existing payload format, no kind-0 fallback, watch-before-opt-in rule for NIP-06 wallets). The v2 summary is in post #8 of this thread; the text below describes v1 and is kept for context.

The short version (v1):

  • The npub owner publishes a replaceable Nostr event (kind 30078) that holds their BCH address (a token-aware z-address).
  • The binding is signed twice, by the Nostr key and by the BCH key, so a relay or a third party can’t swap the address.
  • A wallet resolves npub → address through a relay the user picks, checks both signatures, and shows the address before the user pays.
  • Privacy: this publishes one public address. The spec lists an optional RPA paycode field for anyone who doesn’t want address reuse.

Open questions: which relays should wallets query by default, and should the BCH-key signature be required or optional?

All of it is CC0. (External links removed from this post; ask and I’ll share the draft text.)

@MathieuG, this follows the directions you listed in Cashonize #405, so your view on which one fits best would help a lot.

1 Like

Thanks @kzKallisti, that’s a good point and much simpler when the Nostr key and the wallet key are the same. I’d like to add it to the draft as a second method next to the signed event.

The compression detail, as I understand it: an npub is the 32-byte x-only key from BIP340, so there are two points with that x, with prefixes 02 and 03. BIP340 always means the even-y one, so the canonical derived address is P2PKH(hash160(02||x)). If the wallet’s private key d gives an odd-y point, Nostr signers silently sign with n−d, and the 02 address is spendable with n−d but not with d. A wallet that derives from the same seed has to normalise to even y (or watch both addresses), or the payment lands somewhere the wallet doesn’t look. Is that the same issue you ran into in bchat?

Where I think the signed-event method still helps:

  1. Most npubs today live in browser extensions, bunkers or other Nostr apps, not in a BCH wallet. If someone pays the derived address of one of those npubs, the funds can only be recovered by importing the nsec into a BCH wallet. That’s recoverable, but the payee won’t expect it.
  2. The derived address links the whole Nostr identity to one reused BCH key. Some users will want a separate wallet or an RPA paycode instead.

So my proposal for the draft:

  • Method A (derived): if the npub owner says their Nostr key is also their BCH key, pay P2PKH(02||x). The owner signals this with a binding event whose address equals the derived address (it then self-verifies, since one key covers both signatures), or with a simple tag.
  • Method B (bound): signed binding event pointing at any address or paycode, as now.
  • With no event at all, wallets should warn before paying the derived address instead of doing it silently.

Very interested in the CashAccount + RPA + Nostr work when you’re ready. The draft already has an optional RPA paycode field, and I’m happy to rename or restructure it to match what you build, so there aren’t two incompatible formats.

@penny_docs Nice work, and thanks for making it CC0. I went through the draft, its repo, Cashonize #405 and the current NIPs master. Some of it might change the answers to your open questions.

1. Kind 30078 is no longer a good fit

NIP-78 was changed on 3 September 2026 (#2458). It now says these kinds are “not meant to be used as a generic interchange format”, and that apps that need to work with other apps should use dedicated kinds. It also says relays SHOULD require NIP-42 auth and only serve 30078 events to their author. A sender’s wallet is never the author, therefore “30078 works on every relay today” can stop being true on any relay that follows the new text. I think a dedicated kind would be the better choice.

2. A cross-wallet format already exists

Paytaca publishes the address as kind 30078 with d=paytaca:bch-address and content {"name":"Paytaca BCH Address","data":{"address":"..."}}, signed only by the Nostr key (code). I also worked on Nostr integration in OPTN Wallet, which publishes and reads the same event (code).

The “implemented by at least one other wallet” part of the #405 trigger is already met for that format. What it doesn’t have yet is a written spec.

A spec that keeps the same payload, moves it to a dedicated kind and adds your BCH signature tag would be a small change for two wallets that already use it. Old paytaca:bch-address events could still be read as a fallback, with a warning.

3. The kind 0 fallback could be dropped

NIP-39 moved i tags out of kind 0 in February 2026 (#2216). They are in kind 10011 now, so section 2 is already out of date. An unverified address in a profile is also an easy way to phish someone. If you want the claim to be visible, a bch: i tag in kind 10011 would fit better. That’s where the GitHub, Twitter and other proofs live, so the BCH address would show up next to them.

4. “Derived” can mean two different keys

As I understand it, in bchat the npub comes from the wallet keys (@kzKallisti point, now section 3b). Paytaca and OPTN use NIP-06 at m/44'/1237'/0'/0/0, which is a separate branch from their BCH receive keys (OPTN mainnet uses m/44'/145'/account'). So P2PKH(02||x) for a Paytaca or OPTN npub is a key those wallets hold but don’t scan. Section 3b already makes method A opt-in, which is good. If NIP-06 wallets are meant to use method A, it should also say that they must watch that address before they opt in.

The good part of NIP-06 is that both wallets use the same path, so the same seed gives the same npub in either one. The bad part is that NIP-06 is now marked unrecommended upstream (“prefer a single nsec”), and the identity is tied to the seed. A new or leaked seed means a new identity.

5. A leaked nsec, and what BCH can add

The Nostr signature alone already stops relays from swapping the address. What the BCH signature adds is proof that the npub owner controls the address. Neither one helps against whoever holds the nsec. They can publish a new binding to their own address, signed by their own BCH key, and section 4 lets the old Nostr key authorize a rotation. So the nsec, which #405 notes is often pasted into many clients, still decides where future payments go.

Two valid rotations from the same old key can also exist at the same time, and the spec doesn’t say which one wins. For bindings the newest created_at wins, and the signer sets created_at. The readme in your repo already names part of this (“if both old keys leak”) and suggests a time-locked BCH commitment or a pre-committed next-key hash.

Nostr has no key rotation NIP merged yet (proposals like #2114 and #1056 are still open), so a BCH-native answer here might be useful beyond BCH. Something like this:

  • The identity could be a token category, not the npub. A mutable NFT in the user’s wallet holds the current state in its commitment.

  • Since the Layla upgrade (May 2026), commitments can be up to 128 bytes. npub (32) + P2PKH locking bytecode (25) + hash of the next npub (32) is 89 bytes, so it fits.

  • The address book pins the category on first contact. After that, key rotation and moving to another wallet happen by spending the NFT with the wallet key, not the nsec. If the category has no minting NFT, there is only one current state: no rotation races, and no relay serving an old binding.

  • The NFT can sit in a multisig or a time-delayed vault, which BCMR already describes for identity outputs. I think it would be better to build on BCMR authchains than to invent a new identity scheme, and it could fit into @kzKallisti Cash Accounts](Cash Accounts / Cash Account Specification · GitLab) + RPA + Nostr work. The costs are small each update is one transaction, wallets need a chain lookup to find the NFT, and the identity update history is public on chain. It also doesn’t fix first contact: the first time, the wallet still trusts what the npub points to, same as today.

@ABLA thank you, this is a very useful review, and sorry for the slow reply. I checked the points against the current NIPs master:

  1. NIP-78: agreed. The text now says 30078 is “not meant to be used as a generic interchange format” and that relays SHOULD serve it only to the authenticated author, so a sender’s wallet can’t rely on reading it. The next revision will use a dedicated kind.
  2. Paytaca’s format: I found the paytaca:bch-address event in paytaca-app. Writing that payload down as the spec, on a dedicated kind with the optional BCH signature tag, and reading old paytaca:bch-address events as a fallback with a warning, seems like the smallest change for the wallets that already use it. I’ll restructure the draft around that.
  3. Kind 0 fallback: agreed, I’ll drop it. NIP-39 claims now live in kind 10011, so a bch: i tag there is the place for a public claim.
  4. NIP-06 keys: good catch. I’ll add that a wallet whose npub comes from m/44’/1237’ must watch P2PKH(02||x) before it opts into method A, and note that NIP-06 is now marked unrecommended upstream.
  5. nsec leaks and rotation: you’re right that neither signature protects against whoever holds the nsec, and that two rotations from the same old key have no defined winner. The BCMR-authchain idea (identity = token category, current state in a mutable NFT commitment, rotation by spending the NFT with the wallet key) fits in the 128-byte commitment and avoids the race. I’ll add it as a separate optional section, building on BCMR rather than a new scheme, and leave first-contact trust as an open question.

I’ll post here when the revised draft is up.

@ABLA as promised, the revised draft (v2) is up on the same page as before, with v1 kept for comparison. Here is a short version so nobody has to click through:

Address event (dedicated addressable kind; 30145 is a placeholder, unassigned, 145 = BCH coin type):

kind:    30145
tags:    ["d", "bch-address"]
         ["i", "bch:<cashaddr>", "<BCH signmessage sig>"]   (recommended)
         ["statement", "bch-nostr-bind.v1:<pk hex>:<cashaddr>:<ts>"]
content: {"name":"BCH Address","data":{"address":"<cashaddr>"}}
  • content is exactly Paytaca’s current payload, so a wallet that already publishes paytaca:bch-address only changes the kind and d tag, and can add the BCH signature tag when it’s able to sign messages.
  • Trust levels: signed by both keys, Nostr-signed only, or legacy. If an i tag is present but doesn’t verify, the event is rejected instead of being downgraded.
  • Legacy: kind 30078 paytaca:bch-address events are read as a fallback, marked legacy, with a note that NIP-78 relays may not serve them.
  • Kind 0 claim removed. A bch: i tag in kind 10011 is allowed for display only, and wallets never pay to it alone.
  • Derived address (3b): a wallet must watch P2PKH(02||x) before it opts in. NIP-06 wallets don’t scan that branch by default, and NIP-06 is now unrecommended upstream.
  • Rotation: the known limits are now stated plainly. A leaked nsec still wins, and if two rotations conflict the wallet shows both and never pays automatically.
  • New optional section: identity anchored in a mutable NFT. The commitment is npub || P2PKH bytecode || hash(next npub) = 89 bytes, rotation means spending it with the wallet key, the category is described via BCMR, and the Nostr event links it with a bch-category tag. First-contact trust and the light-wallet indexer call are listed as open questions.

Open questions I’d like input on: is 30145 OK as a placeholder until someone writes a NIP? Should a “verified” badge require the BCH signature? And is the NFT section worth prototyping?