Table of Contents
- Obtaining Stake Vouchers
- Monitoring your solo staking activity
- Changing the fee you pay to stake
- How you earn staking rewards
Solo staking is an alternative to staking via a collective pool like PAI Coin Pool. When you solo stake, your device or server automatically:
- accumulates stake vouchers;
- configures the vouchers to vote when they are chosen to validate a block;
- revokes any vouchers that expire or miss their opportunity to vote;
- accumulates rewards and, if desired, automatically restakes them
Note 1: You must be running a PAI Coin full node (i.e., paicoind) with a wallet enabled in order to solo stake. Follow the “Setting up a full node with a wallet” section the Solo Mining guide to set up paicoind with a wallet. For best results, you must ensure that the PAI Coin full node you’re using to stake is online all the time.
Note 2: The full usage of any
paicoin-cli commands mentioned in this article can be obtained by running
paicoin-cli help [command] for the command in question.
In order to obtain a stake voucher, you must stake an amount of PAI Coin equal to the current price of a stake voucher. This value is set automatically by the blockchain network based on a supply and demand calculation, with the goal of consistently maintaining the number of outstanding valid stake vouchers at 40,960.
There are five different categories of outstanding stake vouchers:
1. Immature — A stake voucher (SV) remains immature until 256 blocks following its acquisition. Immature stake vouchers cannot yet vote on blocks.
2. Live — A stake voucher which is both (a) mature, meaning it was obtained in a transaction with 256 or more confirmations, and (b) valid, meaning none of its other properties preclude it from voting, is live. Live stake vouchers are eligible to vote on a new block if chosen.
3. Insufficiently valued — As the price of stake vouchers fluctuates, some older stake vouchers may have a value lower than the current price. This renders the vouchers ineligible to vote. Insufficiently valued stake vouchers can become eligible to vote again if and when the current SV price drops to a level equal to or below their value.
4. Expired — A stake voucher is expired if it was not chosen to vote before its specified validity period ended. The default validity period is 40,960 blocks following its maturity, equal to approximately 284 days.
5. Missed — A stake voucher which was chosen to vote, but for any reason did not submit a vote, is considered to have missed its chance to vote and is not eligible to be chosen again.
Obtaining Stake Vouchers
You obtain stake vouchers by configuring paicoind to automatically purchase them for you. You do this using the
paicoin-cli startticketbuyer command. The simplest way to run the command is as follows.
paicoin-cli startticketbuyer "" 0
This tells paicoind to continue to try to purchase stake vouchers as long as your wallet balance is greater than 0 PAI. If you only want a portion of your total wallet balance accessible for staking, specify the threshold below which you would not like your wallet balance to fall at the end of the command. For example, consider the following command.
paicoin-cli starticketbuyer "" 1000
This tells paicoind to continue purchasing stake vouchers as long as your wallet balance is greater than 1000 PAI.
Once the ticket buyer is running, you may want to do additional configurations. For example, by default, the ticket buyer will attempt to purchase 1 stake voucher per block. But, you can try to purchase more, if so desired. Consider the following command.
paicoin-cli setticketbuyermaxperblock 3
This command tells paicoind to attempt to purchase 3 stake vouchers per block, rather than 1. Please note that, by protocol rules, a maximum of 20 stake voucher purchase transactions per block are allowed across the entire network. Therefore, it is strongly recommended that you do not attempt to purchase more than 1-3 stake vouchers per block. Otherwise, you may begin to accumulate a large number of pending stake voucher purchase transactions which, by the time they process, may yield insufficiently valued SVs.
You can check whether or not your ticket buyer is running by executing paicoin-cli ticketbuyerconfig. If the buytickets setting is true, the ticket buyer is running; if the buytickets setting is false, the ticket buyer is not running. Additionally, the value of limit indicates the maximum number of stake vouchers that your node is configured to purchase per block. The value of limit resets to 1 whenever the ticket buyer is restarted.
If you wish to stop purchasing stake vouchers, simply execute
Monitoring your solo staking activity
Run the command
paicoin-cli getstakeinfo to get a snapshot of your solo staking activity and activity across the entire network.
Changing the fee you pay to stake
Transaction fees are the way in which miners earn compensation as block rewards diminish over time (see the block halving countdown). When miners construct a block, they have to choose which transactions to include from the set of all pending transactions in the mempool. In some situations, the mempool may contain such a large number of transactions that they will not all fit in a single block. In this case, miners typically choose to include higher-fee transactions first. The same logic applies to stake voucher purchase transactions.
If you find that you are not acquiring stake vouchers as quickly as you expect, you have the option of increasing the fee you pay to purchase them. If the fee you are paying is relatively larger than those of other stake voucher purchase transactions that are in the mempool at the same time as yours, your transactions will likely go through first, and you will accumulate stake vouchers faster.
You can check the fee that your ticket buyer is configured to pay by running
paicoin-cli getticketfee. If you want to change the fee you pay, simply run
paicoin-cli setticketfee [fee], replacing
[fee] with a value. For example,
paicoin-cli setticketfee 0.0002 sets your stake voucher purchase transaction fee to 0.0002 PAI per kB.
How you earn staking rewards
When a new block is mined, five stake vouchers are chosen at random from the set of live stake vouchers in the voucher (ticket) pool. You can see the total size of the voucher pool by checking the value of
poolsize in the output of the command
paicoin-cli getstakeinfo. Further, the value of
proportionlive reflects the fraction of the pool made up of stake vouchers that you own. The probability of at least one of your stake vouchers being chosen to vote on a given block as a function of the number of vouchers you own is shown below.
All of the following conditions have to be met for you to earn a stake reward from one of your stake vouchers.
- One or more of your stake vouchers gets randomly chosen to vote, AND;
- The PAI Coin node (with wallet) that owns the stake voucher(s) is online and set to automatically vote, AND;
- The stake voucher is not insufficiently valued.
If all conditions are met and one or more of your chosen stake vouchers successfully votes, you will:
- Recover the funds you paid/staked to obtain the voucher (less the transaction fee);
- Earn some additional amount of PAI Coin for each of your stake vouchers that successfully voted. This is your staking reward.
The amount of staking reward you will earn for each of your vouchers that voted depends on (a) the total block reward, and (b) the number of other votes that were received (can be 3, 4, or 5). As of the writing of this article, the total block reward is 1500 PAI. That total block reward is split 60/40 between stakers and miners. Therefore, 900 PAI (60% of 1500) is distributed among the 3-5 stake vouchers that vote on a given block, which implies the staking reward can be 180 PAI if 5 votes are received, 225 PAI if 4 votes are received, and 300 PAI if only 3 votes are received.
Read the full documentation here:
Solo Staking.pdf (307.8 KB)