Bitcoins - a chicken and egg story
So... what is Bitcoin?
Well, lets start with the Chicken and just agree that people trade bitcoins (do transactions), buy things with bitcoin (over 100,000 merchants now accept it, including WordPress, Overstock.com, Wikipedia, Steam, NewEgg, and I hear Paypal if your a merchant there). So people are using it, collecting it, etc. BTW: I'm going to explain all terms I highlight in this color later in this post, and will highlight it again in this color when I'm about to explain a term or just introduce one. So heads up: if something is in a color, its a term you will likely want to understand.
When you agree to accept payment from somebody, you provide them a deposit address - something like 178iFZHVAPCar68x1WZBjYhT4Fc9eyGbeP. I just created that one seconds ago using my wallet. An address can be generated for every transaction you do, or you can use it multiple times. Think of that address as being like a public bank account number where anyone can deposit funds to you. You wallet helps you manage your addresses. It allows you to add labels like "Kevinsthoughts blog post" or "Money from Mom", which is convenient. However, its primary duty is to talk to the rest of the bitcoin network. Its important to know that public addresses, like the sample above, can only be deposited to - nobody can use it to withdraw money from your wallet.
When someone sends you money from their wallet, it creates a transaction. Typically, if your using a Windows based wallet, your wallet is routinely talking to around 8 other wallets - and they are talking to 8 others, who are talking to 8 others, etc. That is the bitcoin network in a nutshell - its just a bunch of wallets talking to each other. Turns out that it takes about 12 seconds for any transaction to be sent to virtually all the wallets spread across the world. Those wallets put those transaction in something called the mempool - a bit of memory they manage that represents all the transactions that need processing.
That leads us to mining - the process of selecting transactions from the mempool and combining them into a block. Miners, as they are typically referred to, are people that have specialized computers that work on solving a mathematical puzzle in order to claim a block. A block, somewhat simplified, contains a link back to the previous block, and contains all the transactions from the mempool that the miner's software selected for processing. Thus the term blockchain - since the blocks are "chained" together with those links.
So lets back up a little bit and dive in a bit deeper: When someone creates a transaction, they get to choose (or at least let their wallet choose for them) how much they would like to pay to have their transaction processed. They can even choose to pay nothing if they wish. What is important to know is that most miners use software that pulls the transactions out of the mempool that pay the most - because if they solve the puzzle, they will earn those transaction fees.
Once the puzzle is solved, and a valid block is found, that fact is also broadcast to the network, and those transactions are removed from every wallets mempool. This is how you actually get "paid" - your wallet is monitoring the network for blocks that contain transactions tagged with your address. When it sees such a thing, it increments your balance providing you with the ability to send bitcoins to someone else.
That is the basics. If you want to know more, with a bit of bitcoin history thrown in... keep on reading!
So... the next obvious question is "Where do bitcoins come from?" (often combined with the "so anyone can just MAKE them??!?!"). Lets address both of those. The software that everyone agrees to use has some basic rules, and checks in it to make sure everyone is following those rules. The first is that there is a fixed number of bitcoins that will ever exist. That makes it a limited resource, and helps give it value. Those bitcoins have been being injected into the system with every block that is found. Originally, whoever solved the puzzle, was awarded 50 bitcoins on top of the transaction fees (which were very very small in the early days). About 2 years later, the code reduced that reward to 25 bitcoins/block - in what is known as a halving. Halving's occur about every 2 years, with the reward currently at 12.5 bitcoins/block. Eventually, the reward will be a very small fraction of a single bitcoin - but the authors of the code hoped that transaction fees will then be sufficient reward to keep miners mining! Note this is a major assumption - this whole concept has never been done before - its one giant experiment.
Regarding the "so anyone can just MAKE them" question... the answer is YES, kind of. Anyone is welcome to try. Originally, way back in 2009, bitcoin was new, and it was relatively easy to solve the puzzle. Only a handful of people had wallets and the network was small. They could just let their everyday computer work on it in the background and they were occasionally lucky and got the reward. Stories abound of people that quit mining when they earned less than one bitcoin a day (about $10,000 as of this writing, but worthless back then). What, wait... worthless? Yeah, when this started their were no merchants and nothing to do with these coins - it was purely an experiment with geeks (a group I'm told I qualify as a founding member of) getting a kick out of their computer talking to other computers around the world and solving these puzzles - a game of sorts. In fact, to encourage people to join the game, for some time bitcoins were given away free! All you needed to do was visit a website and prove you were part of the network by providing a valid address. The game evolved as more people joined in, since many folks like to "win". Those folks starting finding LOTS of servers to work on the puzzle (like early free one on Amazon Web Services) so they could earn more Bitcoins than others.
The world started to change around 2010. On May 22nd, 2010, one Laslo Hanyecz paid 10,000 bitcoins (valued then at about $25 in total (a cool $100M today!!!)) for two Papa John's pizzas. That event is now celebrated as "Bitcoin Pizza Day" (google it if you don't believe me!). The significance is that it was the first public use of bitcoins to purchase a product.
The race really started to heat up then. Someone did some seriously hard programming work and discovered that the main part of puzzle code could be run in parallel on the processors in a graphics card - and because there is a lot of processors on a graphics card, it could run like 200 times faster than on an ordinary PC. The bitcoin world shifted virtually overnight to using those graphics cards. Motherboard manufacturers started making motherboards that could hold 5 or more graphics cards... the most popular graphics cards were actually selling well above the MSRP - like 20-30% above it. Alas, using just one portion of a graphics card, and using it to death, literally burned out cards in months - but it was a race, and people like to win!
Along the lines of the CPU to Graphic card switch, there was a brief period when people used something called Field Programable Gate Arrays (FPGAs) - instead of being a general purpose computer, these FPGAs could be programmed to do one thing, and one thing only, very quickly. The matched or somewhat exceeded the performance of a graphics card, and did it for a fraction of the electrical usage. Electrical usage? Yeah - people running dozens of graphics card, each eating 175-300 watts of power, were starting to heat their homes with the power they were burning. This period didn't last long, because a bunch of companies realized they could take the FPGA code and build Application Specific Integrated Circuits (ASICs), literally creating small bitcoin-only computers that not only took a fraction of the power of a graphics card, but could run something like 200 times faster than those graphics card. Guess what? Overnight the bottom fell out of the graphics card market as miners switched to ASICs.
ASICs come on the scene around 2013-2014 (about the time I started fooling around with Bitcoins). My first one was a bunch of Antminer U1s - they did something like 2 GH/sec of puzzle solving efforts (yeah, that is 2 BILLION attempts per second) and used like 2 watts apiece. You could run a dozen on a heavy duty USB bank with an external power supply. Didn't take long before bigger, higher density boxes came out. The game was on for the hardware manufactures. Their were dozens, but whomever was best in any given generation of these tended to win the next round. Today only something like 3 manufactures are left, with Bitmain being the biggest and best. A current BItmain S9 does 14 TH/sec of puzzle solving for about 1500 watts of power. That is 7000 times more processing, at about 1/10th the power per effort. All those changes came over about 3 years - it was a wild ride.
Suppose its time to mention that the Bitcoin software is designed so that a block is found about every 10 minutes. The puzzle I've been mentioning involves random tries at a solution, and the Bitcoin software adjust the difficulty about every two weeks to achieve that average time - adapting the network to the ever growing number of players and machines.
The best way I have come up with to explain difficulty is to use an analogy: think of having a 1000 normal 6-sided gaming dice. Now imaging that in order to solve a puzzle, you need to roll those dice, one at a time, and have the first 200 come up as a "1". Fail (like rolling a "2") and you have to start over. Oh by the way, the sum of the remaining 800 dice have to add up what amounts to all the transaction in the block you want to submit to the network as a puzzle solution. Sound hard? Yeah, it is. Very hard. Hard enough that all the machines in the world, each doing trillions of attempts a second, only solve the problem about once every 10 minutes. If enough people join the game, the software changes the rules and starts requiring 201 dice to be "1". In any case, it does happen. There are checks and balances - once someone submits a block, all the wallets validate it. If someone, a few seconds to minutes later, also submits a block, and their block was harder to calculate, they win... and their block will replace the previous one on the blockchain. But remember, each block is based in part of that link back to the previous block, so sooner or later you must assume someone's submitted block is the best one that is going to be found, and base your next set of calculations on that one.
This random process of blocks being submitted, with hardness test to figure out who the winner is, is why most people don't accept a transaction until at least 6 confirms. All that really means is that a transaction is at least 6 blocks back in the blockchain - at that point, its very unlikely anyone will be submitting a solution that is better, along with 5 other blocks based on that solution. Being conservatively minded, the code insures that a miner isn't actually awarded their bitcoins and transaction fees until the block they submitted has 100 confirms - e.g. 99 other blocks have been added to the blockchain based on their solution. Fortunately, miners are use to this - the confirms become increasingly likely very quickly - after a couple, its just a matter of time.
Alas, I can't have a Chicken and Egg story and only talk about the Chicken! Fortunately, the Egg story is a LOT shorter. As I mentioned every block is based on the previous block. But how did it all get started? How did it work before there were any blocks on the blockchain. The answer is simple: Every cyber coin, like Bitcoin, has what is called a Genesis block - or block #0, that block #1 is based on. This is a valid block, it is just one that is calculated without a previous one. The process is done during the creation of the coin and takes about 10-20 minutes on a normal computer. I think I heard that the first one used with Bitcoin took over a day to calculate (computers were slower back then) - but that is just a rumor I heard.
Suppose I should mention a few other things before wrapping this up. The blocksize is simply the maximum size a block can be for a given coin. For BTC (the Bitcoin most talk about), the maximum blocksize is currently 1 megabyte. Back in October, a hard fork happened, and BCH (Bitcoin Cash, sometimes referred to as BCC) was born. BItcoin Cash has a maximum blocksize of 8 megabytes. Why does this matter? Because as I type this, the BTC mempool is about 175MB in size, with over 32,800 transaction in it. Recall that the maximum BTC blocksize is 1MB - so its about 175 blocks behind. This means that if you want your transaction confirmed within a few blocks, you will likely need to pay a pretty stiff fee. Again, as I type, that fee is around 0.00148 BTC. With Bitcoin at close to $11,000, that means you would need to spend about $16 worth of bitcoin to have a reasonable chance of being confirmed within an hour. Again, wallet software does all the heavy lifting for you, and can advise you on what transaction fees are likely to result in what confirmation times - after all, its has a copy of the current mempool to look at. For instance, if a 24 hour confirm time is good enough for you, it would recommend you pay 0.0001718 BTC, less than $2. Either way, your not likely to spend bitcoin to buy a cup of coffee these days!
To be technically accurate: transaction fees are based on the size of your transaction. That makes sense, since only so many can fit into a block. Your transaction size is based on your wallet activity. If you receive lots of small payments, and want to make a large purchase, your transaction will be larger than the opposite situation.
The developers of Bitcoin Cash felt that it was time to make the maximum blocksize bigger, so that more transactions could be processed per block, and so that transaction fees would naturally drop. Its working. I just checked my BCH wallet, and the mempool has 552 transaction and is slightly under 1mb in size. That simply means that very low cost (in fact free) transaction will likely be included in the next block found. Bitcoin Cash could, in fact, be used to buy that cup of coffee...
Will Bitcoin Cash eventually become "The Bitcoin"? Well, their developers hope so... and they are backed by some serious players - like Bitmain. You may recall they are the #1 producers of miners these days, and they only accept payment in BCH.
Others, of course, believe differently, or believe both can exist, perhaps with BTC being a "store of value" (e.g. an investment coin - something like gold) and BCH being a currency (e.g. something used to buy routine items - something like US Dollars).
Final thought: "But Bitcoins are just computer transactions, there is nothing real about them". There is no easy way to say this, but time to wake up people. The US Dollar is printed by the treasury whenever they want to. Its not backed by anything other than the faith in the US Government. In fact, a few years ago they printed up billions worth - remember Quantitative Easing? This is all that was - printing money and pumping it into circulation. Regarding Bitcoins as just being computer transactions? When was the last time so saw your worth in terms of a pile of money? Likely never... instead you looked it up on a computer or referenced an account statement. No real difference there from my perspective.