Alex's technical questions


#1

Hey guys, trying to resharpen my technical knowledge, figured I’d make a thread where I ask the questions as they come up so as not to clutter up the forums.

  1. Okay, so now that i’ve got a basic grasp of how the minting protocol works, some questions about current development. When we’re talking about parity with bitcoin v0.8 we’re mostly (only?) talking about levelDB migration? Or also the bloom filter… the bloom filter is the thing that made it possible to have light wallets, is my understanding? And that would seem to not be relevant to peercoin. And I’m guessing the levelDB upgrade is motivated by the future implementation of transaction pruning in new blocks. Is that all basically correct?

*below this has been answered
1:Currently trying to figure out how minting works, and I’ve just realized that I don’t actually know how the protocol is determining exactly when blocks are found (as opposed to which order they were found in) I know that it’s necessary the protocol know when they were found, or at least how much time took place between them being found to adjust the difficulty (for bitcoin, not peercoin), so what am I missing here? It can’t just be a timestamp from my computer, cause I could fake that. How is this done.

2: In the peercoin white paper, under Checkpoint: Protection of History there seems to be mention of an attack vector having to do with hoarding coin age and then minting it over a short time to make double spends practical with a much smaller fraction of the total coins, so long as you’re willing to wait between attacks. I seem to remember this being a solved problem now, but I can’t remember how. This is not quite the duplicate stake problem, as I can be as many ‘signatures of different owners’ (I’m not sure what owner means in this context. That sounds like something a wallet would determine, rather than the protocol) but surely I can be as many owners as I please if I don’t mind diluting my hoard.


#3

Chaintrust uses difficulty now not coinage so 2) is not a problem. 1) works because you can only hash once per timestamp and no one will accept time stamps in the future. So your timestamp is basically how you are minting and how the protocol limits people from finding PoS blocks using work. Because you only get to try once a second, you will try every second since the last block and you won’t timestamp in the future because you’ll get rejected and orphaned.


#4

Thanks. I was confused because bitcoin v0.6 defined time in a trickier way than PPC:

bitcoin v0.6:
// Threshold for nLockTime: below this value it is interpreted as block number, otherwise as UNIX timestamp.
static const int LOCKTIME_THRESHOLD = 500000000; // Tue Nov 5 00:53:20 1985 UTC

PPC
static const int64 nMaxClockDrift = 2 * 60 * 60; // two hours

But moving on to how the actual minting happens. So the timestamp is limiting the search space by only having valid seeds and they’re somehow related to your timestamp +x seconds (after 30 days)… or … not quite because then you could predict when your next valid mint block would be even though it isn’t valid till that time… or does that not matter? Also that explanation doesn’t cover why 90 days + have optimum probability to mint so obviously something is evading me.

Or is it that you stake X coins, and they mature up to 90 days, at which point, you’re getting X hashes * 90 per second. In which case… where are the hashes actually coming from, are you being issued valid hashes by something?


#5

here is an outdated description how to find a stake aka mint a block:

nowadays peercoin has a floating stakemodifier which reduces the ability to forecast a mint by 21 days.

if you can read javascript, here is how it is done:


#6

Ah thanks, this looks excellent. If my initial read over was accurate, what you were saying was : you’re always getting 1 hash per second , and that hash needs to come out to a lower 32 bit number than your coin days staked - but because your coin days staked increases up to 90 days you’ll mint as soon as your coin days eclipses one of your hashes? uh… Except if you were unlucky and made it to 90 days in which case, you’d be right back where you started… so probably not quite. Well, I’ll reread it after a nap.

***Ah, I think it just came to me. I thought it mattered that there should be an exponential increase in your probability to mint, because it had to work out to minting 1% a year. There’s no exponential increase in probability. You only mint on your current hash, it’s just 3x more likely after 90 days instead of 30 days, and you’re awarded a fraction of that 1% depending on the last time you had a transaction, so being extremely unlucky only loses you some compounded interest.