TL;DR
This proposal aims to build a Staking mechanism, a delegate mechanism and a front-end for the end users and keypers of the Shutter delegate and Stake. It outlines the MVP and a V1 for future work.
Introduction
The staking mechanism will play an important role in guaranteeing the Shutter Network’s security and functionality. By enabling SHU staking, the Shutter validators, known as “keypers,” who are responsible for managing the cryptographic keys used in the protocol, will be incentivized and rewarded for their commitment to the network. When a keyper stakes their SHU tokens, they will earn a percentage of the fees generated by the protocol. Meanwhile, SHU holders can also earn rewards by delegating their staking tokens to keypers they trust. This creates more utility for SHU tokens, which can counteract sell pressure and increase the security of the Shutter network by creating a reputation mechanism for keypers.
Objectives
MVP Objectives:
- Encourage Keyper Participation: Provide an incentive for keypers to participate in the network by staking SHU tokens and showcasing their commitment to the role.
- Enable Community Support: SHU token holders can delegate their SHU tokens to support specific keypers, enhancing the network’s security and decentralization.
- Reward Long-Term Commitment: Offer rewards to both keypers and SHU token holders who lock their tokens and support the network over time.
- Counter Selling-Pressure: Periods with intense selling pressure can be solved with staking and lock periods.
V1 Objectives (to be approved by the Shutter DAO)
- Layer-2 Governance: Allow users and keypers to vote on-chain by using layer-2 scalability, reducing fees and efficiency
- Keypers approved by delegated amount: The smart contract will make this process seamless and less manual by approving keypers through delegating and DAO Governance.
- Voting power by delegated and staked tokens: This allows keypers to increase their voting power on the DAO using their staked and delegated tokens.
Development process
At Blockful, we take security measures very seriously when developing smart contracts. Our team uses industry-leading tools and follows best practices to ensure that our code is flawless and bug-free. In order to achieve this, we are committed to implementing the following approaches across all smart contracts:
-
During Smart Contract Development:
- Unit tests with 100% line coverage and 100% branch coverage, if possible
- Fuzzing tests on critical functions like stake and redeem.
- Integration tests running on mainnet fork to make sure that the Staking Contract, Delegate Staking Contract, and the SHU ERC20 contract operate seamlessly and bug-free.
- Run AST tools analyzers like Slither and Aderyn
- Throughout code review
-
After code frozen
- Deploy all the contracts to L1 and L2 testnets and conduct thorough testing
- Internal audit
MVP Scope - Technical Specification
Blockful proposes creating two contracts for the MVP and deploying them to L1 and L2. The first contract is the Keyper staking contract, which allows Keypers to stake their SHU tokens and earn rewards. This will give them an opportunity to showcase their commitment to the project. The second contract is the Delegate Contract, which permits SHU holders to delegate their tokens to a Keyper they trust. This contract will also facilitate the community’s involvement in selecting and supporting a Keyper.
Scope
Staking contract
Currently Shutter AddrsSeq contract uses Arrays for store keypers. That makes integrating with the Staking contract really hard as we can’t easily retrieve whether a given address is a keyper or not to create restrictions on the stake function. Therefore, there a two options:
-
Deploy a new contract that uses mapping instead of arrays (Deploy on both L1 and L2)
-
Builtin the keyper whitelist functionality directly on the Staking’s contract (L1 and L2).
We recommend going with option two since there have been some conversations in the DAO about enforcing a minimum staking requirement for keypers. By selecting this option, we can easily switch to a new design in the future where to become a keyper, you must stake the minimum SHU threshold decided by the DAO. We could even take community participation to the next level by integrating the Staking Contract with the Delegation Contract and creating a system where becoming a keyper also requires a minimum threshold of delegation tokens.
The staking contracts on L1 and L2 should be identical. The SHU token is assumed to have been deployed on both layers. It is worth noting that the proposal does not include bridging SHU tokens. If the DAO wants, Blockful can propose the development of SHU xERC20 token on Layer 2 in a separate scope.
-
Contract design:
- Upgreadeble: The DAO should be able to expand the contract in the future, which can be achieved through upgradeability. This will enable the DAO to develop additional features to the staking contract. For instance, the DAO may choose to make the staking contract compatible with ERC20, thereby creating a secondary market of staked tokens. This would enable staked SHU price discovery on AMMs, transfers, etc. Furthermore, it may also opt to make the staked contract compatible with ERC20Votes, which gives keypers the ability to use staked SHU as a voting power for the DAO. The contract’s upgradeability will ensure that the DAO can evolve and create a healthy ecosystem by implementing these enhancements.
- Ownable:
- The contract should inherit Open Zeppelin Ownable2Step
- Owner should be the DAO multisig at MVP
-
Immutable parameters:
- Staking token: this should be the SHU token on both L1 and L2.
- Lock period: The lock period refers to the minimum duration in seconds that must pass after a keyper stakes before they can withdraw their principal. We believe that this parameter should be immutable to ensure that keypers can trust that their SHU tokens will not be locked for longer than they expect.
-
The following parameters are controlled by the DAO:
- Rewards tokens: DAO can set as many rewards tokens as it wants
- Reward rate per token: DAO can choose the reward to be paid per second to each token.
- Stake minimum threshold: the minimum amount of SHU that the keyper must stake. This will be set to 0 at MVP time, and the DAO can vote to change this parameter later.
- Keypers list: The DAO can add or remove keypers from its list, which will restrict the staking function only to those on the list at MVP. The contract can be upgraded in the future to allow anyone to become a keyper as long as they meet the minimum SHU staked and delegated threshold.
-
Interface
I) Called only by keypers:
stake
: only addresses belonging to the keyper mappings are able to stake at MVP
II) Permissionelees :
redeem
: allow keyper to redeem staked SHU after the minimum X months and stop earning rewardsgetAccumulatedRewards
: allow keyper to get the amount of rewards they have accumulated until the current block.timestampcollectRewards
: allow keypers to collect SHU/ETH (or any other token the DAO decides) rewards accumulated over timeisKeyper
: utility function that will be called on the Delegate Staking Contract to verify if an address is a keyper or not
III) Called only by the Owner:
-
configureRewardToken
: allow the DAO to configure the rewards token. Accept two parameters:1. Emissions per second 2. The underlying reward token
-
configureRewardsToken
: same as above but allows configuring multiple tokens in a single call. -
updateKeypers
: allow the DAO to update the keypers mapping, adding or removing keypers.
Delegate Staking Contract
The Delegate Staking Contract enables SHU holders to delegate their tokens to a trustworthy Keyper and earn a share of the fees generated by the Shutter ecosystem.
The Delegate Staking Contracts on L1 and L2 should be identical. The SHU token is assumed to have been deployed on both layers. It is worth noting that the proposal does not include bridging SHU tokens. If the DAO wants, Blockful can propose the development of SHU xERC20 token on Layer 2 in a separate scope.
-
Contract design
- Upgreadeble: The DAO should be able to expand the contract in the future, which can be achieved through upgradeability. This will enable the DAO to develop additional features to the Delegate Staking contract. For instance, the DAO may choose to make the Delegate staking contract compatible with ERC20, thereby creating a secondary market of delegated staked tokens. This would enable delegated staked SHU price discovery on AMMs, transfers, etc. Furthermore, it may also opt to make the staked contract compatible with ERC20Votes, which gives holders or keypers (using the delegated tokens) the ability to use the staked SHU as a voting power for the DAO. The contract’s upgradeability will ensure that the DAO can evolve and create a healthy ecosystem by implementing these enhancements.
- Ownable:
- The contract should inherit Open Zeppelin Ownable2Step
- Owner should be the DAO multisig
-
Immutable parameters:
- Staking token: this should be the SHU token on both L1 and L2.
-
The following parameters are controlled by the DAO:
- Rewards tokens: DAO can set as many rewards tokens as it wants
- Reward rate per token: DAO can choose the reward to be paid per second to each token.
-
Interface
I) Permissionelees:
delegate
: It’s possible for anyone to delegate tokens to any keyper they choose. The function will then call the Keyper Staking contract and verify whether the delegated address belongs to a keyper or not.redeemFrom
: Users should be able to redeem their delegated staked SHU by entering the desired redemption amount and specifying the keyper they are redeeming from.getAccumulatedRewards
: allow users to get the amount of rewards they have accumulated until the current block.timestampcollectRewards
: allow users to collect SHU/ETH (or any other token the DAO decides) rewards accumulated over timegetDelegatedBalance
: get the balance delegated for a given account
II) Called only by the Owner:
-
configureRewardToken
: allow the DAO to configure the rewards token. Accept two parameters:1. Emissions per second 2. The underlying reward token
-
configureRewardsToken
: same as above but allows configuring multiple tokens in a single call.
Frontend
Delegate and Stake button. Allow the display of keyper yield and amount of delegated tokens.
Estimation
Feature | Time to Develop |
---|---|
i) Staking contract (L1 and L2) | 3 weeks |
ii) Delegate contract (L1 and L2) | 3 weeks |
iii) Testnets deployment and tests | 2 week |
iv) Internal audit | 1 week |
iv) Front-end | 3 weeks |
v) Design | 1 week |
Proposed Team
Ana Julia Bittencourt (Smart Contract Engineer)
Linkedin: https://www.linkedin.com/in/anajuliabit//
GitHub: anajuliabit (Ana ) · GitHub
Alexandre Vieira Souza (Full-stack Engineer)
Linkedin: Alexandre V. - alt.bank | LinkedIn
Github: AlexandreUser (Alexandre Vieira) · GitHub
Gabriel Novak (Project Manager)
Linkedin: https://www.linkedin.com/in/gabriel-novak/
Budget
We propose an additional allocation of 10.000 USDC to develop the staking and delegation contract specifically designed for Layer 2 solutions and an additional budget of 10,000 USDC for auditing the smart contract by an independent auditor.
Thus, the total proposal for MVP is as follows: 50,000 SHU tokens and 35,000 USDC + 10.000 USDC for a Blockful audit with an independent auditor of this MVP.
V1 Scope - Technical Specification and Estimation (To be approved by the DAO)
Although the following scope is not a part of Shutter DAO’s proposal requirements, we at Blockful are committed to ensuring the best possible experience for DAOs. To that end, we propose an improvement to the DAO governance process by expanding the current governance model to a cross-chain model. This would allow users to vote on both L1 and L2 and utilize staked and delegated tokens for voting. By doing so, we can increase stakeholder governance power. Additionally, we aim to automate the DAO process by making the Keyper selection process more streamlined, less manual, and more community-driven. We will use a holders delegation threshold to increase community power and a Keyper staking threshold to reduce the chance of malicious Keyper. By doing this, we can increase the SHU network security.
Scope
Staking contract upgrade
- Make the Staking contract compatible with Open Zeppelin ERC20Votes.
- Call Delegate Staking contract and approves staking based on the amount of delegated tokens the keyper has.
- Keyper can decide whether they wish to distribute rewards among SHU holders who have delegated tokens to them and the amount of rewards they would like to distribute.
Delegate contract upgrade
- Make the Staking contract compatible with Open Zeppelin ERC20Votes.
- Remove isKeyper validation and allow delegation to anyone.
- In addition to the rewards provided by the DAO, individuals who delegate to a keyper will also receive a portion of their rewards.
Cross-chain governance infrastructure
Creates a new governance infrastructure with the following architecture
- Voting power is the sum of SHU staking tokens, SHU delegate staking tokens, and SHU tokens.
- The system is designed to operate across both L1 and L2 chains.
- Proposals can be created on either chain and once a new proposal is created, a cross-chain message is sent to the other chain as well. Voting can take place on both layers, but once the voting period ends, the votes must be emitted from the secondary chain to the one that originates the proposal. They are then tallied, and if the governance threshold is met, the status moves to succeed, and the proposal can be executed on the original chain.
- Ownership Is transferred from the DAO multisig to the governance contract.
Estimation
Feature | Time to Develop |
---|---|
i) Staking contract upgrade | 3 weeks |
ii) Delegation contract upgrade | 3 weeks |
iii) Cross-chain governance infrastructure | 8 weeks |
v) Updates on the Front-end | 3 weeks |
Budget
The budget for this implementation will come after the implementation of the MVP, as previously shown, Shutter DAO can have an idea of how much will cost the development of the overall application, MVP and V1.
Thus, the total proposal only for the V1 is as follows: 50,000 SHU tokens and 45,000 USDC + 15.000 USDC from a Blockful audit with an independent auditor.
About Blockful
Our expertise lies in crafting blockchain Public Goods solutions and applications for DAOs, offering tailor-made solutions to meet their unique need.
Twitter: https://twitter.com/blockful_io
Linkedin: Blockful | LinkedIn
Website: blockful.io
Github: Blockful · GitHub
Past services:
ENS Official Services Providers (check the proposal).
We received a grant to build and improve ENS:
- User experience [UX]
- Developer experience [DX]
- Platform sustainability [PS]
- Governance improvements [Gov]
This is a feedback from Avsa (ENS co-founder) about our deliveries and work ethics.