Closed sc0Vu closed 6 years ago
HD derivation key wallet
Multi-Account Hierarchy for Deterministic Wallets
https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki
https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki
https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki
https://en.bitcoin.it/wiki/Mnemonic_phrase
The English-language wordlist for the BIP39 standard has 2048 words, if the phrase has 12 words then the number of possible combinations is 2048^12 = 2^132, so this phrase would have 132 bits of security.
Can use more than 12 words as seed?
https://en.bitcoin.it/wiki/Deterministic_wallet
m / purpose' / coin_type' / account' / change / address_index
hd root m/44'/60'/0'/0 address 1 m/44'/60'/0'/0/0/0 address 2 m/44'/60'/0'/0/0/1
I think it's good to remove dependency of ethereumjs-wallet and implement our own wallet.
The spec can find here https://github.com/ethereum/wiki/wiki/Web3-Secret-Storage-Definition/b66dfbe3e84287f6fa61c079007255270cd20c14
PBKDF2-SHA-256
Test vector using AES-128-CTR and PBKDF2-SHA-256:
File contents of ~/.web3/keystore/3198bc9c-6672-5ab3-d9954942343ae5b6.json:
Intermediates:
Derived key: f06d69cdc7da0faffb1008270bca38f5e31891a3a773950e6d0fea48a7188551 MAC Body: e31891a3a773950e6d0fea48a71885515318b4d5bcd28de64ee5559e671353e16f075ecae9f99c7a79a38af5f869aa46 MAC 517ead924a9d0dc3124507e3393d175ce3ff7c1e96529c6c555ce9e51205e9b2 Cipher key: f06d69cdc7da0faffb1008270bca38f5 Scrypt
Test vector using AES-128-CTR and Scrypt:
Intermediates:
Derived key: fac192ceb5fd772906bea3e118a69e8bbb5cc24229e20d8766fd298291bba6bd MAC Body bb5cc24229e20d8766fd298291bba6bdd172bf743a674da9cdad04534d56926ef8358534d458fffccd4e6ad2fbde479c MAC: 2103ac29920d71da29f15d75b4a16dbe95cfd7ff8faea1056c33131d846e3097 Cipher key: fac192ceb5fd772906bea3e118a69e8b