PoS - How does it really work? Long and maybe confusing thread incoming ;)

The lottery is about when you get your reward, which causes only small differences in how much you get. If you happen to get the reward exactly one year after the transaction, you’ll get the perfect 1% over the year. If you get one block half way through and another at the end of the year, you’ll get 0.5% over your balance twice. The difference between the two is that you’ll get compound interest in the second case, so rather than the perfect 1% you’ll actually get 1.0025%. The maximum you could possibly get this is one block every 30 days (for a huge balance with a lot of luck). In that case you’d end up with a total of 1.0046% interest on a yearly basis.

So the difference between the minimum interest and the maximum interest you can possibly earn is small.

No as I understand you can’t get at once 1% at the end of year as coins reach maximum maturity after 90 days.
Regarding amount of peercoins you should hold not to waste coindays would be in worst scenario (if nobody in network is wasting coindays) like this:
In 90 days you have 90246=12960 number of blocks created (asuming all blocks are PoS).
If market cap at that moment would be worth e.g. 13B$ then you would need to have at least 1M$ right?
That could be improved with expanding maximum number of days coin could mature e.g if coin could mature up to 5 years figure you should have would be then 50k$, still not available to common participants…
Also with expending maximum maturity it allows for cheaper double-spend attack.

If only rich ppl are allowed to collect interest then this coin would not have bright future?
So what could be solution to this? I guess some “pool” might be constructed but that pool would differ from PoW pool as it have to have whole lot trust in it as ppl would trust it with all their money not just hasing power like at bitcoin.

Had some thoughts on pooling with PoS. Even once trust issues has been solved, then I’m not sure if the network would be happy with it. The risk on creating a few big PoS pools would be a threat to the network and go against the distributed nature of it. This becomes more important once PoW is no longer profitable for PPC.

Not sure how to solve this, setting a maximum PoS per node is easy to circumvent by adding a few nodes, setting a maximum on one account is also not working. Setting maximum coinage on 90 days as been done last year fixes this problem to some extent, but PoS pools would significantly reduce the value of that.

I guess it is the same problem as we have with current currencies, e.g. Dollars and Euros. Small account get no interest, bigger accounts get a lot of interest and the largest accounts have the opportunity to buy the bank if they collaborate. A way to somewhat stop that from happening is coin destructing when coins are not being used. But this also has its flaws and goes against the nature of a reserve currency PPC is.

A possible way to go is being able to have unique worldwide identities in the system which are tied to crypto accounts. Rules and enforcement can then be set to prevent overtaking the network. However such system (worldwide eGov) is not available yet and it still might not stop lot’s of people collaborating to attempt it. 8)

Just thinking out loud, but I was considering a hypothetical situation that could occur if multiple sig addresses could be used to allow multiple holders to collaborate for pooling their holdings for PoS minting.

Functionally, I think it works, and provides the trust and security needed, but economically, it’s hazy whether or not it would make a significant difference.

All things considered though, PoS yearly rewards are about as equitable as you’ll find in any system – assuming a loophole isn’t discovered, everyone gets their 1%, per year, rather than in today’s world where your holdings are directly related to how good of rates you’ll be offered by a financial institution.

Yea if it would be built into protocol (maybe it is???) than different addresses could join into “decentalized teams” and if anyone in team would succeed in finding block then all of them would earn interest. What would be wrong with that? And to decrease overhead in kernel of the block, it could be limited to some value e.g. max 1000 participants/addresses in one team and later that limit could be moved more…

Multiple Sigs might work to solve trust issue. However the network would gain more from multiple nodes with small account than a few with large accounts.
So only if you keep your stake in your (private) node and the system provides a way to share the stake across nodes this would work.

Not sure about the system being equal as small stakeholders might not be able to mint a block within 90 days. This will depend on stake (coinage) and network block creation (PoS difficulty) as far as I understand. Still trying to find out the calculation for that in another thread.

I think the expectation needs to be clearly set, e.g. account <1000 PPC have <50% chance to forge a block in 90 days given a certain difficulty (BTW this is an assumption)

