When web3.eth.accounts.create
is used to create an account something like this can be seen.
web3.eth.accounts.create();
> {
address: "0xb8CE9ab6943e0eCED004cDe8e3bBed6568B2Fa01",
privateKey: "0x348ce564d427a3311b6536bbcff9390d69395b06ed6c486954e971d960fe8709",
signTransaction: function(tx){...},
sign: function(data){...},
encrypt: function(password){...}
}
now if web3.eth.accounts.encrypt(privateKey, password);
is executed using the same privatekey that we got from the previous step we can get a output as the web3 keystore v3 standard. Now if we store this file in the geth node's keystore folder (ex user/.ethereum/private/keystore
) and run personal.listAccounts
we can get our created address on that list.
So when I need to unlock this account with web3.personal.unlockAccount
what would be the passphrase that I need to give to unlock my account?