How Does Bitcoin Work?

With massive increases in price and mainstream attention, it is clear that Bitcoin has a role to play in the future of finance. However, as with most emergent technologies, it is also confusing. How does Bitcoin work? And just as important, how do bitcoin transactions work?

In order to understand bitcoin, you have to first understand the technology behind it and why that technology is needed. Bitcoin is more than just a digital currency. It is also a network and software. Digital currencies is something that people have been working on since the advent of the internet. The problem with the previous efforts was that they required a central authority to make everything function.

Before bitcoin, any attempt at digital currency required a company or other authority that could keep track of how much of the currency everyone held and when they spent it. Otherwise, users could digitally copy their money and pass off the forgeries to unsuspecting merchants. Having a central authority, however, comes with its own problems. The companies themselves could be untrustworthy, making consumer confidence hard to come by. Additionally, in the United States Constitution, the federal government is given the authority to issue legal tender exclusively, so companies operating in the United States also faced legal challenges. Companies also often found themselves in legal hot water for what their users were using the digital currencies for.

Bitcoin removes the need for the central authority by replacing it with a decentralized authority. The technological innovation that allows bitcoin and all modern day digital currencies to work is called the blockchain. But how do blockchains work?

The blockchain is essentially a public ledger that includes every bitcoin account (called addresses or wallets) the amount of bitcoin they hold, and every transaction that has ever taken place on the bitcoin network.

Every person who runs Bitcoin software on their computer has a copy of the blockchain. They can be separated into two types of people: miners and non-miners. Miners are the main security force of the Bitcoin network. Whenever a bitcoin user makes a transaction, it is announced to the miners. Using the magic of cryptography and encryption, miners are able to confirm that the account attempting to send bitcoin has the bitcoin to send, and then facilitates that transaction.

But what stops someone from spending someone else’s bitcoin? The trick to that, is public key encryption. Originally developed to allow secure messaging between two parties without those two parties meeting to share a key or cypher, public key encryption underlays a lot of secure communication online today. Essentially, every user has a public key and private key. The public key is shared to the public and allows anyone to encrypt a message that can only be decoded using your private key. In no way does the public key hint at what the private key might be and there is no hope of decoding the message without the private key.

Soon, the same system was adopted to prove identities online. Using your private key, you could create a message (called a signature) that could only be created using your private key. Other users could take that message and, using your public key, confirm that the signature was created using your private key, but would not reveal that private key to the user or to the public. In this way, the public could be sure that the person writing a message was who they claimed to be (or at the very least, was someone who got their hands on the private key of the person they are claiming to be).

In bitcoin, it works much the same way. All bitcoin wallets have both a private and public key. When a transaction is sent to the network, the user signs it with their private key and the miners check it using the public key and if it matches, adds it to the next block of transactions to be processed.

Roughly every ten minutes, a new block of transactions are completed and the transactions go through. There is a complicated process that miners go through to make sure that no one tries to forge the blockchain in anyway, which is covered in another guide. For the purposes of this article, all you have to know is that the miners compete for these blocks and the one who solves it is rewarded with the transaction fees and the newly created bitcoin that comes in each block.

To prevent blocks from coming too quickly, the network artificially makes the process more difficult. This slows the rate of bitcoin creation and also helps secure the network. Anyone trying to forge part of the blockchain would have to recreate all the work done by miners to that point and doing so would require computational power larger than the rest of the network combined (this is called a 51% attack and was a larger concern when bitcoin’s network was much smaller and weaker).

Every 210,000 blocks the amount of bitcoin created by each block is cut in half. When bitcoin first launched in 2009, each new block rewarded the miner who solved it with 50 bitcoins. At block 210,000 that was cut down to 25 and again at block 420,000 it was cut down to 12.5. This process will continue until the reward reaches zero. At that time, all 21 million bitcoins will have been mined and miners will have to sustain on transaction fees alone.

The other group of people on the network, the non-miners, have an important role to play as well. They run what is called a “full-node” and also keep a full copy of the blockchain on their computers, but rather than help the miners add to it, they simply double check the completed work and also help spread the news of a new block being solved to other miners.

Occasionally, a miner will solve a block but before the rest of the network hears about it, other miners will continue work on that already solved block, meanwhile the rest of the network has moved onto the next block. This is wasted work and any blocks solved by a second or third miner will become “orphaned” meaning that it has no blockchain of its own and the transactions contained in it are considered invalid (because they already happened on the main blockchain).

In addition to double checking the miner’s work, full-nodes alleviate the orphan block problem by spreading the news that block has been solved and miners should begin work on the next block instead. While they are not rewarded for their work, it is very easy to run a full-node (other than the hard drive space required to hold the entire blockchain) and they are an essential part of the bitcoin ecosystem.

The blockchain, and its miners and full-node runners, is what makes bitcoin fundamentally different than any digital currency that came before it. It is what makes it a decentralized digital currency rather than a centralized one and is the exact reason why bitcoin works.

Hopefully this article increased your understanding of bitcoin. The next step would be to learn how to set up a wallet and buy your own bitcoin.