Tuesday, March 29, 2022

What is bitcoin mining?

 A friend asked the following question on Facebook:

What does it mean to “mine for bitcoin?”
Bitcoin isn’t tangible, is it?
Concise answers only, please.

However, not being one for concise answers and still having a bit of teaching instinct, I tried to explain it all at a little more practical level than most technical explanations.

Apologies for any slight technical errors. This is meant to be a useful analogy, not an exact representation of bitcoin/blockchain.

My answer

 OK, story time.

Bitcoin and some other cryptocurrencies run on the blockchain. Blockchain is a transaction ledger. Each person is identify in the ledger by unique number (the wallet key) that identifies their account. The ledger just records the transaction that occurred. For example, account 123 transferred 5 brentcoin to account 456. The ledger is public, which means anyone can see the ledger to know what happened to all the transactions between accounts.

How do we know we can trust that the ledger can be trusted? This is where the bitcoin mining comes in. Basically, every transaction must be verified through mining. Basically, there is a mathematical algorithm that mining computers run to verify that the transaction is real. Mining often requires more than one computer to come up with the same answer, and if enough computers agree on the answer, then the transaction is verified. That is, if many sources come up with the same answer, then there is no single computer that can game the system.

Once all the mining computers submit their answer, they are basically put in a lottery for who gets paid for doing the calculation. Only one computer gets paid for it, and they get paid a tiny amount of bitcoin. This is kind of like a transaction fee on the bitcoin transaction.

The lottery part is where it gets crazy. In order to make good money on mining, you need a whole lot of computers verifying a whole lot of transactions so that you can win more of the lotteries to get paid. Most of the transactions you verify are for free.

OK, so let's make a real life analogy for what is happening. Let's say that bitcoin is real estate. The bitcoin ledger on the blockchain is like the public records. If you want to know who bought and sold a house, you can go to the county clerk and look up all the sales of the house to different people and the sale price and such. That's the public ledger.

If a house is sold, there is a records check to make sure the title is clear, which means there are no other claims on the house (no liens, and it wasn't sold to somebody else and not recorded properly). That is, to make sure the seller owns the house he is selling and that he is who he says he is. In bitoin, this verification is the mining process, to make sure after all the transactions on an account, the payer has enough bitcoin for the transaction and such. The miners look at the history of the account, calculate the balance, and so on, to say it is all good to go.

Where this analogy gets weird is the mining part. In real estate, there is one title company/notary public that verifies and records the transaction. Imagine that instead of one title company, there are millions of title companies who all do the same work for the same house sale to verify the transaction, and they are submit their verification. Then there is a lottery to draw one title company out of a hat to pay them the closing costs, and the other title companies walk away with nothing.

If the title company does this work for enough sales, they may win enough money to get ahead. So you end up with huge title companies that try to process all the sales so they can make enough money to survive.

This doesn't sound like a good business model, so why do they do it? Because they still get paid enough to cover their losses. Also, they get paid in bitcoin, which they hope will continue to grow in value. If title companies got paid in owning a fraction of the land that is being sold instead of money, then they could sell all those fractions of the property to make money. And if they think real estate value will go up 1000x this year, there is more incentive to have that real estate to sell for even more money later.

That is bitcoin mining.