Hacker News new | ask | show | jobs
by jgeralnik 1403 days ago
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.
1 comments

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.

Yeah I meant proof of stake, not proof of work
Sure but I think the question is about the random number generation used to decide in PoS who gets to do the next block.