DeFiCh / ain

DeFi Blockchain - enabling decentralized finance on Bitcoin
https://defichain.com
MIT License
401 stars 119 forks source link

Long term staking should be implemented with "subnode" to unambiguously yield 1.5x (5y) & 2x (10y) returns #626

Closed uzyn closed 3 years ago

uzyn commented 3 years ago

What would you like to be added:

Related: #546, #562 & #619

Introduction of "subnode", where each of the following masternodes will mine at subnode level.

Each of the subnodes not only allows for multiple hashes, but also accumulates coinage independently. This unambiguously yields the desired effect of 10-year lockup masternode effectively running double the number of subnodes of 1 normal masternode – thereby generating 2x more returns.

Why is this needed:

See #619

Previous attempts at implementing coinage adjustment for long-term staking does not consistently yield the desired outcome of 1.5x more return for 5-year lockup and 2x more return for 10-year lockup when difficulty changes.

Subnode brings about the desired outcome unambiguously.

This has also been tested on Monte Carlo simulation:

$ node freeze-staking-montecarlo.js 
CYCLES 100000
NODES [ 1000, 1000, 1000 ]
TARGET 0.0012
COINAGE_EVERY [ 24, 24, 24 ]

Findings: [ 1206911, 1810558, 2413457 ]
Type 0: 1.207% success rate. (1.000x)
Type 1: 1.811% success rate. (1.500x)
Type 2: 2.413% success rate. (2.000x)

Simulation code: https://gist.github.com/uzyn/f9766cfd69ff6a586a0877b6cbae11c0

defichain-bot commented 3 years ago

@uzyn: Thanks for opening an issue, it is currently awaiting triage.

The triage/accepted label can be added by foundation members by writing /triage accepted in a comment.

Details I am a bot created to help the [DeFiCh](https://github.com/DeFiCh) developers manage community feedback and contributions. You can check out my [manifest file](https://github.com/DeFiCh/ain/blob/master/.github/governance.yml) to understand my behavior and what I can do. If you want to use this for your project, you can check out the [DeFiCh/oss-governance-bot](https://github.com/DeFiCh/oss-governance-bot) repository.
uzyn commented 3 years ago

/triage accepted

Sebz84 commented 3 years ago

I think this way of distribution only works, if only a small percentage of masternodes locks their collateral for 5/10 years. The more masternodes lock their collateral long term, the lower the yield gets for them. If for example "worst case" 100% of all masternodes lock their collateral for 10 years, their yield will decrease back to 1x. I think a constant multiplier of 1.5x (5y) & 2x (10y) can not be achieved, because its depending on how many masternodes are locking their coins. Is this fact considered / accepted?

Please correct me if Im wrong :-)

uzyn commented 3 years ago

@Sebz84 The 1.5x and 2x is in relative to non-longterm staking. What you mentioned is a fact, if it's all 10-year node, then effectively it's 1x as everyone is 2x.

However, if there's 1 node that's non-longterm even in a pool of 1 million 10-year nodes, than that 1 node is expected to be getting half the reward of a 10-year node, regardless of the number of nodes overall.

This implementation adheres to that better.