Proof of Stake
Proof of Stake
Chapter 4
Page 1
Proof of Stake
Table of Contents
1. Introduction to Proof of Stake
1.1 Overview
1.2 Basic Concept
1.3 Why Proof of Stake Was Introduced
2. Properties of Proof of Stake
2.1 Key Principles
2.2 Security and Decentralization
2.3 Advantages of Proof of Stake
2.4 Disadvantages of Proof of Stake
2.5 Examples of Proof of Stake Blockchains
3. Proof of Stake Process and Transaction Structure
3.1 How Does PoS Work?
3.2 Ethereum Transaction Structure
3.3 Transaction Fee Mechanics
4. Transaction Lifecycle
4.1 Stages of a Transaction
4.2 Block Validation and Finality
5. Cryptocurrency
5.1 What is Cryptocurrency?
5.2 How Does Bitcoin Work?
5.3 What is Ethereum?
5.4 Ethereum Proof of Stake
5.5 What are Smart Contracts?
5.6 What is DeFi?
5.7 What are NFTs?
5.8 What are CBDCs?
5.9 Ethereum Token Standards
5.10 Cryptocurrency Security on Blockchain
6. Numerical Examples and Problems
6.1 Basic Validator Selection Example
6.2 Weighted Validator Selection (Advanced)
6.3 PoS Network with 5 Validators
6.4 Numerical PoS with 4 Validators
6.5 Security: 51% Attack Cost
6.6 Slashing Example
6.7 Real-World Example: Ethereum PoS
Page 2
Proof of Stake
1. Introduction to Proof of Stake
1.1 Overview
Proof of Stake (PoS) is one of the Consensus mechanisms used in Blockchain technology to validate
transactions and secure the network. It is an alternative to Proof of Work (PoW), which is used by blockchains
like Bitcoin.
In a PoS system, Validators are selected to create new blocks and confirm transactions based on the number
of tokens or coins they hold and are willing to "stake" (lock up as collateral). The more tokens a participant holds
and locks in the network, the higher their chances of being selected as a Validator.
1.2 Basic Concept
In PoS, participants called Validators deposit coins as a stake. The network randomly selects Validators to:
■ Propose new blocks
■ Verify transactions
■ Maintain network security
■ The higher the stake, the higher the chance of being selected — but modern PoS systems also add
randomness and fairness mechanisms.
1.3 Why Proof of Stake Was Introduced
PoW systems consume large electricity because miners compete using hardware power. PoS solves several
issues:
■ Energy Efficiency: No heavy computational mining. Lower electricity usage.
■ Faster Transactions: Blocks can be confirmed quickly.
■ Scalability: Supports higher throughput compared to PoW.
■ Economic Security: Validators risk losing their staked coins if they behave maliciously.
Page 3
Proof of Stake
2. Properties of Proof of Stake
2.1 Key Principles
Proof of Stake (PoS) is a Consensus mechanism used by some Blockchain networks to achieve distributed
Consensus. It is an alternative to Proof of Work (PoW), aiming to address some of the inefficiencies of the
latter, particularly its high energy consumption.
Staking Instead of Mining:
In PoS, the process of creating new blocks is called "Forging" or "Minting" instead of mining. Instead of using
computational power to mine blocks (as in PoW), PoS involves Validators who stake their cryptocurrency as a
form of collateral.
Block Validator Selection:
The process of selecting the node that will create the next block is typically randomized but influenced by factors
such as the amount of currency a Validator is Staking, the age of the staked coins, and sometimes random
selection. This means that the more cryptocurrency a Validator stakes, the higher their chances of being
chosen to validate the next block.
Energy Efficiency:
PoS is much more energy-efficient than PoW, as it eliminates the need for extensive hardware and electricity
consumption required for mining.
2.2 Security and Decentralization
Reduced Risk of Centralization:
PoW can lead to centralization, as seen in mining pools. PoS is considered less prone to centralization as it
requires less specialized hardware, making it more accessible.
Security:
In PoS, security is maintained through financial incentives. Validators lose a portion of their stake if they
approve fraudulent transactions. This stake or bond is what makes them trustworthy.
Forging Rewards:
Unlike PoW, where miners receive a Block Reward for solving the cryptographic puzzles, in PoS, Validators
typically receive Transaction Fees as rewards.
2.3 Advantages of Proof of Stake
Energy Efficiency: Far less energy-intensive compared to PoW, addressing major environmental concerns.
Lower Barrier to Entry: No need for expensive mining rigs, making it more accessible for average users to
participate as Validators.
Enhanced Security: The economic stake discourages malicious behavior, as Validators have a vested interest
in the integrity of the network.
Scalability: PoS can potentially handle more transactions, contributing to better Scalability of the Blockchain.
2.4 Disadvantages of Proof of Stake
Wealth Concentration: Wealthier participants who can afford to stake more coins have a higher chance of
being chosen as Validators, potentially leading to a concentration of power.
Nothing at Stake Problem: Validators might have little cost to validate multiple Blockchain histories, leading
to security concerns, although newer PoS systems have mechanisms to prevent this.
2.5 Examples of Proof of Stake Blockchains
• Ethereum (which has moved from PoW to PoS through its Ethereum 2.0 upgrade)
• Cardano
• Polkadot
Page 4
Proof of Stake
• Tezos
In summary, Proof of Stake is seen as a more sustainable and efficient alternative to Proof of Work,
particularly in terms of energy consumption and environmental impact. Its adoption is increasing, especially with
major networks like Ethereum switching to a PoS Consensus mechanism.
Page 5
Proof of Stake
3. Proof of Stake Process and Transaction Structure
3.1 How Does PoS Work?
Staking Cryptocurrency:
Participants (nodes) in the network lock up some of their own cryptocurrency as their stake. This acts as a form
of security deposit.
Validator Selection:
The protocol selects Validators to create a new block based on various factors. These can include the size of
their stake, the length of time they have held it (coin age), and sometimes random selection. The higher the
stake, generally, the higher the chance of being selected. This process differs from PoW, where the probability
of creating a new block is determined by computational power.
Creating New Blocks:
The selected Validator checks if the transactions in the block are valid, signs the block, and adds it to the
Blockchain. The process is typically much quicker and requires far less energy than mining in PoW.
Rewards:
Unlike PoW, where miners are rewarded with new cryptocurrency, Validators in PoS usually earn the
Transaction Fees. Some PoS systems still generate new coins for block rewards, but this is less common.
Security and Trust:
Validators have a financial stake in the network. If they approve fraudulent transactions or try to attack the
network, they risk losing their stake. This financial commitment helps to ensure the integrity and security of the
network.
3.2 Ethereum Transaction Structure
Here is a breakdown of the typical structure of an Ethereum transaction:
Nonce: A counter that represents the number of transactions sent from the sender's address. It helps to prevent
transaction replay attacks.
Gas Price: The amount of Ether the sender is willing to pay per unit of gas for processing the transaction. It is
usually measured in Gwei, a denomination of Ether.
Gas Limit: The maximum amount of gas units that the sender is willing to spend on the transaction. This limit
protects the sender from overspending due to errors in the contract execution or transaction processing.
To: The recipient's address. This could be an externally owned account (another user) or a contract address.
Value: The amount of Ether (in Wei, where 1 Ether = 1e18 Wei) to be transferred from the sender to the
recipient.
Data: This field is used when the transaction involves a Smart Contract. It contains the function call and the
arguments to the contract's method. For simple ETH transfers, this field is usually empty.
v, r, s: These fields are related to the transaction's signature. They are used to generate the sender's public key
from the signature and ensure the transaction was not altered after being signed. The v parameter represents
the recovery id, while r and s are part of the ECDSA signature.
3.3 Transaction Fee Mechanics
Smart Contract Interaction: When a transaction involves a Smart Contract, the Data field plays a critical role. It
specifies which function of the Smart Contract to call and with what parameters.
Transaction Fees: The total fee for a transaction is calculated as Gas Price × Gas Used, where Gas Used is
the actual amount of gas consumed by the transaction. If the Gas Limit is set too low, the transaction will fail. If
set too high, the unused gas is refunded.
Signature: The signature ensures that the transaction is valid and authorized by the holder of the private key
corresponding to the sending address.
Page 6
Proof of Stake
EIP-1559 Update: With Ethereum's EIP-1559 update, the transaction fee mechanism has been altered to
include a base fee per gas (which is burned) and a priority fee (tip), providing better predictability of transaction
costs and improving the network's economic model.
Page 7
Proof of Stake
4. Transaction Lifecycle
4.1 Stages of a Transaction
The transaction lifecycle in a Proof of Stake (PoS) Blockchain, while sharing some similarities with Proof of
Work (PoW) systems, has its unique aspects due to the different Consensus mechanism.
Transaction Creation: A user initiates a transaction, which includes details such as the recipient's address, the
amount to be transferred, and any additional data (especially if interacting with Smart Contracts). The
transaction is digitally signed by the sender using their private key, ensuring its authenticity and non-repudiation.
Transaction Broadcast: The signed transaction is broadcast to the network and propagated to various nodes.
This is typically done through a wallet interface or a Blockchain application.
Transaction Verification (Mempool): Nodes in the network receive the transaction and verify its validity. Checks
include signature verification, ensuring the sender has enough balance, and confirming that the transaction
format is correct. Valid transactions are placed into a memory pool (Mempool), awaiting inclusion in a block.
Block Creation (Forging): In PoS, a Validator (or forger) is chosen to create the next block. This process varies
per Blockchain but generally depends on the size of a Validator's stake and possibly other factors like the age
of the stake. The selected Validator picks transactions from the Mempool. High-priority transactions (often
those with higher fees) may be chosen first.
4.2 Block Validation and Finality
Block Validation: The Validator constructs a block of transactions and validates it. This involves executing the
transactions (especially important for those invoking Smart Contract functions) and ensuring all transactions
are valid. The Validator then broadcasts the completed block to other nodes.
Block Addition to the Blockchain: Other nodes in the network receive the new block and validate it. Upon
successful validation, they add it to their copy of the Blockchain. This addition represents the first confirmation
of the transactions included in the block.
Transaction Finality: More confirmations occur as subsequent blocks are added to the chain. In PoS, the finality
of a transaction can be faster compared to PoW, depending on the specific Blockchain's protocol. Once a
transaction is deeply embedded in the Blockchain (after several confirmations), it is considered irreversible.
Rewards and Penalties: The Validator who created the block typically receives Transaction Fees (and possibly
block rewards) as an incentive. Some PoS systems include mechanisms to penalize Validators (e.g., Slashing
part of their stake) for actions like validating fraudulent transactions or going offline.
Network Security: The security in PoS comes from the stake Validators have in the network. Malicious actions
would harm the network and, in turn, the value of the Validators' own stake.
Page 8
Proof of Stake
5. Cryptocurrency
5.1 What is Cryptocurrency?
Cryptocurrency is a type of digital or virtual currency that uses cryptography for security and operates on a
decentralized network, typically a Blockchain. Unlike traditional currencies issued by governments (fiat
currencies), cryptocurrencies are not controlled by any central authority, making them theoretically immune to
government interference or manipulation.
Key Characteristics:
Decentralization: Cryptocurrencies operate on a distributed network of computers (nodes), which means there
is no central server or controlling entity.
Digital and Virtual: They exist only in digital form and have no physical counterpart like coins or paper bills.
Cryptographic Security: Transactions are secured using advanced cryptographic techniques, making them
highly secure and resistant to fraud.
Blockchain Technology: Most cryptocurrencies operate on Blockchain technology, which is a distributed
ledger that records all transactions across a network of computers.
Anonymity and Transparency: While transactions are transparent and can be viewed on the Blockchain, the
identities of the parties involved are often pseudonymous.
Limited Supply: Many cryptocurrencies have a cap on the total number of units that can ever exist, which is
often used to control inflation.
Types of Cryptocurrencies:
Bitcoin (BTC): The first and most well-known cryptocurrency, often referred to as digital gold.
Ethereum (ETH): Known for its Smart Contract functionality, Ethereum has become a platform for many
decentralized applications.
Altcoins: Any cryptocurrency other than Bitcoin (e.g., Litecoin, Ripple, Cardano).
Stablecoins: Cryptocurrencies pegged to a stable asset like the U.S. dollar or gold to minimize volatility (e.g.,
Tether, USD Coin).
Uses of Cryptocurrency:
Digital Payments: Used as a medium of exchange for goods and services.
Investment: Many people invest in cryptocurrencies hoping their value will increase.
Decentralized Finance (DeFi): Cryptocurrencies enable financial services like lending, borrowing, and trading
without traditional financial intermediaries.
Challenges and Risks:
Volatility: The value of cryptocurrencies can be highly volatile.
Regulatory Concerns: Different countries have different regulations, and the regulatory environment is still
evolving.
Security Risks: While the Blockchain technology itself is secure, exchanges and wallets can be hacked.
Environmental Impact: The mining of some cryptocurrencies (particularly Bitcoin) consumes a significant
amount of energy.
Despite these challenges, cryptocurrencies have gained significant attention and adoption, representing a
significant innovation in the financial sector.
5.2 How Does Bitcoin Work?
Bitcoin operates on a decentralized peer-to-peer network, which means that it does not require a central
authority (like a bank or government) to manage transactions. Instead, it uses a technology called Blockchain
to record all transactions across a distributed network of computers.
Blockchain: Bitcoin's transactions are recorded on a public ledger called a Blockchain. This ledger is
decentralized and spread across many computers, making it extremely secure and transparent.
Transactions: When a Bitcoin transaction takes place, it is broadcast to a network of peer-to-peer computers.
Page 9
Proof of Stake
Mining: Bitcoin uses a process called Proof of Work (PoW) for transaction verification and the creation of new
coins. Miners use specialized hardware to perform complex mathematical computations.
Wallets: Bitcoin is stored in digital wallets. These wallets do not store Bitcoin per se but store the private and
public keys used to access Bitcoin addresses.
Cryptography: Bitcoin's security is based on cryptographic principles. The SHA-256 hash function and ECDSA
(Elliptic Curve Digital Signature Algorithm) are used to secure transactions.
5.3 What is Ethereum?
Ethereum is a decentralized, open-source Blockchain system that features Smart Contract functionality. It
was proposed in 2013 by programmer Vitalik Buterin and development was crowdfunded in 2014, going live on
30 July 2015.
Ethereum's cryptocurrency is called Ether (ETH). Unlike Bitcoin, which was primarily designed as a digital
currency, Ethereum was built to also run decentralized applications (dApps) and Smart Contracts.
Smart Contracts: These are self-executing contracts with the terms of the agreement directly written into code.
They automatically execute actions when conditions are met, without the need for a middleman.
Decentralized Applications (dApps): Ethereum provides a platform for developers to build and deploy dApps,
which are applications that run on a decentralized network. These applications are transparent, secure, and
resistant to censorship.
Ether (ETH): The native cryptocurrency of the Ethereum network, Ether, is used to compensate participants
who perform computations and validate transactions. It is also used as a general form of payment on the
network.
Ethereum Virtual Machine (EVM): The EVM is a powerful, sandboxed virtual stack embedded within each full
Ethereum node, responsible for executing contract bytecode.
5.4 Ethereum Proof of Stake
Ethereum's transition to Proof of Stake (known as The Merge) represents a significant shift in how
transactions are validated on the Ethereum network. Before this shift, Ethereum used a Proof of Work (PoW)
Consensus mechanism, similar to Bitcoin.
Validators Instead of Miners: In Ethereum 2.0's PoS, Validators replace miners. Instead of competing to solve
complex puzzles, Validators are chosen to create new blocks and confirm transactions based on the amount of
Ether they have staked.
Staking ETH: To become a Validator, an individual must stake a minimum of 32 ETH. This stake acts as
collateral and incentivizes Validators to act honestly; if they try to manipulate the system, they risk losing their
staked ETH.
Validator Selection: Validators are selected to propose and attest to new blocks through a pseudo-random
process. The selection is influenced by the size of a Validator's stake and the length of time they have been in
the Validator pool.
Beacon Chain: The Beacon Chain is a new Blockchain introduced as part of Ethereum's upgrade to PoS. It
runs in parallel to the existing Ethereum chain and manages the registry of Validators, including their stakes
and rewards.
Committees and Epochs: Validators are organized into committees, and they take turns to propose and attest
to new blocks. Each period of time, called an epoch, consists of 32 slots where Validators can propose blocks.
Benefits Observed:
Energy Efficiency: The shift to PoS significantly reduces energy consumption. PoW required enormous
amounts of energy for mining, while PoS operates at a fraction of that energy cost.
Security: PoS introduces Slashing conditions, where Validators who act dishonestly are penalized by having a
portion of their stake removed (slashed).
Decentralization: By reducing the barrier to entry, PoS can lead to greater Decentralization as more people
can afford to participate as Validators.
Page 10
Proof of Stake
Reduced Issuance Rate: In Ethereum 2.0, the issuance of new ETH as block rewards is reduced compared to
PoW.
Scalability: PoS is a step towards Ethereum's broader goal of improving its Scalability, further addressed by
technologies like sharding.
5.5 What are Smart Contracts?
Smart Contracts are self-executing contracts with the terms of the agreement between buyer and seller being
directly written into lines of code. The code and the agreements contained therein exist across a distributed,
decentralized Blockchain network.
The Smart Contract not only defines the rules and penalties around an agreement in the same way that a
traditional contract does, but it also automatically enforces those obligations.
Key Characteristics:
Self-executing: Smart Contracts automatically execute transactions based on predefined rules, without the
need for human intervention.
Transparent: Once deployed on the Blockchain, the terms of the Smart Contract are visible to all parties
involved. This transparency builds trust.
Immutable: Once a Smart Contract is deployed, its code cannot be changed. This ensures the integrity of the
contract.
Distributed: Smart Contracts run across a network of nodes, which means they are not dependent on any
single server and therefore are resilient to failures.
Trustless: Parties can rely on the code to perform the agreed upon actions, without the need to trust each other.
Common Use Cases:
Financial Services: Automating complex processes in financial transactions, like derivatives trading, escrow
services, and cross-border payments.
Supply Chain Management: Tracking the production and delivery of goods in real-time, ensuring compliance
with contract terms.
Healthcare: Managing patient data, automating insurance claims, and ensuring data security.
Real Estate: Simplifying property sales by automating the transfer of funds and properties.
Voting: Creating transparent and tamper-proof voting systems.
How Smart Contracts Work:
1. Writing the Contract: The terms of the contract are written in a programming language. For Ethereum, this is
typically Solidity.
2. Deploying on Blockchain: The contract is then compiled into bytecode and deployed onto the Blockchain.
3. Condition Trigger: When predefined conditions are met, the contract automatically executes the relevant
transactions.
4. Execution and Verification: The execution of the contract is verified by the nodes on the network.
5. Immutable Record: Once executed, the transaction is recorded on the Blockchain as an immutable record.
5.6 What is DeFi?
Decentralized Finance (DeFi) refers to the ecosystem of financial applications and services built on
Blockchain networks that aim to recreate and improve upon traditional financial systems.
Unlike traditional finance, which relies on central authorities like banks and governments, DeFi uses Smart
Contracts on blockchains (primarily Ethereum) to create protocols that replicate existing financial services in a
more open, interoperable, and transparent way.
Key Features of DeFi:
Decentralized: No central control. Operated by code (Smart Contracts) and governed by community.
Permissionless: Anyone with a cryptocurrency wallet can access DeFi applications.
Interoperable: Different DeFi applications can interact with each other.
Transparent: All transactions and protocols are visible on the Blockchain.
Self-Custody: Users maintain control of their assets.
Page 11
Proof of Stake
Examples of DeFi Applications:
Lending and Borrowing: Platforms like Aave and Compound allow users to lend and borrow cryptocurrencies.
Decentralized Exchanges (DEXs): Platforms like Uniswap allow users to trade cryptocurrencies directly from
their wallets.
Yield Farming: Users can earn returns by providing liquidity to DeFi protocols.
Stablecoins: DeFi-native stablecoins like DAI maintain their value through overcollateralization.
Risks in DeFi:
Smart Contract Vulnerabilities: Bugs in code can be exploited.
Regulatory Risk: DeFi exists in a legal gray area in many jurisdictions.
Liquidity Risk: Low liquidity can lead to high slippage.
Complexity: DeFi can be complex and hard to understand for new users.
Impermanent Loss: Liquidity providers can suffer impermanent loss if asset prices change.
5.7 What are NFTs?
Non-Fungible Tokens (NFTs) are a type of digital asset created using Blockchain technology. Unlike traditional
cryptocurrencies such as Bitcoin or Ethereum, which are fungible and can be exchanged on a one-to-one
basis, NFTs are unique and cannot be exchanged on a like-for-like basis.
Key Characteristics of NFTs:
Uniqueness: Each NFT has distinct information or attributes that make it different from any other NFT.
Indivisibility: NFTs cannot be divided into smaller units. You cannot buy or sell 0.5 of an NFT like you can with
Bitcoin.
Ownership and Provenance: Blockchain technology records the ownership and history of NFTs, making it easy
to verify their authenticity and provenance.
Interoperability: NFTs can potentially be used across different platforms and applications.
Programmability: Smart Contracts can be used to attach rules to NFTs, like royalties for the original creator.
Uses of NFTs:
Digital Art: NFTs have revolutionized the digital art world, allowing artists to sell their work as unique pieces.
Collectibles: Digital trading cards, sports memorabilia, and other collectibles.
Gaming: In-game items, characters, and other assets as NFTs.
Music and Entertainment: Musicians and other entertainers can sell unique digital content.
Real Estate: Virtual land in digital worlds.
NFTs and Proof of Stake:
Since NFTs are primarily built on Ethereum, Ethereum's shift to PoS directly impacts NFTs. The use of PoS
Consensus mechanism makes Ethereum (and by extension, NFTs) more environmentally friendly. PoS makes
validation of NFT transactions more energy efficient. In this way, PoS encourages Validators to act in the best
interest of the network, as they are financially invested and can lose their stake if they break the rules.
5.8 What are CBDCs?
Central Bank Digital Currencies (CBDCs) are a digital form of a country's fiat currency, issued and regulated by
the nation's central bank. They represent a new, technology-driven approach to traditional money, blending the
benefits of digital systems with the regulated, reserve-backed money supply of conventional currencies.
Key Characteristics of CBDCs:
Centralized Issuance: Unlike cryptocurrencies like Bitcoin which are decentralized, CBDCs are issued and
controlled by a nation's central bank. This gives the central bank greater control over the currency's supply and
circulation.
Legal Tender Status: CBDCs are recognized as legal tender by the government, meaning they must be
accepted as a form of payment within the country.
Digital Form: They exist solely in digital or electronic form, eliminating the need for physical notes or coins.
Page 12
Proof of Stake
Blockchain Technology (Optional): Some CBDCs might use Blockchain or distributed ledger technology, but it
is not a necessity.
Regulatory Oversight: Being a central bank-issued currency, CBDCs are subject to the regulatory frameworks
and monetary policies of the issuing country.
Types of CBDCs:
Retail CBDCs: Intended for use by the general public, much like physical currency. They are designed for
everyday transactions and payments.
Wholesale CBDCs: Used for transactions between financial institutions. They are not available to the general
public and are primarily used for interbank payments and financial settlements.
Objectives of CBDCs:
Improve Payment Systems: Enhance the efficiency and security of payments, both domestically and
internationally.
Financial Inclusion: Provide access to banking services for populations currently underserved by traditional
banking systems.
Reduce Costs: Lower the cost of printing, distributing, and managing physical money.
Combat Illegal Activities: Offer a regulated alternative to cryptocurrencies, which are sometimes associated with
illegal transactions due to their anonymity.
Strengthen Monetary Policy: Give central banks new tools for effective monetary policy implementation.
Examples and Global Trends:
Many countries are researching or piloting CBDCs. For example, China's Digital Currency Electronic Payment
(DCEP), the Bahamas' Sand Dollar, and the European Central Bank's exploration of a digital euro.
Considerations and Challenges:
Privacy: Balancing the need for regulatory compliance with the privacy of users.
Security: Ensuring robust protection against cyber threats and fraud.
Impact on Banks: Understanding how CBDCs will affect commercial banks and the traditional banking system.
Technology and Infrastructure: Establishing a reliable and accessible technological framework for issuing and
managing CBDCs.
5.9 Ethereum Token Standards
ERC-20 Tokens:
Purpose: Primarily used for fungible tokens, which means each token is identical and can be exchanged on a
one-to-one basis.
Common Use Cases: Used for various purposes like utility tokens, governance tokens, or even as digital
currencies.
Examples: Tether (USDT), Chainlink (LINK), and Binance Coin (BNB) originally started as ERC-20 tokens.
ERC-721 Tokens:
Purpose: Used for non-fungible tokens (NFTs), where each token is unique and cannot be exchanged on a
like-for-like basis.
Common Use Cases: Mostly used in digital art, collectibles, and gaming for items like digital artwork, in-game
items, or other unique assets.
Examples: CryptoKitties, a popular Blockchain game, uses ERC-721 tokens for its collectible kittens.
ERC-1155 Tokens:
Purpose: A more advanced standard that supports both fungible and non-fungible tokens within a single
contract, allowing for more efficient transactions and storage.
Common Use Cases: Useful in gaming and digital art, where a combination of fungible and non-fungible assets
is required.
Examples: Used in various Ethereum-based games and platforms that require a mix of fungible and
non-fungible tokens.
5.10 Cryptocurrency Security on Blockchain
Page 13
Proof of Stake
Cryptography:
Public and private keys: Users have a public address (similar to a bank account) and a private key (used for
authorization).
Digital signatures: Used to verify the identity of the sender and ensure the integrity of the transaction.
Decentralization:
Transactions are validated by a network of nodes, not by a central authority.
Prevents fraud and double-spending.
Consensus Mechanisms:
Proof of Work: Miners compete to solve complex mathematical problems to validate blocks (used by Bitcoin).
Proof of Stake: Validators validate transactions based on the amount of cryptocurrency they hold (used by
Ethereum 2.0).
Advantages of Using Cryptocurrency in Blockchain:
Low Transaction Fees: Cryptocurrency transactions usually have lower fees compared to traditional financial
systems.
Faster Transactions: Peer-to-peer transactions on Blockchain can be quicker than traditional banking methods.
Global Accessibility: Cryptocurrencies can be accessed and used by anyone with an internet connection.
Security and Transparency: The Blockchain provides a transparent and immutable ledger, increasing trust and
security.
Challenges of Cryptocurrency in Blockchain:
Scalability: The current Blockchain infrastructure (especially Bitcoin) struggles to handle a high volume of
transactions quickly.
Energy Consumption: Proof of Work Consensus mechanisms (used by Bitcoin) consume large amounts of
energy.
Regulatory Concerns: Governments and financial institutions are concerned about the potential for illegal
activities like money laundering.
Volatility: The value of cryptocurrencies can fluctuate dramatically, leading to instability.
Page 14
Proof of Stake
6. Numerical Examples and Problems
6.1 Basic Validator Selection Example
Suppose a PoS network has four Validators with the following stakes:
Total Stake = 10 + 50 + 80 + 20 = 160 coins
Probability of selection:
Alice → 10/160 = 6.25%
Bob → 50/160 = 31.25%
Carol → 80/160 = 50%
David → 20/160 = 12.5%
■ Higher stake increases chances but does not guarantee selection.
Transaction Scenario:
Users send transactions to the network. The protocol randomly selects Carol due to higher stake probability.
Carol proposes Block #150. Bob and David validate it. Block becomes part of Blockchain.
Rewards: Carol receives Block Reward. Validators receive small incentives.
If Carol Cheats: Network detects invalid block. Carol loses part of 80 staked coins (Slashing).
Validator Coins Staked Selection Chance
Alice 10 Low
Bob 50 Medium
Carol 80 High
David 20 Moderate
6.2 Weighted Validator Selection (Advanced)
Modern PoS systems do NOT use stake alone. They often use a weighted selection formula.
Scenario Setup:
Step 1 — Basic Selection Probability (Stake Only):
Total Stake = 120 + 80 + 60 + 200 + 40 = 500
■ If only stake mattered, Validator D would dominate.
Step 2 — Adjusted Selection Probability (Weighted Score):
Applying uptime and misbehavior penalty factors:
■ Notice how Validator C's chance dropped significantly due to past misbehavior.
Validator Coins Staked Uptime Score Misbehavior History
A 120 0.95 No
B 80 0.90 No
C 60 0.85 Yes
D 200 0.98 No
E 40 0.80 No
Validator Probability
A 120/500 = 24%
B 80/500 = 16%
C 60/500 = 12%
Page 15
Proof of Stake
Validator Coins Staked Uptime Score Misbehavior History
D 200/500 = 40%
E 40/500 = 8%
Validator Weighted Probability
A 114/449.7 ≈ 25.3%
B 72/449.7 ≈ 16.0%
C 35.7/449.7 ≈ 7.9%
D 196/449.7 ≈ 43.6%
E 32/449.7 ≈ 7.1%
6.3 PoS Network with 5 Validators
A PoS Blockchain has 5 Validators:
Step 1: Total Stake
Total = 500 + 300 + 100 + 50 + 50 = 1000
Step 2: Probability Formula
P = Individual Stake / Total Stake
Validator Stake (Coins)
A 500
B 300
C 100
D 50
E 50
Validator Probability Expected Blocks (out of 20)
A 500/1000 = 0.50 10
B 300/1000 = 0.30 6
C 100/1000 = 0.10 2
D 50/1000 = 0.05 1
E 50/1000 = 0.05 1
6.4 Numerical PoS with 4 Validators
Suppose a PoS Blockchain has:
Total Stake = 100 Coins
Selection Probability:
V1 → 40/100 = 40%
V2 → 30/100 = 30%
V3 → 20/100 = 20%
V4 → 10/100 = 10%
If 10 blocks are generated statistically:
V1 → ~4 blocks
V2 → ~3 blocks
V3 → ~2 blocks
Page 16
Proof of Stake
V4 → ~1 block
Validator Stake (Coins)
V1 40
V2 30
V3 20
V4 10
6.5 Security: 51% Attack Cost
Example 1 — Basic:
Total Stake = 10,000 coins. Attacker owns 3,000 coins. Attack probability = 30%.
To control majority: Needs >5,000 coins.
Costly and risky because if caught: Stake is slashed.
Example 2 — Ethereum Scale:
A PoS network (like Ethereum) has:
Total Stake = 2,000,000 coins
Market Price = $2 per coin
Step 1: Coins required for 51% attack
Coins needed = 51% × 2,000,000 = 1,020,000 coins
Step 2: Cost of attack
Cost = 1,020,000 × $2 = $2,040,000
Conclusion: An attacker would need to spend over $2 million to attempt a 51% attack, making it economically
prohibitive.
Economic Security:
To attack the network, an attacker must own >50% of total stake.
If total stake = 1,000,000 coins, attacker needs >500,000 coins — extremely expensive.
6.6 Slashing Example
Validator stakes 100 coins.
If Validator cheats → 20% slashed.
New stake = 80 coins.
This discourages malicious behavior. Validators who act dishonestly or try to compromise the network are
penalized by having a portion of their stake removed.
6.7 Real-World Example: Ethereum PoS
After The Merge (2022), Ethereum moved from PoW to PoS.
Requirements:
Minimum stake: 32 ETH
Validators run node software
Randomized Validator selection
Slashing for malicious behavior
Benefits Observed:
■ ~99% reduction in energy usage
■ More environmentally friendly
■ More accessible participation
PoW vs PoS Comparison:
Page 17
Proof of Stake
Complete Transaction Flow in PoS:
1. User sends transaction
2. Transaction enters Mempool
3. Validator selected
4. Block created
5. Other Validators attest
6. Block finalized
7. Reward distributed
Feature PoW PoS
Energy Use Very High Very Low
Equipment Mining hardware Normal servers
Security Computational power Economic stake
Example Bitcoin Ethereum
Page 18