Skip to content
Snippets Groups Projects

RFC_0014: DUBP Mnemonic

1 file
+ 67
0
Compare changes
  • Side-by-side
  • Inline
+ 67
0
# DUBP Mnemonic
This RFC describes the conventions for generating a DUBP keypair.
As a summary:
1. Generate a random mnemonic
2. Using [scrypt] to generate the seed from the mnemonic
3. Encrypt the seed in [DEWIF] format with a password or pin code.
# 1. Generate a random mnemonic
A mnemonic is a safety phrase designed to be easy to remember. This concept is defined in [BIP39].
# 2. Generate the seed from the mnemonic
The seed must be generated via [scrypt] with the following parameters.
## password
mnemonic phrase encoded in UTF-8 NFKD
## salt
Hash SHA256 of the string "dubp" + `mnemonic phrase`.
Example:
mnemonic: `tongue cute mail fossil great frozen same social weasel impact brush kind`
hashed string: `dubptongue cute mail fossil great frozen same social weasel impact brush kind`
salt: `0x13EB03436DD9374B554648237AEF473117FCB3D985FBC78B3C397BD3EAD9CFE6`
WARNING: The salt must be the binary value of hash sha256. It must not be encoded in base16, we give here its representation in base16 only for practical readability reasons.
## key lenght
Sometimes called `dklen` in some libraries.
Expected value: `32`.
## N,r,p parameters
N= 4096
r= 16
p= 1
## Example
mnemonic: `tongue cute mail fossil great frozen same social weasel impact brush kind`
seed (base64): `qGdvpbP9lJe7ZG4ZUSyu33KFeAEs/KkshAp9gEI4ReY=`
public key (base58): `732SSfuwjB7jkt9th1zerGhphs6nknaCBCTozxUcPWPU`
# 3. Encrypt the seed in [DEWIF] format
The seed must never be stored in clear on the utility machine.
It is recommended to encrypt the seed in [DEWIF] format.
The password used to encrypt the seed must be sufficiently robust and preferably randomly generated.
[BIP39]: https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki#Wordlist
[scrypt]: https://tools.ietf.org/html/rfc7914.html
[DEWIF]: https://git.duniter.org/nodes/common/doc/blob/dewif/rfc/0013_Duniter_Encrypted_Wallet_Import_Format.md
Loading