diff --git a/docs/faq/proof-of-stake/general.md b/docs/faq/proof-of-stake/general.md index f723372ff..8406121b6 100644 --- a/docs/faq/proof-of-stake/general.md +++ b/docs/faq/proof-of-stake/general.md @@ -1,63 +1,51 @@ -# PoS General FAQ +# PoS Voting General FAQ --- -#### 1. What is Decred's Proof-of-Stake system? +#### 1. What is Decred's Proof-of-Stake (PoS) Voting system? -The Proof-of-Stake (PoS) system allows holders of Decred to have a say in the governance of the currency. It aims to give users a voice alongside the miners. -In order to participate, users can purchase "tickets", which enter a lottery pool. Every block 5 tickets are chosen from the PoS ticket pool. If at least 3 of those validate the previously mined block, -the newly mined block is added to the chain, and both PoW miners and PoS stakers are paid. If the block is not validated by the PoS stakers the PoW miners do not get paid, but the PoS stakers do. This is - to incentivize PoW miners to mine according to the wishes of the PoS stakers. +The Proof-of-Stake (PoS) Voting system allows holders of Decred to have a say in the governance of the currency. It is designed to give Voters who stake their DCR control over the protocol's rules and funds in the Decred Treasury. -This PoS system has several advantages that solve problems PoW-only systems might encounter. For example, because the PoS stakers have to validate the blocks the PoW miners mine, the PoW miners cannot -decide on their own to change the rules of the network (a 51% attack). Or, when the Decred chain hardforks the old, smaller, chain will die off quickly due to not being validated by the PoS component of -the chain. +In order to participate, users can purchase "tickets", which enter a lottery pool. Every block, 5 tickets are chosen from the PoS ticket pool. If at least 3 of these tickets validate the previously mined block, the newly mined block is added to the chain, and both PoW miners and PoS voters are paid. If the block is not validated by the PoS voters, the PoW miners do not get paid, but the PoS voters do. This is to incentivize PoW miners to mine according to the wishes of the PoS voters. -The PoS system rewards participants for their staking. Every Decred block has a PoS reward component that will be distributed to every ticket chosen to vote in that block. The system is designed in such a -way that the average time for the ticket to be selected is 28 days. If a ticket hasn't been selected after 40960 blocks (a bit under 5 months) it will be revoked by the system. The DCR used to purchase a - ticket is returned regardless of whether or not it votes. +This hybrid system has several advantages that solve problems PoW-only systems might encounter. For example, because the PoS voters have to validate the blocks the PoW miners mine, the PoW miners cannot +decide on their own to change the rules of the network (a 51% attack). Likewise, when the Decred chain hardforks, the minority chain will die off quickly due to not being validated by PoS voters. -Another interesting feature this PoS system allows for is the ability to vote on an agenda. Because the block validation can be considered a vote, by adding extra votebit components to the ticket the system can track and count votes over a series of blocks. These votes can be about anything. +The tickets system rewards participants for their voting. Every Decred block has a PoS reward component that will be distributed to every ticket chosen to vote in that block. The system is designed in such a way that the average time for the ticket to be selected is 28 days. If a ticket hasn't been selected after 40960 blocks (a bit under 5 months) it will be revoked by the system. The DCR used to purchase a ticket is returned regardless of whether or not it votes. -In the Decred Proof-of-Stake system anyone holding DCR can participate by buying a ticket. +Another interesting feature this PoS system allows for is the ability to vote on an agenda. Because the block validation can be considered a vote, by adding extra "votebit" components to the ticket, the system can track and count votes over a series of blocks. These votes can be about anything. In practice, these on-chain votes are used to accept or reject proposed changes to the consensus rules. + +In the Decred PoS system anyone holding DCR can participate by buying a ticket. --- #### 2. What are tickets? -A ticket is a token you buy to participate in the PoS system. You can buy tickets through the command line interface of dcrctl, or through a GUI like Decrediton[^1]. Whenever you buy a -ticket, you pay the current ticket price and a ticket fee using your DCR. When a ticket is purchased, it goes to a temporary "mempool". 20 tickets can be mined into each block and tickets are chosen -to be mined based on their fee per kilobyte. Since there is a limited number of tickets that can mined into blocks at a given price (2880), there may be competition to get tickets mined. In this case, -you can increase the fee you're willing to pay to get your ticket(s) mined. Once your ticket is mined it will move from the current 'allmempool' to the 'immature' ticket pool. After 256 blocks -(about 20 hours) it then will mature and go into the live ticket pool where it is eligible to be chosen to vote. +A ticket is a token you buy to participate in the PoS system. You can buy tickets through the command line interface of dcrctl, or through a GUI like Decrediton[^1]. Whenever you buy a ticket, you pay the current ticket price and a ticket fee using your DCR. When a ticket is purchased, it goes to a temporary "mempool". Twenty tickets can be mined into each block and tickets are chosen to be mined based on their fee per kilobyte. Once your ticket is mined, it will move from the current "allmempool" to the "immature" ticket pool. After 256 blocks (about 20 hours) it then will mature and go into the live ticket pool where it is eligible to be chosen to vote. --- #### 3. Do I need to be constantly connected to the network to participate in PoS? -A wallet needs to be online 24/7 to respond to a vote if one of your tickets is selected. There are two main ways to do this; a solo staking wallet which you set up and keep online all the time, or you -can use a [stake pool](../../mining/how-to-stake.md). A stake pool is basically a community run wallet to which you can assign the voting rights of your tickets and the pool will -vote on your behalf for a small percentage of the PoS reward. +A wallet needs to be online 24/7 to respond to vote if one of your tickets is selected. There are two main ways to do this: 1) a solo staking wallet which you set up and keep online all the time, or 2) you can use a [Voting Service Provider](../../mining/how-to-stake.md#pos-using-a-voting-service-provider-vsp) (VSP). A VSP is a community-run wallet to which you can assign the voting rights of your tickets. The VSP will vote on your behalf, charging a small percentage of the PoS reward as a fee for this service. -It is important to note that you are only assigning voting rights to the pool, not your actual funds. A stake pool does not have access to your funds at any time. +It is important to note that you are only assigning voting rights to the pool, not your actual funds. A VSP does not have access to your funds at any time. --- #### 4. What is the "ticket price"? -The price for tickets is determined by an algorithm that aims to keep the ticket pool size, which is the total amount of tickets in the PoS system ticket pool around a target size of 40960 tickets. -The ticket price will go up or down according to the demand for tickets, and the number of tickets currently in the pool. +The price for tickets is determined by an algorithm that aims to keep the ticket pool size, which is the total amount of tickets in the PoS system ticket pool, around a target size of 40960 tickets. -Every 144 blocks the algorithm adjusts the ticket price. This is called a buying window. Each block can contain 20 newly bought tickets. This means that in every buying window a maximum of 2880 tickets -can be added to the PoS system ticket pool. +The ticket price goes up or down according to the demand for tickets, and the number of tickets currently in the pool. Every 144 blocks the algorithm adjusts the ticket price. This is called a buying window. Each block can contain 20 newly bought tickets. This means that in every buying window a maximum of 2880 tickets can be added to the PoS system ticket pool. -The ticket price is always refunded no matter if your ticket votes, misses or expires. +The ticket price is always refunded, no matter if your ticket votes, misses or expires. --- #### 5. What are fees? -The PoS system utilizes two types of fees, a txfee (also known as a 'split' fee) and a ticketfee. +The PoS system utilizes two types of fees, a "txfee" (also known as a 'split' fee) and a "ticketfee". The txfee is a fee you pay the network for handling the transaction to buy your ticket. This fee is at default set to a low amount (0.001 DCR/kB) and should not be changed. The ticketfee is the fee you pay if your ticket gets mined. This fee is an incentive for PoW miners to mine your ticket and add it to the ticket pool. @@ -65,36 +53,30 @@ The ticketfee is the fee you pay if your ticket gets mined. This fee is an incen In case the buying window is full, meaning there are more tickets being bought than there are available to be mined during that window, the ticketfee will be used to determine which tickets get put into the ticket pool. The tickets with the highest ticketfee will be selected by the PoW miners. -Fees are calculated in DCR per kilobyte. Since a ticket is only about 300 (solo) or 540 (pool) bytes in size, the actual fees you pay will be lower than what you set as the specific fee amount. +Fees are calculated in DCR per kilobyte. Since a ticket is only about 300 bytes (for solo) or 540 bytes (for VSP) in size, the actual fees you pay will be lower than what you set as the specific fee amount. -Both txfees and ticketfees will not be returned when a ticket votes, expires, or misses a vote. +Both txfees and ticketfees will *not* be returned when a ticket votes, expires, or misses a vote. -Returning the funds back to your wallet after a ticket votes or is revoked does not generate a fee. +Returning the funds back to your wallet after a ticket votes or is revoked does not incur a fee. --- -#### 6. What is a stake pool? +#### 6. What is a Voting Service Provider? -A stake pool is the equivalent of a mining pool, but for the PoS system. Through the options in your Decred wallet, you can give your voting rights to a stake pool. If your ticket is selected to vote, -the stake pool will cast the vote for you and you are rewarded with the PoS reward minus the stake pool fee (usually 4-5%). Unlike the mining pools, the PoS reward is not split amongst the users of the stake pool. The full reward goes to the owner of the ticket. +A Voting Service Provider (VSP) is similar in some ways to a mining pool, but for the PoS system. Through the options in your Decred wallet, you can give your voting rights to a VSP. If your ticket is selected to vote, the VSP will cast the vote for you and you are rewarded with the PoS reward minus the VSP fee (usually 1-5%). Unlike mining pools, the PoS reward is not split amongst the users of the stake pool. The full reward goes to the owner of the specific ticket that voted. -A stake pool will allow you to buy tickets but not have your own wallet unlocked and always online. It is important to note that your funds never leave your wallet. You are not sending anything to the pool, -just giving it authority to vote on your behalf. A stake pool cannot access your funds. +A VSP allows you to buy tickets and vote without the requirement of maintaining an online and unlocked wallet. It is important to note that your funds never leave your wallet. You are not sending anything to the VSP, just giving it authority to vote on your behalf. A VSP cannot access your funds. -Stake pools will usually implement multi-wallet redundancy by having many wallets physically distributed around the globe. This means there's less chance of a vote being missed because one wallet is down. +VSPs will usually implement multi-wallet redundancy by having many wallets physically distributed around the globe. This means there's less chance of a vote being missed because one wallet is down. It also reduces latency between the wallet and network which can reduce the chance of a vote being missed. --- #### 7. What happens to my funds when I buy a ticket? -Funds used to purchase tickets are locked until the ticket is selected to vote or it expires. They are unable to leave your wallet and will appear in the "lockedbytickets" section of your wallet. -If your ticket is selected to vote, you will be refunded the total amount paid for the ticket and given the PoS reward. - -The only cost for using this system are the fees you set. The txfee will be charged for the transaction of your ticket across the network. The ticketfee will be charged for incorporation into the -ticket pool, and is paid to the PoW miners. If your ticket does not get mined, there is no charge as the transaction never made it onto the network. +Funds used to purchase tickets are locked until your ticket is selected to vote or expires; tickets expire if they aren't selected to vote after 40960 blocks (about 4 months). If your ticket does successfully vote when called, you will receive the PoS reward. -In case your ticket isn't selected to vote after 40960 blocks (about 4 months), the system will revoke your ticket and the decred you paid for it (minus fees) will be transferred back into your wallet. +If you submit a ticket, and it is not added to the ticket pool (included in a block by PoW miners), the `ticketfee` set when you purchased your ticket is never paid. The `txfee` for buying the ticket is paid out of the unlocked DCR sent back to your wallet. --- @@ -103,12 +85,11 @@ In case your ticket isn't selected to vote after 40960 blocks (about 4 months), The PoS system in Decred uses a Poisson distribution to determine the chances of a ticket voting at any given time. Given the target pool size of 40960 tickets, any one ticket has a 50% chance to vote within 28 days and a 99.5% chance to vote before expiry. Note that these values will change with the pool size. - --- -#### 9. What is Proof-of-Stake voting? +#### 9. What is Proof-of-Stake (PoS) voting? -Because the block validation performed by the PoS system behaves like a voting system, it can be used to vote on other issues too. +Because the block validation performed by the Proof-of-Stake (PoS) system behaves like a voting system, it can be used to vote on other issues too. When selected to validate a block, the tickets vote on whether or not to approve the previously mined block. This requires 3 out of 5 selected tickets to vote yes. @@ -116,7 +97,7 @@ By adding another parameter to the ticket that doesn't interfere with the approv For example, you could choose the color of your ticket to be either red or blue, set that option, and the system will count for the next 1000 blocks how many red tickets and how many blue tickets there are. Maybe there are 3000 red tickets, 1500 blue tickets, and 500 that didn't select a colour. -If you replace the red or blue option with a yes or no option, you have a voting system that can count votes over time. By using the PoS voting system anyone who holds DCR can vote on issues set in an agenda. +If you replace the red or blue option with a yes or no option, you have a voting system that can count votes over time. By using the PoS voting, system anyone who holds DCR and locked it for tickets can vote on issues set in an agenda. This voting system can be used for any governance issue. For Decred, the most prominent use will be to vote on hardforks, which are technical changes to the way the currency works. Some examples: @@ -132,59 +113,54 @@ Currently, a platform for the community to submit and advocate a voting agenda i #### 10. What is hardfork voting? -Like any other cryptocurrency Decred might need to hardfork at some point. +A more up-to-date version of this information, with a diagram, is available on [consensus rules voting](../../governance/consensus-rules-voting.md) page. + +Like any other cryptocurrency, Decred might need to hardfork at some point. -One of the agenda issues set for the PoS voting system could be a hardfork. If such an issue is set, the new version of the Decred source code will include the hardfork in it, but the hard fork will not activate until the PoS system has voted on it. +One of the agenda issues set for the PoS voting system could be a hardfork. If such an issue is set, the new version of the Decred source code will include the hardfork in it, but the hard fork will not activate until the PoS system has voted to approve it and a set interval has passed. For a hardfork vote to start two critical conditions have to be met: -- First, 75% of the PoW miners have to upgrade to the latest version of the current network block version. This check runs over the past 1000 blocks. +- First, 95% of the PoW miners have to upgrade to the latest version of the current network block version. This check runs over the past 1000 blocks. - Second, 75% of the PoS miners have to upgrade to the latest version. This check runs over the past 2016 blocks. -Once these checks are met, the voting process begins. Tickets can be set with an additional parameter of yes/no/abstain. You do this in your wallet before the ticket votes. Tickets marked as abstain will not be counted in the total amount of votes. +Once these checks are met, the voting process begins. Tickets can be set with an additional parameter of Yes/No/Abstain. You do this in your wallet before the ticket votes. Tickets marked as abstain will not be counted in the total amount of votes. -The PoS system then starts counting tickets with these parameters set over a predetermined amount of blocks. If over this interval the amount of ‘yes’ votes is 75% or more, the vote has passed. A lock in period of a set number of blocks will start before the hardfork goes live, so everyone has a chance to upgrade and not be hardforked off the network. +The PoS voting system then starts counting tickets with these parameters set over a predetermined amount of blocks. If over this interval the amount of Yes votes is 75% or more, the vote has passed. A lock in period of a set number of blocks will start before the hardfork goes live, so everyone has a chance to upgrade and not be hardforked off the network. -Because the code for the hardfork is already in the then current version of Decred there is no need for the developers to interfere or the majority of PoW miners and PoS miners to upgrade after a decision has been reached. If the vote on a hardfork passes it will be implemented automatically after the lock in period. +Because the code for the hardfork is already in the then current version of Decred there is no need for the developers to interfere or the majority of PoW miners and PoS voters to upgrade after a decision has been reached. If the vote on a hardfork passes it will be implemented automatically after the lock in period. -The hardfork vote can fail at multiple points. The vote might not start at all if the PoW miners or PoS miners do not upgrade. After that, the threshold of 75% votes might not be reached. +The hardfork vote can fail at multiple points. The vote might not start at all if the PoW miners or PoS voters do not upgrade. After that, the threshold of 75% Yes votes might not be reached. -In case a vote fails a new round will start at the beginning of the process. This means checking whether the PoW miners have upgraded, if the PoS miners have upgraded, and then another vote counting period. This will continue for a certain amount of rounds, after which, if the vote hasn't passed, the agenda issue will be tabled. +In case a vote fails a new round will start at the beginning of the process. This means checking whether the PoW miners have upgraded, if the PoS miners have upgraded, and then another vote counting period. This will continue for a certain amount of rounds, after which, if the vote hasn't passed, the agenda issue will be shelved. --- -#### 11. Is PoS susceptible to large exchanges using their customers’ decred? +#### 11. Is Proof-of-Stake (PoS) susceptible to large exchanges using their customers’ DCR? -The number of decred a person (or exchange) has means nothing to PoS. It's the number of tickets you have. Funds used to purchase tickets are locked until the ticket they purchased votes. This means that -decred involved in PoS are effectively nontransferable. For an exchange to use their customers’ decred for voting, they would have to transfer them out of the wallets and lock them for up to 5 months. People -would notice their balances change (decred locked in PoS will not show as spendable) and they would not be able to withdraw any funds so the exchange would suffer a large loss of liquidity. +The amount of DCR a person (or exchange) posesses doesn't matter, only the number of tickets. Funds used to purchase tickets are locked until the ticket they purchased votes. This means that DCR involved in PoS are effectively nontransferable. For an exchange to use their customers’ DCR for voting, they would have to transfer them out of the wallets and lock them for up to 5 months. People would notice their balances change (DCR locked in PoS will not show as spendable) and they would not be able to withdraw any funds so the exchange would suffer a large loss of liquidity. -Further there is a hard limit of 20 tickets added per block so no exchange could flood the pool faster than this. +Furthermore, there is a hard limit of 20 tickets added per block, so no exchange could flood the pool faster than this. -Finally, there's a soft cap on the total number of tickets in the pool. Every 144 blocks (2880 tickets) the ticket price is adjusted based on the number of tickets in the pool and the rate that new tickets -were added in the last window. Eventually the ticket price would be so high that even an exchange wouldn't be able to buy many tickets. And remember that even if they did that their DCR are locked so they -can't buy more when the price drops again. +Finally, there's a soft cap on the total number of tickets in the pool. Every 144 blocks (2880 tickets) the ticket price is adjusted based on the number of tickets in the pool and the rate that new tickets were added in the last window. Eventually the ticket price would be so high that even an exchange wouldn't be able to buy many tickets. And remember that even if they did that their DCR are locked so they can't buy more when the price drops again. --- -#### 12. Is PoS susceptible to influence from large balance holders such as the original developers? +#### 12. Is Proof-of-Stake (PoS) susceptible to influence from large balance holders such as the original developers? -The pool size limits above apply here. This stops one person/group flooding the PoS pool with large numbers of their own tickets. Even if they bought up the whole pool (with huge fees) the most they would -likely get is about 4000 tickets (based on previous ticket windows where the ones around 30DCR usually go up to 100 for the next window, and the max for the one after that is often over 300). So a large -balance holder could probably buy 2 windows out. A window at 30 would be 86,400DCR then the next at 100 would be 288,000DCR. So it would cost 374,400DCR to buy 5760 tickets. With a target pool size of 40960 tickets, 374400 DCR would give you about 14% of all tickets. +The pool size limits above apply here. This stops one person/group flooding the PoS pool with large numbers of their own tickets. Even if they bought up the whole pool (with huge fees) the most they would likely get is about 4000 tickets (based on previous ticket windows where the ones around 30 DCR usually go up to 100 for the next window, and the max for the one after that is often over 300). So a large balance holder could probably buy 2 windows out. A window at 30 would be 86,400 DCR, then the next at 100 would be 288,000 DCR. So it would cost 374,400 DCR to buy 5760 tickets. With a target pool size of 40960 tickets, 374400 DCR would give you about 14% of all tickets. -Now the holder could wait a couple of days for the price to drop then start buying back up again. Except that most of their funds will be locked in the ones they bought earlier (although some will have voted) so their buying power for the new window is greatly reduced. But let's say they have super capital and bought all the decred on all exchanges. So they are able to buy another two windows and replace those tickets that voted and were successful in buying all the tickets (at very high fees and/or prices). Let's say that takes them to about 25% of the tickets. +Now the holder could wait a couple of days for the price to drop then start buying back up again. Except that most of their funds will be locked in the ones they bought earlier (although some will have voted) so their buying power for the new window is greatly reduced. But let's say they have super capital and bought all the DCR on all exchanges. So they are able to buy another two windows and replace those tickets that voted and were successful in buying all the tickets (at very high fees and/or prices). Let's say that takes them to about 25% of the tickets. -Tickets for a block are chosen with a random distribution. To force a vote to go a certain way you would need 3 out of 5 votes for a given block which is 60%. Even with that huge expenditure of capital, -they are less than half way there. And a vote isn't decided on a single block so you would need 60% of 75% of blocks in the voting period. +Tickets for a block are chosen with a random distribution. To force a vote to go a certain way you would need 3 out of 5 votes for a given block which is 60%. Even with that huge expenditure of capital, they are less than half way there. And a vote isn't decided on a single block so you would need 60% of 75% of blocks in the voting period. And THEN you still need the PoW miners to confirm the votes. If they think someone is trying to game the system, they can choose to invalidate blocks. So basically this is close to impossible, even if a single person has a HUGE percentage of DCR. -But then we come to the stake pools. Stake pools, while not having access to any of their users' funds, do have the ability to change votes on tickets assigned to them. This is why it is suggested that when joining a stake pool, people don't just go for the largest one. Decred is short for 'decentralised credit' so part of the spirit of PoS is ensuring that the PoS stake pools don't get too large in relation to the others. However, even the largest at almost 20% would still only get on average one vote per block. +But then we come to the Voting Service Providers. VSPs, while not having access to any of their users' funds, do have the ability to change votes on tickets assigned to them. This is why it is suggested that when joining a stake pool, people don't just go for the largest one. Decred is short for 'decentralised credit' so part of the spirit of PoS is ensuring that the VSPs don't get too large in relation to the others. However, even the largest at almost 20% would still only get on average one vote per block. -So Decred was specifically designed to minimise impact from both large PoW and PoS pools as well as individuals (including developers) with large holdings. +Decred was specifically designed to minimise impact from both large PoW mining pools and PoS VSPs as well as individuals (including developers) with large holdings. ## :fa-book: Links diff --git a/docs/faq/proof-of-stake/solo-mining.md b/docs/faq/proof-of-stake/solo-mining.md index 564f1dc1f..55294c88f 100644 --- a/docs/faq/proof-of-stake/solo-mining.md +++ b/docs/faq/proof-of-stake/solo-mining.md @@ -1,20 +1,18 @@ -# Solo Mining +# Solo Voting --- #### 1. Do I need hash power to stake mine? -Stake "mining" does not need any hash power[^9304]. Think of it a bit like interest on invested coins. You lock your coins for a period of time in order to purchase a ticket that gives you a high probability (>99%) of gaining voting rights and receiving interest in exchange for casting a vote and the opportunity cost of not being able to use those coins for potentially up to ~4.7 months. +Stake "mining" is a term that is no longer used, because the actions and dynamics associated with PoS voting are very different to PoW mining. -If you have already purchased stake tickets, those coins are locked until the tickets either win or expire. You are solo staking and therefore you MUST keep your wallet online 24/7 until all of your tickets have won (or expired) or you will miss out on the rewards since you cannot cast a vote if you wallet is not online. Because those coins are now locked there is no way for you to change the already staked coins now. - -The stake pool, on the other hand, allows you to delegate your voting rights to the pool so it is responsible for being online 24/7 and casting your vote for you. +Voting does not require any hash power[^9304]. The only requirement is having enough DCR to stake (lock) in exchange for a ticket. --- -#### 2. Isn't one of the main reasons for stake mining to ensure there are always a sufficient amount of peers online? +#### 2. Isn't one of the main reasons for Proof-of-Stake (PoS) voting to ensure there are always a sufficient amount of peers online? -Definitely not[^9311]. Stake mining cannot possibly enforce that. An SPV style wallet could easily perform the necessary staking by communicating with other full nodes (`dcrd` instances) on the network. It is true that the current wallet requires `dcrd` to be running, but that will not always be the case. +Definitely not[^9311]. Stake voting cannot possibly enforce that. An SPV-style wallet could easily perform the necessary voting by communicating with other full nodes (`dcrd` instances) on the network. It is true that the current wallet requires `dcrd` to be running, but that will not always be the case. Even if the software did try to enforce that, you could not stop people from writing utilities and such to do it via the peer-to-peer network without needing to run their own local instance anyways. diff --git a/docs/faq/proof-of-stake/stake-pools.md b/docs/faq/proof-of-stake/stake-pools.md index d2b77d60d..2b75bbf7c 100644 --- a/docs/faq/proof-of-stake/stake-pools.md +++ b/docs/faq/proof-of-stake/stake-pools.md @@ -2,10 +2,10 @@ --- + #### 1. Are there any other benefits to a stake pool other than not needing to run a full node and keeping your wallet unlocked? For example, will it have a better chance of winning or anything like that? -Stake pools will usually implement multi-wallet redundancy by having many wallets physically distributed around the globe. This means there's less chance of a vote -being missed because one wallet is down. It also reduces latency between the wallet and network which can reduce the chance of a vote being missed. +Stake pools will usually implement multi-wallet redundancy by having many wallets physically distributed around the globe. This means there's less chance of a vote being missed because one wallet is down. It also reduces latency between the wallet and network which can reduce the chance of a vote being missed. Using a stake pool (Voting Service Provider (VSP)) does not affect the chance of one's ticket being called to vote. --- diff --git a/docs/governance/how-to-vote.md b/docs/governance/how-to-vote.md index 1486a3873..9e5251733 100644 --- a/docs/governance/how-to-vote.md +++ b/docs/governance/how-to-vote.md @@ -1,19 +1,20 @@ -# **How To Vote** +# **How to Vote on consensus rule changes** This guide assumes you already have an active wallet and have purchased tickets. If not, please follow the [Voting Preparation](consensus-rules-voting.md#voting-preparation) guide. The choice a ticket votes with depends on your vote preference at the time the ticket is chosen, not when it is bought. So you can set your choice at any time within the voting window and all future tickets will vote accordingly. -## **Stakepool Voting** +## **Voting with a Voting Service Provider (VSP)** -If your Stakepool has updated to the latest stakepool software, you will find a "Voting" page in the navigation menu with dropdown options for each agenda. After you've chosen how you want your tickets to vote, simply press the "Update Voting Preferences" to save your votechoices. Below you'll find an image of the votechoices for vote version 5. +If your Voting Service Provider (VSP) has updated to the latest VSP software, you will find a 'Voting' page in the navigation menu with dropdown options for each agenda. After you've chosen how you want your tickets to vote, simply press the 'Update Voting Preferences' button to save your vote choices. Below you'll find an image of the vote choices for vote version 5. -You can also update your voting preferences via Decrediton. Under the Tickets section, you'll find the option to set your vote. You must be using a stake pool to use this option. +You can also update your voting preferences via Decrediton. Under the 'Tickets section', 'Governance tab', you'll find the option to set your vote. + --------------------------- ## **Solo Voting** diff --git a/docs/mining/how-to-stake.md b/docs/mining/how-to-stake.md index 827d0a629..596ecd94f 100644 --- a/docs/mining/how-to-stake.md +++ b/docs/mining/how-to-stake.md @@ -1,37 +1,38 @@ -# How to Stake +# How to Stake/Vote --- -## How to Stake +## How to Stake/Vote -Participating in proof-of-stake requires a Decred wallet to be running 24/7. The wallet needs to be always online so that it can be called to vote - if the wallet is unavailable then the votes will be missed and no block reward will be received. +Participating in Proof-of-Stake (PoS) voting requires a Decred wallet to be running 24/7. The wallet needs to be always online so that it can be called to vote; if the wallet is unavailable then the votes will be missed and no block reward will be received. -Running your own always-online wallet is known as "Solo" staking/mining. +Running your own always-online wallet is known as **"Solo" Voting**. -Stakepools are available for those unable to keep a personal voting wallet online. Using a stakepool is completely safe, the Decred PoS protocol allows you to delegate your vote to a stakepool's always-online wallet without ever giving the stakepool access to your funds. +**Voting Service Providers (VSPs)** (formerly "Stakepools") are available for those unable to keep a personal voting wallet online. Using a VSP is completely safe; the Decred PoS protocol allows you to delegate your vote to a VSP's always-online wallet without ever giving the VSP access to your funds. --- -## Solo PoS +## Solo PoS Voting -Solo mining is currently only possible using the Decred command line tools. The [Buying Tickets with dcrwallet](../getting-started/user-guides/dcrwallet-tickets.md) guide explains how to buy tickets using the CLI wallet `dcrwallet`. +Solo PoS voting is currently only possible using the Decred command line tools. The [Buying Tickets with dcrwallet](../getting-started/user-guides/dcrwallet-tickets.md) guide explains how to buy tickets using the CLI wallet `dcrwallet`. --- -## PoS using a Stakepool +## PoS using a Voting Service Provider (VSP) -You can find the list of all official stakepools and statistics by visiting the -[:fa-external-link-square: Decred website](https://decred.org/stakepools/). +A list of Voting Service Providers (VSPs) and statistics is maintained on the +[:fa-external-link-square: Decred.org website](https://decred.org/stakepools/). -Using a stakepool DOES NOT give the pool access to your funds. All you are doing is granting voting rights to the pool. +Using a VSP **does not give the pool access to your funds**. All you are doing is granting voting rights to the VSP. -In order to support network decentralization, it is recommended that you join a smaller pool with fewer live tickets. +In order to support network decentralization, it is recommended that you join a smaller VSP with fewer live tickets. As VSPs control tickets delegated to them, they could in theory vote those tickets in a way which contradicts the expressed wishes of the ticket owners. This could be easily detected, and any VSP which attempted it would likely be abandoned by the stakeholder community. However, it is good practice to limit the power of individual VSPs, to limit the potential for damage from this kind of attack. -All stakepools run the same basic code, but they may differ in the amount of redundancy available. -More redundancy equals less chance of missed votes, although all pools will have missed votes as many missed votes are caused by PoW miners. -Sometimes they will find a solution to the blocks so quickly that votes haven't had time to propagate around the network. +Unlike Proof-of-Work (PoW) mining pools, VSPs do not pool work or rewards. The number of tickets a VSP has does not affect how regularly one's tickets will be called and rewards received. -There are currently two wallets which support stakepool voting: +All VSPs run the same basic code, but they may differ in the amount of redundancy available. +More redundancy equals less chance of missed votes, although all pools will have some missed votes as many missed votes are caused by PoW miners. This is because sometimes miners will find a solution to the next block so quickly that votes haven't had time to propagate around the network. -- `Decrediton` - GUI wallet for Windows/macOS/Linux. The [Purchase Tickets tab](../getting-started/user-guides/using-decrediton.md#tickets) is used to buy tickets. +PoS voting using a VSP can be done using Decrediton or dcrwallet. + +- `Decrediton` - GUI wallet for Windows/macOS/Linux. The [Tickets menu, Purchase tab](../getting-started/user-guides/using-decrediton.md#tickets) is used to buy tickets. - `dcrwallet` - CLI wallet for Windows/macOS/Linux. The [Buying Tickets with dcrwallet](../getting-started/user-guides/dcrwallet-tickets.md) guide explains how to purchase tickets via command line. diff --git a/docs/mining/proof-of-stake.md b/docs/mining/proof-of-stake.md index f7a81f608..6375be835 100644 --- a/docs/mining/proof-of-stake.md +++ b/docs/mining/proof-of-stake.md @@ -1,22 +1,29 @@ -# Proof-of-Stake (PoS) Mining +# Proof of Stake Voting + --- ## Overview -Decred's unique Proof-of-Stake protocol serves multiple purposes: +Proof-of-Stake (PoS) voting is a form of Proof-of-Stake (PoS) security, but the way Decred integrates this as a complement to Proof-of-Work (PoW) mining gives it a distinctive set of roles and characteristics. -1. Allowing stakeholders to vote for or against proposed changes to the Decred blockchain. If stakeholders vote in support of a change, the chain will hardfork and the new feature becomes active automatically. More information on voting can be found in the [Mainnet Voting Guide](../governance/consensus-rules-voting.md). +PoS voting serves a number of purposes: -1. Providing a mechanism for stakeholders to keep check of nonconforming proof-of-work miners. Stakeholders can vote a block invalid even if it conforms to the consensus rules of the network. This allows stakeholders to discourage unfavourable mining behavior such as mining empty blocks. +1. Allowing stakeholders to vote for or against proposed changes to the Decred blockchain. If stakeholders vote in support of a change, the chain will hardfork and the new feature becomes active automatically. More information on voting can be found in the [Mainnet Voting Guide](../governance/consensus-rules-voting.md). +1. Providing a mechanism for stakeholders to influence Proof-of-Work (PoW) miners. Stakeholders can vote to withhold a miner's reward even if the block conforms to the consensus rules of the network. This allows stakeholders, in principle, to discourage problematic mining behavior such as mining empty blocks. +1. For a block to be valid, it has to be signed by at least 3 of the 5 tickets that are called to vote in that block. This makes the Decred blockchain more robust to certain kinds of attack, such as those which rely on secret mining. +1. The same principle makes the Decred blockchain resistant to contentious hard forks. PoW Miners are unable to build on a chain without the Votes of the tickets that are called. +1. Snap voting of live tickets is used to make decisions about the project treasury through [Politeia](../governance/politeia.md). -1. Allowing long-term holders of Decred to lock up their funds for a length of time in order to accrue new coins from the [Block Reward](../advanced/inflation.md). +These roles are incentivized; ticket-holders (or "Proof-of-Stake (PoS) Voters") collectively receive 30% of the block reward when their tickets are called to vote. --- -## How Proof-of-Stake Works +## How Ticket Voting Works -To participate in proof-of-stake mining, stakeholders lock some DCR in return for a ticket. Every ticket owned gives a stakeholder the ability to cast a single vote. Upon voting, each ticket returns a small reward plus the original **Ticket Price** of the ticket. Each ticket is selected to vote at random, giving an average vote time of 28 days, but possibly requiring up to 142 days, with a .5% chance of expiring before being chosen to vote (this expiration returns the original **Ticket Price** without a reward). Every block mined must include 5 votes (Miners are penalized by a reward deduction if fewer than 5 votes are included). Every block mined can also include up to 20 fresh ticket purchases. A new ticket requires 256 block to mature before it is entered into the **Ticket Pool* and able to be called upon to vote. +To participate in PoS voting, stakeholders lock some DCR in return for a ticket. Every ticket owned gives its holder the ability to cast a single vote. Upon voting, each ticket returns a small reward plus the original **Ticket Price** of the ticket. Each ticket is selected to vote at random, giving an average vote time of 28 days, but possibly requiring up to 142 days, with a 0.5% chance of expiring before being chosen to vote (this expiration returns the original **Ticket Price** without a reward). Every block mined must include 5 votes (Miners are penalized by a reward deduction if fewer than 5 votes are included). + +Every block mined can also include up to 20 fresh ticket purchases. A new ticket requires 256 blocks to mature before it is entered into the **Ticket Pool** and can be called to vote. There are a few important variables that you should familiarize yourself with while staking. @@ -26,29 +33,31 @@ The **Ticket Price**/**Stake Difficulty** is the price you must pay for a ticket The **Ticket Pool** is the total number of tickets in the Decred network. -The **Ticket Fee** (`ticketfee`) is the fee rate that must be included in the ticket purchase to incentivize Proof-of-Work miners to include that ticket in a new block. **Ticket Fee** usually refers to the DCR/kB fee rate for a ticket purchase transaction. Therefore, with a higher transaction size, you will end up paying a higher absolute fee. For example, solo-staking ticket purchases are around 300 Bytes, which means a **Ticket Fee** of .3 DCR/kB will result in the spending on .1 DCR if, and only if, that ticket gets included in a block. +The **Ticket Fee** (`ticketfee`) is the fee rate that must be included in the ticket purchase to incentivize Proof-of-Work (PoW) miners to include that ticket in a new block. **Ticket Fee** usually refers to the DCR/kB fee rate for a ticket purchase transaction. Therefore, with a higher transaction size, you will end up paying a higher absolute fee. For example, solo-staking ticket purchases are around 300 Bytes, which means a **Ticket Fee** of 0.3 DCR/kB will result in the spending of 0.1 DCR, if and only if, that ticket gets included in a block. + +**When a ticket is called to vote, the wallet that has voting rights for that ticket must be online.** If the wallet is not online to cast its vote, the ticket will be marked as `missed` and you will not receive a reward for that ticket. In practice, **Solo Voters** often run voting wallets on a number of servers on different continents, to minimise the chance of their tickets missing a call to vote. -When a ticket is called to vote, the wallet that has voting rights for that ticket must be online. If the wallet is not online to cast its vote, the ticket will be marked as `missed` and you will not receive a reward for that ticket. Stakepools are offered as a solution for those that cannot have a voting wallet online 24/7. +**Voting Service Providers (VSPs)** (formerly "Stakepools") offer a service whereby ticket buyers can delegate the act of voting to the VSP. The ticket-buyer instructs the VSP how their ticket should vote on any open rule change proposals, but transfers voting rights to the VSP to take advantage of the voting infrastructure they provide (i.e. at least three always-online servers). -Stakepools allow stakeholders to generate ticket purchase transactions that give a stakepool voting rights for your ticket. They vote on your behalf, usually requiring a small fee for participation (under 7%) which covers the cost of hosting the minimum of 3 servers required to run a stakepool. This fee is known as the **Pool Fee** and is only taken out of the small PoS reward. A list of stakepools can be found [here](https://decred.org/stakepools/). +VSPs charge a fee for this service, which is taken out of the reward returned upon a successful vote. This fee is generally 5% or less. A [list of VSPs](https://decred.org/stakepools/) is maintained on decred.org. VSPs do not take custody of DCR. By using them, you only delegate the voting rights of a ticket. --- ## Ticket Lifecycle -Purchasing a ticket for PoS is quite simple (see below) but what happens to it after you buy it? -A ticket on main net (test net uses different parameters) will go through a few stages in its lifetime: +Purchasing a ticket is quite simple (see below), but what happens to it after you buy it? +A ticket on mainnet (testnet uses different parameters) will go through a few stages in its lifetime: 1. You buy a ticket using a Decrediton or dcrwallet wallet. The total cost of the each single ticket transaction should be **Ticket Price** + **Ticket Fee**(`ticketfee`). 2. Your ticket enters the `mempool`. This is where your ticket waits to be mined by PoW miners. Only 20 fresh tickets are mined into each block. -3. Tickets are mined into a block in with higher **Ticket Fee** transactions having a higher priority. Note that the **Ticket Fee** is DCR per KB of the transaction. A few common transaction sizes are 298 Bytes (a solo ticket purchase) and 539 Bytes (a pool ticket purchase). +3. Tickets are mined into a block, with higher **Ticket Fee** transactions having a higher priority. Note that the **Ticket Fee** is DCR per KB of the transaction. A few common transaction sizes are 298 Bytes (a solo ticket purchase) and 539 Bytes (a pool ticket purchase). 4. **A -** If your ticket is mined into a block, it becomes an immature ticket. This state lasts for 256 blocks (about 20 hours). During this time the ticket cannot vote. At this point, the ticket fee is non-refundable.
**B -** If your ticket is not mined, both the **Ticket Price** and **Ticket Fee** are returned to the purchasing account. 5. After your ticket matures (256 blocks), it enters the **Ticket Pool** and is eligible for voting. -6. The chance of a ticket voting is based on a Poisson distribution with a mean of 28 days. After 28 days a ticket has a 50% chance to have already voted. +6. The chance of a PoS voting is based on a Poisson distribution with a mean of 28 days. After 28 days a ticket has a 50% chance to have already voted. 7. Given a target pool size of 40960 tickets, any given ticket has a 99.5% chance of voting within ~142 days (about 4.7 months). If, after this time, a ticket has not voted, it expires. You receive a refund on the original **Ticket Price**. 8. A ticket may miss its call to vote if the voting wallet does not respond or two valid blocks are found within close proximity of each other. If this happens, you receive a refund on the original **Ticket Price**. -9. After a ticket has voted, missed, or expired, the funds (ticket price and subsidy if applicable, minus the fee) will enter immature status for another 256 blocks, after which they are released. If a ticket is missed or expired, a ticket revocation transaction is submitted by the wallet which then frees up the locked ticket outputs. **NOTE:** Revocations can only be submitted for a corresponding missed ticket. You cannot revoke a ticket until it is missed. +9. After a ticket has voted, missed, or expired, the funds (ticket price and reward if applicable, minus the fee) will enter immature status for another 256 blocks, after which they are released. If a ticket is missed or expired, a ticket revocation transaction is submitted by the wallet which then frees up the locked ticket outputs. **NOTE:** Revocations can only be submitted for a corresponding missed ticket. You cannot revoke a ticket until it is missed. ---