Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
13 views

Ethereum Blockchain

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Ethereum Blockchain

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 71

ETHEREUM BLOCKCHAIN

DR SADIQA ARSHAD
ETHEREUM BLOCKCHAIN
WHAT IS ETHEREUM?

Ethereum is a blockchain. It is the foundation for building apps and organizations in a


decentralized, permissionless, censorship-resistant way.
Ethereum Virtual Machine

◼ In the Ethereum universe, there is a single, canonical computer (called


the Ethereum Virtual Machine, or EVM) whose state everyone on the
Ethereum network agrees on.
◼ Everyone who participates in the Ethereum network (every Ethereum
node) keeps a copy of the state of this computer.

2024/10/30
ETHEREUM BLOCKCHAIN
WHAT IS ETHEREUM?

Ethereum is a blockchain. It is the foundation for building apps and organizations in a


decentralized, permissionless, censorship-resistant way.

Ethereum Virtual Machine

The Ethereum Virtual Machine is the global virtual computer whose state every
participant on the Ethereum network stores and agrees on. Any participant can
request the execution of arbitrary code on the EVM; code execution changes the
state of the EVM.

2024/10/30
ETHEREUM BLOCKCHAIN
WHAT IS ETHEREUM?
• Any participant can broadcast a request for this computer (EVM)to perform arbitrary
computation.
• Whenever such a request is broadcast, other participants on the network verify,
validate, and carry out ("execute") the computation.
• This execution causes a state change in the EVM, which is committed and
propagated throughout the entire network.
• Requests for computation are called transaction requests.
• The record of all transactions and the EVM's present state gets stored on the
blockchain, which in turn is stored and agreed upon by all nodes.

2024/10/30
ETHEREUM BLOCKCHAIN
WHAT IS ETHER?
• Ether (ETH) is the native cryptocurrency of Ethereum. The purpose of ETH is to
allow for a market for computation. Such a market provides an economic incentive
for participants to verify and execute transaction requests and provide
computational resources to the network.
• Any participant who broadcasts a transaction request must also offer some amount
of ETH to the network as a bounty.
• The network will burn part of the bounty and award the rest to whoever eventually
does the work of verifying the transaction, executing it, committing it to the
blockchain, and broadcasting it to the network.

2024/10/30
ETHEREUM BLOCKCHAIN
WHAT IS ETHER?

The amount of ETH paid corresponds to the resources required to do the computation.
These bounties also prevent malicious participants from intentionally clogging the
network by requesting the execution of infinite computation or other resource-intensive
scripts, as these participants must pay for computation resources.

2024/10/30
ETHEREUM BLOCKCHAIN
WHAT IS ETHER? ( Native currency of ethereum)

ETH is also used to provide crypto-economic security to the network in three main ways:

1) It is used as a means to reward validators who propose blocks or call out dishonest
behavior by other validators.

2) It is staked by validators, acting as collateral against dishonest behavior


—if validators attempt to misbehave their ETH can be destroyed.

3) It is used to weigh 'votes' for newly proposed blocks, feeding into the fork-choice
part of the consensus mechanism.
2024/10/30
ETHEREUM BLOCKCHAIN
WHAT IS ETHER?

2024/10/30
ETHEREUM BLOCKCHAIN
WHAT ARE SMART CONTRACTS?

• In practice, participants don't write new code every time they want to request a
computation on the EVM.
• Application developers upload programs (reusable snippets of code) into EVM state, and
users make requests to execute these code snippets with varying parameters.
• These programs are called smart contracts.
• Any developer can create a smart contract and make it public to the network, using the
blockchain as its data layer, for a fee paid to the network.
• Any user can then call the smart contract to execute its code, again for a fee paid to the
network.

2024/10/30
ETHEREUM BLOCKCHAIN
WHAT ARE NODES?

Nodes are the real-life machines which are storing the EVM state.
Nodes communicate with each other to propagate information about the
EVM state and new state changes.
Any user can also request the execution of code by broadcasting a code
execution request from a node.
The Ethereum network itself is the aggregate of all Ethereum nodes and their
communications.

2024/10/30
ETHEREUM BLOCKCHAIN
Accounts?

Where ETH is stored.


