简体   繁体   中英

How to convert seeds into private key?

how to convert bip39 mnemonic seed phrase into private key without any libraries like web3 or ethers.js
basically I'm trying to replicate my metamasks wallets private key

so I would like to write a function that takes my seed words as my input and return the private key for ethereum based wallets

privateKey = function([seed_1, seed_2, ..., seed_12]);

Where do I get started?

@elangovan you can use dart's BIP32 implementation and follow below steps

  1. Convert Mnemonic(12 words) to seed using bip32.mnemonicToSeed
  2. Seedto HD Master Node using bip32.BIP32.fromSeed
  3. Derive child node at desired HD path (m/44'/0')

However, you can derive public and private keys from the child node.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM