Lido Explained, Part 1: History & Architecture

1 February, 2024
article image
Case Study

Contents

Introduction

This article discusses the history of the Lido project, founded by Vasilii Shapovalov, Konstantin Lomashuk, and a team of experienced developers in December 2020, which has shown impressive growth in TVL over the past two years.

In 2020, Lido made a significant impact by effectively creating the Liquid Staking industry, thanks to the introduction of its financial derivative, stETH. In the first version of the protocol, stETH made funds staked in the deposit contract liquid, and in the second version, it even allowed the withdrawal of deposits with the return of ETH and the burning of stETH.

Native staking in Ethereum emerged concurrently with the launch of the Beacon Chain, which marked the beginning of the gradual transition from Proof of Work (PoW) to Proof of Stake (PoS). Initially, staking was a one-way operation involving interaction with the deposit contract. After staking, it was impossible to withdraw funds from the deposit contract until the activation of The Merge update, which introduced the logic for voluntary and forced exit of validators. This limitation highlighted the clear need for a new direction that would address the problem of being unable to unstake and use funds, thus giving rise to liquid staking.

What Lido created in the first version of their protocol made them pioneers of liquid staking, a concept that began to gain momentum since the protocol’s inception. Before Lido, there were no reliable and high-quality representatives in this field.

Lido offers an alternative to exchange stocks, self-staking, and other restrictive and decentralized protocols. There is a risk of losing or missing rewards, which happens if a validator is disqualified for bad behavior. This can happen, for example, due to a bug in the validator node code, or due to connectivity issues. This risk makes staking on Ethereum particularly unattractive in the initial stages, when for an average reward, the participant must bear the market risk without being able to refuse the placement.

To make staked funds liquid, the protocol introduced a token derivative, stETH, which allowed users’ funds to become unfrozen and reusable in other protocols. These derivatives are still issued today on a 1:1 staking-to-derivative ratio.

In this series of articles, we will guide you through the entire journey of the Lido protocol’s development. We aim to shed light on how Lido adapted to changes in Ethereum and the opportunities it offers to its users. We will also delve deeper into the mechanics of the protocol itself, describing in simple terms the complex aspects of its architecture and operational principles.

But before we delve into the protocol itself, we should take a brief detour into the history of Ethereum’s ecosystem updates.

As part of the audit of Lido’s on-chain and off-chain components, our team of auditors thoroughly examined the architecture and features of the project. We will gradually increase the complexity of the concepts examined in this series, ensuring that you don’t miss anything and can fully understand all the important details. We invite you to dive in with us!


A brief look into history of Ethereum

In this section, we will briefly discuss the key updates to the Ethereum protocol, which shaped the problem solved by Lido. This is important also because these updates significantly influenced the changes made in Lido V2.

In September 2020, Ethereum began transitioning from the Proof of Work (PoW) to the Proof of Stake (PoS) consensus protocol, seen as a faster, more secure, and energy-efficient alternative. The culmination of this process was the launch of the Beacon Chain on December 1, 2020, through the adoption of EIP-3675, which initially was a separate blockchain running parallel to the Mainnet. Throughout 2021 and 2022, enhancements and improvements were made to its architecture. The transition to PoS began with the Beacon Chain’s launch, requiring validators to stake multiples of 32 ETH in the deposit contract.

Untitled

This development laid the groundwork for Ethereum’s key event, The Merge, which occurred on September 15, 2022.

The activation of this update led to the final merger of the two chains and the separation of the Ethereum PoW hard fork (with its token, WETH), which became an independent project and recently announced its dissolution. The protocol fully implemented the ability to add and remove validators, but the problems present since the Beacon Chain’s inception were not resolved. These issues continue to pose obstacles for many potential network participants.

Let’s now examine these problems and delve a bit more into their essence.


Ethereum native staking drawbacks

In this section, we will provide reasoned answers to why the launch of native validators in the Beacon Chain is imperfect and highlight the main problems that made Lido’s services extremely relevant.

First of all, let’s define that staking is a way of earning rewards while holding onto certain cryptocurrencies. The reason your crypto earns rewards while staked is because the blockchain puts it to work. Cryptocurrencies that allow staking use a “consensus mechanism” called Proof of Stake, which is the way they ensure that all transactions are verified and secured without a bank or payment processor in the middle. Your crypto, if you choose to stake it, becomes part of that process.

As we said before, the integration of Beacon chain allowed users to stake their ETH for the first time. However, there were still some problems:

  1. Inability to withdraw a stake: After depositing, users were unable to withdraw their stake from the Beacon Chain’s Deposit contract until The Merge was activated. This turned staking into a one-way operation for many months. Moreover, even after The Merge, withdrawals were only possible for about 43% of validators, as only addresses with the 0x01 prefix could designate a wallet for the final closure of the deposit. Thus, for many, native staking remained a one-way operation. Worse still, throughout this period, even rewards remained inaccessible for withdrawal, creating a situation where validators had to work without immediate compensation, relying on future accumulated deferred rewards.
  2. Illiquidity: While staking, users cannot move, trade, or use their ETH as collateral in DeFi. This is especially costly until they can withdraw funds from Beacon Chain.
  3. High participation fee: Users can only stake multiples of 32 ETH, which excludes users with smaller or odd balances.
  4. Operational costs: Despite Ethereum’s core developers recognizing low hardware and uptime requirements for staking, many users preferred to provide capital and outsource operational work to a third party, negatively impacting decentralization.

This was the moment when a significant opportunity arose to take staking to a new level of development. Neither centralized exchanges (which initially were the main beneficiaries of the Beacon Chain’s launch) nor decentralized staking protocols could solve these problems.

Let’s now take a closer look at the solution that the Lido protocol offered to the world, as well as briefly dive into its history of creation.


Lido – a decentralized solution

In this section, we’ll help you understand how the Lido project was conceived and developed, who stands behind it, and what key features underpin the Lido solution.

The project raised $2 million in December 2020. Semantic Ventures, ParaFi Capital, Terra, MakerDAO creator Rune Christensen, Aave CEO Stani Kulechov, and Synthetix founder Kain Warwick were among the investors. Stakefish and Staking Facilities were the first node operators.

Following that, the Paradigm fund invested 15,120 ETH in Lido, receiving 70 million LDO. The investment was approved by the DAO vote. Andreessen Horowitz contributed $70 million to the service in March 2022.

ETH was the first crypto to be made available for liquid staking via Lido. Later, support for Solana (SOL), Kusama (KSM), Polygon (MATIC) and Polkadot (DOT) appeared.

A primary advantage of the project is that Lido accepts deposits of any size, issuing stETH in return, significantly lowering the entry threshold from 32 ETH.

stETH is compatible with decentralized applications from the DeFi sector, giving users access to additional revenue streams. Coins can be invested in liquidity pools, used as collateral for loans, and sold on the open market. The token is extremely liquid. It is the link between Ethereum 1.0 and Ethereum 2.0.

Large validators receive funds from the staking service. The income is distributed to stETH owners on a daily basis. This causes a shift in the user balance, which takes into account both rewards and penalties.

Lido charges a 10% commission on all income received. Users will receive their invested ETH and interest via rebase mechanism once transactions begin on the Beacon Chain network. Simultaneously, stETH tokens will be liquidated. The fees collected are then distributed to validators (as they need to be compensated for their expertise in running technical operations) and the protocol’s treasury.

This derivative firmly holds the top position in the liquid staking market, significantly ahead of the second and third players. Lido, as the leading decentralized liquid staking protocol, controls >31% of the total staked ETH. According to DeFi Llama on January 10, 2024, the market capitalization of stETH is $22.624 billion, representing ~15% of the entire market capitalization! Meanwhile, the second-largest liquid staking provider, Rocket Pool, with their token rETH, has a TVL of $2.962 billion, almost 11 times less!

The first version of the protocol operated successfully, placing user funds in the classic deposit contract on the Beacon Chain. However, it did not support the withdrawal of staked funds, a feature expected post-Merge. Consequently, developers began working on the second version of the protocol, aiming to introduce support for Withdrawals.

After extensive development, testing, and the release of Lido’s second version, the protocol essentially became a complete alternative to staking platforms of all kinds, supporting both deposits and withdrawals with rewards for deposits of any size! This achievement allowed the governance token LDO to reach the 25th position in the cryptocurrency ranking by CoinMarketCap as of January 10, 2024.

The Lido DAO Token (LDO) is an ERC — 20 standard token used to manage the Lido. The maximum offer is one billion dollars. The staking service’s founders received 64% of the specified amount. More than 890 million LDO are in circulation totally.


Architecture overlook

Let’s explore the components of Lido’s architecture! Our goal is to understand its constituent parts and what happens when a user interacts with the protocol.

Understanding the protocol’s architecture isn’t straightforward, so before delving into the details of each element in subsequent articles, we’ll start with a brief introductory overview to comprehend how they interact when a user (Alice) wants to use the protocol.

Lido’s architecture is based on several key elements, each performing a critically important function within the entire system. We’ve divided these elements into 5 main groups based on their functionality. Note that this isn’t a schematic of the architecture but a graphical organization of the existing modules into logical parts for ease of understanding.

Generalized diagram of the components of the Lido Protocol architecture

Generalized diagram of the components of the Lido Protocol architecture

Deposit & Staking

This component is responsible for the initial step in the Lido ecosystem - depositing and staking. Users transfer their ETH to the Lido protocol, receiving stETH in return, a token representing their share in the staking pool. This process allows user participation in Ethereum 2.0 without managing their own validators.

Oracle infrastructure

Oracles play a crucial role in updating and reflecting the current state of staked assets in the system. This component ensures regular updates of stETH value in line with the actual staking income in Ethereum 2.0. Oracles are also pivotal in monitoring network status and transmitting off-chain information from the validators’ consensus nodes for on-chain smart contract usage.

Consensus

Consensus plays a vital role in the deposit and withdrawal process as it determines the order and rules validators must follow to earn rewards. Studying it will help us understand what could theoretically go wrong in the protocol’s operation, what behavior scenarios of validators should be avoided, and in what order withdrawals should be made.