Users can initialize accounts, deposit ETH into the accounts, and transfer ETH
from their accounts to other users.
Accounts and account balances are stored in a big table in the EVM; they are a part
of the overall EVM state.
There are two types of accounts
Externally owned accounts:
They are controlled by private keys and have no code associated with them.
Contract accounts:
They are controlled by their contract code and have code associated with them.
2024/10/30
ETHEREUM BLOCKCHAIN
Accounts?
Contract accounts can’t initiate
new transactions on their own.

Contract accounts can only fire


transactions in response to other
transactions they have received
(from an externally owned
account or from another contract
A message between two externally owned accounts is account)
simply a value transfer. (e.g Wallets)

2024/10/30
ETHEREUM BLOCKCHAIN

2024/10/30
ETHEREUM BLOCKCHAIN

• An externally owned account can send messages to other externally owned


accounts OR to other contract accounts by creating and signing a transaction
using its private key.

• A message from an externally owned account to a contract account activates the


contract account’s code, allowing it to perform various actions (e.g. transfer tokens,
write to internal storage, mint new tokens, perform some calculation, create new
contracts, etc.).

2024/10/30
ETHEREUM BLOCKCHAIN
Therefore, any action that occurs on the Ethereum blockchain is always set in
motion by transactions fired from externally controlled accounts.

2024/10/30
ETHEREUM BLOCKCHAIN
Transactions
• An Ethereum transaction refers to an action initiated by an externally-owned
account, in other words an account managed by a human, not a contract. For
example, if Bob sends Alice 1 ETH, Bob's account must be debited and
Alice's must be credited. This state-changing action takes place within a
transaction.

2024/10/30
ETHEREUM BLOCKCHAIN
Transactions
• A "transaction request" is the formal term for a request for code execution on
the EVM,
• Any user can broadcast a transaction request to the network from a node.
• For the transaction request to affect the agreed-upon EVM state, it must be
validated, executed, and "committed to the network" by another node.
Execution of any code causes a state change in the EVM; upon commitment,
this state change is broadcast to all nodes in the network.
Examples:
•Send 1 ETH from my account to Alice's account.
•Publish some smart contract code into EVM state.
•Execute the code of the smart contract at address X in the EVM, with
arguments Y. 2024/10/30
ETHEREUM BLOCKCHAIN
Transactions
A submitted transaction includes the following information:
•from – the address of the sender, that will be signing the transaction. This will be an
externally-owned account as contract accounts cannot send transactions.

•to – the receiving address (if an externally-owned account, the transaction will
transfer value. If a contract account, the transaction will execute the contract code)

•signature – the identifier of the sender. This is generated when the sender's private
key signs the transaction and confirms the sender has authorized this transaction

•nonce - a sequentially incrementing counter which indicates the transaction number


from the account

2024/10/30
ETHEREUM BLOCKCHAIN
Transactions

• value – amount of ETH to transfer from sender to recipient (denominated in WEI,


where 1ETH equals 1e+18wei)
• input data – optional field to include arbitrary data
• gasLimit – the maximum amount of gas units that can be consumed by the
transaction. The EVM specifies the units of gas required by each computational step
• maxPriorityFeePerGas - the maximum price of the consumed gas to be included as
a tip to the validator
• maxFeePerGas - the maximum fee per unit of gas willing to be paid for the
transaction (inclusive of baseFeePerGas and maxPriorityFeePerGas)

2024/10/30
ETHEREUM BLOCKCHAIN
Transactions

• A transaction object needs to be signed using the sender's private key. This
proves that the transaction could only have come from the sender and was
not sent fraudulently.

2024/10/30
ETHEREUM BLOCKCHAIN
Transactions
An Ethereum client like Geth will handle this signing process.

2024/10/30
•the raw is the signed transaction in Recursive Length Prefix (RLP) encoded form

ETHEREUM BLOCKCHAIN
Transactions

raw is the signed


transaction in Recursive
Length Prefix encoded
form

•the tx is the
signed
transaction
in JSON form

2024/10/30
ETHEREUM BLOCKCHAIN
TYPES OF TRANSACTIONS
On Ethereum there are a few different types of transactions:

• Regular transactions: a transaction from one account to another.

• Contract deployment transactions: a transaction without a 'to' address, where


the data field is used for the contract code.

• Execution of a contract: a transaction that interacts with a deployed smart


contract. In this case, 'to' address is the smart contract address.

With the signature hash, the transaction can be cryptographically proven that it came from the sender and
submitted to the network.
2024/10/30
ETHEREUM BLOCKCHAIN
Transactions

2024/10/30
ETHEREUM BLOCKCHAIN