That’s a good point. If someone only has 1 PPC, even after 90 days, they only have accumulated 90cd. If it takes ~140000 cd to mint a block, the probability of solving the block on any day isn’t terribly high.

I know that it can work though, at small values, because if you look at block 89327, which was solved tonight via PoS, only 62.09 PPC was required for stake.

Digging into the block chain to follow the transactions used for that stake, I see that 38.59 PPC came from a transaction on 8/30/2013 (~126 days) and the rest, 23.3 PPC, came from a transaction on 9/17/2013 (~108 days). With the max coinage reached for that stake (5588.1 cd), it took ~26 days beyond the maximum to solve the block.

Difficulty for that PoS block was 6.568, in case it is of value.

[quote=“petar87, post:42, topic:648”]No as I understand you can’t get at once 1% at the end of year as coins reach maximum maturity after 90 days.
Regarding amount of peercoins you should hold not to waste coindays would be in worst scenario (if nobody in network is wasting coindays) like this:
In 90 days you have 90246=12960 number of blocks created (asuming all blocks are PoS).
If market cap at that moment would be worth e.g. 13B$ then you would need to have at least 1M$ right?
That could be improved with expanding maximum number of days coin could mature e.g if coin could mature up to 5 years figure you should have would be then 50k$, still not available to common participants…
Also with expending maximum maturity it allows for cheaper double-spend attack.

If only rich ppl are allowed to collect interest then this coin would not have bright future?
So what could be solution to this? I guess some “pool” might be constructed but that pool would differ from PoW pool as it have to have whole lot trust in it as ppl would trust it with all their money not just hasing power like at bitcoin.[/quote]
I thought that the maximum of 90 coindays only applied to the accumulation of stake (chance of minting a block) to prevent someone from collecting a ton of stake and do a 51% attack. I should hope that if you do end up minting a block with older coins, you would get interest over the full coin age acquired. Please confirm!

If not, I agree this system is very skewed towards the wealthy…

That’s an interesting nuance, if your assertion is true. It appears to solve one of the “gotchas” with proof- of-stake that I could not seem to get my head around.

Assersion: coinage accumulates beyond 90 days, and is used as a variable in the payout reward, but the “difficulty” of solving a PoS block caps at coinage of the stake*90.

When I get a chance, I’ll add to my spreadsheet to see how it modifies different values for stakes solved at different times over the course of one year.

[quote=“Jazzer, post:48, topic:648”][quote=“petar87, post:42, topic:648”]No as I understand you can’t get at once 1% at the end of year as coins reach maximum maturity after 90 days.
Regarding amount of peercoins you should hold not to waste coindays would be in worst scenario (if nobody in network is wasting coindays) like this:
In 90 days you have 90246=12960 number of blocks created (asuming all blocks are PoS).
If market cap at that moment would be worth e.g. 13B$ then you would need to have at least 1M$ right?
That could be improved with expanding maximum number of days coin could mature e.g if coin could mature up to 5 years figure you should have would be then 50k$, still not available to common participants…
Also with expending maximum maturity it allows for cheaper double-spend attack.

If only rich ppl are allowed to collect interest then this coin would not have bright future?
So what could be solution to this? I guess some “pool” might be constructed but that pool would differ from PoW pool as it have to have whole lot trust in it as ppl would trust it with all their money not just hasing power like at bitcoin.[/quote]
I thought that the maximum of 90 coindays only applied to the accumulation of stake (chance of minting a block) to prevent someone from collecting a ton of stake and do a 51% attack. I should hope that if you do end up minting a block with older coins, you would get interest over the full coin age acquired. Please confirm!

If not, I agree this system is very skewed towards the wealthy…[/quote]

I read somewhere that coindays are wasted (interest not earned) after 90 days in order to give incentive to PoS miners so solve blocks frequently before 90 days period. So now I am not sure if there is interest for coindays after 90 days or not? I just downloaded code and looks like CTransaction::GetCoinAge() method does not use 90 days limit when counting coindays to calculate reward.

