Masternodes, Miners and Decentralization – Upcoming Fork
March 20, 2018
March 20, 2018
In this article, I introduce in details all the changes for the upcoming fork and explain our initiatives and deeper intent with decentralization.
Miners – Love and Hate Story
Miners are an essential part of the blockchain ecosystem, however the coinbase reward is not tempting enough to some of them. G. Gekko would say that “greed is good”, maybe, but it often comes at the expense of others. In our case, these others are masternode owners.
Miners have power, and with power comes responsibility. Unfortunately, since we cannot ask every miner to be responsible, we must take explicit measures to ensure they share their rewards with the backbone of the ecosystem – the masternodes.
Masternodes have proven to be a very powerful asset to blockchains however their real-world implementation may still suffer from the need to centralize various controls (e.g. payment enforcement and verification). The main culprit is the transient nature of masternodes.
Peers could maintain and sync temporary lists (most implementations do), but offline nodes are then not able to verify the data when coming up online as they do for transactions – a problem that reminds some limitations of the lightning network for example (channels are transient too!).
Essentially, the only exhaustive and decentralized way to verify masternode payments would be through the data available with the blockchain otherwise we end up delegating trust to a temporary state that cannot be verified offline (i.e. when syncing the blockchain). Furthermore, this state check is often enabled through centralized mechanisms (e.g. sporks).
We have decided to take a step further toward decentralization to prepare the ground for what’s coming next with Magnet. We truly believe that a decentralized approach, although not the easiest route, can take us much further toward our end goals.
Leveraging Our Hybrid System
Magnet can leverage its duality (PoS/PoW) to enforce and further verify that addresses being paid are/were valid masternodes at time of payment. Here is how we take advantage of it:
Rule 1: A Proof-of-Work payment shall always follow a Proof-of-Stake payment.
Since Proof-of-Stake mining is fully decentralized (the staking wallet is the miner), stake based (coin weight) and time restricted (24h limit), this rule alone introduces major resource hurdles for malicious miners (e.g. address reuse).
Rule 2: At least one unspent collateral must be available at the payee address.
This rule further ensures that attacks based on generation of new addresses become as costly as possible. These attacks would essentially become worthless since a real masternode could be setup for the same cost.
We have further assessed that donations are only configured with actual masternode addresses so the change is not affecting our current users. Smart contracts will in place be used to implement donations later on.
Rule 3: A minimum number of confirmations must be observed after a Proof-of-Stake payment to receive a Proof-of-Work payment.
The confirmation number is derived by taking the third of valid payees count having received a Proof-of-Stake within the last 960 blocks divided by the number of unspent collateral for that payee.
R = count of unique recipients of PoS payment for past 960 blocks
C = count of unspent collaterals on the payee address.
Confirmations = R / 3 / C
In other words, this rule ensures that the maximum number of Proof-of-Work rewards an address can receive is 3 per day provided it has also received 3 Proof-of-Stake payments (“prorata-ed” to the number of collateral held on that address).
The system relying on blockchain data is also able to perform full masternode payment verification when syncing the blockchain. The wallet scans the blockchain for collateral outputs (and prevout) and additionally gathers meta data for Proof-of-Stake payments and confirmations.
The RPC interface was modified to automatically help mining firmware with masternode winner selection so that any standard miner does not have to “know” the new rules – any non-standard miner must respect them for their block to be accepted.
Whenever a block is connected to the local blockchain the wallet verifies the payee against the rules. This is done whether the block was generated online or offline (similarly to standard transactions which can be sent to any address while the wallet is offline).
Two More Notes
With this fork we are also fixing the current block generation time. Due to hybrid overlap and hash rate fluctuation we have been generating blocks at faster rate of 1600 average per day. The adjustment brings back the expected rate and is computed as follow so we should fall back on our feet:
(60 ^ 2 * 24) / (960 ^ 2 / 1600) = 150
One more change, we are raising the Proof-of-Stake dividends from 7% to 14% annually till the first Proof-of-Work halving (block 360000).
As always, we believe in open source so for more technical details and progress feel free to check out our dev branch: third-hard-fork branch on github.
Any comment feel free to reach us on Discord.