Sui Liquidity Staking Hackathon|Those hard-core SUI staking knowledge that you may not know

Registration for the Sui Liquidity Staking Hackathon is in full swing (closed on September 16). The Sui Foundation sincerely invites developers from all over the world to participate and help recirculate assets. Learn more about the hackathon: Sui Liquidity Staking Hackathon opens for registration, win tens of millions of US dollars in pledges and rewards!

Hackathon Official Website: Sui Liquid Staking Hackathon

On August 30th, Alonso, the chief economist of Mysten Labs, brought you the workshop sharing of "Sui Pledge and Economic Model Introduction"  , which is one of the Workshops series activities launched by the Sui Foundation during the hackathon. Professional guidance. The following is the main content shared by Alonso.

Main uses of SUI

  • PoS : used to participate in the delegated proof-of-stake mechanism
  • Gas mechanism : used to pay for network transactions and storage fees
  • Providing liquidity : Providing on-chain native liquidity in the Sui economy
  • Community Governance : Governance that may affect Sui’s future

Pledge process

Q1: What is a staker?

Anyone with a Sui address can stake SUI by staking it to one or more validators of their choice, including validators who pledged SUI or third-party SUI holders.

Q2: Where did the pledged SUI go?

Rest assured they are safely locked at your address! Unlike existing liquidity staking solutions in other networks, where stakers are required to hand over control of their staked tokens to a third-party liquidity staking smart contract. Sui allows SUI holders to stake their SUI directly to the verification node of choice while retaining full control of their locked pledge tokens. The pledge token is protected by the Sui protocol layer and is not affected by vulnerabilities of third-party smart contracts.

Q3: What is a pledge pool?

Each Sui validator node maintains its own staking pool to track the amount staked and accumulate staking rewards. The validator pool operates with a time-series exchange rate calculated at each epoch boundary. These exchange rates determine the amount of SUI that each past SUI staker can withdraw in the future. Importantly, as more rewards are deposited into the staking pool, the exchange rate will increase, and the longer SUI is deposited into the staking pool, the more rewards will be accumulated.

Each validator node has an exchange rate time series corresponding to its specific staking pool, stored on-chain within the staking pool object. From the perspective of SUI stakers, the value of their pledges can be tracked through the following consensus.

SUI at E' = (SUI deposited at E) * (Exchange rate at E'/Exchange rate at E)

Conceptually, staking pools operate exactly like liquidity pools. When SUI is deposited into the pledge pool at epoch E, it will be converted into a liquidity token based on the exchange rate of epoch E. As the staking pool receives rewards, the exchange rate increases. At epoch E', these liquidity tokens have a higher value and can be converted into more SUI.

The only difference between Sui staking pools and typical liquidity pools is that in Sui, the liquidity tokens do not exist. Instead, the global exchange rate table is used to track calculations. An advantage of this design is that since all SUI in the staking pool are the same, regardless of whether they were originally deposited as new staking or as staking rewards, all SUI is immediately considered staking, so rewards are compounded immediately.

The staking pool is a system-level smart contract ( staking_pool.move ) and is also part of the Sui framework.

Q4: What stages has the development of SUI staking gone through?

Staking v1: [original design, deprecated]

This design was used in the second phase of the testnet, but it has now been deprecated. Two major implementations have now been removed:

Previously, the staking process was divided into two stages. First, after the staker deposits SUI, he immediately obtains a StakedSUI object containing the locked SUI. Secondly, at the end of the epoch, once the exchange rate of the pledge pool is updated, the user obtains a Delegation object containing the user pool token. The Delegation object has to wait until the epoch is closed because the exchange rate at the end of the epoch cannot be known in advance because it depends on the amount of gas fees collected throughout the epoch. This approach requires reconfiguring a lot of transactions at epoch boundaries, so the Delegation object has been removed in Staking v2 (see below).

Previously, when a pledge withdrawal was performed, the withdrawn pledge entered the pending pledge state and was processed after the epoch closed at the epoch boundary. The reason for this is that since the staking rewards for the current epoch are determined throughout the epoch, the exchange rate at the end of the epoch cannot be fully predicted while the epoch is still active. Therefore, this design waits for the epoch to close before processing a retrieval with an updated exchange rate. This situation no longer exists and retrieval will be processed immediately at the exchange rate of the previous epoch.

Staking v2: [Current Mainnet Design]

