Types of accounts on Ethereum
If you’ve used Ethereum, you know what an Ethereum account is. Your account address looks something like this:
????????????????????????????????????????????????????????????????????????????????????
You may have used your Ethereum account to buy ETH, DAI, NFTs, and much more.
But did you know that there are ?????? ?????????????????? ?????????? of accounts on Ethereum?
Before we explain what the two types are, it’s important to understand how Ethereum stores state
So let's start there...
The Ethereum blockchain stores state as a mapping between Ethereum ?????????????????? and the ?????????? associated with each address
An “??????????????” is the object which contains the address and the state associated with that address.
Address is intuitive. But what exactly do we mean by “?????????????? ??????????”?
Well, it depends on the type of account it is. There are two types of accounts on Ethereum:
1) ???????????????????? ?????????? ?????????????? (EOA)
2) ???????????????? ?????????????? (CA)
The Metamask account that you use to sign transactions is an Externally Owned Account
EOA’s are controlled by ?????????????? ????????.
A contract account, on the other hand, is a ?????????? ????????????????. In other words, every smart contract on Ethereum is an account.
An Externally Owned Account only stores ?????? things:
1) ??????????????
2) ??????????
We all know what a balance is. For example, if my Ethereum account has 10 Ether in it, then the EOA would store 10 in the “balance” field.
What’s a ???????????
A nonce is like a ??????????????. It keeps track of the number of transactions that have been executed from that account.
So if my Ethereum account has completed 23 transactions, then the nonce is 23.
A Contract Account, on the other hand, stores ???????? things:
1) balance
2) nonce
3) ???????? ????????
4) ?????????????? ????????
Just like a regular Ethereum account (i.e. EOA), a Contract Account also keeps track of the balance and nonce
In addition to that, it stores the ???????? ???? ?????? ?????????? ???????????????? ???????? and a ???????? ???? ?????? ???????? ???????? of the Merkle Patricia trie.
Explaining a Merkle Patricia tree is out of the scope of this thread, but it is enough for you to understand that the trie encodes the ?????????????? ???????????????? ???? ?????? ?????????? ???????????????? ??????????????.
In simpler terms, the storage hash is effectively a ???????? ???? ?????? ?????????? ????????????????’?? ????????.
So when we ???????????? a smart contract onto Ethereum, a new Ethereum account is created and this account stores the ?????????????? of the contract, the ?????????? of the contract, the ????????, and the ????????.
That’s all folks. Hopefully you understand Ethereum a tiny bit better.