# Could do with more help with the pos calculator

i am still trying to understand the pos calculator.

i have entered, as an example:
Number Of Coins: 100
Age of transaction (days): 90
POS difficulty: 12.37094793

i got the POS difficulty from typing getdifficulty in the debug console in v0.4 client

it then returns this info:
Minting POS block within 10 min 24 hours 31 days 90 days 1 year
Probability 0.006775% 0.970924% 26.099985% 58.442885% 97.159497%

does this mean that if i open up my wallet after 90 days of holding 100 coins, that i have less than a 1% chance of minting even if i keep my wallet open continuously for 24 hours. i personally would find it hard keeping my wallet open, for example, for 90 days continuously for less than a 60% chance of minting… am i understanding wrong?

thanks a lot for any help…

if anyone can help with this, i’d be very grateful…

You’re understanding correctly, the probabilities are calculated for an always online and able to mint node.

What you understand, I think, is right. It does seem to discourage owners of small amount of stakes from keeping their wallet open, which decrease the network security due to fewer nodes and more centralization. It’s one of the problem with Peercoin POS system. For supporting the network, it really doesn’t matter if a block is found by a 10,000 PPC stake or a 10 PPC stake. There are other schemes by NXT and the DPOS proposal. They haven’t gone through the test of time (or of reality, for DPOS)

So it would be great if somehow this problem can be addressed. One can’t fix this problem by rewarding small stakes, because currenly there is no way to tell a block generated by one node that has a few small stake from a block generated by one of the thousands of small stakes own by one node.

What you understand, I think, is right. It does seem to discourage owners of small amount of stakes from keeping their wallet open, which decrease the network security due to fewer nodes and more centralization. It’s one of the problem with Peercoin POS system. For supporting the network, it really doesn’t matter if a block is found by a 10,000 PPC stake or a 10 PPC stake. There are other schemes by NXT and the DPOS proposal. They haven’t gone through the test of time (or of reality, for DPOS)

So it would be great if somehow this problem can be addressed. One can’t fix this problem by rewarding small stakes, because currenly there is no way to tell a block generated by one node that has a few small stake from a block generated by one of the thousands of small stakes own by one node.[/quote]
We limit max stake age(security purpose, small stakes affected) so why not also limit max nCoin age and increase nRewardCoinYear(security, small stakes compensated)? Question for Sunny?

Capping max coin age does encourage people bring wallets online often. But increasing nRewardCoinYear will not benefit small stake holders only because the big stake holder can just split his holding into many blocks of 100 PPC and also get the benefit.

## They’ll benefit,relative to the current state, from ~equalization of opportunities( actually I don’t like this phrase) - taken away from them by max stake age capping.

mhps could you rewrite my question in correct English and add it to SK-interview question pool please?

ok, thanks everybody for your answers. that is pretty bad news as i was under the impression that minting 24 hours every 90 days would be sufficient to generate some coins regardless of the size of holdings.

i guess my next question is whether anybody knows if the wallet has to be online continuously to have a chance to mint, or for example could you have it on every day for a couple of hours and cumulatively increase your chances?

i guess the good news is that the wallet isn’t very intensive on processing so shouldn’t affect other programs on the computer whilst it is running?

thanks again. also great work on the calculator which is giving some honest answers about proof-of-stake minting expectations.

When the wallet is online, and minting is enabled, it’s attempting to solve for a block once per second, per mature transaction. If the wallet application is turned off, you’re not trying hashes.

You can certainly turn the wallet on and off, and your coin age will continue to accrue, which increases your chances of solving for a block the next time it is online, but given the choice between being online or offline, you’re better off (if your intent is to solve as many block by minting as possible) leaving the wallet turned on, continuously.

i thought that if i had held coins for 90 days already, then coin age would not increase?

in any case, if it is trying once every second, then surely as long as i have it on for a long time, even with breaks, will be just the same as having it on for the same amount of time but without breaks (by breaks i mean exiting the wallet, say overnight, and then turning it back on in the morning)?

They’ll benefit,relative to the current state, from ~equalization of opportunities( actually I don’t like this phrase) - taken away from them by max stake age capping.[/quote]

I said “But increasing nRewardCoinYear will not benefit small stake holders only”. That means increasing nRewardCoinYear will also benefit big stake holders who split his stakes to small size.

[b]mhps[/b] could you rewrite my question in correct English :) and add it to SK-interview question pool please?

Either I don’t fully understand what you meant or increasing nRewardCoinYear just won’t help. Plus I don’t see SK actively answering detailed questions unless you catch him when he is around.

The probability per day won’t increase after 90 days.

in any case, if it is trying once every second, then surely as long as i have it on for a long time, even with breaks, will be just the same as having it on [i]for the same amount of time[/i] but without breaks (by breaks i mean exiting the wallet, say overnight, and then turning it back on in the morning)?

You are confused. Even the probability per day won’t increase after 90 days, your chance of finding a block increase as long as you mint, interrupted or not. For example the probability per day for your stake maxes out at 5% per day after 90 days. Then the chance of finding a block is the same if you 1) mine continuously for 10 days, or 2) mine 2 hours a day for 120 days. Because 2x120 = 10x24 , and you will have 5% x 10 = 50% chance to find a block in the end. However note that if you find a block later, your POS block will give more reward because your coin age is greater. You don’t get less reward if you don’t mint often, you just get it later and in bigger sizes. Gee that really doesn’t sound good to promote minting often. :-\

