Skip to content

Latest commit

 

History

History
41 lines (17 loc) · 705 Bytes

钱包初步想法.md

File metadata and controls

41 lines (17 loc) · 705 Bytes
钱包功能初步想法

账号管理:创建账号、账号的导入和导出

信息展示:查看eth余额

转账功能:发送eth

创建账号:

生成32字节随机数作为私钥然后创建账户

https://docs.ethers.io/ethers.js/html/api-utils.html?highlight=random

或生成助记词然后创建账户(具体使用再查下bip39相关资料)

https://github.com/bitcoinjs/bip39

账号的导入导出:

可借助ethers进行keystore的导入和导出

https://docs.ethers.io/ethers.js/html/

查看余额:

调用web3的方法

转账:

调用web3的sendTransaction,中间还涉及签名等步骤,没怎么研究

参考https://github.com/ethereumjs/ethereumjs-tx