How does Bitcoin work?
Bitcoin operates on a technology called blockchain. The blockchain is essentially a digital ledger that records all Bitcoin transactions ever made.
This ledger is distributed across numerous computers, known as nodes, all around the world. This distribution ensures that the system is secure and transparent, as everyone can see the transactions, but no single entity controls the ledger.
This distribution also makes it difficult to make false transactions for the benefit of bad actors. If a person tries to change the Bitcoin ledger to add more funds to their account than they have, the whole distributed network would have to agree, which is virtually impossible to get right.
Another aspect of Bitcoin that adds to its security is the process known as mining. To record new transactions onto the blockchain, a “miner” must encode those transactions into a format that is acceptable to the network. In other words, the miner is tasked with “writing” the true transactions on a block in the Bitcoin blockchain.
This requires the use of a hashing algorithm called SHA-256, which turns readable data, such as the transaction information, the timestamp, the previous block header, and so on, into a single, long, cryptic alphanumeric string.
The miner then adjusts the input bit by bit by adding meaningless letters and numbers (this added information is called the “nonce” value) until a hash that is small or “neat” enough is reached, as required by the network. This “neatness” is usually dictated according to the number of leading zeros in a hash and isn’t predictable, meaning there’s much trial and error involved.
Once a miner reaches an acceptable format, the rest of the network ought to validate its authenticity by checking that the inputs are valid and, of course, the miner isn’t lying about the neatness (which changes every two weeks, if you weren’t already confused enough).
Upon majority approval, the “proof” is verified, a new block is added to the chain and the miner is rewarded with some newly minted Bitcoin and the user transaction fees from the block that was just mined out.