POS Proof of Stake and Liquidity Pools
Key Points
References
Reference_description_with_linked_URLs_______________________ | Notes______________________________________________________________ |
---|---|
m Ethereum | |
m Ethereum Smart Contract Concepts | |
DLT concepts & principles | |
capital markets, securities management concepts | |
Digital Money Concepts | |
m Crypto Notes | |
What Does POS mean in Crypto? Investopedia | |
https://www.forbes.com/advisor/investing/cryptocurrency/proof-of-stake/ | |
Ethereum, Shanghai and staking update 23.01.10 staking-liquditiy-pools-Ethereum Staking Tokens Rally as Shanghai Upgrade Nears.pdf | update on value of liquidity pools given Shanghai date to unlock stakes |
Key Concepts
What Does POS mean in Crypto? Investopedia
consensus-pos-investopedia.com-What Does Proof-of-Stake PoS Mean in Crypto.pdf link
consensus-pos-investopedia.com-What Does Proof-of-Stake PoS Mean in Crypto.pdf file
Proof-of-stake is a cryptocurrency consensus mechanism for processing transactions and creating new blocks in a blockchain. A consensus mechanism is a method for validating entries into a distributed database and keeping the database secure. In the case of cryptocurrency, the database is called a blockchain—so the consensus mechanism secures the blockchain.
- With proof-of-stake (POS), cryptocurrency owners validate block transactions based on the number of staked coins.
- Proof-of-stake (POS) was created as an alternative to Proof-of-work (POW), the original consensus mechanism used to validate a blockchain and add new blocks.
- PoS mechanisms require validators to hold and stake tokens for the privilege of earning transaction fees.
- Proof-of-stake (POS) is seen as less risky regarding the potential for an attack on the network, as it structures compensation in a way that makes an attack less advantageous.
- The next block writer on the blockchain is selected at random, with higher odds being assigned to nodes with larger stake positions.
https://www.forbes.com/advisor/investing/cryptocurrency/proof-of-stake/
With proof of stake, participants referred to as “validators” lock up set amounts of cryptocurrency or crypto tokens—their stake, as it were—in a smart contract on the blockchain. In exchange, they get a chance to validate new transactions and earn a reward. But if they improperly validate bad or fraudulent data, they may lose some or all of their stake as a penalty.
The blockchain algorithm selects validators to check each new block of data based on how much crypto they’ve staked. The more you stake, the better your chance of being chosen to do the work. When the data that’s been cleared by the validator is added to the blockchain, they get newly minted crypto as a reward.
If a validator submits bad data or fraudulent transactions, they could be punished by “slashing.” Their stake is “burned,” meaning it is sent to an unusable wallet address where nobody has access, rendering them useless forever.
proof of stake works because validators are saying “Hey, I have so much faith in the legitimacy of this transaction that I’m willing to back it up with my own money.” And verified transactions earn a cryptocurrency reward in proportion to the size of the stake.
Crypto exchanges like Coinbase, Binance and Kraken offer staking as a feature on their platforms. There are even dedicated staking platforms, like Everstake. Depending on the blockchain, crypto owners can earn yields of 5% to even 14% on their holdings by staking.
in theory, support more simultaneous transactions without compromising security or decentralization.
POS risks
Certain implementations of proof of stake could leave blockchains more vulnerable to different kinds of attacks than proof of work, such as low-cost bribe attacks. Susceptibility to attacks decreases the overall security of the blockchain.
Ethereum POS
https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/
To participate as a validator, a user must deposit 32 ETH into the deposit contract and run three separate pieces of software: an execution client, a consensus client, and a validator. On depositing their ETH, the user joins an activation queue that limits the rate of new validators joining the network. Once activated, validators receive new blocks from peers on the Ethereum network. The transactions delivered in the block are re-executed, and the block signature is checked to ensure the block is valid. The validator then sends a vote (called an attestation) in favor of that block across the network.
Time in proof-of-stake Ethereum is divided into slots (12 seconds) and epochs (32 slots). One validator is randomly selected to be a block proposer in every slot. This validator is responsible for creating a new block and sending it out to other nodes on the network. Also in every slot, a committee of validators is randomly chosen, whose votes are used to determine the validity of the block being proposed.
HOW A TRANSACTION GETS EXECUTED IN ETHEREUM POS
The following provides an end-to-end explanation of how a transaction gets executed in Ethereum proof-of-stake.
- A user creates and signs a transaction with their private key. This is usually handled by a wallet or a library such as ether.js, web3js, web3py etc but under the hood the user is making a request to a node using the Ethereum JSON-RPC API. 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.
- The transaction is submitted to an Ethereum execution client which verifies its validity. This means ensuring that the sender has enough ETH to fulfill the transaction and they have signed it with the correct key.
- 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. When other nodes hear about the transaction they add it to their local mempool too. Advanced users might refrain from broadcasting their transaction and insteads forward it to specialized block builders such as Flashbots Auction. This allows them to organize the transactions in upcoming blocks for maximum profit (MEV).
- One of the nodes on the network is the block proposer for the current slot, having previously been selected pseudo-randomly using RANDAO. This node is responsible for building and broadcasting the next block to be added to the Ethereum blockchain and updating the global state. The node is made up of three parts: an execution client, a consensus client and a validator client. The execution client bundles transactions from the local mempool into an "execution payload" and executes them locally to generate a state change. 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. The communication between the execution and consensus clients is described in more detail in Connecting the Consensus and Execution Clients.
- Other nodes receive the new beacon block on the consensus layer gossip network. They pass it to their execution client where the transactions are re-executed locally to ensure the proposed state change is valid. 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 as defined in the fork choice rules). The block is added to the local database in each node that attests to it.
- The transaction can be considered "finalized", i.e., that it can not be reverted, if it has become part of a chain with a "supermajority link" between two checkpoints. Checkpoints occur at the start of each epoch and to have a supermajority link they must both be attested to by 66% of the total staked ETH on the network.
More detail on finality can be found below.
FINALITY
A transaction has "finality" in distributed networks when it's part of a block that can't change without a significant 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". To revert a finalized block, an attacker would commit to losing at least one-third of the total supply of staked ETH. The exact reason for this is explained in this Ethereum Foundation blog post. Since finality requires a two-thirds majority, an attacker could prevent the network from reaching finality by voting with one-third of the total stake. There is a mechanism to defend against this: the inactivity leak. This activates whenever the chain fails to finalize for more than four epochs. The inactivity leak bleeds away the staked ETH from validators voting against the majority, allowing the majority to regain a two-thirds majority and finalize the chain.
Ethereum Staking
https://ethereum.org/en/staking/#what-is-staking
Rewards
- Maximum rewards - receive full rewards directly from the protocol
- You'll get rewards for batching transactions into a new block or checking the work of other validators to keep the chain running securely
- You'll also receive unburnt transaction fees for blocks you propose
Risks
- Your ETH is at stake
- There are penalties, which cost ETH, for going offline
- Malicious behavior can result in 'slashing' of larger amounts of ETH and forced ejection from the network
Requirements
- You must deposit 32 ETH
- Maintain hardware that runs both an Ethereum execution client and consensus client while connected to the internet
- The Staking Launchpad will walk you through the process and hardware requirements
Staking as a service
Rewards
- Usually involves full protocol rewards minus monthly fee for node operations
- Dashboards often available to easily track your validator client
Risks
- Same risks as solo staking plus counter-party risk of service provider
- Use of your signing keys is entrusted to someone else who could behave maliciously
Requirements
- Deposit 32 ETH and generate your keys with assistance
- Store your keys securely
- The rest is taken care of, though specific services will vary
Pooled staking
Rewards
- Pooled stakers accrue rewards differently, depending on which method of pooled staking chosen
- Many pooled staking services offer one or more liquidity tokens that represents your staked ETH plus your share of the validator rewards
- Liquidity tokens can be held in your own wallet, used in DeFi and sold if you decide to exit
Risks
- Risks vary depending on the method used
- In general, risks consist of a combination of counter-party, smart contract and execution risk
Requirements
- Lowest ETH requirements, some projects require as little as 0.01 ETH
- Deposit directly from your wallet to different pooled staking platforms or simply trade for one of the staking liquidity tokens
Liquidity Pools Overview
Liquidity Pools are crowd-sourced collections of digital assets locked in a smart contract. They support DEXs by providing liquidity for traders to swap between currencies.
Users who supply assets to a Liquidity Pool are financially rewarded for providing liquidity
Essentially, liquidity pools are a collection (pool) of tokenized assets through which traders and investors can buy and sell those specific assets (liquidity). The funds are locked within a smart contract and an algorithm manages the automated transactions (Automated Market Maker (AMM)) of assets for buyers and sellers within that specific liquidity pool.
AMM - Automated Market Maker Model
This style of order processing is not a viable solution for blockchains, primarily due to:
- transaction speed (far too many orders to place, process, or cancel)
- gas fees would be cost prohibitive for market makers to justify participating
- relying on a sole market maker is not particularly decentralized
To solve this problem, and keep the nature of these financial transaction processes more decentralized, the Liquidity Pool and, subsequently, the Automated Market Maker (AMM) was created. AMMs are DEX protocols that rely on algorithms to price assets and facilitate trades. They leverage funds from the Liquidity Pools to do so.
Think of traditional order books as a type of centralized or peer-to-peer (P2P) tool, and an automated market maker as a decentralized tool or “peer-to-contract” (P2C) model. Through an AMM, a user (buyer or seller) makes a trade directly with the protocol via the Liquidity Pool.
AMM notes
https://finance.yahoo.com/news/regulators-bringing-multichain-era-close-212022558.html
Liquidity becomes an issue as well. Polling Automated Market Makers (AMM) for their sample prices by volumes of proposed swaps on different token pairs shows how quickly liquidity drops off once you leave the Ethereum blockchain. Even within public Ethereum, trading is highly concentrated among the top tokens. Tokens without liquidity are much more vulnerable to price manipulation.
Insufficient liquidity in an inadequately regulated market is one of the main reasons the Securities and Exchange Commission has rejected applications for bitcoin (BTC) exchange-traded funds (ETF). The last year has shown, time and again, that crypto asset prices are often manipulated. So these concerns are unlikely to go away and will increasingly deter firms for interacting with, or transacting upon, less-liquid ecosystems.
Potential Value Opportunities
Potential Challenges
Candidate Solutions
Step-by-step guide for Example
sample code block