文章目录
一、生成以太坊地址私钥
1.1 生成以太坊地址私钥函数代码
- 一、生成以太坊地址私钥
-
- 1.1 生成以太坊地址私钥函数代码
- 1.2 pbkdf2.Key() 生成秘钥函数
- 1.3 HMAC 生成摘要算法
- 二、根据私钥创建公私钥
-
- 2.1 根据私钥创建公私钥函数代码
- 2.2 PrivKeyFromBytes 创建私钥、公钥对
- 三、根据公钥转地址
-
- 3.1 主函数代码
- 3.2 子函数代码
- 创建常量
const (
BitcoinSeed = "Bitcoin seed"
Mnemonic = "search crime session tag file joke leaf express interest slender file hawk"
)
- 创建生成地址函数
func NewAccount(password string) string {
seed