Skip to content

BIP85: add Nostr application#2126

Open
ethicnology wants to merge 8 commits into
bitcoin:masterfrom
ethicnology:bip85-nostr-application-86
Open

BIP85: add Nostr application#2126
ethicnology wants to merge 8 commits into
bitcoin:masterfrom
ethicnology:bip85-nostr-application-86

Conversation

@ethicnology

@ethicnology ethicnology commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

BIP-85: the Nostr path

Adds a dedicated BIP-85 application for deriving Nostr private keys a.k.a. nsec, with a structured /{identity}'/{account}' path supporting multiple unlinkable identities.

Motivation

Today there is no standardized BIP-85 path for Nostr key derivation:

Method Path Problem
BIP-85 HEX m/83696968'/128169'/32'/index' Not Nostr-specific, no identity structure
BIP-85 mnemonic + NIP-06 BIP-85 → 12 words → m/44'/1237'/0'/0/0 Two-step, wasteful intermediate mnemonic
NIP-06 directly m/44'/1237'/account'/0/0 Unhardened, Not BIP-85 entropy isolation

A dedicated application number eliminates this fragmentation.

Without an isolated derivation path, a mnemonic imported into a Nostr-aware wallet could collide with keys already in use by a Bitcoin wallet (or vice versa). A dedicated BIP-85 application isolates Nostr key derivation entirely, preventing any cross-protocol key reuse.

The structured {identity}'/{account}' path also enables account discovery: a wallet can derive pubkeys aka npub for the first N identities and accounts, then query Nostr relays for events signed by those keys to automatically recover all active accounts.

Application number: 9000