Then I can see as incentive for miners to mint PoS blocks frequently only in compound interest. Could that be strong enough incentive to keep network secure? The less coindays are wasted network is more secure.

[quote=“Ben, post:49, topic:648”]That’s an interesting nuance, if your assertion is true. It appears to solve one of the “gotchas” with proof- of-stake that I could not seem to get my head around.

Assersion: coinage accumulates beyond 90 days, and is used as a variable in the payout reward, but the “difficulty” of solving a PoS block caps at coinage of the stake*90.

When I get a chance, I’ll add to my spreadsheet to see how it modifies different values for stakes solved at different times over the course of one year.[/quote]

Probably this is the only way, otherwise you simply break the system when coins get spread out more as there simply aren’t enough blocks to go around for everyone in 90 days. Furthermore, this should also apply to the first 30 days (when you aren’t collecting stake yet). Those first 30 days of coinage should also count towards the interest reward, as otherwise a PPC transaction cuts into future interest effectively leading to a transaction fee of almost 0.1% of the transacted amount on top of the fixed fee.

I wasn’t sure if you were referencing this, or something else, but proof-of-stake transactions are fee-less.

Very interesting ideas.

I think Jazzer is referring to the first 30 days without coinage and calling that fee of almost 1% on 1% interest (1/12 of 1%). Hope Petar is right that calculation of stake stops with 90 days, but that calculation of interest (coinage) still continues. That would be great. Even so, it doesn’t increase your chance to solve a block at any given time as your stake stays the same, but once you succeed you will be rewarded for the coinage at the time you solve the block. This would also mean that you cannot touch your coins unless you have solved a block or loose your interest. Hmmm.

I understand that the 90d coinage cap for the calculation of proof of stake came in to prevent 51% attack from wealthy coinholder sitting for e.g. year on coins. Side effect is that it creates issues with most of us holding smaller values. Hope the assertions made above are true and someone can proof it with actual code or better acknowledgement from the developer(s).

I found some proof from ‘the developer’ for this in one of the chats, Ben you would remember this one?

Sunny King @Ben it’s ca 10-600; ca 100-6000 1385764969
Sunny King it’s the stake generation weight, i.e. proportional to the chance that you can generate the blocks 1385765021
MeBeingAwesome Mcgin - Sent PM, let me know if it didn’t come through 1385765040
Sunny King the reward is different, is based on simple coin-age 1385765045

Stake is limited by 90d, reward is different and just based on coin age without limitation. The answers are out there, just finding them. Pfff.

Yeah, I remember the conversation, but like a lot of things, I was still trying to grasp the fundamentals. I’ll reread the chat exchange when I’m at my computer and see if it all makes more sense :slight_smile:

i find this thread very informative. Im sitting here soaking in this incredible information. Thanks for clarifying POS guys.

I’ve updated the draft calculator for figuring out potential proof-of-stake rewards based on coin age. Improvements:

[ol][li]Calculation now takes into account the fact that coinage (for reward calculations) continuously accrue until it is destroyed when used in a transaction. The table covers 365 days, but presumably, coinage will still increase after that point, as will the potential reward.*[/li]
[li]Coinage that contributes to an increased chance to solve a proof-of-stake block only matures between Day 31 and Day 91.[/li][/ol]

Here’s a link to the Excel file. Please play around with it and let me know if it’s accurately producing values. Bonus points if you get a chance to load in known data from your own minting successes to confirm that they match up based on the coinage consumed to generate the block.

https://dl.dropboxusercontent.com/u/4111133/Peercoin/ProofOfStakeCalc-draft3.xlsx

  • Unknown: If coinage that has reached maturity has not solved a block within a year, does the equation, [font=courier]coinage * 33 / (( 365 * 33 + 8 ) * nRewardCoinYear)[/font] still hold true? In this case, nRewardCoinYear = 0.01. The calculation appears to support it, for instance, if you have 10000 PPC and you try to mint stake for two years (and have incredibly, impossibly, horribly, very bad luck), and finally on Day 730 your 10000 PPC staked solves a block, the reward should be 199.867253 PPC, which matches up to exactly double what it would be (99.93362648 PPC) if you had solved that same block at Day 365.

