lido-dao
lido-dao copied to clipboard
Off-chain storage & management for Lido validators' keys
Prize Title
Off-chain storage & management for Lido validators' keys
Prize Bounty
3000 LDO (ERC20)
Challenge Description
Lido is a liquid staking protocol on Ethereum. The crucial protocol actors are Node operators: teams running ETH2 validator nodes and earning ETH2 beacon chain rewards for the protocol. Every validator has a key+signature pair conforming to the spec and the signature must contain the protocol's withdrawal credentials. Also, the keys must be unique. The protocol governance checks the key+signature pairs before allowing to delegate ether to new validators. The delegation method is permissionless. If there are no unused and approved key+signature pairs, no ether gets delegated on the delegation method call.
Currently the protocol stores all the operators' keys in the separate smart contract — Node operators registry. This results in significant gas costs, as the need in blockchain storage grows linearly with the amount of ether deposited. The challenge is to bring operators' keys off-chain and build the process for operations in such a setup. The possible method for validating the keys is Merkle-tree proofs.
The goal is to implement proof-of-concept: the key management smart contract, off-chain tooling and the demo code for the happy-path scenario.
Submission Requirements
Valid submission to win the prize consists of the open source PoC for the off-chain validator key management. The solution should:
- Not rely on storing the validator keys on the smart contracts.
- Have the demo of the working system. There are three actors in the demo: Node operator, Governance and Stranger. Node operator submits the data on key+signature pairs, Governance checks and approves the keys for delegation, and Stranger calls the delegation method which takes next approved key and uses it.
- The delegation method delegates the ether only to the keys which are approved and aren't used yet.
Note that the use of the actual ETH2 deposit contract isn't required and the mock will suffice. Having more than one Node operator in the proof-of-concept also isn't required. You can and probably should also mock/TODO most of Lido outside of adding keys and making deposits including the governance inner workings.
As a starting point please take a look on the Dummy Node Operators Registry storing the key pairs on-chain: https://gist.github.com/kadmil/e6c648a02cd656d41fa983615c4a21a3
Current production implementation you can find here: https://github.com/lidofinance/lido-dao/blob/master/contracts/0.4.24/nos/NodeOperatorsRegistry.sol
The submission must contain instructions for running the code and the happy-path in the README.md
Further reading
- Lido Primer
- Lido Documentation
- Node Operator Registry smart contract deployment
- Node Operator manual with the current key submission/management process details
Judging Criteria
The winner would be chosen between the submissions with working PoC demo made by the deadline. Assessment criteria are:
- Working prototype with the the happy-path scenario
- Meets the tech requirements
- Clean code
Winner Announcement Date
Winners will be announced at the conclusion of Open-Defi hackathon.