9000 is the zip code of Funchal in Madeira, Portugal. The place where I wrote this pull request during the Sovereign Engineering event. This deliberately avoids 1237 (the SLIP-0044 coin type used in NIP-06's m/44'/1237'/...) to clearly distinguish BIP-85 derivation from NIP-06 derivation.

m/83696968'/9000'/{identity}'/{account}'

Identity index 0' and account index 0' across identities are reserved for future key management operations.

From this new application number, identity semantics (proof-of-linkage, key rotation, account discovery) can be specified in an external NIP that references this application.

Implementation commitment

I maintain two BIP-85 libraries and can port this application to both:

@ethicnology ethicnology changed the title feat(BIP85): add Nostr application BIP85: add Nostr application Mar 20, 2026

@murchandamus murchandamus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn’t strike me as related to Bitcoin. Perhaps this would be better directed at the NIPs repository.

@ethicnology

Copy link
Copy Markdown
Contributor Author

Hello @murchandamus

I'm surprised by this reaction since most of the applications specified in this BIP are not directly Bitcoin related either (RSA, Dice, Passwords...)

@murchandamus

murchandamus commented Mar 20, 2026

Copy link
Copy Markdown
Member

Maybe I reacted too quickly. @akarve, please let us know whether you are interested in accepting this PR.

@murchandamus murchandamus reopened this Mar 20, 2026
@murchandamus murchandamus added Proposed BIP modification PR by non-owner to update BIP content Pending acceptance This BIP modification requires sign-off by the champion of the BIP being modified labels Mar 20, 2026
@akarve

akarve commented Mar 21, 2026

Copy link
Copy Markdown
Contributor

Maybe I reacted too quickly. @akarve, please let us know whether you are interested in accepting this PR.

Thanks for caring, @murchandamus.

@ethicnology nostr could be a reasonable BIP85 app. I'm probably missing something about nostr since I don't know it deeply, so I will ask a few basic questions to make sure we aren't reinventing any wheels. Looking at NIP-06 there are BIP32 and BIP39 derivations for nostr keys. BIP85 already has apps for 32' and 39'.

  • What is missing if one just assigns an integer key index for either app as their nostr index and then derives the nsec and npub?
  • How does your proposed derivation relate to the recommended BIP32 m/44'/1237'/<account>'/0/0 derivation?

For later (if we get there):

  • Higher app numbers are better (less collisions, higher = later, saves room for BIPs) so I'd recommend one number per letter of nostr
  • I am updating the linked reference implementation to have an app protocol soon and would request if we move forward that you extend the same https://github.com/akarve/bipsea

@ethicnology

Copy link
Copy Markdown
Contributor Author

Hi @akarve, thanks for taking the time

What is missing if one just assigns an integer key index for either app as
their nostr index and then derives the nsec and npub?

HEX can produce valid Nostr keys but carry no semantics. The integer index is just a counter there is no concept of identity / account, and we cannot perform any discovery.

The two-level {identity}'/{account}' structure allows: multiple unlinkable identities, key rotation within an identity, a dedicated proof key for linkage/revocation (account 0).

How does your proposed derivation relate to the recommended BIP32
m/44'/1237'/<account>'/0/0 derivation?

I want to distinguish my proposal from NIP-06 (or BIP85–> BIP39 + NIP06), because it derives directly from the wallet's master seed without BIP-85 isolation AND the last two path levels are unhardened, exposing sibling keys.

As a wallet (Bull) that offers BIP85 mnemonics to create sub/decoy-wallet, we would invent our own convention to integrate Nostr keys without conflicting with HEX and BIP39 derivations.

Higher app numbers are better

Ok, I'm open to your suggestion.

I would request that you extend bipsea

Ok, will do if we move forward.

PS: Full identity/account semantics allow Nostr enthusiasts to design mechanism for key rotation/migration like this one: nostr-protocol/nips#1691 (comment)

@jodobear

Copy link
Copy Markdown

It makes sense for Nostr to have a defined number in BIP 85

Comment thread bip-0085.mediawiki Outdated
@BullishNode

Copy link
Copy Markdown

I find this useful as an application layer BIP enhancement in the context that a few wallets have expressed the intention of leveraging Nostr identities as payment contacts (already the case for LNURL, with work ongoing for silent payments). Another application being considered is PSBT sharing and multisig coordination over Nostr. It is useful for these wallets to be able to regenerate the Nostr identities in a standardized way from the same mnemonic used to recover Bitcoins. So there is relevance to Bitcoin wallets in addition to the more typical Nostr "social media" apps.

@akarve

akarve commented Apr 4, 2026

Copy link
Copy Markdown
Contributor

@ethicnology Your app proposal makes sense. The reference implementation has a new protocol that you can use when PR'ing that repo (and as an implicit test of the protocol and your app): https://github.com/akarve/bipsea/blob/main/src/bipsea/apps/README.md

@murchandamus

Copy link
Copy Markdown
Member

@akarve: Could you clarify, whether this is ready to be merged?

@akarve

akarve commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

@murchandamus not yet; will review in more detail and circle back

Comment thread bip-0085.mediawiki Outdated
Comment thread bip-0085.mediawiki Outdated

====Added====

* Nostr application 86'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about 7879838482 per earlier discussion?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it a too big number ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this is the remaining point to resolve?

@ethicnology ethicnology May 6, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is.
86 is too small, but 7879838482 exceeds 2³¹. I want to make sure that won't cause issues.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it a too big number ?

Good catch. No reason to break integer bounds. Can we try the Hebrew “NSTR”?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid removing a char, we could try, the ASCII sum of "nostr" (110+111+115+116+114) –> 566

But then I don't know if it is still too small

If so I could try a date

Comment thread .typos.toml
@jonatack jonatack requested a review from akarve May 6, 2026 17:43
@akarve

akarve commented May 10, 2026 via email

Copy link
Copy Markdown
Contributor

@ethicnology

Copy link
Copy Markdown
Contributor Author

@akarve let's use 9000 ?
It's the zip code of Funchal in Madeira, Portugal. The place where I wrote this pull request during the Sovereign Engineering event.

@akarve

akarve commented May 13, 2026 via email

Copy link
Copy Markdown
Contributor

@jonatack jonatack added the PR Author action required Needs updates, has unaddressed review comments, or is otherwise waiting for PR author label May 13, 2026
@ethicnology

ethicnology commented May 14, 2026

Copy link
Copy Markdown
Contributor Author

c0aa336

  • 86'9000'
  • Version bumped 2.0.02.1.0 to match the changelog entry.
  • Added rust-bip85 (1.2.0) and dart-bip85-entropy (1.1.0) to Reference Implementations

Comment thread bip-0085.mediawiki Outdated
Comment on lines +484 to +488
* 1.3.0 Python 3.x library implementation: [https://github.com/akarve/bipsea]
* 1.1.0 Python 2.x library implementation: [https://github.com/ethankosakovsky/bip85]
* 1.0.0 JavaScript library implementation: [https://github.com/hoganri/bip85-js]
* 1.2.0 Rust library implementation: [https://github.com/ethicnology/rust-bip85]
* 1.1.0 Dart library implementation: [https://github.com/ethicnology/dart-bip85-entropy]

@murchandamus murchandamus May 14, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don’t collect long lists of implementations in BIPs. This later creates work for BIP authors and editors, as more people open pull requests to add their own implementations. Such lists then tend to outdate quickly and contain implementations that have not gotten much review in the first place. BIPs are explicitly not meant to be sign-posts to adopting projects.

Please remove any outdated implementations from this list and preferably link to a single reference implementation. If some projects represent the reference for different aspects of this BIP, and you decide to keep more than one, please indicate clearly why more than one is being retained and what they are the reference for.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, I've amended my commit and let only the bipsea reference implementation

6f47566

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ethicnology ethicnology force-pushed the bip85-nostr-application-86 branch from c0aa336 to 6f47566 Compare May 14, 2026 15:08
@jonatack jonatack removed the PR Author action required Needs updates, has unaddressed review comments, or is otherwise waiting for PR author label May 14, 2026

@jonatack jonatack left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ethicnology Can you update the PR description for the application number (86 -> 9000)?

@akarve any further feedback here?

Comment thread bip-0085.mediawiki Outdated
…st-bip85 + dart-bip85-entropy reference implementations
@ethicnology ethicnology force-pushed the bip85-nostr-application-86 branch from 6f47566 to 13f307b Compare May 15, 2026 05:36
Comment thread bip-0085.mediawiki

Application number: 9000'

9000 is the zip code of Funchal in Madeira, Portugal, where this specification was written during the Sovereign Engineering event.

@akarve akarve May 24, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is customary to leave the origin of the number a mystery, even if the number is semantic :)

@akarve akarve May 24, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the app author this number is really up to you. I would still suggest NSEC or NIP or CHAT or something more likely to be semantic. Think of this as a tiny puzzle or fairy door that readers can solve for themselves and smile later.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mention of a ZIP Code for Vegas was just because gambling happens in Vegas not because we invented the app there ;)

Comment thread bip-0085.mediawiki
Comment on lines +436 to +438
Identity index <code>0'</code> is reserved for future protocol use.
Account index <code>0'</code> is reserved across all identities for key management operations.
Usable keys start at <code>identity >= 1'</code> and <code>account_index >= 1'</code>.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a great reason to do this as written. If it's really about illegal values, fine, but update the description? Otherwise show me for example how you would use the derivation path m/83696968'/9000'/0'/0' in the future? Or do you mean nostr reserves account 0 for its own use, in which case we should link to that spec here. Pretty much every index in this spec starts with 0, it seems weird to do things different just for nostr.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If what you really want is a type segment (for future uses) is that something worth adding now or will it be forward compatible to add a segment for new "types"/sub-apps?

@akarve akarve left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This mostly looks good to me and I anticipate approving after next round of answers/edits. @ethicnology

Comment thread bip-0085.mediawiki

The derivation path format is: <code>m/83696968'/9000'/{identity}'/{account_index}'</code>

Uses the entropy as a Nostr private key.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please consolidate this section with the 32-byte comment (push it below), it doesn't make sense here.

Comment thread bip-0085.mediawiki
Account index <code>0'</code> is reserved across all identities for key management operations.
Usable keys start at <code>identity >= 1'</code> and <code>account_index >= 1'</code>.

The resulting 32-byte private key is Bech32 encoded as an <code>nsec</code> per NIP19.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you be more explicit about truncation and which 32 bytes to use? The user gets 64 bytes by standard application of BIP-85 so this is a leap.

Comment thread bip-0085.mediawiki
* PATH: m/83696968'/9000'/1'/1'

OUTPUT
* DERIVED ENTROPY=552ad1d578fe1bc927cec9612651652b07c52dde4017911bc23bc953568075ff

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not consistent with the rest of the spec. Even if you only use 32-bytes you should show all 64 for test consistency.

Comment thread bip-0085.mediawiki
Comment on lines -439 to -440
* 1.1.0 Python 2.x library implementation: [https://github.com/ethankosakovsky/bip85]
* 1.0.0 JavaScript library implementation: [https://github.com/hoganri/bip85-js]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to change this section. It's showing up as a net delete; we should leave it as is.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this was in reaction to my comment. See: #2126 (comment)

@akarve akarve May 26, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure but it drops two lines too many, not just the two new ones (which would show up as no diff) but two existing ones.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, but why are there three reference implementations in the first place? Unless they are references for different aspects of BIP85, shouldn’t there just be one?

@akarve

akarve commented May 27, 2026 via email

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Pending acceptance This BIP modification requires sign-off by the champion of the BIP being modified Proposed BIP modification PR by non-owner to update BIP content

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants