kopia lustrzana https://github.com/nostr-protocol/nostr
add nip-06, generating keys from mnemonic codes.
rodzic
97786e3142
commit
bf34ca018e
|
@ -0,0 +1,19 @@
|
||||||
|
NIP-06
|
||||||
|
======
|
||||||
|
|
||||||
|
Key derivation from mnemonic
|
||||||
|
----------------------------
|
||||||
|
|
||||||
|
`draft` `optional` `author:fiatjaf`
|
||||||
|
|
||||||
|
This combines [BIP39](https://bips.xyz/39) and a modified [BIP32](https://bips.xyz/32) into a scheme that allows the generation of a private key from a list of seed words.
|
||||||
|
|
||||||
|
BIP32 is modified to use the key `Nostr seed` instead of `Bitcoin seed` in the HMAC function.
|
||||||
|
|
||||||
|
This document specifies the creation of a single Nostr private key, but it can be expanded in the future if "HD Wallets" ever become a relevant use case.
|
||||||
|
|
||||||
|
Steps for generating the private key:
|
||||||
|
|
||||||
|
1. Follow the steps on BIP39 for generating the `mnemonic` and then the `seed` (512 bytes);
|
||||||
|
2. Calculate `result = hmac-sha512(key = 'Nostr seed', data = seed)`;
|
||||||
|
3. Use the first 32 bytes of `result` as the private key.
|
Ładowanie…
Reference in New Issue