transfer mnemonic seed into Wallet Import Format(WIF) string
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錢包架構格式 https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki
bip39 mnemonic encode https://github.com/bitcoin/bips/blob/master/bip-0039/bip-0039-wordlists.md