ok thanks. but in my example for 100 coins which have already been held for 90 days… this was the result of the calculator:

Minting POS block within 10 min 24 hours 31 days 90 days 1 year
Probability 0.006775% 0.970924% 26.099985% 58.442885% 97.159497%

so it’s basically a 1% chance (rounded from 0.970924%) rather than 5% (as you mentioned in your example) of minting within a day - is that right?

however the probability of minting within 90 days is not equal to 1% * 90 - the calculator returns roughly 58.44% - so what is going on?

the other thing i would like to clarify is whether i am right in thinking that even though your probabilty of minting does not increase after 90 days, your coin age does and so therefore so does your reward?

thanks again for all responses…

In fact, I think that by minting often you will earn a little more, because you will most likely find blocks earlier, and after maturation the rewards you get for these blocks will be able to mint too (compound interest).

[quote=“r00tsical, post:13, topic:2404”]ok thanks. but in my example for 100 coins which have already been held for 90 days… this was the result of the calculator:

Minting POS block within 10 min 24 hours 31 days 90 days 1 year
Probability 0.006775% 0.970924% 26.099985% 58.442885% 97.159497%

so it’s basically a 1% chance (rounded from 0.970924%) rather than 5% (as you mentioned in your example) of minting within a day - is that right?[/quote]

Yes, that’s right.

Your “1% * 90” formula is not a mathematically correct way to calculate the probability, it’s an approximation that works well only for extremely small probabilities. For example, with this formula, minting during 120 days would give a probability of 120%, which is nonsense.

If for each attempt to mint a block, the probability of minting is p, the probability of minting at least one block in n attempts is (1 - (1 - p)^n).

Yes, that’s right.

In fact, I think that by minting often you will earn a little more, because you will most likely find blocks earlier, and after maturation the rewards you get for these blocks will be able to mint too (compound interest).[/quote]

Right. That is compound interest.

[quote="r00tsical, post:13, topic:2404"]however the probability of minting within 90 days is not equal to 1% * 90 - the calculator returns roughly 58.44% - so what is going on?[/quote]

Your “1% * 90” formula is not a mathematically correct way to calculate the probability, it’s an approximation that works well only for extremely small probabilities. For example, with this formula, minting during 120 days would give a probability of 120%, which is nonsense.

If for each attempt to mint a block, the probability of minting is p, the probability of minting at least one block in n attempts is (1 - (1 - p)^n).

Yes that is right. Sorry to have added more confusion. :-[

thanks again for all the responses, especially good to have the formula to calculate the probability.

what i’m getting is that i need to be minting for a year to be nearly sure of success (97.159497%), but then i will only get roughly 0.25 peercoin on my 100 peercoin holding. but i thought it worked out at 1% per annum?

lucky i’ve found a setting to open the wallet automatically on windows startup (in the options)… will it remember my unlock for minting setting, if i unlock it say for 365 days = 31536000 seconds, and then open and close it as needed?

what i'm getting is that i need to be minting for a year to be nearly sure of success (97.159497%), but then i will only get roughly 0.25 peercoin on my 100 peercoin holding. but i thought it worked out at 1% per annum?

I apologize if this digs into areas of the protocol that you’re familiar with already. For anyone else who’s interested in learning how it all works, I’ll try to keep it simple.

The important components in any calculation of a stake reward are:

[ul][li]The amount of the input transaction, in peercoins;[/li]
[li]Length of time that the input transaction’s coins have been held, without being moved from the address they were deposited to[/li][/ul]

Here’s the relevant code, from src/main.cpp, lines 861 - 869:

``````// ppcoin: miner's coin stake is rewarded based on coin age spent (coin-days)
int64 GetProofOfStakeReward(int64 nCoinAge)
{
static int64 nRewardCoinYear = CENT;  // creation amount per coin-year
int64 nSubsidy = nCoinAge * 33 / (365 * 33 + 8) * nRewardCoinYear;
if (fDebug && GetBoolArg("-printcreation"))
printf("GetProofOfStakeReward(): create=%s nCoinAge=%"PRI64d"\n", FormatMoney(nSubsidy).c_str(), nCoinAge);
return nSubsidy;
}``````

The “1% per annum” is the rate that the reward accumulates, respective to the input transaction (stake) it uses to solve the block. What this means is that for your 100 PPC, that if your wallet used those coins to solve a block exactly 365.25 days after they were first deposited into your wallet, you would receive a coinstake transaction of 1.00 PPC to the address where the coins reside.

Can you share the values you’re using in the calculation that is returning 0.25 PPC, please?

@Ben
thanks that was really useful to see how it is calculated from code.

as for your question, if i use the pos calculator at http://poscalculator.peercointalk.org/ and enter:
Number of coins: 100
Age of transaction (days): 90
POS difficulty: 12

it returns:
Reward (90): 0.246412 PPC

[quote=“r00tsical, post:18, topic:2404”]@Ben
thanks that was really useful to see how it is calculated from code.

as for your question, if i use the pos calculator at http://poscalculator.peercointalk.org/ and enter:
Number of coins: 100
Age of transaction (days): 90
POS difficulty: 12

it returns:
Reward (90): 0.246412 PPC[/quote]
The 0.246412 is your reward after 90 days (roughly 3 months). Multiply by 4 and you have your annual reward.
When you are successfully minting for 90 days after the 90 days coinage your reward will be approximately 0.5 PPC.

I think the POS calculator only needs to clarify that a bit better