Ethereum Unit4
Ethereum Unit4
Introduction
Nonce
Value that is incremented every time a transaction is
sent from the address.
In case of contract accounts, it represents the number
of contracts created by the account.
Contract accounts are one of the two types of accounts
that exist in Ethereum
Balance
Represents the number of Weis which is the smallest unit
of the currency (Ether) in Ethereum held by the
address.
The account state
Storageroot
Represents the root node of a Merkle Patricia tree
that encodes the storage contents of the account.
Codehash
This is an immutable field that contains the hash of the
smart contract code that is associated with the
account.
In the case of normal accounts, this field contains the
Keccak 256-bit hash of an empty string.
This code is invoked via a message call.
world state and its relationship with accounts trie, accounts,
and block header
world state and its relationship with
accounts trie, accounts, and block header
It shows the account data structure in the middle of the
diagram,
which contains a storage root hash derived from the root
node of the account storage trie shown on the left.
Account data structure is then used in the world state
trie,
which is a mapping between addresses and account
states.
Finally, the root node of the world state trie is hashed
using the Keccak 256-bit algorithm and made part of
the block header data structure,
which is shown on the right-hand side of the diagram
as state root hash.
World state and its relationship with
accounts trie, accounts, and block header
Contract Account
• Ethereum accounts can store and execute
code
Has an associated nonce and balance
codeHash - hash of associated account code
storageRoot contains Merkle tree of associated
storage data
Gas used
Total gas consumed by the transactions included in
the block.
Timestamp
Epoch Unix time of the time of block initialization.
Extra data
Used to store arbitrary data related to the block.
Block header
Mixhash
Mixhash field contains a 256-bit hash that once
combined with the nonce is used to prove that
adequate computational effort has been spent in
order to create this block.
Nonce
Nonce is a 64-bit hash (a number) that is used to
prove, in combination with the mixhash field, that
adequate computational effort has been spent in
order to create this block.
Extra Points
Geth
Go implementation of the Ethereum client.
Eth
C++ implementation of the Ethereum client.
Pyethapp
Python implementation of the Ethereum client.
Parity
Built using Rust and developed by EthCore.
Light clients
SPV clients download only a small subset of the
blockchain.
This allows low resource devices, such as mobile phones,
embedded devices, or tablets, to be able to verify the
transactions.
SPV clients validate the execution of transactions.
SPV clients are also called light clients.
There is a wallet available from Jaxx (h t t p s ://j a x x . i o
/ ),
which can be installed on iOS and Android, which provides the
SPV (Simple Payment Verification) functionality.
Installation
Sharding
Sharding is the process of splitting a database horizontally to
spread the load.
sharding will reduce network congestion and increase
transactions per second by creating new chains, known as
“shards.”
This will also lighten the load for each validator who will no longer
be required to process the entirety of all transactions across the
network.
OFF-CHAIN SCALING
Layer 2 Scaling
Layer 2 solutions are centered around a server or cluster of
servers, each of which may be referred to as a node, validator,
operator, sequencer, block producer, or similar term.
Transactions are submitted to these layer 2 nodes instead of
being submitted directly to layer 1 (mainnet);
Layer 2 instance then batches them into groups before
anchoring them to layer 1, after which they are secured by layer
1 and cannot be altered.
OFF-CHAIN SCALING
State Channels
State channels utilize multisig contracts to enable participants to
transact quickly and freely off-chain, then settle finality with
mainnet.
Minimizes network congestion, fees, and delays.
Two types of channels are currently state channels and payment
channels.
OFF-CHAIN SCALING
Sidechains
Sidechain is an independent EVM-compatible
blockchain which runs in parallel to mainnet.
Compatible with Ethereum via two-way bridges, and
run under their own chosen rules of consensus, and
block parameters
Plasma
Plasma chain is a separate blockchain that is
anchored to the main Ethereum chain
WHY ARE SO MANY SCALING
SOLUTIONS NEEDED?
Multiple solutions can help to reduce the overall
congestion on any one part of the network, and also
prevents single points of failure.
Different solutions can exist and work in harmony,
allowing for an exponential effect on future transaction
speed and throughput.
Not all solutions require utilizing the Ethereum consensus
algorithm directly, and alternatives can offer benefits
that would otherwise be difficult to obtain
References