I’ve been digging deep into the corners of the internet. Have a look at the wiki here:

https://en.bitcoin.it/wiki/Proof_of_Stake

If you’re brave also try these posts:
https://bitcointalk.org/index.php?topic=68213.msg799549#msg799549
and
https://bitcointalk.org/index.php?topic=68213.msg801015#msg801015
and this:
https://bitcointalk.org/index.php?topic=68213.msg801253#msg801253
The question remains what factors were chosen within PPC.

They are talking about a randomiser factor +Coin age to solve blocks, double the coinage doubles your chance. I got that.
Ok, let’s do some examples ignoring any complex randomisers to equal chances to start with. Let’s say you have just one block in a certain period.

And the following people have their wallet set to minting:
5 people (A) have 100 coinage, 4 people (B) have 50 coinage, 1 © has 24 coinage and 1 (D) only 1 coinage.

Throwing this into the pool; A has double the chance of solving a block over B. B would have double the chance over C.
But what is the actual chance for A, B and C? Total coinage is 5100+450+124+11= 725
So someone in group A would have a 100/725 chance = ~13.79% chance. An individual in B would have 50/725 = 6.7% C would have 24/725 = 3.3% and D only 1/725 = 0.13%

Let’s keep these 11 individuals and add more blocks into it. With Peercoin we seem to have 6 blocks every hour. However it seems there are on average 5 to 6 blocks PoS and 1 block PoW in an hour (this needs further statistical proof). Let’s assume 5 blocks in hour for PoS. A day has 24 hours. 5 blocks x 24 = 120 blocks/days

So what are the chances now? To me each individual would have 120x times more chance (draws) to solve a block in a day then if there was only one.
So someone from group A would on average successfully mint a block after 100/16.55% = 6.04 blocks.
C have to wait for 100/6.7% = 14,93 blocks to successfully mint.
However D 100/0.13% = 769 blocks, so the chance of D minting a block on that day is 0.13% * 120 blocks = 15.6%

The above assumes that if a buy 1 lotto ticket out of 100 tickets (=1% chance) then after 100 draws I should have won on average at least once given all variables equal. However the uncertainty principle may vary the number of draws before a win as I still have only 1% chance in every draw.

Here I need some help in mathematics. Question: Does each block provides all minting wallets with an equal chance based on their stake again and again, ignoring the fact that coins will be destroyed when a wallet successfully creates a block (mints)?

If so, then we’re ready to introduce another complex factor, as soon we have one person solving a block his stake would be removed and the others will have a higher chance with the next block. In our example we know that people in group A have 100 coinage at stake. But how would we know that in the network? Solving this would provide a variable against the percentages above.

I think this is only solvable if you know how many coinage each wallet has at stake when a block is to be created. As far as I know this information is not in the blockchain. You’ll find how much coins would be eligible, but not how many are actually active nodes and how many coins each wallet/node would have at stake. Is this a dead end?

I think we can still make a model assuming the number of coins at stake and number of nodes based on number of coins, number of nodes, number of wallets, total coins and some variables about the number of coins at stake. This would provide best case and worst case scenarios given a certain coinage.

If you’re still with me after reading the above then you’re probably a mathematician or a very big proof-of-stake/PPC fan :wink:

The way I understand it, it still keeps track of the reward you are due so you don’t get ripped off. I would imagine if you wanted to test it out for sure, you could purposefully choose not to mint for say 120 days, and then see what the mint reward would be. You should get the full amount of reward though. If had 100 Peercoins and you saved them for 10 years, and then minted… you should receive 10 coins. The only thing you would miss out on is compound interest… which if you started with 100 coins would be about .001 PPC that you would have missed out on over ten years time… which is not much really to worry about, IMO.

Ok, I’m on a roll now. Just found the average coin age here: ppc.cryptocoinexplorer.com. There is also the %coins days destroyed. 77.762% This says something about the liquidity of the coin. Unsure if that comes in handy, I’m parking this one for now.

