Is there anywhere I can read a technical version of how proof-of-stake work?
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.
You get assigned by a random number generator to create the next block. If you fail to create it your only penalty is the opportunity cost (i.e., you miss on the reward that you would have gotten for creating one).
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.
In proof of work the leader election (the thing that decides who gets to write the next page/block of the ledger) is based on how much money you can put in computing power or how big your mining pool is. The more computing power, the more lottery tickets you get to write the next block.
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)
A bunch of nodes generate random numbers and publish their hashes.
After all hashes have been published all nodes reveal their random number, verify that their number actually corresponds to their hash.
Xor all the numbers together and as long as at least one node was honest and generated a random number the result will be a random number.
I don't recall if this is exactly what proof of work does but I think it's pretty solid.
PoW as used in bitcoin and ethereum is a bit different. It's designed to reduce the communication needed between nodes.
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.
You should check out drand (https://drand.love), which is based on threshold cryptography and the group running the network is composed of 16 independent organisations, none of which can manipulate or predict the next beacon. Beacons can be consumed from the public HTTP APIs (https://drand.love/developer/http-api/).
Lots of exciting features to land very soon that include Timelock Encryption, among several others.
Wondering the same thing myself. The entire problem with proof of stake is that the only thing in the digital realm that can be relied on as a source of objective truth is computation, hence proof of work.
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.
I don't know how they do it but it seems easy in practice. You hash the concatenation of chunks of data submitted by participants. Adding more data to the hash can only make it more random, not less. As long as at least one participant wants the outcome to be random and therefore they submitted actual random bits, the result will be random no matter how unrandom all the other participants' data chunks were.
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.
For anyone who might be concerned by the claim here; it’s really a political argument and not a technical one. Proof of stake as implemented by Ethereum makes a tradeoff which requires some small amount of trust (to identify the correct chain more quickly) which does not create a centralization risk.
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.
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.