This proposal has also been discussing on community forum: https://forum.phala.network/t/proposal-stakepool-v2-and-vault-launch/3784
This proposal aims to upgrade the 'Delegate to Earn' mechanism on the Khala network. After the upgrade, a Delegation NFT is assigned as a certificate for users' delegations which solves the withdrawal issue caused by lock-up time. Furthermore, automatically compounding delegator rewards will replace having to claim rewards manually which will improve delegation efficiency. In addition, we are introducing a major new feature called Vault, which allows users to pass the management of delegation to the Vault operator. Vault operators will manage delegations to individual StakePools on behalf of their delegators which will further enhance delegation efficiency. This will also lower the barrier to entry significantly.
Update 1: An NFT representing each delegation share
Your delegation positions in each pool are now represented as NFTs in StakePool V2. Like any other NFT, they will be transferable and tradable in the PhalaWorld NFT marketplace. As a result, using NFT technology to represent pool shares, the liquidity of your delegation is dramatically increased. Instead of having the sole option of waiting upto 7-14 days to withdraw, you can now trade your StakePool delegation on a secondary marketplace for potentially immediate liqudity.
Update 2: Automatically compounding delegator rewards
Delegator rewards can be automatically reinvested in the same StakePool or Vault. As a result, there is no longer a need to manually claim rewards periodically.
Update 3: Vault - Lowering risk and barrier to entry
Inspired by many DeFi protocols, we present a Vault feature that allows third party operators to manage the delegation of your funds across multiple StakePools in a non custodial fashion. Vaults are pools of funds which can be delegated across any number of StakePools by the Vault operator on behalf of their delegators. The choice of strategy a Vault operator pursues can lead to maximum returns and minimal worker downtime risk to enable premium efficiency for the Vault delegators. Vault operators are incentivised to pursue the best possible strategy for their delegators by receiving a percentage of the rewards.
For many delegators, they will not necessarily have the time or experience to manage individual StakePool delegations in an optimal fashion. Even if they attempt to manually manage their delegations, choosing the wrong pools can be an expensive mistake. These mistakes not only affect their delegation rewards but also effect the stability of the whole network. Our new Vault feature solves all of these issues in one go. A small group of Vault operators, for a fee, effectively can manage the StakePool choices for a large chunk of the user base. This allows them to obtain optimal rewards while incentivising the best run and most stable StakePools, improving the quality of the network for everyone.
As with delegating to StakePools, when a user delegates to a Vault, they will receive a Delegation NFT. The delegations in the Vault also compound interest.
Update 4: New WrappedBalances pallet and Governance Voting
In StakePool V1, delegation could still be used for governance voting. However those tokens were "locked". This meant the tokens could not be transferred or traded.
In StakePool V2 with an NFT now representing a delegation and being tradable, we need to introduce a mechanism to transfer governance voting rights of the original stake when the NFT is traded. To do this, we need to introduce the concept of WrappedBalances and Wrapped-PHA (W-PHA).
In StakePool v2 you need W-PHA in order to be able to delegate to a StakePool or Vault. You can always exchange PHA to W-PHA in a one to one fashion. A new pallet called WrappedBalances handles this exchange via smart contract automatically. When a user withdraws they can then convert their W-PHA back to PHA in a reversal of the original exchange. W-PHA and PHA are always 1:1.
The WrappedBalances pallet enables the tracking of W-PHA. When the user delegates W-PHA to a pool they receive a Delegation NFT which acts a certificate of proof of the share in the pool. This allows the W-PHA to be held by the StakePool or Vault, but be associated with the address of the account that holds the Delegation NFT.
WrappedBalances uses a proxy voting mechanism. When you exchange PHA to W-PHA, the voting rights of the PHA transfer along to the W-PHA. Delegators can vote for a proposal through the WrappedBalances pallet; it will temporarily lock part of or all of their W-PHA assets to represent the fact these tokens are being used for a governance vote. These locked W-PHA cannot be transferred, or exchanged back to PHA, until your vote has finished.
So far, WrappedBalances does not support council elections. This feature will be developed within two months after this upgrade. However, because the current total Delegation on the network is close to 190 million PHA, to avoid this impacting council elections, we will freeze the election function until we support this feature.
Upgrade process impact
Computing & Delegate related on-chain functions must be stopped during the upgrade
Due to the fact this upgrade involves the entire delegation mechanism, this upgrade will have to be split across multiple blocks, which has never happened in Phala or even in other parachains.
Therefore the time required to complete this upgrade will be non trivial. This means that we need to stop all functions related to StakePools, Workers, Delegation, and Computing Rewards on the chain. This may take upto five days.
Breaking upgrade on pRuntime & PRB
During the on-chain upgrade computing providers are highly encourage to upgrade their own stack. Changes to the chain will break any existing version of PRB, and so the PRB update is a critical one. pRuntime compatability with the new chain will only support the most recent versions and so an upgrade of this is strongly recommended too. We will provide an exact version number on the PRB monitor page to ensure that compute providerscan determine whether their PRB upgrade is successful.
Computing Rewards will be delayed for 8 Days
Due to the pausing of all chain functions related to Workers they will all go unresponsive as soon as this upgrade starts and will remain in that state at least as long as the upgrade is ongoing. Therefore we have developed a new function that can suspend the distribution of computing rewards within a certain period. Once this reward pause period finishes, at the first heartbeat event, each worker will be paid the full reward for the entire pause period. But, of course, it requires the worker to have been active before the reward pause period starts and be active after it stops. We feel this is the fairest solution for the community.
Before the upgrade, we will determine the specific time period required to suspend rewards in advance, including the start block and end block and announce it to the community.
Phala App 2.0
We will substantially update the Phala App to deal with this on-chain upgrade. This includes the following:
- Being compatible with the functional changes of StakePool V2, including
- an NFT representing a share of a StakePool or Vault
- Automatically compounding delegator rewards
- Providing Vault usage and management pages
- Automated exchange between PHA and W-PHA
The app has been redesigned from the ground up, both under the hood and the user interface. This version strives to be mobile compatible from day one as well.
Council lists frozen, elections suspended
As mentioned above, starting from this upgrade, we will temporarily freeze the Council list and suspend council elections.
To ensure the Council election's fairness and the Council list's reliability, we will take a snapshot of the Council member list based on the last block before the upgrade and maintain the list until the election function is restored. We of course welcome and encourage the community to fully participate in council elections before they are paused.
Before the upgrade
- 30th Nov ~ 7th Dec Proposal discussion in the community
- 1st Dec ~ 7th Dec Internal Test
- 8th Dec ~ 14th Dec Public Vote for this proposal
- 8th Dec ~ 14th Dec Public Test
- 15th Dec (Estimated) New versions of pRuntime and PRB released
- 15th Dec ~ 23th Dec (Estimated) If the proposal passes, the 'upgrade' starts
The exact upgrade time (block height) will be announced in advance and voted on the motion by Council members.
During the upgrade
The length of the upgrade is not known ahead of time. The entire upgrade may take upto 5 days, though it may be much shorter, and if critical bugs are encountered it may also take longer aswell.
- 15th Dec Suspend the distribution of computing rewards
- 16th Dec On-chain upgrade starts, the Computing & Delegation related functions stop
- 16th Dec The Delegate and Mining pages of the Phala App pause and the Phala App upgrade starts. Compute providers can start to update their pRuntime and PRB.
- 21th Dec On-chain upgrade finishes. Computing & Delegation related functions start on chain. StakePool V2 and Vault on-chain functions officially launch
- 21th Dec - 23th Dec On-chain upgrade test period; Compute providers can register and start workers on chain or create pools during this period.
- 22th Dec Phala App 2.0 launches
- 23th Dec Resume distribution of Computing Rewards. The whole upgrade ends