As of today average coin age is 91.3113. We have 21,040,910 coins created.
So the coin age pool is 91.3113 * 21,040,910 = ~ 1,921,272,845 (total number of possible lottery tickets)
However coins <30d are not eligible and coins not online (at stake) are not in the lottery either.

Let’s assume that most people would put up their coins at stake when they matured to 90d (most effective). This would mean that 33% with eligible coins would not join the lottery on average.
Let’s also assume that 10% of those doesn’t put up their coins at stake at all (too small, lost, forgot about it etc.)

So we have 100% - 33% - (10% of 33%) = 63.3%
BTW Feel free to adjust those assumptions or comment if you have good sources where you can better calculate them.

Ok, so 63,3% of 1,921,272,845 coindays are really in the competition on a daily bases on average. That is ~ 121,615,710 coindays.

Now we can calculate the chance you would have assuming all variables static. In real life they won’t be as stakes/coindays would be destroyed when succeeding in creating a block and people would be bring coins on and off-line. But I think this is as close as we can get.

So let’s make the simplest calculation and calculate a percentage and duration for 100 PPC with 90 coindays. Only put at stake on day 90 (is maximum stake).
So we have 9000 coindays (coinage) at stake (9000 tickets in the lottery)

So in the previous post we assumed we have 5 block per hour = 120 blocks per day (so we have 120 draws a day)
To calculate the chance to solve block 1 we calculate as follows: 9000/121,615,710*100 = 0.007400 % chance to solve the first block.

Luckily we have some more blocks on a day (120), so our chance goes up 120x 0.007400% = to solve a block in 24 hours = 0.888%
So theoretically it would take 100/0.888 = ~112 days to solve a block for 100 PPC with 90d coinage.

We can make it even more complicated and account for coinage lower than 30days which will build up and increase your chance during their time at stake. Could draw a nice diagram with that. Leave that for the Excel gurus under us.

My conclusion based on the assumptions is that you have to really hang on with only 100 PPC. And that would provide you with 112/365 of 1% = 0.3% = .0.3% * 100 PPC = 0.3 PPC
With a current value of $6 that is $1,80.
. No hard guarantees though. Same guarantee as that a dice with 6 faces throws each face a sixth of the time. But we all know that there are variances and that we can throw one side 3 or 4 times in a row if we’re lucky.

The weakest part of the above assumptions is how many wallets with how much stake are on-line at a certain point in time. I understand that when you increase the number of wallets that would increase your chances (not sure why though), but without knowing these exact numbers it’s a BIG assumption.

Please let me know if there are any mistakes, wrong assumption, or better proposals etc. in the above.
If all checked by the community, I think we will get PoS calculator including an estimate of time to realise your stake soon (with some assumptions)

In the mean time it won’t hurt if people would post their experiences with a the number of coins at stake, the coinage and the the number of days they had to wait. This would be another way of proofing the assumption made above or tweaking them closer to reality. Maybe we can find a way of anonymously posting those numbers somewhere as I can understand people won’t be keen to share this sensitive information. Any ideas?

Have fun :wink:

Edit: posting experience anonymously

The way I understand it, it still keeps track of the reward you are due so you don’t get ripped off. I would imagine if you wanted to test it out for sure, you could purposefully choose not to mint for say 120 days, and then see what the mint reward would be. You should get the full amount of reward though. If had 100 Peercoins and you saved them for 10 years, and then minted… you should receive 10 coins. The only thing you would miss out on is compound interest… which if you started with 100 coins would be about .001 PPC that you would have missed out on over ten years time… which is not much really to worry about, IMO.[/quote]

You’re right. You won’t get ripped off, but it can take a long time as I showed in my previous post to realise your interest. Agree that compound interest is negligible given current PPC value.
A significant increase of value of PPC, say to $10000 might change this thinking again though.

What I’m trying to get across is what to expect when you have 100 PPC at stake as of today and that people don’t waste their time (or computing energy). Hope I’m starting to share that understanding with my previous posts.

The other consideration is the network strength in the long term. If it’s not worth for a majority of small holders than this would weaken the network (less nodes). This might become an issue when mining is no longer profitable in the long term