Rules of engagement - how deposits workThis is a description of the functionality of deposits and their role in the block creation process.It can also be found at:
http://credits-currency.org/viewtopic.php?f=24&t=755In this description there are two roles that acts to create a block, miner and depositor. In many cases both roles are the same entity. But as time passes they will probably separate into two distinct roles.
Every block must have between one and ten deposits added to it.
A deposit is a transaction, holding an amount of CRE, usually sent to an address that the depositor controls. One specific functionality separates a deposit transaction from a normal transaction, namely an extra public key that is used by the depositor to approve the inclusion in a block, when the block is assembled.
A miner creates a block in the normal way. Each block has a requirement for deposits that should be added to the block. Depositors can offer up deposits for inclusion in a block. The miner selects a number of deposits that they want to include.
Once a block has been assembled, the miner informs the depositors that their deposit has been selected for inclusion in a block that the miner is about to create.
If the depositor approves of the inclusion in the block, they use their private key to sign the whole block, thereby approving it. This is what the extra public key that is included in a deposit transaction is for.
When all signatures have been gathered the miner can start hashing the block to find a solution to the normal hashing challenge. Eventually a block is found.
When the block is found and announced, all deposits will be locked into the block until they are released 15 000 blocks later.Where do the deposit requirement come from? - The rules are actually quite simple.
The required deposit for each block is 1 / 30 000 of the total monetary base. The total monetary base is all coins that have been created up until that block, plus all coins that have been claimed from Bitcoin up until that block. So for example, if 100 000 Bitcoins have been claimed and we are at block 18 000 where all blocks have given a reward of 40 CRE, the total monetary base will be 18 000 * 40 + 100 000 = 820 000 CRE.
The required deposit for next block will then be 820 000 / 30 000 = 27.33 CRE. Yes, this means that the deposit requirement will continue to rise when new blocks are mined. For example when 18 000 000 of all CRE have been mined or obtained through claiming, the required deposit will be 18 000 000 / 30 000 = 600 CRE per block.
What happens if the full required deposit isn’t added?A block must have at least one deposit transaction with a non zero output. If the deposit isn’t fulfilled, the difficulty for the block for that individual miner will raise with a factor calculated from the amount of missing deposits. If the requirement is 50 CRE and only 25 CRE have been added as deposit, the difficulty will double.
For example, if the difficulty is 120, and only 25 CRE of the required 50 CRE are added to the block, the difficulty for that specific miner will double to 240.One extra effect will also occur when half of all coins (15 000 000) have been mined.
On top of the higher difficulty, the reward will also be lowered in the same way. With a reward of 80 CRE, requirements for 50 CRE as deposit, and only 25 CRE given, the maximum reward that can be gained from the block is 80 * (25 / 50) = 40 CRE.
But I’m already mining and I haven’t created any deposits?Actually you have, its just the software that is taking care of it automatically for you. The reward (coinbase) that is added to each block can be spent directly by a deposit transaction in the same block. As long as the reward for a block is higher than the required deposit, all miners can use the reward and add it to cover the full deposit.
There’s a tipping point at approximately block 33 000 when the deposit requirement will become larger than the reward. At first, it doesn’t really make much of a difference, since the difficulty will only be marginally higher for miners without extra deposits. But as the blockchain progresses, the requirement to add extra deposits will grow larger and larger.
Must I lockup the whole reward in deposit if I use it as input to a deposit transaction?No. A deposit can send coins to two outputs.
The first output, which always must exist, is the deposit output. Once included in a block, it can not be used in any way for 15 000 blocks.
The other output, which is optional, is the deposit change output. To this output all extra coins can be sent. The deposit change can be used after the same time as it takes rewards to mature, that is, after 101 blocks.