The two main changes are:

  1. Accounting for staking pools has been simplified. As before, when a user stakes SUI, these objects are wrapped into StakedSUI objects. However, the pledge pool no longer implements each user's relative ownership of the pledge pool through the Delegation object. Instead, accounting is performed directly through the StakedSUI object's timestamp (which determines the point in time when the deposit occurred) and the change in the exchange rate between the deposit epoch and the withdrawal epoch. The data structure of each staking pool contains a time series of the exchange rate for that pool. These exchange rates can be used to determine withdrawals for any staker in the pool.
  2. Staking withdrawals will be processed immediately based on the exchange rate of the previous epoch, without waiting for the current epoch to close. Withdrawals include the original stake deposited by the user and all staking rewards accumulated to the previous epoch. The disadvantage of this method is that stakers will not receive their staking rewards during the epoch of withdrawal. Until the epoch closes, since there is no way to know in advance how many staking rewards will be accumulated during the current epoch, they cannot be included in withdrawals. Therefore, any user can immediately withdraw their stake and get: epochE'retrieved SUI = (epoch E deposited SUI) * (epoch E'-1 exchange rate / epoch E exchange rate)

Staking v3: [Future Update]

This is a long-term solution that will eventually be pushed to mainnet.

The main challenge with the staking v2 design is the inability to handle unbonding (or cooldown) periods, which are critical to network security. This is achieved by modifying how Sui handles fetch requests, breaking it into two steps:

  • In the first transaction, the staker will submit a withdrawal request and receive a WithdrawalReceipt. At this time, stakers will not receive any SUI.
  • In the second transaction, once the scheduled unbonding period has passed, stakers can submit a WithdrawalReceipt and receive their SUI stake and accumulated rewards.

Importantly, in addition to enabling the unbind period, this design allows users to get the full reward they deserve after withdrawing the WithdrawalReceipt, since the withdrawal must be done at the end of the epoch in which the withdrawal request was submitted. This design does not suffer from the challenges of staking v1 causing very large reconfiguration transactions, because WithdrawalReceipt objects can be redeemed at any time (once the unbonding period ends) and are not dependent on epoch boundaries.

Q5: When will my pledge deposit request take effect?

Once a staking deposit request is submitted, it immediately enters the pending state in the staking pool. Sui Wallet will reflect any pending staking deposit requests for user accounts. However, pending staking deposit requests will not take effect until the end of the epoch in which they were requested.

Q6: When will my unstaking request take effect?

Once received, unstaking or withdrawal requests will be processed immediately. Stakeholders will receive the SUI originally deposited and all staking rewards accumulated up to the previous epoch boundary. In other words, they do not include staking rewards for the current epoch. See Staking v2 for more details on this implementation. Please note that in the future, once staking v3 is implemented, unstaking requests will not be processed immediately.

Q7: How to calculate the exchange rate of each validator pool?

The exchange rate for each validator pool is calculated at each epoch boundary as follows:

Exchange rate at E+1 = (1 + (Staking reward at E/Stake amount at E)) * (Exchange rate at E)

Importantly, the staking rewards earned by stakers during epoch E are a subset of the total staking rewards earned by the validator pool during that epoch. In other words, the total staking reward earned by a pool of validators can be divided into three separate parts, depending on who earns them:

Staking reward = staker reward + verification node commission + storage fund reward

Ordinary SUI stakers only receive staker rewards. At the same time, validators receive a commission charged on these rewards (Validator Commission) and rewards attributed to the storage fund.

The exchange rate of the validator pool is only updated by the amount of staker rewards so that the rewards earned by SUI stakers are fully tracked. However, this calculation method also enables Sui to track rewards earned by validators by providing validator commissions and storage fund rewards to validators in the form of additional StakedSUI objects via updated exchange rates

Q8: Compared with third-party SUI holders, how is the staking process of verification nodes different?

The process is the same. A validator that stakes SUI with its validator will follow the same process as any third-party SUI holder that stakes with that validator.

Q9: How is the staking reward accounting for validators different compared to SUI stakers?

In a given validator staking pool, all stakers receive the same proportion of rewards through the appreciation of the pool’s exchange rate. Additionally, since validators earn commissions and storage fund rewards for managing staking, validators receive additional StakedSUI objects proportional to these amounts at the end of each epoch.

Staking rewards

Q1: Where do staking rewards come from?

Staking rewards come from the transaction gas fees collected during the current epoch and the staking allowance released at the end of the epoch.

Staking reward = Staking allowance + gas fee

The staking subsidy is designed to subsidize the early stages of the network and is funded by 10% SUI. Once this allocation is exhausted, the entirety of staking rewards will be made up of gas fees collected through regular network operations.

Q2: Will the staking rewards compound interest automatically?

Yes! Please see the answer to "Q3: What is a staking pool" above.

Q3: How many staking rewards will there be on the mainnet?

Staking rewards are composed of gas fees and staking allowances. The total amount distributed at each epoch is determined as follows:

  • Staking Allowance : The amount distributed for each epoch is determined according to a predetermined schedule before the epoch begins.
  • Gas fee : The amount of each epoch depends on the total gas fee collected during the entire epoch. Each Sui transaction pays a gas fee based on two variables, the gas unit executed and the gas price: gas fee = gas price * gas unit

The total gas fee collected corresponds to the sum of gas fees for all transactions processed within the epoch. Under normal market conditions, we expect that the gas price for the vast majority of transactions will be equal to the reference gas price. In the future, Sui will introduce a congestion pricing mechanism so that when the network is congested, the gas price will be higher than the reference gas price because users will actually tip the validator nodes in exchange for priority.