Gas
A transactions cost gas to execute. Simple transfer transactions
require 21000 units of Gas.
So for Bob to send Alice 1 ETH at a baseFeePerGas of 190 gwei
and maxPriorityFeePerGas of 10 gwei, Bob will need to pay the
following fee:

(90 + 10) * 21000 = 4,200,000 gwei


--or--
Bob's account will be debited -1.0042 ETH (1 ETH for
0.0042 ETH Alice + 0.0042 ETH in gas fees)
Alice's account will be credited +1.0 ETH
Any gas not used in a transaction is refunded to the user The base fee will be burned -0.00399 ETH
account. Validator keeps the tip +0.000210 ETH
2024/10/30
ETHEREUM BLOCKCHAIN
Transactions

Smart contract interactions


Gas is required for any transaction that involves a smart contract.
Smart contracts can also contain functions known as view or pure functions, which
do not alter the state of the contract. As such, calling these functions from an EOA
will not require any gas.

2024/10/30
ETHEREUM BLOCKCHAIN
Transactionslifecycle
Transaction
Once the transaction has been submitted the following happens:
1. A transaction hash is cryptographically generated:
0x97d99bc7729211111a21b12c933c949d4f31684f1d6954ff477d0477538ff017

2.The transaction is then broadcasted to the network and added to a transaction pool
consisting of all other pending network transactions.

3.A validator must pick your transaction and include it in a block in order to verify the
transaction and consider it "successful".

4.As time passes the block containing your transaction will be upgraded to "justified"
then "finalized".
2024/10/30
ETHEREUM BLOCKCHAIN
Transactions

4.These upgrades make it much more certain that your transaction was successful
and will never be altered.

5. Once a block is "finalized" it could only ever be changed by a network level


attack that would cost many billions of dollars.

2024/10/30
ETHEREUM BLOCKCHAIN
Blocks
Why blocks?
• To ensure that all participants on the Ethereum network maintain a synchronized state
and agree on the precise history of transactions, we batch transactions into blocks.
• This means dozens (or hundreds) of transactions are committed, agreed on, and
synchronized all at once.

2024/10/30
ETHEREUM BLOCKCHAIN
Blocks
HOW BLOCKS WORK
• To preserve the transaction history, blocks are strictly ordered (every new block
created contains a reference to its parent block).
• Transactions within blocks are strictly ordered as well.
• At any given time, all participants on the network are in agreement on the exact
number and history of blocks, and are working to batch the current live
transaction requests into the next block.
• Once a block is put together by a randomly selected validator on the network, it
is propagated to the rest of the network; all nodes add this block to the end of
their blockchain, and a new validator is selected to create the next block.
• The exact block-assembly process and commitment/consensus process is
currently specified by Ethereum’s “proof-of-stake” protocol.
2024/10/30
ETHEREUM BLOCKCHAIN
CONSENSUS MECHANISMS

• The term 'consensus mechanism' is often used colloquially to refer to 'proof-


of-stake', 'proof-of-work' or 'proof-of-authority' protocols.

• However, these are just components in consensus mechanisms that protect


against Sybil attacks.

• Consensus mechanisms are the complete stack of ideas, protocols and


incentives that enable a distributed set of nodes to agree on the state of a
blockchain.

2024/10/30
ETHEREUM BLOCKCHAIN
WHAT IS CONSENSUS?
• By consensus, we mean that a general agreement has been reached.

• Consider a group of people going to the cinema. If there is no disagreement on a


proposed choice of film, then a consensus is achieved. If there is disagreement, the
group must have the means to decide which film to see.

• In extreme cases, the group will eventually split.

• In regard to the Ethereum blockchain, the process is formalized, and reaching


consensus means that at least 66% of the nodes on the network agree on the global
state of the network.

2024/10/30
ETHEREUM BLOCKCHAIN
WHAT IS A CONSENSUS MECHANISM?

◼ The term consensus mechanism refers to the entire stack of protocols, incentives
and ideas that allow a network of nodes to agree on the state of a blockchain.

◼ Ethereum uses a proof-of-stake-based consensus mechanism that derives its


crypto-economic security from a set of rewards and penalties applied to capital
locked by stakers.

◼ This incentive structure encourages individual stakers to operate honest validators,


punishes those who don't, and creates an extremely high cost to attack the network.

2024/10/30
ETHEREUM BLOCKCHAIN
WHAT IS A CONSENSUS MECHANISM?

