I'm still confused at what happens if you create a valid block with the Ethereum you stake and then that block doesn't end up being part of the main branch.
I'm still confused at what happens if you create a valid block with the Ethereum you stake and then that block doesn't end up being part of the main branch.
So at any given time only one validator is going to create a block. If you create it, it's going to be included in the blockchain. If you don't create it (or you create but due to network problems fail to communicate it), then the blockchain skips a beat and someone else will create the next one.
If you want a user friendly introduction I recommend you Ben Edgington's book (WIP): https://eth2book.info/altair/
Or straight from the source: https://github.com/ethereum/consensus-specs
In proof of stake, the more crypto tokens you have, the more lottery tickets you get to win the right to write the next block.
In PoW the lottery is solving puzzles, that’s the energy inefficiency, in PoS the lottery is decided like a real lottery: with a random number generator (a distributed one at that, so that people agree that it was generated honestly)
How do you get verified (true) randomness without an oracle and without a connection to the analog world (proof of work)?
It would be amusing if the answer was randomness that came from a proof of work algorithm.
Each block is published with a hash which is based on all the previous blocks plus its own data. All participants are racing to solve a puzzle: basically a big guessing game where the first to guess the winning number gets to make the next block. The game is to find a number which when combined with the previous hash and put through an expensive hash function comes up with a result which has a specific number of binary zeros at the end. Since hashes are one way functions the only way to solve the problem is for everyone to guess until the solution is found.
The first participant to find the solution gets to create the new block. They also check the last few blocks to see if anyone's been cheating by adding fraudulent transactions. If fraud is detected they just ignore those nefarious blocks like they never happened.
The algorithm scales with the number of participants by automatically making the "difficulty" higher by changing the size of the pattern that needs to be matched.
def totally_random():
return 42
In seriousness, solana’s proof of history is a super novel take ontop of proof of stake to solve this problem.Lots of exciting features to land very soon that include Timelock Encryption, among several others.
Technical explainer can be found here: https://research.protocol.ai/tutorials/resnetlab-on-tour/dra... and documentation here: https://drand.love/docs/
It's almost certainly better for the environment / our continued existence than proof-of-work, if we must suffer cryptocurrency, but I don't trust people who were willing to continue to engage with proof-of-work for years to create an ethical (or even functional) alternative.
But this is always the way; leveraging trust where appropriate can allow great increases in efficiency, this is how society works, so you have a political spectrum where Ethereum is “responsibly pro social” and Bitcoin is still a kind of super trust less money with enormous energy costs to enable this somewhat superficial security property.