This commit is contained in:
Miloslav Ciz 2024-03-08 16:56:58 +01:00
parent f920115b91
commit 75f99e7b81
69 changed files with 2008 additions and 1791 deletions

View file

@ -19,7 +19,7 @@ But where is the blockchain stored? It is not on a single computer; many compute
But how do we know which one is the "official" blockchain? Can't just people start forging information in the blockchain and then distribute the fake blockchains? Isn't there a chaos if there are so many copies? Well yes, it would be messy -- that's why we need a **consensus** of the participants on which blockchain is the *real* one. And there are a few algorithms to ensure the consensus. Basically people can't just spam add new blocks, a new block to be added needs to be validated via some process (which depends on the specific algorithm) in order to be accepted by others. Two main algorithms for this are:
- [proof of work](proof_of_work.md): For a block to be confirmed it has to have a specific cryptographic puzzle solved, e.g. it may need to have appended some string that makes the block's hash some predetermined value. Participants try to solve this puzzle: finding the string is difficult and has to be done by [brute force](brute_force.md) (which wastes electricity and makes this method controversial). Once someone finds a solution, the block is confirmed and the solver gets a reward in coin -- this is therefore called **mining**.
- [proof of stake](proof_of_stake.md): This methods tries to waste less energy by not solving cryptographics puzzles but rather having some chosen participants validate/confirm the blocks. Basically participans can give some of their money at stake which then gives them a chance (proportional to the amount of money put at stake) to be chosen as validators. A validator is then chosen at random who will check the transactions and sign the block. For this they will get a small reward in coins. If they try to confirm fraudulent transactions (e.g. money sent from people without any money), the network will punish them by taking away the money they put at stake (so there is a financial motivation to not "cheat").
- [proof of stake](proof_of_stake.md): This methods tries to waste less energy by not solving cryptographics puzzles but rather having some chosen participants validate/confirm the blocks. Basically participants can give some of their money at stake which then gives them a chance (proportional to the amount of money put at stake) to be chosen as validators. A validator is then chosen at random who will check the transactions and sign the block. For this they will get a small reward in coins. If they try to confirm fraudulent transactions (e.g. money sent from people without any money), the network will punish them by taking away the money they put at stake (so there is a financial motivation to not "cheat").
Can't people just forge transactions, e.g. by sending out a record that says someone else sent them money? This can be easily prevented by [digitally signing](digital_signature.md) the transactions, i.e. if there is e.g. a transaction "A sends 1 coint to B", it has to be signed by A to confirm that A really intended to send the money. But can't someone just copy-paste someone else's already signed transactions and try to perform them multiple times? This can also be prevented by e.g. numbering the transactions, i.e. recording something like "A sent 1 coin to B as his 1st transaction".