What is the difference between web3.eth.coinbase and web3.eth.accounts[0]? Which is the best method to get the current address? I am new to this community and I know this may be a silly question
Asked
Active
Viewed 2,149 times
2
Muhzin
- 194
- 1
- 1
- 7
1 Answers
4
web3.eth.accounts[0] refers to very first address created on an Ethereum node. web3.eth.coinbase returns you the coinbase. Coinbase or the Etherbase is the account in which your mining Ether i.e Block Reward will be credited. When there is one account, it is same as accounts[0] but you can also set it for other available address of same node.
Related: What is coinbase?
Aniket
- 3,545
- 2
- 20
- 42
web3.eth.accounts[0]– Aniket Jan 04 '19 at 06:36