aezeed
A package for encoding, decoding, and generating mnemonics of the aezeed specification. (WIP)
Example
- TypeScript types are available as well. commonjs example below.
const { CipherSeed } = require('aezeed');
- You can also pass the 16 byte entropy and 5 byte salt as Buffers to the constructor.
- random() uses randombytes under the hood to generate the 21 random bytes needed.
const mnemonic1 = CipherSeed.random().toMnemonic('strongPassword');
console.log(mnemonic1);
const mnemonic2 = CipherSeed.random().toMnemonic();
console.log(mnemonic2);
- You can decode mnemonics as well.
birthDate
is a Date object of the approximate day when the wallet was generated. (rounded down to the nearest 18:15:05 UTC (the time-of-day of the timestamp in the Bitcoin genesis block))birthday
is a number, represents the number of days since the genesis block.entropy
is the 16 bytes needed for generating the root key for the BIP32 HD key.
const mnemonic3 =
'able mix price funny host express lawsuit congress antique float pig ' +
'exchange vapor drip wide cup style apple tumble verb fix blush tongue ' +
'market';
const cipherSeed1 = CipherSeed.fromMnemonic(mnemonic3, 'strongPassword');
console.log(cipherSeed1.entropy);
console.log(cipherSeed1.birthDate);
const mnemonic4 =
'able concert slush lend olive cost wagon dawn board robot park snap ' +
'dignity churn fiction quote shrimp hammer wing jump immune skill sunset ' +
'west';
const cipherSeed2 = CipherSeed.fromMnemonic(mnemonic4);
console.log(cipherSeed2.entropy);
console.log(cipherSeed2.birthDate);