Staking limit

Q1: Can I unstake part of my active validator node stake?

This is not supported. The unstaking of each StakedSUI object is either completely released or not released.

However, users can stake any number of SUI objects to any validator node. So if they unstake a portion of the SUI object from a validator, they can actually partially unstake it from the validator. Since a StakedSUI object can be split into multiple objects, if the staker first splits a StakedSUI object into several objects and then unstakes some of the objects, the staker can always effectively unstake a portion of the object.

Q2: What is the minimum pledge amount for a single verification node?

The minimum pledge amount is 1 SUI.

Q3: What is the relationship between the verification node’s pledge and the voting rights in the consensus?

By convention, regardless of the amount pledged, the total voting power is always 10,000, so the legal threshold is 6,667 (2/3 ratio). Each validator's consensus voting power is proportional to its stake, with one exception: a single validator's voting power is capped at 1,000 (10% of total voting power).

Q4: What is the maximum pledge amount for a single verification node?

no limit. However, in consensus, the voting power of a single validator is capped at 10%. If a validator accumulates more than 10% of the total stake, then that validator's voting power will remain at 10% and the remaining voting power will be spread across the rest of the validator set.

Similarly, validators' share of staking rewards will also be calculated using the same 10% cap to manage the amount staked (see staking reward calculation). In other words, once a validator accumulates more than 10% of the total stake, the SUI reward per stake will start to drop, as the staking pool no longer increases the amount of staking rewards it gets.

Staking reward calculation

Warm reminder: There are too many formulas, so those who are interested are advised to read them carefully.

Verification node

Q1: What is the reference gas price and when do verification nodes need to participate?

Sui is designed so that end users can expect gas prices to remain stable and predictable during regular network operations. This is achieved by validating nodes setting the network’s reference gas price at the beginning of each epoch.

Operationally, this is achieved through "gas price survey", the steps are as follows:

  • During each epoch E, each validator submits what they think is the best reference gas price for the next epoch E+1.
  • At the epoch boundary, when Sui transitions from epoch E to epoch E+1, the network will observe the gas price in the verification node set, and will weight the votes at 2/3 as the reference gas price for the next epoch. Therefore, the reference gas price for each epoch is constant throughout the epoch and is updated only when the epoch changes.

The process of submitting a quote for a gas price survey is very simple. Each validator node owns an object containing their reference gas price. If validating nodes wish to change their quotes, then they simply update the value in this object. Validating nodes can delegate the ability to set gas price quotes to other accounts by transferring their operational capabilities objects.

Q2: What does the statistical rule look like, and when does the verification node need to participate?

Sui is designed to encourage and enforce community monitoring of the validator set. This is achieved through statistical rules where each validator monitors and scores every other validator to ensure everyone is operating efficiently, with the best interests of the network in mind. Those non-compliant validators will be fined and their staking rewards will be reduced.

The protocol only calculates global statistical rule scores at epoch boundaries and therefore relies on active monitoring by validators and changing their individual scores when it detects changes in the behavior of other validators. In general, the default option for statistics rules should always be a score of 1 for all validating nodes, and only change to zero if improper operation is determined. In practice, statistical rules consist of a set of objects owned by each validator that have a default score of 1, so validators typically passively update only objects corresponding to the scores of other validators when needed. Similar to submitting gas price quotes, validating nodes can also delegate their power to participate in statistical rules to other accounts by transferring their operational capability objects.

Q3: On what basis is the verification node assigned 0 points in the statistical rules?

Statistical rules should be implemented through social equilibrium. The set of validators should actively monitor themselves, and if a validator is clearly underperforming, the other validators should give that validator a 0 score and cut its rewards. In the future, as the Sui network matures, we expect the community to launch a public dashboard to track the performance of validator nodes and can be used as a signal to further understand the operation of validator nodes.

Q4: Can multiple verification nodes be given 0 points?

Yes. Through statistical rules, each validator scores every other validator, and there is no limit on how many 0 or 1 points each validator can submit.

If you have more questions about Liquidity Staking Hackathon or SUI Staking, please join the Slack workspace and ask questions: Slack

Chinese developers can join the Sui Chinese Telegram group to ask questions and communicate:  https://t.me/sui_dev_cn

We look forward to your joining!


About Sui Network

Sui is an L1 public chain redesigned and built based on first principles, aiming to provide creators and developers with a development platform capable of hosting the next billion users in Web3. Applications on Sui are based on the Move smart contract language and are horizontally scalable, allowing developers to support a wide range of application development quickly and at low cost. Get more information: https://linktr.ee/sui_apac

Official website | English Twitter | Chinese Twitter | Discord | English Telegram group | Chinese Telegram group

Sui

hackathon

Guess you like

Origin blog.csdn.net/Sui_Network/article/details/132635808