繁体   English   中英

如何使用Web3客户端将私钥导入到以太币中

[英]how to Import private key into geth ethereum using web3 client

我想使用web3.py客户端从go-ethereum( geth )导入以及删除私钥。 您能否建议适当的功能? 我已经生成了私钥。

谢谢,Raja K

有关使用私钥web3.py文档包含以下示例:

 with open('~/.ethereum/keystore/UTC--...--5ce9454909639D2D17A3F753ce7d93fa0b9aB12E') as keyfile: encrypted_key = keyfile.read() private_key = w3.eth.account.decrypt(encrypted_key, 'correcthorsebatterystaple') # tip: do not save the key or password anywhere, especially into a shared source file 

“从geth导入和删除私钥”的过程是:

  1. 确定geth将网络数据存储在何处
  2. 查看geth数据目录中的keystore文件夹
  3. 用您要导出的帐户选择密钥文件(地址在密钥名称中)
  4. 使用w3.eth.account.decrypt(...)在本地解密
  5. 将私钥备份保存在安全且可恢复的位置
  6. 测试从备份中恢复私钥
  7. 从您的geth数据目录中删除密钥文件

暂无
暂无

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

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