Nym mixnet contract upgrade
The Nym mixnet smart contract is having a significant make-over. Most of this will not be very visible on the surface of things, but are…
The Nym mixnet smart contract is having a significant make-over. Most of this will not be very visible on the surface of things, but are essential improvements to the system in the long run. The most noticeable change will be that compounding will happen automatically and gas costs will be reduced due to a new, lighter data structure.
The contract upgrade and migration will happen early next week. There will be a platform release v1.1.0 immediately after (more details and release note on that soon). If you are running any of the Nym infrastructure (mix node, gateway, network requester, etc.) you will have to update your binaries so that they can keep working with the new contract.
NOTE: from this release, if you unbond your mixnode that means you are leaving the mixnet and you will lose all your delegations (permanently). You can join again with the same identity key, however, you will start with no delegations.
This blogpost gives a first overview of the reasons why a new contract is needed and the improvements you can expect from it.
Why a new contract?
There are three major reasons why the mixnet contract needs to be upgraded:
- The mixnet contract was storing too much contract state data. This meant that queries about rewards (from a wallet for example) required large amounts of gas, validators needed a custom configuration to support large queries, and eventually no one would be able to query for rewards because the whole thing would simply be too heavy. As a result, any query would always return 0 for rewards and rewards would not be visible until you unbonded (or undelegated). The new contract fixes this.
- The mixnet directory data structure of the mixnet needed a clean-up. The new directory structure will allow mix nodes to change their settings or even upgrade their nodes without the need to unbond. NOTE that this also means that when mix nodes DO unbond, they leave the mixnet and therefore they will lose all their delegations. They can rejoin, but will have to attract new delegations.
- Compounding was costing unnecessary gas fees. Whenever anyone compounded their rewards, this would cost gas. In the new version, compounding will happen automatically and without fees. Redeeming rewards will still incur fees.
What can I expect in the new contract?
The first thing to note is that there will be a new mainnet address for the contract, and the data structure will change. More details on this in the coming days.
For delegators:
- Compounding will be automatic — you no longer have to keep track of it or click on the compound button for compounding rewards.
For mixnode operators:
- Mixnode operators will be able to set their operating costs.
- Profit margin can be more granular.
- Operators can update their configurations without unbonding. What this also means is that if you unbond your mixnode that means you are leaving the mixnet and you will lose all your delegations (permanently).
- Change in saturation level to 730k per node, which means that more stake will be needed to reach full saturation.
Why is mixnode stake saturation changing?
The staking supply of NYM has increased due to quarterly vesting. Therefore there are more NYM tokens that can be staked, including all vested tokens and 10% of unvested tokens. Stake saturation depends on the available staking supply, the target level of staking, and the number of rewarded nodes. After the next vest the available staking supply will be around 350 million NYM. With 240 rewarded nodes and a target of 50% of available tokens staked this leads to a saturation stake of around 730k NYM (computed as 0.5*350m/240).
The contract update will also clean up legacy effects of a bug that was fixed a while back, which made some nodes appear to have more delegated stake than they actually had. As result of the update the displayed delegated stake will be correct for all nodes. As a result, some nodes may see slightly lower delegated amounts if they were previously displaying an incorrect delegation amount.
Stay tuned for further updates and the exact timing of the contract migration.
Privacy loves company
Discord // Telegram // Element // Twitter
The internet is global and so is Nym: join the Nym Community wherever you are and help build the private internet today.
English // 中文 // Русский // Türkçe // Tiếng Việt // 日本 // Française // Español // Português // 한국인