◼ This incentive structure encourages individual stakers to operate honest validators,


punishes those who don't, and creates an extremely high cost to attack the network.

◼ Then, there is a protocol that governs how honest validators are selected to propose
or validate blocks, process transactions and vote for their view of the head of the
chain.

◼ In the rare situations where multiple blocks are in the same position near the head
of the chain, there is a fork-choice mechanism that selects blocks that make up the
'heaviest' chain, measured by the number of validators that voted for the blocks
weighted by their staked ether balance.
2024/10/30
ETHEREUM BLOCKCHAIN
Types of consensus mechanisms

Proof-of-work based
Like Bitcoin, Ethereum once used a proof-of-work (PoW) based consensus
protocol.

Proof-of-work has now been deprecated. Ethereum no longer uses proof-of-work as part of its
consensus mechanism. Instead, it uses proof-of-stake.

2024/10/30
ETHEREUM BLOCKCHAIN
Ethereum Merge to PoS from PoW

The “Merge” is intended to shift the Ethereum blockchain from the current proof-
of-work (PoW) consensus mechanism to a proof-of-stake (PoS) model intended to
be faster and more energy efficient.
While proof-of-work is reliable and secure, the comparative benefits of proof-of-
stake include:
•No requirement for advanced and expensive hardware like mining rigs

•Much more efficient use of energy, according to the Ethereum Foundation

•A lower risk of network centralization, which is a barrier to network security

2024/10/30
ETHEREUM BLOCKCHAIN
Proof-of-Stake (PoS)
◼ Proof-of-Stake (PoS) is a consensus mechanism that ensures validators have a
stake in the network.

◼ Validators stake ETH as collateral, which can be destroyed if they act dishonestly,
ensuring trust in the network.
◼ Validators deposit ETH into a smart contract to participate in securing Ethereum.
Validator Role:
◼ Check the validity of new blocks.
◼ Occasionally create and propagate new blocks.
◼ Penalties: Dishonest actions (e.g., proposing multiple blocks or conflicting
attestations) can lead to partial or total loss of staked ETH.

2024/10/30
ETHEREUM BLOCKCHAIN
Proof of Work
•Requirements: To join as a validator, a user deposits 32 ETH into the deposit contract
and runs:
•An execution client
•A consensus client
•A validator client

After depositing, users enter an activation queue that controls how many new validators
can join.

•Validation Duties:
Receive new blocks from peers and re-execute transactions to verify state changes.
Check the block signature and send a vote (attestation) in favor of valid blocks.
2024/10/30
ETHEREUM BLOCKCHAIN
Block Timing and Validation in Ethereum’s Proof-of-Stake

Fixed Timing: Unlike Proof-of-Work, where block timing depends on mining difficulty,
Ethereum's Proof-of-Stake has a fixed tempo.
• Slot: 12 seconds
• Epoch: 32 slots

2024/10/30
ETHEREUM BLOCKCHAIN

Block Timing and Validation in Ethereum’s Proof-of-Stake

Fixed Timing: Unlike Proof-of-Work, where block timing depends on mining difficulty, An epoch
Ethereum's Proof-of-Stake has a fixed tempo. consists of 32
• Slot: 12 seconds slots, each slot
• Epoch: 32 slots lasting 12
seconds, the
total length of an
Block Proposer: In each slot, one validator is randomly selected to propose a new block
epoch 6.4
and broadcast it to the network. minutes

Committees:
• In each slot, a committee of validators is chosen to vote on the block’s validity.
• Committees are essential to manage network load and ensure every validator attests
in each epoch, but not in every slot.

2024/10/30
2024/10/30
ETHEREUM BLOCKCHAIN
How a Transaction Gets Executed in Ethereum PoS

1. A user creates and signs a transaction with their private key. This is usually
handled by a wallet or a library such as ethers.js(opens in a new
tab), web3js(opens in a new tab), web3py(opens in a new tab) etc but under the
hood the user is making a request to a node using the Ethereum JSON-RPC API.

2. The user defines the amount of gas that they are prepared to pay as a tip to a
validator to encourage them to include the transaction in a block. The tips get
paid to the validator while the base fee gets burned.

2024/10/30
ETHEREUM BLOCKCHAIN
How a Transaction Gets Executed in Ethereum PoS

1. The transaction is submitted to an Ethereum execution client which verifies its


