Maybe a concrete example would help here.
Let’s say the network has 4 people, A, B, C, and D, and they have 1 million shares each. Let’s also say that all that’s needed to get a vote is 50 blocks in a 100-block window.
Today, they each volunteer 10k chunks, and statistically should each get 25 of the next 100 blocks accepted. It’s not as likely that they’d get 50 blocks straight though…
If the priority is determined by the number of shares, then A using 20k shares per block would have double the priority of B, C, and Ds blocks, right? If so, the the next 100 blocks would (I assume) look like…
- 50 of A’s blocks (because P=20k*7)
- 50 of B, C, and D’s blocks randomly selected (A is out of blocks, and they have P=10k*7)
This means…
- A earns half as much as is possible (after 50 blocks minted, all shares are now staked, vs 100 blocks possible from the total holdings)
- A got enough blocks to pass a vote (50 / 100)
- B, C, and D should each get 1/3 of the next blocks, since A doesn’t have any unstaked.
Bringing this back to real-world stuff…
I’d love to see some code… My understanding of this is that it’s not a centralized “block chooser” but instead a distributed consensus mechanism.
More concretely, it would mean that each client is saying “here’s the chain with my new block!” and sending that around to peers.
For that version of the chain to be “accepted”, everyone else who’s capable of minting has to go “OK yea, your block is best. SGTM. I’ll re-broadcast this to my friends too.”
Sometimes, they don’t say that, and instead say “Like hell! My block here is higher priority. I’m not telling anybody about your block. I’m sending my version to everyone!”
And then everyone else on the network goes “Hm, yea, this one is higher priority… Sorry dude, he’s right.”
Sometimes they say “Hm, yea yours was higher priority, but someone else has already built on that block, so the combined priority is the kicker… We’re going with the longer chain. Sorry!”
At least that’s my understanding based on my knowledge of Bitcoin (though I realize that this is … not Bitcoin).
Either way, the truth is in the code, so I’m hoping someone can point me towards that in the BitBucket repository…? I’m sure there are ways to randomize the selection, but didn’t know that was in effect today… Do we have a doc somewhere saying “Here’s how the network selects the next block based on all the potential options” ?