Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yuanyu90221/recover_seed
recover_seed
https://github.com/yuanyu90221/recover_seed
Last synced: 1 day ago
JSON representation
recover_seed
- Host: GitHub
- URL: https://github.com/yuanyu90221/recover_seed
- Owner: yuanyu90221
- Created: 2018-04-25T12:48:39.000Z (over 6 years ago)
- Default Branch: gh-pages
- Last Pushed: 2024-11-16T04:56:09.000Z (about 2 months ago)
- Last Synced: 2024-11-16T05:25:44.028Z (about 2 months ago)
- Language: JavaScript
- Size: 527 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SEED RESTORE
# purpose
transfer mnemonic seed into Wallet Import Format(WIF) string# code
```code
function derivedWIF(phrase, accountIndex=0, accountType=0, addressIndex=0) {
let seedBuffer = bip39.mnemonicToSeed(phrase);
let masterNode = bitcoin.fromSeedBuffer(seedBuffer);
// Derived the first account based on BIP44
let coinType = bitcoinType;
let account0 = masterNode.derivePath(`m/44'/${coinType}'/${accountIndex}'`);
let key0 = account0.derivePath(`${accountType}/${addressIndex}`).keyPair;
let address0 = key0.getAddress();
return key0.toWIF();
}
```
# 參考bip44 HD錢包架構格式
bip39 mnemonic encode
HD錢包格式說明文章