Detailed Masternode Payment Logic

Payment logic

Masternode payments in PRCYCoin are based on Dash version 12 and are determined using a completely decentralized deterministic queue with probabilistic selection.

Global list

Every masternode appears in the global list. Their position in this list is determined by their time since the last payment according to the network, not the blockchain. New masternodes joining the network and masternodes receiving payment are placed at the end of the list. Running, active masternodes which are restarted using the rpc commands ‘masternode start’ or ‘masternode start-alias’ are also placed at the end of the list. Using the new rpc command ‘masternode start-missing’ avoids this. As masternodes are moved to the end of the global list, the remaining masternodes slowly migrate towards the top of the list. Once a masternode reaches the top 10% of the global list, it is eligible for selection from the selection pool.

Selection pool

The selection pool is the top 10% of the global list. Its size is determined by the total masternode count. As an example, if there are 4500 active masternodes, the top 450 masternodes in the global list are eligible for selection. Once in the selection pool, selection for payment is determined by block hash entropy. The block hash 100 blocks ago determines which masternode will be selected for payment. A double SHA256 of the funding transaction hash and index for all masternodes in the selection pool is compared with the proof of work hash 100 blocks ago. The masternode with the closest numeric hash value to that block hash is selected for payment.

Probabilities

Because selection is determined by block hash entropy, it is impossible to predict when a payment will occur. Masternode operators should expect considerable variance in payment intervals over time. Once a masternode enters the selection pool, payments become a probability. The probabilities in this example are calculated using an assumed current pool size of 450 (at 4500 total masternodes). Nodes in the selection pool are selected for rewards randomly, i.e. the probability of being selected on any given block is 1/450.

The table below shows the probably of an eligible node being selected for payment over a particular period of time. For example, the probability that an eligible node is selected within 12 hours is about 46%. The table does not (and cannot) tell us the probability of being selected after a given period of time. For example, if you haven’t been selected within the past 12 hours — and we know from this table there is about a 54% chance of that happening — the probability of being selected on the next block is not 46%. It remains 1/450. Putting these together, if you have an eligible node, and, say, 48 hours have passed without payment, then you’ve been very unlucky, as there’s less than a 10% chance of that happening. But, your chances of being selected on the next block remain the same as for any block, i.e. 1/450.

Once a node is selected for payment, it is moved to the back of the list and cannot be selected again until it re-enters the selection pool.

HoursBlocksProbability
123.075.00%
246.149.76%
369.2114.27%
492.2818.56%
6138.4226.50%
8184.5633.67%
10230.7040.14%
12276.8445.98%
18415.2660.30%
24553.6870.82%
30692.1078.56%
36830.5284.24%
42968.9488.42%
481107.3691.49%
721661.0497.52%
962214.7299.28%

You can run the code (written by community member moocowmoo used to create the table above here.

Article credit/source from DASH: https://docs.dash.org/en/0.12.3/masternodes/understanding.html#payment-logic