简体   繁体   English

如何将种子转换为私钥?

[英]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如何在没有web3ethers.js等库的情况下将 bip39 助记词种子短语转换为私钥
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所以我想写一个 function 将我的种子词作为我的输入并返回基于以太坊的钱包的私钥

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 @elangovan 您可以使用 dart 的BIP32实现并按照以下步骤操作

  1. Convert Mnemonic(12 words) to seed using bip32.mnemonicToSeed使用bip32.mnemonicToSeed将 Mnemonic(12 字)转换为种子
  2. Seedto HD Master Node using bip32.BIP32.fromSeed Seedto HD 主节点使用bip32.BIP32.fromSeed
  3. Derive child node at desired HD path (m/44'/0')在所需的 HD 路径(m/44'/0')处派生子节点

However, you can derive public and private keys from the child node.但是,您可以从子节点派生公钥和私钥。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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