validity.
2. Ensuring that the sender has enough ETH to fulfill the transaction and they
have signed it with the correct key.

2024/10/30
ETHEREUM BLOCKCHAIN
How a Transaction Gets Executed in Ethereum PoS
1. If the transaction is valid, the execution client adds it to its local mempool (list of
pending transactions) and also broadcasts it to other nodes over the execution layer
gossip network.

2024/10/30
ETHEREUM BLOCKCHAIN
How a Transaction Gets Executed in Ethereum PoS
1. If the transaction is valid, the execution client adds it to its local mempool (list of
pending transactions) and also broadcasts it to other nodes over the execution layer
gossip network.

2. When other nodes hear about the transaction they add it to their local mempool too.
3. Advanced users might refrain from broadcasting their transaction and instead
forward it to specialized block builders such as Flashbots Auction). This allows them
to organize the transactions in upcoming blocks for maximum profit (MEV).

Flashbots Auction is a permissionless, transparent, and fair ecosystem for efficient MEV extraction and
frontrunning protection which preserves the ideals of Ethereum. Flashbots Auction provides a private
communication channel between Ethereum users and validators for efficiently communicating preferred transaction
order within a block.
2024/10/30
ETHEREUM BLOCKCHAIN
How a Transaction Gets Executed in Ethereum PoS

1. One of the validator nodes on the network is the block proposer for the current slot,
having previously been selected pseudo-randomly using RANDAO.

2. This node is responsible for building and broadcasting the next block to be added to the
Ethereum blockchain and updating the global state.

3. The node is made up of three parts:


• an execution client,
• a consensus client
• a validator client.

4.
2024/10/30
ETHEREUM BLOCKCHAIN
How a Transaction Gets Executed in Ethereum PoS

4. The execution client bundles transactions from the local mempool into an
"execution payload" and executes them locally to generate a state change.

5. This information is passed to the consensus client where the execution payload is
wrapped as part of a "beacon block" that also contains information about rewards,
penalties, slashings, attestations etc. that enable the network to agree on the sequence
of blocks at the head of the chain.

2024/10/30
ETHEREUM BLOCKCHAIN
How a Transaction Gets Executed in Ethereum PoS

1.Other nodes receive the new beacon block on the consensus layer gossip
network.

2.They pass it to their execution client where the transactions are re-executed
locally to ensure the proposed state change is valid.

3.The validator client then attests that the block is valid and is the logical next
block in their view of the chain (meaning it builds on the chain with the
greatest weight of attestations).

4.The block is added to the local database in each node that attests to it.

2024/10/30
ETHEREUM BLOCKCHAIN
How a Transaction Gets Executed in Ethereum PoS

1. The transaction can be considered "finalized" if it has become part of a chain


with a "supermajority link" between two checkpoints.

2024/10/30
ETHEREUM BLOCKCHAIN
How a Transaction Gets Executed in Ethereum PoS

2. Checkpoints occur at the start of each epoch and they exist to account for the
fact that only a subset of active validators attest in each slot, but all active
validators attest across each epoch.

3. Therefore, it is only between epochs that a 'supermajority link' can be


demonstrated (this is where 66% of the total staked ETH on the network agrees
on two checkpoints).
2024/10/30
ETHEREUM BLOCKCHAIN
How a Transaction Gets Executed in Ethereum PoS
FINALITY
• A transaction has "finality" in distributed networks when it is part of a block that
can't change without a large amount of ETH getting burned.
• On proof-of-stake Ethereum, this is managed using "checkpoint" blocks.
• The first block in each epoch is a checkpoint.
• Validators vote for pairs of checkpoints that it considers to be valid. If a pair of
checkpoints attracts votes representing at least two-thirds of the total staked ETH,
the checkpoints are upgraded.
• The more recent of the two (target) becomes "justified".
• The earlier of the two is already justified because it was the "target" in the
previous epoch. Now it is upgraded to "finalized".

2024/10/30
ETHEREUM BLOCKCHAIN
How a Transaction Gets Executed in Ethereum PoS

https://www.preethikasireddy.com/post/how-does-the-new-ethereum-work
2024/10/30
ETHEREUM BLOCKCHAIN
How a Transaction Gets Executed in Ethereum PoS

Fork-choice rule

In Bitcoin, the right fork is whichever one has the most hash power.
https://www.preethikasireddy.com/post/how-does-the-new-ethereum-work
2024/10/30
ETHEREUM BLOCKCHAIN
How a Transaction Gets Executed in Ethereum PoS

