Nostr Secret Key Seed Derivation for Hierarchical Deterministic Wallets (Draft)
Nostr Secret Key Seed Derivation for Hierarchical Deterministic Wallets (Draft)
Abstract
This proposal specifies a deterministic method for deriving a standard 64-byte BIP32 master seed from a Nostr secret key (nsec).
The purpose is to allow existing Nostr identities to serve as the root secret for Bitcoin Hierarchical Deterministic (HD) wallets while remaining fully compatible with the existing BIP32/BIP44/BIP84/BIP86 ecosystem.
This proposal defines only the seed generation process.
All subsequent key derivation SHALL follow existing Bitcoin standards.
Motivation
Many users already possess a securely backed-up Nostr secret key (nsec1...).
Today that key can authenticate across numerous applications, yet it cannot directly initialize a standard HD Bitcoin wallet.
Current wallets require one of:
- BIP39 mnemonic
- imported private key
- hardware-generated seed
Importing a single private key does not provide deterministic address generation.
This proposal enables:
- deterministic HD wallet recovery from an existing Nostr identity
- optional passphrase protection
- complete compatibility with existing BIP32 wallet infrastructure
- a simple wallet import workflow requiring only an
nsecand optional passphrase
Design Goals
- No new elliptic curve algorithms
- No changes to BIP32
- No changes to BIP44/BIP84/BIP86
- Simple implementation
- Deterministic
- Cross-wallet interoperable
- Independent of any specific wallet vendor
Terminology
Nostr Secret Key
A Bech32-encoded Nostr private key beginning with:
nsec1...defined by NIP-19.
Canonical Secret
The decoded 32-byte private key contained within the nsec.
Passphrase
An optional UTF-8 string supplied by the user.
An empty passphrase is permitted.
Seed Generation
Wallets SHALL accept an nsec1... string as input.
The wallet SHALL:
- Decode the Bech32 Nostr secret.
- Verify that exactly 32 bytes are produced.
- Apply PBKDF2-HMAC-SHA512.
Parameters:
Password:
canonical 32-byte secret
Salt:
"nostr" || passphrase
PRF:
HMAC-SHA512
Iterations:
2048
Output:
64 bytesThe resulting 64-byte value SHALL be interpreted as a standard BIP32 master seed.
Master Key Generation
The seed SHALL be converted into a BIP32 master key exactly as defined by BIP32.
I = HMAC-SHA512(
key = "Bitcoin seed",
data = seed
)
master_private_key = I[0:32]
master_chain_code = I[32:64]No modifications are introduced.
Child Key Derivation
All child derivation SHALL follow BIP32.
Recommended derivation paths include:
Legacy
m/44'/0'/0'/0/0Nested SegWit
m/49'/0'/0'/0/0Native SegWit
m/84'/0'/0'/0/0Taproot
m/86'/0'/0'/0/0Nothing in this proposal alters existing derivation paths.
Wallet Import Procedure
User interface example:
Import Wallet
Nostr Secret
nsec1...
Passphrase (optional)
********Internally:
nsec1...
│
▼
Bech32 Decode
│
▼
32-byte Secret
│
▼
PBKDF2-HMAC-SHA512
│
▼
64-byte Seed
│
▼
BIP32
│
▼
BIP44/BIP84/BIP86Reference Algorithm
seed = PBKDF2(
password = decoded_nsec,
salt = "nostr" || passphrase,
iterations = 2048,
hash = SHA512,
output = 64 bytes
)
(master_key, chain_code) =
BIP32_Master(seed)Security Considerations
The security of the derived wallet depends entirely upon the entropy of the original Nostr private key.
Nostr private keys are uniformly random 256-bit values and therefore exceed the entropy requirements of typical mnemonic-based wallets.
Because the derivation is deterministic:
- loss of the
nsecresults in loss of wallet recovery - compromise of the
nseccompromises both Nostr identity and all wallets derived under this specification
Users SHOULD employ a passphrase when additional protection is desired.
Wallets SHOULD clearly warn users that importing an existing Nostr secret creates a cryptographic relationship between their Nostr identity and Bitcoin wallet.
Compatibility
This proposal is fully compatible with:
- BIP32
- BIP43
- BIP44
- BIP49
- BIP84
- BIP86
Only the generation of the initial seed differs.
No existing wallet functionality requires modification beyond accepting an nsec as an import source.
Test Vector Format
Each implementation SHOULD publish test vectors including:
Input nsec
Passphrase
Decoded Secret
Derived Seed
Master Private Key
Master Chain Code
m/44'/0'/0'/0/0
m/84'/0'/0'/0/0
m/86'/0'/0'/0/0