How Does It All Work?
If you’ve heard anything about cryptocurrencies, you’ve mostly likely heard about Blockchains. In simple terms, a blockchain is a shared database that is constantly being checked and updated in real time.
If you have ever worked in an office and had to share a database, you will know that databases store information. At any time, a user can request information, but to update the information, the database must be locked to prevent the same information being updated at the same time.
Without this locking mechanism, you could be editing a customer’s invoice while somebody from the sales department is editing the same customer’s information – this causes a conflict and somebody’s edits aren’t going to appear in the database, or worse, the whole database could be corrupted.
This might work on a small scale when only a small amount of information needs to be recorded and edited at a time, such as in an office, but it becomes cumbersome as the database gets bigger. The time taken to lock, edit and unlock a database causes delays which would cause huge problems when recording worldwide transactions across the internet. For a cryptocurrency to be a viable payment method, the database needs to be able to handle millions of transactions simultaneously.
In the context of cryptocurrency, transactions (e.g. Payments) are recorded and do not need to be updated later, similar to how an accountant or a bookkeeper records payments in and out of a business in a ledger. Once a transaction has been verified, it will never need to be updated again so it gets added to the ledger as a permanent record of who paid who and how much was sent.
Transactions are combined into blocks of information, once a block has reached a predetermined size, it is added to the end of a chain of previously created blocks – hence the name blockchain.
The blockchain database is not stored on one central computer or server on the network, it is distributed across many different computers called nodes. Each node keeps a copy of the blockchain database, then when a new block is created it is added to the end and the updated blockchain is distributed across the network.
The public nature and shared distribution of the blockchain ensures its integrity. If one instance of the data gets corrupted or someone attempts to alter it, the data can be tested against known good versions. This is done by hashing.
Hashing is a cryptographic method where data is passed through an algorithm and converted to a string of binary digits (represented by zeros and ones) of a fixed length, this string is called a hash. The conversion masks the original data. Hashing is used to protect your password when it is sent through the internet to log in to a website, it is also used to prevent your credit card number being exposed when you buy something online.
One major benefit of hashing is that any change in the input data would result in a different output hash, so it is easy to identify whether the data has been corrupted or altered. A part of each block in the blockchain contains the hash of the previous block.
In a sense, a blockchain is the perfect database – it is secure, incorruptible and can handle an unlimited amount of data. Although Bitcoin was the first, each successive cryptocurrency uses its own implementation of blockchain technology to record and secure transactions.
However, blockchain technology is used for more than cryptocurrency: computer scientists are exploring new ways to use blockchain technology which we will discuss in a later chapter.
One of the most fascinating areas of cryptocurrencies is mining. When people think about mining, the obvious images that spring to mind are prospectors digging through torchlit tunnels with pickaxes collecting nuggets of gold. In a sense, crypto mining does bear some similarities but some explanation is needed.
To join a crypto network and ‘mine’ cryptocurrency, you must download a piece of software which runs on your computer while you are connected to the internet. Your computer becomes a node on the network and receives information about the current blockchain and new transactions.
When a transaction takes place, the sender agrees to send X Bitcoin to the recipient. The network checks whether the sender has enough Bitcoin in their digital wallet, if so, the Bitcoin are then deducted from the sender’s wallet and added to the recipient’s wallet. Transactions are broadcast over the network and collected into blocks. Each block must be checked and verified by multiple nodes before it can be added to the blockchain – this ensures the system cannot be gamed by a person sending the same money twice (known as double payment) or by injecting fake transactions into a block.
To guarantee enough nodes are available on the network and keep the blockchain running, it is important that people have a reason to leave their computers connected to the network verifying transactions and adding them to the blockchain. When he created Bitcoin, Satoshi Nakamoto understood this problem and decided to offer an incentive. For every block added to the blockchain, the node which added it will receive some Bitcoin as payment – this is the ‘block reward’.
Of course, this leaves the question – who gets to add the block?
Let’s say for simplicity there are 100 nodes on the network, 98 of them receive a block containing identical transactions and 2 nodes receive corrupted data. Those two nodes cannot possibly add their block to the blockchain because all the other nodes have data which contradicts them. However, this leaves 98 nodes with correct data that could be added to the blockchain. The Bitcoin software requires nodes to solve a complex mathematical problem and add it to the block before it can be added to the blockchain. The first node to solve the problem and claim the solution as theirs gets to add the block and receive the reward. Once the problem is solved, the process is repeated with the next block. This is known as mining.
Each time a block is added to the blockchain, the node which solves the problem and adds it receives some newly released Bitcoin. Bitcoin are released approximately every ten minutes, and at the time of writing, the payment for successfully mining a block is 12.5 Bitcoin. Only 21 million Bitcoin will ever be released, of which, more than 16 million have been mined so far. You might assume that the total allocation of Bitcoin will run out very soon, however the system protects against that and the total allocation of Bitcoin isn’t expected to happen until the year 2140.
Firstly, although the number of Bitcoin earned per block is currently 12.5, it started out as 50. For every 210,000 blocks mined, the number of Bitcoin earned is halved – this happens approximately every four years and is expected to happen next in 2020. Although this may seem like successful miners are receiving less for their efforts, it is expected that the value of Bitcoin will increase over time.
Secondly, the network is designed to release new Bitcoin (12.5 of them) every 10 minutes. As more nodes are added to the network and computers become more efficient at solving the mathematical problems, the system increases the difficulty of the problems it sets. So, if on average it began to take only 9 minutes to mine a block, the system would increase the difficulty to ensure blocks would take longer to mine – whereas if the difficulty then causes blocks to be mined slower than 10 minutes, the difficulty would be reduced.
As more nodes are added to the network and the difficulty of mining increases, the probability of successfully mining a Bitcoin block decreases. Due to the popularity and potential profit of Bitcoin mining, specialist mining equipment has been created that can perform many more calculations per second than a standard home computer. Some companies buy hundreds and thousands of these and run them 24 hours per day. For this reason, many home computers are no longer viable for mining Bitcoin and have switched to mining other cryptocurrencies such as Ethereum and Litecoin.
Crypto mining is still a very interesting and potentially profitable activity, far beyond the scope of this report. If you are interested in learning more about it, I have spent years learning everything I can about the subject while building GPU mining rigs and for many currencies and will shortly be releasing another report which dives much deeper into the subject.
If you have ever travelled abroad and converted your money from your home currency to the local currency, you will have used a currency exchange. Most currency exchanges buy your currency and sell you another currency at a published rate, then charge you a fee on top for the conversion. cryptocurrency exchanges work in the same way.
Each cryptocurrency exchange (or digital currency exchange) works differently, so it is important to understand how your chosen exchange works. Some exchanges allow you to convert your digital currency into conventional fiat money (local currency that you can withdraw from an ATM) and transfer it to your own bank account while others allow you to convert from one cryptocurrency to another. Some exchanges match buyers with sellers and take a small commission on top, while others act more like a traditional currency exchange.
Always do your research, spend some time getting to know the reputation of an exchange before you commit to using it and, ideally, speak to others who have used the exchange and ask about their experiences. Although the risks are relatively small, most exchanges are not regulated by financial institutions or local governments, which means that if an exchange went bust, money you haven’t transferred to your own bank could be lost. Cases like this are rare, but this did happen in the past with Mt. Gox.