Fork-choice rule

In Gasper, the fork-choice


rule is called "LMD-
GHOST," which stands for
"latest message-driven
greedy heaviest observed
sub-tree." This means we
select the fork with the
greatest accumulated weight
of attestations to be the
canonical one. https://www.preethikasireddy.com/post/how-does-the-new-ethereum-work

2024/10/30
ETHEREUM BLOCKCHAIN
PROOF-OF-STAKE AND SECURITY

•A 51% attack is an attack on a blockchain by


an entity or group that controls more than 50%
of the network.
•Attackers with majority network control can
interrupt the recording of new blocks by
preventing other miners from completing blocks.
a 51% attack on the Ethereum blockchain became even more expensive. To conduct this
attack, a user or group would need to own 51% of the staked ETH on the network. It is
possible for someone to own that much ETH, but it's unlikely.

2024/10/30
ETHEREUM BLOCKCHAIN
How a Transaction Gets Executed in Ethereum PoS
•long-range attacks
Mitigation: (although the finality gadget neutralizes this attack vector)
•short range 'reorgs’
Mitigation: (although proposer boosting and attestation deadlines mitigate this)
•bouncing and balancing attacks
•Mitigation: proposer boosting, and these attacks have anyway only been demonstrated under
idealized network conditions)
•avalanche attacks
Mitigation: (neutralized by the fork choice algorithms rule of only considering the latest
message)

