Coinbase - zoobc/zoobc-core GitHub Wiki
Coinbase Distribution
This document will explain in the detail how the coinbase distribution work for zoobc network.
oinbase Distribution is a reward that given by a creation a new block. Accounts who will get the rewards are based on the participation of Node Registration (Proof of Participation algorithms). Implementing Proof of Participation algorithms,we used pseudorandom lottery to reward how many accounts per block, with participants chance to win being weighted by their participation score.
Total Distribution
To calculate coinbase on each block we used function what we call Total Distribution
to get number of tokens that should have been distributed at given timestamp. New coins generated by a block, will compute the Total Distribution
by a given block timestamp then subtract it with the Total Distribution
for the previous block’s timestamp.
Used common sigmoid function to calculate Total Distribution
function where is a scaled slice of the generic logistic function:
The network constants which shape the distribution token:
e
(Eurler constant) = ~2.71828182845904523536...CoinbaseTotal
= 33 million ZBCCoinbaseTime
= 15 years (in seconds, integer)CoinbaseSigmoidStart
(aka cSS) = 3CoinbaseSigmoidEnd
(aka cSE) = 6
Calculation step in Total Distribution :
-
Block Timestamp (in seconds) is passed to
Total Distribution
function -
CoinbaseSigmoidMin
(aka cSMin) = 1.0 / ( 1.0 + ( e ^ -cSS ) ); -
CoinbaseSigmoidMax
(aka cSMax) = 1.0 / ( 1.0 + ( e ^ -cSE ) ); -
t
= min( 1, ( blockTimestamp - genesisTimestamp ) / coinbaseTime ) );t
is ranges from 0.0 at the genesis, to 1.0 after coinbaseTime, with linear interpolation then becoming flat, like: -
x
= ( t * ( cSE - cSS ) ) + cSS;x ranges from cSS at the genesis, to cSE after coinbaseTime, it converts t to between the range cSS - cSE.
-
y
= ( ( 1.0 / ( 1.0 + ( e ^ -x ) ) ) - cSMin ) * ( 1.0 / ( cSMax - cSMin ) );y is ranges from 0.0 at the genesis, to 1.0 after coinbaseTime.
-
TotalDistribution
= floor(y
*CoinbaseTotal
);The total coinbase distributed as of this block is just y times the eventual
-
Coinbase
=TotalDistribution
(block.timestamp) -TotalDistribution
(prevBlock.timestamp);Coinbase is total coinbase for a block that will distributed into all account participants,