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

[quote=“ppcman, post:109, topic:648”]4) Leave your wallet in minting mode as much as you can (This doesn’t mean for 1 hour while you constantly glance at the screen) This means for 3-4 days as a start 72-96 hours.

If you don’t get a minted block after leaving it open for 3-4 days, then close it, and try this again a week or two later. This is the way I’ve been minting my coins.

The most important thing to remember is that your 1% interest per year will happen either sooner, or later, depending on how much you participate in the minting process. (and the quantity of coins in a single transaction)[/quote]

Meh. Didn’t happen this weekend. Will keep on trying.

I have poured through this entire thread and most of the included links to other threads. And as a new PPC participant I have to say I am super
impressed with everything I have been reading. Thank you to everyone that participates in this thread. Between this thread and the off shoot about double minting it has helped shed some light in my eyes.

It is a metric ton of information to absorb, but the more I read (minus the source code) the more it starts to make sense, so THANK YOU to everyone involved in this community.

I have a question regarding coin-age, and whether or not the coins are first-in last-out.

Say I have a busy wallet that receives 11 PPC every day. I want to hold back some of it for minting, but I want to play the market with the rest.

So on Day 1, I receive 11 PPC and ship out 10, leaving 1 in my wallet. (And assuming for this exercise no transaction fees.)

On Day 2, I receive my daily shipment of 11 PPC. I then transfer 10 to the market of my choice, leaving 2 in my wallet.

But which two?
Do I have 1 PPC with a coin-age of 1 day, and 1 with a coin age of 0? Or two with a coin-age of zero?

What about on Day 3?
Do I have coins with ages: 2 days, 1 day, 0? Or three zeros?

My guess would be that it wouldn’t ship out coins with “some” age, and others without (IE: leaving me with 3 coins, age 2, 0, 0 OR 0, 1, 0.)

So I’m asking, for this busy wallet, is it worth using one wallet for all transactions, or would the user be shooting themselves in the foot by resetting their coin-age to zero every day? Though conceivably, some of those coins could have been there since Day 1, they could also have been rotated out. (transfers in pushing oldest coins forward into transfers out).

If that were the case, coin-age would not start accumulating until Day 12, when of the 11 coins in the wallet only 10 would be pushed out. But then on Day 13, that 1-day aged coin would be pushed out, but the two behind it would age…

Which would mean in this busy wallet, mintable stake wouldn’t show up for over 300 days.

(Please tell me it’s first in, last out!) :-X

Have to disappoint you. It is not FILO. Not sure what it is but it seems to be pretty random which transaction it chooses. There have been many requests for FILO or similar and maybe wallet V0.4 will bring some of this. Currently there is only a function which reserves a number of Peercoins from minting, but you can’t assign which.

So a separate wallet for savings and one for regular transactions is not a bad idea IMHO.

???

So I’m curious as to people’s experiences. I’m pretty small-time in terms of how many coins I have, as an fyi.

I began minting when my first coins hit 30. Essentially, I keep the PPC QT client running all the time on my laptop. I pick up my laptop and go places, but whenever it’s open (say 22 hours/day), it’s on. No minting so far. It’s been about two weeks, and more of my coins have “matured” (what’s the word?) to the 30 day mark.

Any thoughts on this? What are people’s experience with how quickly they mint?

You might want to try the calculator I posted earlier in this thread. At least it confirms my experience and from the few people I heard of. It seems to vary though which would make sense as people will take wallets on and offline all the time.

In general it is best to wait until your coins have at least 30 days coinage. I had good results around 60 days coinage, but again results vary.

[quote=“Cybnate, post:127, topic:648”]You might want to try the calculator I posted earlier in this thread. At least it confirms my experience and from the few people I heard of. It seems to vary though which would make sense as people will take wallets on and offline all the time.

In general it is best to wait until your coins have at least 30 days coinage. I had good results around 60 days coinage, but again results vary.[/quote]

Where’s the calculator? I see the one Ben posted.

Here is the link to the experimental calculator again: https://mega.co.nz/#!txM2CKyL!NLSqaXjlrepSncZhTyYpBwBc_XpbGmuYLMLxLA-3UoM

It is a post on 8 Feb, this thread moved fast since though.

[quote=“Cybnate, post:129, topic:648”]Here is the link to the experimental calculator again: https://mega.co.nz/#!txM2CKyL!NLSqaXjlrepSncZhTyYpBwBc_XpbGmuYLMLxLA-3UoM

It is a post on 8 Feb, this thread moved fast since though.[/quote]

Thanks!