Since the transition to Ethereum 2.0, there have been many changes to the consensus architecture, most of which are related to the Beacon Chain. We’ll tell you which changes have the most significant impact on Lido’s architecture.

Withdraw mechanism

This extremely important element of the architecture became in demand immediately after introducing the ability to exit validators from Beacon Chain. It is this element that Lido developers worked on most in the second version of the protocol, and it is where most of the innovations are contained.

Thanks to this module, users have the opportunity not only to stake their funds one time but also to withdraw them back, receiving rewards.

Governance

Decentralized and transparent administration of the Lido protocol is ensured through the technical solutions of Aragon DAO. This guarantees straightforward maintenance from a technical standpoint and a fair mechanism for managing the key aspects of the protocol on the other.


Interacting with Lido

Having understood the main elements of the architecture, let’s see what happens under the hood when Alice wants to stake 1 ETH in the Lido protocol.

Deposit

Simplified scheme for accepting deposits and staking

Simplified scheme for accepting deposits and staking

  • Assume Alice wants to stake her 1 ETH.
  • The first step in the Lido on-chain infrastructure is deposit initialization. After calling the relevant functions, 1 ETH will be deducted from Alice’s wallet, and in return, she will receive stETH. The tokens will be transferred to the Lido contract address.
  • Next, Alice’s funds, along with those of other depositors (in our example, Bob and Tom), begin to accumulate in the segment responsible for placing new deposits in the Beacon chain. This segment is denoted as the Deposit & Staking infrastructure. These funds may also be used to pay an interest to users who decide to finalize their deposit and withdraw their money.
  • Imagine that in addition to Alice, Bob (with 15 ETH) and Tom (with 16 ETH) also made deposits. Now Lido has accumulated enough ETH to create a stake (a multiple of 32 ETH is required) - the protocol can make a deposit in the Beacon chain and start earning from the amount deposited.
  • For this, the Deposit & Staking infrastructure receives information from the Node Operator about the new validator - their public key, signature, withdrawal address, and the protocol module on which the deposit will be made.
  • Once all the data is collected, a group of validators verifies this information and signs it, protecting Lido from the possibility of front-running deposit transactions. After receiving all necessary signatures, the contract checks the correctness of the transmitted data.
  • Lido then performs final checks for the correctness of the keys, waits for the deposit process to complete, and the users’ funds finally begin participating in staking and earning interest!

But what happens if Alice wants to withdraw her funds?

Withdraw

Simplified scheme for withdrawing funds and receiving interest from participation in Lido’s operation.

Simplified scheme for withdrawing funds and receiving rewards

  • To withdraw her funds, Alice simply needs to submit a withdrawal request and wait for its finalization. After finalization, the unstaked 1.1 ETH (Assume that stETH balance increased on 0.1 ETH during the hold period via rebase mechanism) will become available to claim by Alice’s address, and 1.1 stETH will return to Lido’s balance, where it will then be burned. While stETH is a rebase-token, Alice will earn her interest by simpling holding stETH on balance, which will increase in the value during the time.
  • Within the on-chain infrastructure, all withdrawal requests are compiled into a Withdrawal Queue, which is then processed within the withdrawal infrastructure, marked in red on our diagram.
  • After the Ejector Oracle analyzes the list of all Lido validators, it will choose the most suitable ones, eject them and return the unstaked funds to the vault of Withdrawal Infrastructure.
  • After the funds are returned to Lido’s contracts, earnings for each withdrawer will be calculated and subsequently paid out.

Lido also provides an opportunity to withdraw funds using Withdrawal NFT, but we will talk about it in the part II.


Conclusion

So, we have briefly reviewed the history of the protocol and examined what happens at a high level when a user deposits or withdraws ETH.

In subsequent articles, we will delve into each of the modules involved in this process in detail, as well as explore the withdrawal procedure, so that you can get answers to your questions and appreciate the depth and innovation of this remarkable protocol. This series will also serve as a practical guide, making it easier for you to tackle applied and research tasks.

Our primary focus will be to understand the Lido consensus mechanism, which will be covered in the next article of our series.


References

Terms

[1] - Protocol APR

By Protocol APR we mean gross annual percentage rate — the overall Consensus Layer (CL) and Execution Layer (EL) rewards received by Lido validators to total pooled ETH estimated as moving average of the last 7 days.

[2] - Performance of Lido Validators

The better the operator’s main parameters are tuned, the more reliable, resilient and performant the underlying protocol is.

[3] - Protocol fee

Lido applies a 10% fee on staking rewards that are split between node operators and the DAO Treasury. The fee can be changed by the DAO pending a successful vote.

Resources

[4]- What is Lido?” - Article by Sunflower Corporation

[5]A Dive into ETH Liquid Staking, Node Operators, Shanghai, Future Innovations, and DVT”

[6] Lido documentation

[7] Lido-dao Github

[8] Aragon DAO educational portal

Telegram
Case Study

Contents

Telegram

Have a question?

Have a question?

Stay Connected with OXORIO

We're here to help and guide you through any inquiries you might have about blockchain security and audits.