1

I noticed that web3.eth.personal has unlockAccount method but not web3.eth.accounts. Why not?

Is web3.eth.personal for personal or single account use while web3.eth.accounts for multiple accounts?

1 Answer 1

1

The web3.eth.personal functions worked over the network on node through JSONRPC call.

The web3.eth.accounts functions worked in local computer memory.

Because you have private key in local memory, you don't have to unlock account when you use web3.eth.accounts.

If you check the source code, when you create account through web3.eth.accounts, the private and entrophy is on your computer instead the node you connect to.

https://github.com/ethereum/web3.js/blob/1.0/packages/web3-eth-accounts/src/Accounts.js

If you use web3.eth.accounts a lot, note to clear memory properly. See documentation: https://web3js.readthedocs.io/en/1.0/web3-eth-accounts.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.