Can someone explain in simple words how will this PoW&PoS work for decred? Did I understand the flow right: Reward for the block 30 DCR Some PoW-miner created new block: 1.1 Decred developers team got 10% = 3 DCR 1.2 PoW-miner who created the block got 60% = 18 DCR 1.3 Five PoS-minters were randomly chosen from the tickets pool and received 30% = 9 DCR; (6% = 1.76 dcr for each) Is it right? So my questions are: 1. Where to read more about PoS-realization and rules exactly for decred? 2. To became a PoS-minter is it enough just to keep your wallet always online? So it's better to use some web-service for this or configure some VPS to keep wallet there. UPD: use the stakepool (https://stakepool.dcrstats.com/ or find another in the comparison table in the bottom of the page: https://dcrstats.com) I think there are a lot of laptop-only users on the forum, so PoS is our everything
The company 0 blog has some details about Decred PoS: https://blog.companyzero.com/2015/12/iterating-bitcoin/ POS == point-of-sale POS != PoS (unless you're still running MS-DOS )
By POS I mean "proof-of-stake" from this brief: https://decred.org/dtb001.pdf Updated original question.
The first part breakdown is mostly correct. The only thing you have missing is the fact that the 30% is further split between 5 randomly chosen stake tickets which are called to vote via a lottery. Each stake ticket thus would get 6% (or 1.8 DCR in your example). I'm sure there will eventually be more details available on the wiki or an FAQ, but for a quick overview, in order to be eligible for the lottery, you first have to purchase stake tickets by submitting a special type of signed transaction (called a stake submission transaction, or sstx for short) to the network which locks the coins for a certain period of time. As an aside, this is why cold staking is possible because once you have signed and submitted the sstx, you no longer need the private keys for the original coins available in a hot wallet. Instead there are new private key(s) for the sstx. When a block is mined, a lottery system is used to randomly choose 5 stake tickets which are then called to vote. This is why the stake wallet (or whatever happens to be listening) needs to be online to answer the call. Ultimately the idea is to have stake pools which allow users to pool their funds for voting towards things using multisig. The vote is actually cast by submitting another special type of transaction (called a stake submission generation transaction, or ssgen for short) which is signed by the key(s) associated with the first output of the original sstx. Note these keys are NOT the same as private keys for the original coins, which is what makes the cold staking possible and means they can't be stolen because the original coins aren't actually sent anywhere until they are released. They were simply "locked" to prevent spending. The ssgen transaction effectively casts the vote and causes the original coins and the stake reward to be delivered to the address(es) originally specified in the sstx. I should also note that the PoS difficulty (stake difficulty) dynamically adjusts over time just like the PoW difficulty does. In practice, this means it will get more expensive to purchase stake tickets over time. This effectively keeps the ticket pool size stable and essentially creates a ticket market on the chain.
First, thanks for the response, @davecgh! So, that means that with some probability only one user can deside destiny of the block? What I mean, let's say I have 10K decreds, and one stake ticket costs 1K decreds. So I'm buying 10 tickets and voting "nay" to any block. If 3 of 5 randomly chosen stake tickets was mine, than this block will be dismissed, right? (and nobody including me will receive the reward)
Another question / example: Right after launch decred developers will have their 4% (or 50% of all mined for that moment coins). If they will start PoS-minting for all their coins and will vote always NO to any created block, then they can slow down mining by ~ 50%. Am I wrong?
I have also one question. Quote from decred wiki (https://wiki.decred.org/Introduction#Hybrid_Proof-of-Work_Proof-of-Stake) : "To be considered a stakeholder, one must purchase one or more tickets" "Stakeholders must wait an average of 28 days (8192 blocks) to vote their tickets, and during this time the coins used to purchase the ticket remain locked." "This means that if PoS voters vote against a particular PoW block, it destroys the PoW reward and invalidates any regular transactions within that block." So my question is: Scenario: After 28 days someone (a bad player or anyone how can ) vote NO to a block with other 4 people, the block is destroyed and any regular transactions is invalid. What happens if the coins included in one of these " invalidated " transactions was used in the previous days to buy tickets or transferred in an exchange hot wallet and traded or they are just a legitimate payment between two person? Thanks.
There are two ways to say "no" to a block. Nobody votes at all. In this scenario nobody gets anything and therefore is extremely unlikely to happen in practice because PoS voters are incentivized to vote (either yes or no) through their reward. Not voting would be like leaving free money on the table and is therefore disincentivized. Soft-invalidating a block by a majority "no" vote. In this case, the subsidy that the miner and dev org would have received is destroyed, as well as all transactions in the block, but the PoS voters still receive their portion as if the block were valid (this works because the voting is on the previous block, not the current one). The system works that way because there has to be equal (or at least nearly equal) incentive to vote yes or no. Otherwise, you'd have to choose between voting yes on something you really didn't want to in order to get your PoS reward or voting no and getting no reward. That would unfairly bias the voting process. Now, with that explained, yes there is an extremely low probability (0.00000000105% based on your example) that a single person could end up being able to invalidate a block. However, I think it's prudent to keep in mind that not only is such an event a rarity, it would only apply to a single block, not a bunch of a consecutive blocks. Therefore, the overall network will continue on as normal and only the things the majority stake wants will ultimately win out. In regards to launch, the developers couldn't really slow mining down (see #1 above for why), but they could indeed favor one miner over another. The developers have publicly pledged that after an initial stake mining process to help secure the network, they will throttle their stake mining early on in order to help further foster decentralization. So, let's say only 50% of the airdrop coins only end up being used to mine stake. The developers would throttle their stake mining back accordingly. It is basically impossible to start 100% decentralized, but I think it's pretty clear the developers have gone to great lengths to kick start the process. See the Proof of Activity paper for a detailed treatment of threat models.
There is a 256 block maturity period (average of 21.33 hours) that the ticket must undergo before it is eligible for selection by the lottery. The 28 days figure is the average selection time for any given ticket by the lottery. Obviously that varies wildly just like actual block creation, but over time it averages out to that. PoS voters (the ticket(s) that were randomly selected) can only vote on the previous block. Thus, they can only affect 1-confirmation transactions. In this respect, invalidating a block through voting can be thought of like a reorg. It's as if the normal transactions in the block never happened. Where invalidation differs from an actual reorg though is that a block consists of two different transaction trees secured by independent merkle roots in the header. Normal transactions and stake transactions. Invalidating a block through PoS voting only invalidates the normal transaction tree. The stake transactions remain valid. EDIT: Corrected the maturity period to clarify maturity versus average selection time.
ok i understand your words also if there are a lot of tech and knowledge inside! I'm also reading the document you have posted about PoA. Thanks!
Hi guys im a total noob in this pos process so i need more of a eli5 to my questions, thanks. What is the purpose/added benefits of pos in Decred? Why not just pow. I hear the term voting, but what do you vote for? What is the purpose of the lottery system? Is voting and buying a ticket done automatically by the wallet or do you have to buy a ticket manually after each block? How long is a ticket valid? In pow the more hashpower the more chance to get rewarded, i read that the system will randomly choose 5 stake tickets which gets rewarded. So instead of hashpower you need to buy more tickets to have more chance to get rewarded right? What detemines the price of a ticket? Thanks!
I can ask some question but i don't guarantee ! there are a lot of info here ! https://wiki.decred.org/ What is the purpose/added benefits of pos in Decred? Why not just pow.: This coin is a new concept of cryptocurrency.It's a PoA. https://eprint.iacr.org/2014/452 I hear the term voting, but what do you vote for? : All the matters regarding the community. What is the purpose of the lottery system?: To choose the ticket how can vote and get pos rewards. Is voting and buying a ticket done automatically by the wallet or do you have to buy a ticket manually after each block? manually but i don't know if you join a POS pool if the mecanism is automated by pool admin. What detemines the price of a ticket? the tikets are free they just block your money for some times.
See https://blog.companyzero.com/2015/12/iterating-bitcoin/ and https://eprint.iacr.org/2014/452.pdf which discusses it in detail. Voting is multi-faceted. You can vote for pretty much anything that is made available to vote on. In the context of PoW voting, you vote for whether or not the previous block should be considered valid. This effectively allows the majority stake holders to veto undesired miner behavior. For example, let's say that the majority stake doesn't want to allow blocks produced by miners that are empty when there are thousands of outstanding transactions that need to be mined. By vetoing those types of blocks, the stake holders disincentivize miners from creating them because they will only get a reduced or zero reward for them. In other contexts, it allows you to vote on certain issues for a specific period of time. For example, votes could be established for different block size proposals that allows the majority stake to choose which one (or none) of them should be accepted. Once the majority stake votes something in, it becomes active. This means the majority stake holders are publicly and transparently making a decision instead of a handful of developers and/or miners. The lottery system helps ensure a fair voting system in order to provide decentralized consensus. No, it is definitely not done automatically by default. Buying a ticket is something you have to opt into because it locks your coins making them unspendable for a certain time. You are essentially sacrificing your ability to use the coins for anything else in exchange for a high probability of receiving a reward and voting rights. However, it is possible to configure software to handle it for you automatically according to your preferences. The ticket is valid until it is chosen or for 40,960 blocks (target of 142.22 days), after which time it expires. That figure is based on there being a near 100% probability for the ticket to be chosen before expiring. However, it's important to note here that buying a ticket is actually buying a ticket to 40,960 lotteries. A lottery happens each block with approximately the same level of fairness. That means that some tickets will be unlucky and never get selected before expiring. Yes, you need more tickets to have a higher probability that one or more of your tickets are selected. In order to buy more tickets, you need to own more coins and choose to stake them thus making you a larger stake holder in the system. The system has also been designed with stake pooling in mind, so all stake holders, even those with few coins, can join forces in order to have influence over the direction of which blocks are incentivized and which are disincentivized and which features and changes are voted in or out. Stake pool rewarding will likely end up working like PoW mining in the sense the entire pool has a greater chance of having one of its tickets called and so can amortize the rewards and split them between all members based on the percentage of their contribution. The net effect would be a smaller and more consistent stream of rewards versus solo staking. There is a stake difficulty algorithm that is based on the number of currently active tickets and new tickets entered per block.
So the stake difficulty is proportionate to the work difficulty or just the number of active/new stake tickets or some combo of both? I was unclear on this at first too. To 'vote' you need to do work? So it is like mining and will require some lesser level of mining hardware to do?
So the stake difficulty is proportionate to the work difficulty or just the number of active/new stake tickets or some combo of both?
No, stake doesn't have 'work' involved in the same way that proof of work does. There is no puzzle to solve. Although we've been referring to it as stake difficulty due to the underlying code naming and fact it is similar to the dynamic PoW difficulty retargetting process, I see that it's probably less confusing to refer to it as stake ticket price, as that is realistically what it ends up being. So, I'll refer to it as that from now on. So, rewording it then, the stake ticket price is calculated based on the number of currently active stake tickets and number of new tickets purchased per block (max of 20 may be purchased per block) across a retarget interval. A very simplified view is that there is a target maximum number of active stake tickets, so when there are less active tickets than the target, the stake ticket price goes down. When there are more active tickets than the target, the stake ticket price goes up. Just like the PoW difficulty readjustment, there are limits to how far in each direction the stake ticket price can change for each retarget interval. The actual implementation is a bit more complex than that simplified view as it also takes into account the number of tickets purchased per block and makes use of weighted averages, but hopefully the simplified view helps convey the general concept. EDIT: Added some additional clarifications.