A blockchain is a type of database. To understand what blockchain is, first, you need to understand what a database is. A collection of information that is stored electronically on a computer system is known as a database. A database stores information in a table format which allows for easier searching and filtering. It can store large amounts of information that can be accessed, filtered, and manipulated by any number of users at once.
A blockchain is a digital ledger or digital record of transactions duplicated and distributed across the entire network of computers on the blockchain, making it difficult or impossible to change, hack, or cheat the system. The decentralized database managed by multiple participants on the blockchain network is known as Distributed Ledger Technology (DLT). Transactions in Distributed Ledger Technology are verified with an unchangeable cryptographic signature called a hash.
All participants on the network have access to the distributed ledger and its immutable record of transactions. Transactions are recorded only once, eliminating duplication. No participant can tamper or change a transaction after it’s been registered to the shared ledger. If a transaction includes an error, a new transaction must be added to reverse the error. A set of rules called smart contracts are stored on the blockchain to speed up transactions. Blockchains like Bitcoin and Ethereum are constantly growing as blocks are added to the chain, which significantly adds to the ledger’s security.
Blockchain consists of three important concepts:
Blocks: Each chain is made up of multiple blocks, and each block has three important elements: The data in the block, a nonce (a 32-bit whole number) which is randomly generated when a block is created. When the first block (genesis block) of a chain is created, a nonce generates the cryptographic hash.
Miners: Cryptocurrency miners create new blocks on the chain through a process known as mining. Every block has a unique nonce, a hash, and references to the hash of the previous block in the chain in a blockchain. Miners use special open-source software to solve the complex math problem of finding a nonce that generates an accepted hash. When a block is mined successfully, the change is agreed upon by all nodes on the blockchain network, and the miner receives a reward.
Nodes: One of the most critical concepts in blockchain technology is decentralization. No one computer (node) or organization can own the chain. Instead, it is a distributed ledger distributed across the entire network of nodes connected to the chain. Every node on the network has its copy of the blockchain, and it must algorithmically approve any newly mined block for the chain to be updated, trusted, and verified.
How does blockchain work?
Each block holds some data in a blockchain, the block’s hash, and the previous block’s hash. The data inside a block varies on the type of blockchain. For example, the Bitcoin blockchain keeps details of the transaction, such as a sender, receiver, and amount of bitcoins sent or received. You can relate a hash to a fingerprint. A hash can identify a block’s data, and it’s always unique, just as a fingerprint.
A hash is generated whenever a new block is created. Modifying something inside the block will cause the hash to change. Hashes are very helpful when you want to detect changes to blocks. If the fingerprint of a block is modified, then it is no longer the same block. The third element of each block is the hash of the previously generated block. This creates a chain of blocks that makes a blockchain.
Let’s take an example. Here in the above example, we have a chain of 3 blocks (X, Y, Z). Each block has a hash number and the hash of the previous block. Block 3 (Z) points to block 2 (Y) and block 2 (Y) points to block 1 (X). The first block (X) cannot point to previous blocks because it’s the first block in the chain. We call this the Genesis Block.
Let’s say that you tamper with block 2 (Y). This changes the hash of block 2 (Y), making block 3 and all subsequent blocks invalid because they no longer share a valid hash of the previous block. So tampering with a single block will make all subsequent blocks invalid. You could tamper with a block and recalculate all the hashes of all other blocks to make your blockchain valid. To solve this, blockchains have something called Proof-of-Work.
Bitcoin takes about 10 minutes to calculate and add a new block to the chain. This makes it very hard to tamper with the blocks because if you tamper with 1 block, you’ll need to recalculate the proof-of-work for all the following blocks. Instead of using a central device to manage the chain, blockchain uses a peer-to-peer network, and anyone can join.
When someone joins this network, the participant gets a full copy of the blockchain. When someone generates a new block, that new block is sent to everyone on the network. Then, each node validates the block to ensure that the block has not been tampered with. Once everything is verified, each node adds that block to the blockchain. Other nodes on the network will reject blocks that are tampered with. To tamper with a blockchain, you’ll need to fiddle with all blocks on the chain, redo the proof-of-work for each block and take control of more than 50% of the peer-to-peer network, which is almost impossible.
Advantages of Blockchain
- Thousands of nodes approve transactions on the blockchain network resulting in few errors and an accurate record of information.
- Information on the blockchain is copied and spread across a network rather than storing it in one central database, making it more difficult to tamper.
- When users make public transactions, their unique code called a public key is recorded on the blockchain rather than their personal information.
- Transactions are secure, private, and efficient.
- One can automate transactions with “smart contracts,” increasing your efficiency and speeding the process even further.
Disadvantages of Blockchain
- The “Proof of Work” system that validates transactions requires a lot of electricity and computational power.
- Low transactions per second (TPS).
- History of use in illegal activities.
Blockchain technology has a nearly endless amount of applications that are already being explored and implemented across almost every industry to make operations more efficient, accurate, secure, and cheap with fewer or no middlemen. Today, blockchain is useful for tracking intellectual property rights for artists, detecting fraud in banking and finance, and even acts as a better way to securely share patient medical records between healthcare professionals. The uses for the ledger system will evolve as blockchain technology evolves.