I updated FuzzyBear’s POS calculator and added some probabilities for block minting (http://poscalculator.peercointalk.org).

Please let me know if you find big differences between what is calculated and what you observe in reality…

glv, can you give us an overview of how those probabilities are calculated? I’m interested in the variables and assumptions that you use to generate the values.

Basically, I tried to reproduce what is done in the ppcoind/ppcoin-qt source code (more precisely the functions BitcoinMiner in main.cpp and CheckStakeKernelHash in kernel.cpp).

To mint a block, you must pass the test: hash(stakeModifier + someValuesFromPreviousBlock + currentTime) < target * coinDayWeight.

The target can be calculated from the POS difficulty (you can get it with the ‘getdifficulty’ RPC command in ppcoind/ppcoin-qt for example).
If the age of your coins is at least 30 days, coinDayWeight is: number of coins * (min(age of coins, 90) - 30).
So for a given number of coins, coinDayWeight reaches its maximum at 90 days and is constant afterwards (but for the calculation of the reward the days aren’t limited to 90).
From these parameters, we get the probability of a hash passing the test: (target * coinDayWeight) / maxHashValue.

In the computation of the hash, currentTime (in seconds) is the value that changes the most frequently. Therefore, it is useless to try to pass the test more than once every second.
For example, the probability of minting a block within a day is the probability of one hash passing the test when trying a hash every second of this day.

Basically, I tried to reproduce what is done in the ppcoind/ppcoin-qt source code (more precisely the functions BitcoinMiner in main.cpp and CheckStakeKernelHash in kernel.cpp).

To mint a block, you must pass the test: hash(stakeModifier + someValuesFromPreviousBlock + currentTime) < target * coinDayWeight.

The target can be calculated from the POS difficulty (you can get it with the ‘getdifficulty’ RPC command in ppcoind/ppcoin-qt for example).
If the age of your coins is at least 30 days, coinDayWeight is: number of coins * (min(age of coins, 90) - 30).
So for a given number of coins, coinDayWeight reaches its maximum at 90 days and is constant afterwards (but for the calculation of the reward the days aren’t limited to 90).
From these parameters, we get the probability of a hash passing the test: (target * coinDayWeight) / maxHashValue.

In the computation of the hash, currentTime (in seconds) is the value that changes the most frequently. Therefore, it is useless to try to pass the test more than once every second.
For example, the probability of minting a block within a day is the probability of one hash passing the test when trying a hash every second of this day.[/quote]

Ok I have the donations to Peercointalk fund wallet that I have kept offline for 2 months now http://bkchain.org/ppc/address/PPW6NBgZzWXzW89HRg3V4M77eM3Zu5yDcR and I think this would be a good test for the POS calculator. Please make your predictions on what the POS reward should be and the probability of minting a block. Once we have some figures I am happy to turn minting on in the wallet and see what we get :slight_smile:

How’s that for a slice of fried gold? https://www.youtube.com/watch?v=sQ81Ggv_IAQ

Fuzzybear

I have read the whitepaper and looked at the source code, but it appears there is a discrepancy. Maybe I missed it in the source code, but the current staking process appears to be based on a longest chain metric. This is pretty standard for PoW and most crypto, but in the whitepaper is says that the coinage of the entire block is used to determine the mainchain.

From my reading of the code, what is happening is that if two valid kernels are found both will be accepted by the network and until the next block comes in that refers to one or the other, arguable both valid kernels are the mainchain. I know there is eventual consensus, but my question is why the full blocks coinage is not used. There is already a function to calculate this, but it does not seem to be called. Actually, I am not sure if the two valid kernels’ coinage is being used to determine the winner.

It seems that either the kernel inputs coinage, or the kernel hash, or the block’s coinage could be used to determine which of the two competing blocks are the mainchain, immediately.

I hope somebody knows the reasoning behind why multiple competing blocks are allowed to create forks is allowed and if so, it would seem there should be an easy mechanism to know if the network is currently resolving a fork or not. This is a question that is not unique to PPC, as all of these things are applicable to most all other PoS and PoW coins.

OK, I think I see why we dont want the entire block’s coinage to determine the mainchain. If that was allowed, then anybody can trivially create a reorg of possibly large depth by stockpiling a large amount of coinage and just spending it, ie, any whale that is an occasional user would inadvertently create significant reorgs when he does a large tx. If the block’s coinage is not used, then maybe the whitepaper section on this should be updated?

However, still the question remains about what the benefit is to having two kernels with different coinage both allowed to be potential mainchain candidates

James

@jl777

Sunny King has responded in this thread:

https://www.peercointalk.org/index.php?topic=4558.msg42849;topicseen#msg42849