Myetherwallet

從原始私鑰生成密鑰庫文件(使用 geth)?

  • July 23, 2021

我有我的公鑰和私鑰(使用 MyEtherWallet 生成),但是,我忘記創建一個密鑰庫文件,如果我是正確的,這將使我對錢包的線上訪問更加安全。

我必須在我的離線電腦上安裝 geth.exe,並且

geth account import e:\rawprivatekey.txt

有效,但只返回公共地址。我似乎無法讓它重新生成密鑰庫文件!有誰知道這是怎麼做到的嗎?

當您在 geth 中導入密鑰時,它會自動創建一個 json 錢包。

您可以使用 列出現有錢包geth account list

一個列表應該是這樣的:

賬戶#3:{59cc3d2701a69e2f006a47e412092d1274f81d58} keystore:///home/ubuntu/.ethereum/keystore/UTC–2018-01-28T05-19-52.363512148Z–59cc3d2701a69e2f0062747e4120921d

密鑰庫指向的文件是您的 json 錢包,您可以複製並重命名到其他地方。

使用 Web3.js

var Web3 = require('web3');
var web3 = new Web3(Web3.givenProvider || 'ws://some.local-or-remote.node:8546');
var JsonWallet = web3.eth.accounts.encrypt(privateKey, password);

引用自:https://ethereum.stackexchange.com/questions/37524