According to Beaconchain, more than 32.3 million ETH were staked on May 8, 2024. (Beaconchain.
"Open Source Ethereum Explorer.“)
An entity would need to own and stake more than 16.5 million ETH (more than $49 billion as of May 8,
2024) to attempt an attack 2024/10/30
ETHEREUM BLOCKCHAIN
Ethereum PoW

• Proof-of-work is the underlying algorithm that sets the difficulty and rules
for the work miners do on proof-of-work blockchains.
• Mining is the "work" itself. It's the act of adding valid blocks to the chain.
This is important because the chain's length helps the network follow the
correct fork of the blockchain.
• The more "work" done, the longer the chain, and the higher the block
number, the more certain the network can be of the current state of things.

2024/10/30
ETHEREUM BLOCKCHAIN
Ethereum PoW Vs PoS
At a high level, proof-of-stake has the same end goal as proof-of-work: to help the
decentralized network reach consensus securely.
But it has some differences in process and personnel:

•Proof-of-stake switches out the importance of computational power for staked ETH.
•Proof-of-stake replaces miners with validators. Validators stake their ETH to
activate the ability to create new blocks.
•Validators don't compete to create blocks, instead they are chosen at random by an
algorithm.
•Finality is clearer: at certain checkpoints, if 2/3 validators agree on the state of the
block it is considered final.

2024/10/30
ETHEREUM BLOCKCHAIN

Consensus Mechanisms
• Proof of Work
• Proof of Stake
• Proof of Authority

2024/10/30
CONSENSUS ALGORITHMS
Proof-of-Authority (PoA) Consensus Algorithm

Definition: A reputation-based consensus model, modified from


Proof-of-Stake (PoS).
•Introduction: Coined by Gavin Wood in 2017.
•Key Features:
• Efficient Resource Use: Avoids high hardware demands like in
PoW.
• Enhanced Scalability: Overcomes PoS scalability issues.
• Selective Node Involvement: Small, trusted subset of nodes
store and produce blocks.
•Common Use Cases: Private blockchains, testnets, and local
development networks.

2024/10/30
CONSENSUS ALGORITHMS
Proof-of-Authority (PoA) Consensus Algorithm

Proof-of-Authority (PoA) Overview


•Definition: Reputation-based consensus, modified from Proof-of-Stake
(PoS).
•Origin: Introduced in 2017 by Gavin Wood.
•Use Cases: Primarily in private chains, testnets, and local development.
•Key Advantages:
• Efficiency: Avoids the high resource demands of Proof-of-Work
(PoW).
• Scalability: Solves PoS scalability limitations by using a smaller,
trusted subset of nodes for block production.

2024/10/30
CONSENSUS ALGORITHMS
Proof-of-Authority (PoA) Consensus Algorithm
PoA Mechanism and Implementations

•Authorized Signers:
• Setup: Defined in the genesis block.
• Consensus Power: Authorized signers have equal privileges.
• Transparency: Validators are identifiable, enhancing accountability.

•Implementations:
• Clique (EIP-225): Standard Ethereum implementation, developer-
friendly and supports all sync types.
• Other Implementations: IBFT 2.0 and Aura

2024/10/30
CONSENSUS ALGORITHMS
Proof-of-Authority (PoA) Consensus Algorithm
Proof-of-Authority (PoA) Block Creation and Signer Selection
•Authorized Signers:
• Selection: Chosen based on reputation, often well-known
corporations (e.g., Microsoft, Google).
• Block Creation: Only authorized signers can create new blocks.
• Round-Robin Process: Each signer creates a block within a fixed
time frame.
•Human Trust Model ( trust is not algorithmic):
• Trust in Established Entities: Relies on reputations of known
companies, not quantified values.
• Example: Microsoft could operate a PoA network for startups,
with trusted signers added as needed.
2024/10/30
CONSENSUS ALGORITHMS
Proof-of-Authority (PoA) Consensus Algorithm
PoA Advantages and Modifications
•Resource Efficiency: No need for staking or mining, reducing power and
resource consumption.
•Private Network Use:
• Used cases:
• VeChain uses PoA;
• Binance uses a modified version (PoSA) combining PoA and PoS.
•Voting for Signer Changes:
• Process: Signers vote for adding or removing other signers within each
new block.
• Threshold: Nodes tally votes; changes require reaching a preset limit
(SIGNER_LIMIT).
2024/10/30
CONSENSUS ALGORITHMS
Proof-of-Authority (PoA) Consensus Algorithm
Fork resolution mechanism

Block Signing "In Turn" and "Out of Turn":


•In a PoA network, authorized signers (validators) are scheduled to create
blocks in a specific order.
•If a signer creates a block during their assigned time, it's considered "in
turn" and assigned a difficulty of 2.
•If a signer creates a block outside their assigned time, it's "out of turn"
and assigned a difficulty of 1.

2024/10/30
CONSENSUS ALGORITHMS
Proof-of-Authority (PoA) Consensus Algorithm

Managing Small Forks:


•Small forks can happen when two or more signers create blocks
simultaneously, creating parallel versions of the chain.

•When this occurs, the protocol selects the chain with the highest
accumulated difficulty as the main chain.

•Since "in turn" blocks have a higher difficulty, the chain where signers
more consistently create "in turn" blocks will accumulate more difficulty.

2024/10/30
CONSENSUS ALGORITHMS
Proof-of-Authority (PoA) Consensus Algorithm

Fork Resolution:

•The network resolves forks by choosing the chain with more blocks
created "in turn," ensuring that the chain with more consistent and
predictable block production is preferred.

•This approach encourages signers to follow their assigned order and


promotes stability in the network.

2024/10/30
CONSENSUS ALGORITHMS
Attacks on PoA
1. Malicious signers
Compromised Signers: A malicious user could be added, or a signing
key/machine might be compromised.

Potential Risks: Risk of chain reorganizations or spamming attacks.

Solution:
Block Limitation: Each signer out of N authorized signers can mint only 1
block per K blocks.( if K= 10, then each signer mint only one block in a
specific time)
Damage Control: Limits the impact of a compromised signer.
Voting System: Remaining signers can vote to remove malicious users
2024/10/30
CONSENSUS ALGORITHMS
Proof-of-Authority (PoA) Consensus Algorithm
Censorship Risk:
•Malicious signers might attempt to censor blocks that vote to remove
them.

Minting Frequency Restriction:


•Each signer can only mint 1 out of every N/2 ​ blocks.

Outcome:
• Majority Control Requirement: Malicious signers need at least 51%
of signing accounts to fully control the chain.
• Ensures network security and resistance to censorship under normal
• Limits any single signer’s control over block production.

2024/10/30
CONSENSUS ALGORITHMS
Proof-of-Authority (PoA) Consensus Algorithm
Pros and Cons
Scalable more than other popular mechanisms PoA networks typically have a relatively small
such PoS and PoW, as it's based on a limited number of validating nodes. This makes a PoA
number of block signers network more centralized.

PoA blockchains are incredibly cheap to run Becoming an authorized signer is typically out
and maintain of reach for an ordinary person, because the
blockchain requires entities with established
reputation.

The transactions are confirmed very quick as it


could reach less than 1 second because only
limited number of signers are required to
validate new blocks

2024/10/30
Thanks
Any Questions Please

2024/10/30

You might also like