Radium Core/Staking

From Wikibooks, open books for an open world
Jump to navigation Jump to search


Staking is the process by which Radium network grows and secures its blockchain. Instead of mining, Radium uses the Blackcoin Proof-Of-Stake v3 protocol for generating new blocks/coins. Staking requires a balance of Radium coins in the wallet, in order to stake. The larger the balance, the more stake-weight, or staking power the wallet has, and the more often your wallet will generate blocks. There is no minimum amount of coins required to stake, however very small balances may not generate a reward for months or even years. Staking requires that the wallet be kept open, and unlocked for staking. Wallets that are closed or not connected to the network are unable to stake and generate new coins.

Basic staking process[edit]

When your wallet is staking, it scans your unspent inputs (incoming coin transactions) and attempts to find an input that can be used to generate a new block. When a potential new block is found, the input is split into two new inputs in a special staking transaction. If the staking transaction and potential new block meets the network target, the wallet will submit the block to the network and hope that it is accepted.

Spendable balance and Stake balance[edit]

In the reference client (qt), there are both a spendable balance and a stake balance. When your wallet successfully generates a block, the coins used in the staking transaction become locked for a period of 60 blocks. During the time the coins are locked, they move from the spendable balance into the stake balance. After the period of 120 blocks, the coins will return to the spendable balance, and be available for spending or staking another block. Coins in the stake balance have ALREADY been used in a staking transaction. Coins in the spendable balance are available to be used in a new staking transaction.

Stake Weight[edit]

Stake weight is a measurement of "staking power" each wallet that is staking has a stake weight equal to that of its available balance. The network stake-weight is the total number of all coins that are being staked on the entire network. As a rough estimate, any particular wallet should generate coins at a daily rate determined by the following formula. (Wallet Stake Weight / Network Stake Weight) * 1440 * 0.5. Example: IF a wallet is staking 1,000 radium, and the total number of radium staking on the entire network is 10,000, the formula would be (1,000 / 10,000) * 1440 * 0.5 = 72. Roughly, this demonstrates that per day, a wallet will generate a percentage of the total daily blocks roughly equal to the amount their percentage of the total network stake weight.

Input Optimization[edit]

A common question is should all your coins be in the same address for different addresses for staking. The theoretical answer is no, it does not make any difference if your coins are all in one address or not. What MAY have some effect on your staking process, is how your coins are divided up into inputs. Each address can be the owner of multiple inputs. A discussion on inputs and transaction structure is beyond the scope of this page, but Google is your friend! Each time a new block is found on the network, the wallet tries generates a new candidate block for each input. The more inputs your wallet has, the longer it takes to complete this step, and the more cpu power is required. This does not become a noticeable issue until the wallet has hundreds and hundreds of inputs. The obvious fix for this, would be to consolidate all the coins into as few inputs as possible, however this has its own issues. Each time a wallet successfully stakes a block, an input gets spent, and it becomes two new inputs. This means, that if all the coins are in one input, the wallet will have to wait for the new inputs to mature before it can even try and stake again. The best way to stake lies somewhere in between. Keeping your input count below 200 will negate the first issue, and above 20 should negate the second issue. So long as your wallet isn't locking up every minute or so when a new network block appears, and has a few different inputs, it should be good to go. The longer you stake, the more inputs you get, so a reasonable strategy would be to send all your coins to yourself, whenever you notice your wallet seems go get bogged down from time to time. You can use different addresses if you like, but there is no real benefit.

Generated but not accepted blocks[edit]

Sometimes the wallet will generate a block that is not accepted by the network. While this is disappointing, it is a normal part of staking. Often several wallets will find a block that meets the network requirements, and several blocks are submitted to the network for approval. When several blocks are submitted, the one that has the best or most difficult hash is selected, and becomes the next block in the chain. The blocks that were not selected become orphans, and appear in the client as generated but not accepted, and have a question mark beside them..


Staking Tutorial (QT)[edit]

Tutorial on how to stake Radium using the reference QT client

Staking Tutorial (Raspberry Pi)[edit]

Tutorial on how to stake Radium using a Raspberry Pi