How do does solving mathematical problems create bitcoins?


How do does solving mathematical problems create bitcoins?

In: Technology

As simply as possible:

Bitcoin miners verify the validity of a Bitcoin transaction block by correctly guessing the number that passes through a hash function thus confirming the transaction. The correct number could be any integer between 0 – 4,294,967,296.

Basically your computer just guesses as fast as it can until it hits the right number.

Bitcoin has a long ledger, describing every transaction for every bitcoin. This ledger is tamper-proof because there is a cryptographic checksum on every block that is always 0 (not exactly true but it’s simpler to explain this way). If the block’s checksum is not 0, it’s been tampered with, and you need to get the good copy from somebody else. Each block depends on the block before, thus a block chain, hence the term.

The way they make the block’s checksum =0 is by adding a little random number to the end of the block, and then seeing if the checksum is 0. This is a computationally expensive process, taking many millions of tries. The first person to find a number that works publishes their block, and everybody moves on to the next block. Since this process is expensive, and the person paid for the electricity to calculate the answer, the person who publishes the block gets paid a small amount of bitcoin. This process, called mining, is the process of being the fastest to find a solution to the checksum(block+number)=0.

Bitcoins don’t just exist out in the wild for us to find. When the person who invented Bitcoin wrote the paper that laid out the plan for Bitcoin, they needed put a Proof of Work system in place, some sort of barrier so that Bitcoin would actually take work to collect. If you can get them easily, they won’t have any value, and currency needs value if it is to function like a currency. The mathematical problem is a sort of imposed artificial scarcity, limiting the quantity of Bitcoin so that it has value. Solving reliably difficult math problems is a good way to do that.

None of these explanations are ELI5. Solving math problems makes it hard to get Bitcoins. Because they are hard to get they are valuable. Bitcoin was designed so that math problems create Bitcoin in order to make sure they remain hard to get.

In math, there are problems where verifying the answer is a lot easier than finding it in the first place. For example, if I told you to find the square root of 2, you have to do a lot of calculations to actually figure out the digits. However, if I told you to verify that 1.41421356237… was the square root of 2, you can do some quick math (relatively) and confirm it (lets ignore the whole irrational number thing here).

You can take this further and have problems that are unsolvable one way, but verifiable the other. This is actually easy when you have an algorithm that throws away part of the data each time.

With Bitcoin, there is a Ledger of transactions. In order for everyone to believe the ledger, it has to be regularly signed. The signature the ledger needs depends on the contents of the ledger, but it cannot be calculated directly from the contents, only verified against. Thus, everyone just has to “guess” what the signature is. You generate a random signature, check it, see it it succeeds, and if it doesn’t, you generate another one and check.

Because this requires computing power, the system has an incentive for the people doing the checks. This incentive is adding some amount of bitcoin to their wallets. So they’re not actually “creating” bitcoin. It’s just extra bitcoin being added into circulation as a reward for maintaining the ledger.

Now let’s get into why this sucks. All those people that are trying to guess the ledger signature are using a lot of power to run all their computers. They obviously pay for this power with the bitcoin they mine. Thus, people will keep adding more and more computers into the bitcoin mining pool as long as they make more revenue from successful mining compared to the cost of electricity for mining it. Bitcoin also has a mechanism for adjusting the difficulty of the mining calculations, since the entire point of Bitcoin is that there is too much work for any one person to try and rewrite the entire ledger in a way that suits them. Whenever too many people start mining, it makes Bitcoin that much harder to successfully mine. This means that eventually the large miners may be making less and less profit but require more and more electricity.

The end result is that essentially every bit of cash being added to the bitcoin pool was, more or less, already used to pay for the electricity required to mine the bitcoin. Bitcoin will eventually crash as a result of this, and at the end of it all, nobody will have anything to say for it. The only people who will make out at the end of it are power companies who have sold a ridiculous amount of power to the bitcoin mining operations, as well as the suppliers of raw materials for the power. If it’s done off of coal or gas, there’s a pretty significant CO2 footprint to the mining.

But it gets even worse than that. A lot of the mining happens in areas where power may be partially subsidized by the government. That means that everyone else is paying taxes that are actually helping to partially pay for the power used in mining. The end result is that the citizens are losing out