Ethereum Architecture Sept2022
Ethereum Architecture Sept2022
Sept 2022
What is Ethereum?
● Also used Proof of Work (PoW) consensus algorithm but recently changed to
Proof of Stake (PoS)
What is Ether
● ‘Wei’ is the smallest unit of Ether, where 10power18 wei equal 1 Ether.
● Thus 1 wei = 10power(-18) Eth
● An Ether can therefore be written in 18 places of decimal.
● Another popular unit of Ether is gwei, where 10power9 gwei equal 1 Ether.
● Thus 1 gwei = 0.000000001 Eth.
● Conversion from wei to gwei would therefore be, 1 gwei = 10power9 wei.
● Or 1 wei = 10power(-9) gwei.
Transaction Fee - GAS
● With every transaction, a sender sets a Gas limit and Gas price.
● The product of gas price and gas limit represents the maximum amount of Wei that
the sender is willing to pay for executing a transaction.
● 50,000 x 20 gwei = 1,000,000,000,000,000 Wei = 0.001 Ether
● If limit set is less than actual Gas requirement, then transaction runs ‘out of gas’ and
is considered invalid. All the Gas is considered spent is no Gas is refunded back to
sender. A record is maintained where the transaction failed.
Transaction Fee – GAS for Storage
● The transaction’s gas limit must be equal to or greater than the intrinsic gas
used by the transaction.
● Each account has a state associated with it and a 20-byte address which is
usually the public key of the account owner.
● EOA do not have any code and CA do not have a private key.
Ethereum Accounts
● An EOA can send messages to other EOAs or to other CAs by creating and signing a
transaction using its private key.
● Unlike externally owned accounts, contract accounts can’t initiate new transactions on their
own.
● Instead, contract accounts can only fire transactions in response to other transactions they
have received (from an externally owned account or from another contract account).
● Any action that occurs on the Ethereum blockchain is always set in motion by transactions fired
from externally controlled accounts.
What are smart contracts?
● Smart contract are programs that have their code stored on a blockchain.
● Since the code is immutable, thus users can predict the outcome of a
transaction, based on the inputs and other variables.