比特币地址和私钥是怎样生成的?
Favorite
Share
Scan with WeChat
Share with Friends or Moments
比特币使用椭圆曲线算法生成公钥和私钥,选择的是secp256k1曲线。生成的公钥是33字节的大数,私钥是32字节的大数,钱包文件wallet.dat中直接保存了公钥和私钥。我们在接收和发送比特币时用到的比特币地址是公钥经过算法处理后得到的,具体过程是公钥先经过SHA-256算法处理得到32字节的哈希结果,再经过RIPEMED算法处理后得到20字节的摘要结果,再经过字符转换过程得到我们看到的地址。这个字符转换过程与私钥的字符转换过程完成相同,步骤是先把输入的内容(对于公钥就是20字节的摘要结果,对于私钥就是32字节的大数)增加版本号,经过连续两次SHA-256算法,取后一次哈希结果的前4字节作为校验码附在输入内容的后面,然后再经过Base58编码,得到字符串。
这里需要提一下的是Base58编码为了让输出字符串易于辨别,所以编码时故意排除了4个字符: '0'、'I'、'l'、'O' ,如果你想生成一个带特殊词缀的地址那就不要带这4个符了,比如我的ID(walker)也就不能生成了。
这里需要提一下的是Base58编码为了让输出字符串易于辨别,所以编码时故意排除了4个字符: '0'、'I'、'l'、'O' ,如果你想生成一个带特殊词缀的地址那就不要带这4个符了,比如我的ID(walker)也就不能生成了。
Disclaimer: This article is copyrighted by the original author and does not represent MyToken’s views and positions. If you have any questions regarding content or copyright, please contact us.(www.mytokencap.com)contact
About MyToken:https://www.mytokencap.com/aboutusArticle Link:https://www.mytokencap.com/news/168175.html
Previous:什么是安全散列算法SHA256?
Next:什么是安全散列算法SHA256?
Related Reading


BlackRock Moves to Tokenize $150B Fund for Institutional Investors
The post BlackRock Moves to Tokenize $150B Fund for Institutional Investors appeared first on Coinpe...
Team behind popular Telegram wallet Grindery reveals wallet infra for AI agents
Singapore, Singapore, 30th April 2025, Chainwire...
Bitcoin to $1 Million? Arthur Hayes Thinks It’s Coming by 2028
The post Bitcoin to $1 Million? Arthur Hayes Thinks It’s Coming by 2028 appeared first on Coinpedia ...