What is the Blockchain?
One of the big terms that you hear in cryptocurrency is “the blockchain”. But what is the blockchain? What is it for? How does it work? How does everyone agree on what is included in the blockchain? Here, we answer these questions and more and take away the mystery of “the blockchain”.
What is the Purpose of the Blockchain?
What Goes in a Block?
he purpose of the blockchain is to store transaction information in a way that makes it difficult for anyone to modify blocks. So, it makes sense that the most important contents of a block are a record of the transactions that have occurred since the previous block. While different cryptocurrencies store different types of data and secure it in different ways, their blocks always include a section for the data to be stored on the blockchain.
The exact time a block is created is useful for several reasons. One example is organizing a copy of the blockchain from blocks received independently. Since some blockchains have a quick block time, it’s possible that you may receive blocks out of order and need to organize them.
Another reason is that many cryptocurrencies are designed to create a block at regular intervals. In many cases, this is enforced by creating a puzzle with a difficulty set so that it takes the entire network the desired amount of time to solve the puzzle. As the network grows, the difficulty needs to be adjusted and the best way to determine when this occurs is to check how quickly the network is solving each puzzle (which is the difference in timestamps between two blocks).
One of the main principles of blockchain is decentralization. No one person should have control of the blockchain, which means that no-one officially adds blocks to the blockchain. However, if everyone decided on their own what the next block contains, the blockchain would be in chaos, with no-one’s ledge matching anyone else’s.
To maintain decentralization, cryptocurrencies include a process to select the person who will create the next block. Since this process involves that person doing work (at a minimum collecting all transactions, creating the block, and sending it out), they get paid to do it. A block includes an identifier for this person both to say who created the block (in case they did a bad job of it or did it when they weren’t supposed to) and to make sure that the correct person gets paid for doing so.
Previous Block Hash
Each block in the blockchain contains the hash of the previous block in the chain. Here, a hash means the output of a mathematical function with a few useful properties:
- It’s not possible to determine the input from the output (unless you’re willing to try each possible input until you get lucky)
- It can take an input of any size and create an output of a fixed size
- Similar inputs create very different outputs
- The same output can be created by many different inputs
- It’s nearly impossible to find two inputs that will produce the same output
This may sound complicated but you don’t need to understand the details of hash functions to understand blockchain. The most important part of this is the last point: “It’s nearly impossible to find two inputs that will produce the same output”. Even if you have the output of a hash function for a block, you can’t find another input that produces the same output without doing a lot of work.
And by a lot of work, we’re saying that it will take the Bitcoin network (which is huge) several times the life of the universe to calculate two hashes with the same output. And that doesn’t guarantee that they’re the output of the hash for the block that you care about or even that they’re the hash for a block on the blockchain. In other words, as long as hash functions remain secure, you’re never going to be able to find two inputs that produce the same hash output. The reason that this is important and that the previous block’s hash is included in the block is related to the “chain” part of “blockchain”. We’ll get to that in the “How are the Blocks “Chained” section.
Any legal or official document will include a signature or a stamp saying that someone important verifies the authenticity and correctness of the information included in it. If you believe that the signature is genuine, you can be certain that the document is official and genuine as well. Since each block of the blockchain contains several transactions of real money, it’s not surprising that everyone wants some verification that the supposed author of the block actually created it and that nothing has been modified. Since blocks are digital, a handwritten signature isn’t really an option, so the blockchain includes digital signatures. All you really need to know about digital signatures is the following:
- It’s easy to verify the authenticity of the signature
- It’s very difficult to impossible to modify the data included in a signed block without invalidating the signature
Basically, a digitally signed block was actually created by the person it claims and hasn’t been messed with since and you can easily verify this.
How are the Blocks “Chained”?
This is the reason that blocks are chained together in the blockchain rather than distributed as independent chunks of the ledger. The blockchain is intended to be decentralized and not require trust between any of the members of its network. If every block was independent, a forger only needs to successfully forge a single block to convince someone of a fake transaction happening or a real transaction not happening. With chained blocks, an attacker needs to forge a plausible, complete blockchain, which is much more difficult.
Who Stores the Blockchain?
We’ve talked about how the blockchain is a decentralized ledger for all of the transactions in a network. This means that we can’t rely on a central repository (like a bank) to hold the official record of the blockchain. So who does store it?
Anyone who wants to can store a copy of the blockchain. Since it’s easy to verify, many nodes don’t bother saving an entire copy and instead only store a set of the most recent blocks. As long as one node in the network has a complete copy, anyone can request it and verify its authenticity and the authenticity of any chunk. However, a single node with a complete copy means a single point of failure, so networks should have multiple storage locations to provide robustness and high download speeds (since it’s quicker to download from a local repository than one halfway around the globe).
How is the Blockchain Updated?
The blockchain is decentralized and distributed, meaning there is no central organization to add blocks and send out official updates to anyone interested. So how is the blockchain updated? We discussed previously that each block is created by someone chosen from among the community to create that block. Several processes exist for choosing this person, for a description of two of the most widely-used, see Proof of Stake (POW) and Proof Os Stake (POS).
How Can I Get Involved?
Everyone involved in a cryptocurrency is involved with modifying the blockchain in some way. If you’re interested in investing in cryptocurrency, you’re changing the state of the blockchain by purchasing and selling cryptocurrency. See "How to get cryptocurrency"