How Blockchains Work
Blockchain technology underpins cryptocurrencies, NFTs, and decentralized applications, but do you know how it actually works?
This guide explains everything you need to know about how blockchains work, from the basics of blocks and transactions to security and advanced concepts.
What is a blockchain?
A blockchain is a decentralized, distributed ledger technology that records transactions in blocks. Network participants (validators or miners, depending on the blockchain) verify transactions, eliminating the need for a centralized authority.
Blockchain technology was first outlined in 1991 by Stuart Haber and W. Scott Stornetta, two researchers who wanted to implement a system in which documented timestamps could not be tampered with. However, it went largely unused until Satoshi Nakamoto adapted the idea in 2008 to create the peer-to-peer digital cash system known as Bitcoin.
Types of blockchains
There are various types of blockchains, including public, private, and consortium blockchains.
Public blockchains
A public blockchain is a decentralized network with a globally accessible public ledger that documents transaction history. They utilize a consensus mechanism to validate and secure data across a network of participants.
Examples of public blockchains include:
Bitcoin: Bitcoin is the first and most well-known public blockchain, enabling peer-to-peer digital payments without intermediaries.
Ethereum: Ethereum is a versatile public blockchain that introduced smart contracts, enabling decentralized applications (dApps) and helping drive the growth of decentralized finance (DeFi) and non-fungible tokens (NFTs)..
Public blockchains offer transparency and security but face scalability and energy-efficiency trade-offs.
Private blockchains
A private blockchain is a restricted network: rather than being accessible to anyone, it requires an invitation to join and limits who can verify transactions. Private blockchains are centralized and owned by a single organization.
They are more commonly used for highly secure transactions, such as internal bank data or legal and health records.
Common examples of private blockchains are:
Hyperledger Fabric: An open-source, private blockchain hosted by the Linux Foundation, allowing for private data collections through confidential, peer-to-peer subsets that sit outside of the main ledger.
R3 Corda: Corda is a private blockchain used for internal institutional transactions across a select group.
While private blockchains provide security and sometimes faster transaction speeds, they face centralization challenges as the entire network relies on a single organization.
Consortium blockchains
Consortium blockchains are semi-decentralized: they are owned and governed by a group of organizations rather than a single entity, while remaining permissioned. They’re widely used for business collaborations to facilitate transactions across different groups/companies.
As they are co-owned, consortium blockchains can face challenges such as conflicting interests among competing organizations or having to comply with different regulations across borders.
How blockchains work
Although the technology behind blockchains is complex, the basic process follows a straightforward sequence: a transaction is created, verified by the network, grouped into a block, and permanently added to the blockchain. Understanding each stage explains why blockchains are considered secure and transparent.
Distributed Ledger Technology
Blockchains are a type of Distributed Ledger Technology (DLT), an infrastructure for maintaining records across a network that enhances transparency and security through a shared, replicated, and synchronized database.
Unlike traditional databases that are centralized and governed by a single entity, a distributed ledger records transactions in a transparent, secure, and tamper-resistant manner. This is achieved through blocks.
Blocks
Blocks are groups of verified transactions recorded on a blockchain. Like pages in a ledger, each block links to the previous one using cryptographic hashes. Once a block reaches capacity, a new one is created.
Every block has two key identifiers: a unique code termed a 'hash' and the hash of the preceding block. This sequential hashing ensures a chronological and unalterable chain of blocks. If someone were to tamper with a block's details, its hash would change, effectively breaking the chain and signaling potential foul play. This inherent feature of blocks underpins the security and trustworthiness of blockchain technology.
The creation of a block differs depending on the blockchain’s consensus mechanism. In networks like Bitcoin, it involves 'miners' solving complex mathematical puzzles. Upon solving this puzzle, the miner presents the new block to the network for verification. Once approved, the block is added to the chain, and the miner receives a reward, usually in the form of cryptocurrency.
Transactions
Blockchains are used to facilitate transactions of cryptocurrencies, real-world assets (RWAs), NFTs, and more. They are the starting point of every blockchain. Transactions work as follows:
A user initiates a transaction by signing a transfer request with their private key.
The transaction is broadcast to the network.
Validators check the transaction to confirm that it is legitimate and able to be processed.
Validated transactions then wait in the mempool until they can be grouped into a block.
Once the transaction sits in a block, it is permanently recorded on the blockchain.
Every transaction has a unique transaction ID (TXID), allowing anyone to track its status and view details such as wallet addresses, fees, and confirmations.
Transaction fees are required when making a transaction, as they are used to compensate the validators responsible for verifying your transaction and adding new blocks to the chain. The fee can vary depending on factors such as network congestion and network throughput.
Throughput and transactions per second (TPS) are terms used to describe how fast a network can process transactions. Throughput measures the number of transactions processed over a given period, while TPS measures the number processed each second. Networks with higher throughput and TPS can generally support more users without significant delays, which is why they are used as indicators of a blockchain’s scalability.
Blockchain networks
A blockchain is maintained by a network of participants that communicate, verify transactions, and keep the ledger up to date. Each component has a specific role in keeping the blockchain operational.
Nodes
Consider nodes the backbone of the blockchain network: they store blockchain data, communicate with other participants, and help validate information across the network.
In proof-of-work (PoW) and proof-of-stake (PoS) networks, nodes help maintain the blockchain by verifying transactions and ensuring they comply with the network’s rules. Validators then propose and confirm new blocks of verified transactions through the consensus process. This helps prevent fraudulent or invalid transactions from being added to the blockchain and ensures every participant shares the same, trusted version of the ledger.
Because nodes store copies of the entire blockchain, the network remains operational even if some go offline.
There are two types of nodes:
Full node: They store a complete copy of the blockchain and actively participate in validating transactions and blocks. Bitcoin's full nodes, for instance, ensure the network's security by enforcing consensus rules.
Lightweight node: Lightweight, or simplified payment verification (SPV) nodes, rely on full nodes for blockchain data while independently verifying block headers and transaction inclusion proofs.
A network with a healthy distribution of nodes enhances censorship resistance, making it more difficult for malicious actors to manipulate transactions or gain control over the network.
Validators
Validators confirm transactions and propose or validate new blocks on PoS blockchains. They ensure transactions comply with the network’s rules before the new blocks are added.
In a blockchain like Bitcoin, which uses a PoW consensus mechanism, validators are commonly known as miners. They solve complex mathematical problems to validate transactions and create new blocks.
Validators are incentivized through block rewards, consisting of newly minted coins, as well as transaction fees from the transactions included in the new block.
In PoS, validators are chosen based on the number of coins they hold and are willing to "stake" as collateral. Staking serves as both an incentive and a penalty system; validators are rewarded for confirming legitimate transactions but can lose their staked coins if they validate fraudulent activities.
Peer-to-peer networks
Blockchain networks use peer-to-peer (P2P) networking, which allows participants to communicate directly with one another without an intermediary or central authority. In this system, every participant acts as both a client and a server, rather than relying on a single server or entity for the desired service.
There are several advantages to P2P:
Decentralization: Ensures that the system remains robust against systemic failures. If one peer fails or acts maliciously, the system can continue functioning normally.
Heightened privacy: Transactions aren't necessarily tied to personal identities as they are in traditional banking systems.
Cross-border transactions: By sidelining intermediaries, cross-border transactions become simpler, faster, and often cheaper, fostering a more interconnected and efficient global economy.
However, as with any system, the P2P model in cryptocurrencies isn't without its challenges. The absence of intermediaries means that there's often no recourse in the case of disputes. Additionally, while the system as a whole might be more resilient, individual peers can be susceptible to hacks, scams, or technical failures.
Blockchain protocols
Blockchain protocols are the rules that govern how participants communicate, verify transactions, reach consensus, and secure the network. They help prevent issues such as double-spending while ensuring all participants follow the same standards.
Protocol layers
A "protocol layer" is a distinct and hierarchically organized component of a blockchain, responsible for governing specific functions, rules, and interactions within the network. Each layer operates at a different level of abstraction and contributes to the overall functionality and security of the system.
By dividing the network into distinct layers, security vulnerabilities and scalability challenges can be addressed more effectively. Each layer's design can be optimized for its specific task, enhancing overall network performance.
Some of the most common protocol layers include:
Application layer: The topmost layer that is closest to the end-users and encompasses dApps, user interfaces, and interactions with the blockchain network. It presents data and enables users to interact with the blockchain without needing an in-depth technical understanding.
Smart contract layer: Sitting below the application layer, this layer handles the execution of smart contracts. These contracts automate processes and facilitate transactions without intermediaries.
Consensus layer: This layer is responsible for achieving agreement among network participants on the state of the blockchain. It ensures that all nodes validate transactions and maintain a consistent, tamper-proof ledger.
Network layer: The network layer manages the communication between nodes in the blockchain network. It handles data propagation, peer discovery, and synchronization to ensure a consistent view of the blockchain across participants.
Decentralization
Blockchains are built to be decentralized, with no central authority or control in a system. In a decentralized system, control, decision-making, and data storage are dispersed across multiple nodes, thereby eliminating a single point of failure and often increasing transparency and security.
However, decentralization is not binary; some projects might be fully decentralized, with no single entity having any control, while others may only be partially so, featuring elements of both centralized and decentralized architectures.
Decentralization comes with several benefits:
Enhanced security: With participants verifying transactions and producing blocks, it becomes exponentially difficult for a bad actor to manipulate the system.
Resilience: If one node fails or is compromised, the network can still function correctly, as the other nodes maintain copies of all necessary data.
Transparency: It promotes openness, as the rules governing the network are encoded in open-source software that anyone can examine and audit.
Decentralized applications include DeFi platforms, Decentralized Autonomous Organizations (DAOs), and NFT marketplaces, using blockchain technology to distribute control across a network rather than relying on a central authority.
However, a primary concern, that blockchains continue to work on, is the scalability of decentralized networks. Every transaction needs to be validated by multiple nodes and with certain consensus mechanisms, this may cause transaction speeds to be slower. The implementation of Layer 2s is the most common infrastructure change used to improve scalability.
Web 2 vs. Web 3
The internet's vastly different from when it was first introduced, and the idea of decentralization has led to even more developments.
Web 2 is the internet that most people are familiar with, emphasizing user-generated content, interaction, and social platforms. That means when you use Instagram, YouTube, or Reddit, you’re on Web 2. However, these centralised platforms, including Google, Meta, and Amazon, now control vast amounts of user data, which raises concerns about privacy, data security, and centralization. Web 2's centralization led to an imbalance in the power dynamics between service providers and users.
That's where Web 3 comes in. Web 3 is a term that describes the next evolutionary phase of the internet. It aims to bring the concept of decentralisation to the internet, eliminating the need for intermediaries and thus returning control to the users. Technologies like blockchains are fundamental here, as they signify a new paradigm of decentralised, open, and interoperable apps and services.
On Web 3, your data belongs to you. Unlike in the current model, where your information is stored on large institutionally owned servers, blockchain's DLT allows data to be stored across multiple nodes in a network. This allows you to manage your own data and grant or revoke permission for use as you see fit.
However, there are still a few concerns surrounding Web 3, including scalability issues on the blockchain, the environmental impact of certain consensus mechanisms, and decentralization presenting new complexities in governance and regulation.
Advanced blockchain concepts
If you’re looking to learn even more about blockchains, here are a few more advanced concepts for you to grasp.
What are blockchain APIs?
An API, or Application Programming Interface, is a set of rules and protocols that allow different software applications to communicate with each other. They are pivotal for enabling various types of interactions between applications and blockchain networks. These interactions can include transferring tokens, querying transaction history, or even initiating smart contracts on platforms like Ethereum.
APIs allow applications to interact with blockchain networks, such as retrieving transaction data, checking wallet balances, or interacting with smart contracts.
However, poorly secured APIs can create vulnerabilities, particularly if they expose sensitive information or allow unauthorized transactions.
Zero-Knowledge Proof
A Zero-Knowledge Proof (ZKP) is a cryptographic method that allows one party to prove knowledge or validity of information without revealing the underlying data. In other words, it enables someone to demonstrate knowledge of a fact without disclosing the details of that fact. This innovative technique empowers data validation while preserving privacy.
For example, a person could prove they know a password without revealing the password itself. The verifier can confirm the claim is true without learning the underlying information.
Important blockchain events
There are certain events that happen on a blockchain network that impact token supply, governance, and the operation of the network.
Token burning
Token burning permanently removes cryptocurrency tokens from circulation by sending them to an unusable wallet address, thereby reducing the overall supply within its designated blockchain ecosystem.
There are several motivations and benefits of initiating token burns:
Regulating the supply: Reducing circulation can increase scarcity, potentially influencing demand and value.
Maintain or improve the economic balance: Some projects might choose to burn a portion of transaction fees they collect as a strategy to bolster the token's value.
Proof-of-Burn: Participants demonstrate consensus by deliberately burning a predetermined quantity of cryptocurrency, showcasing their commitment to the network.
Burning announcements can also influence market behavior, as investors may speculate on potential price changes.
Why this matters for your taxes
Blockchain transactions are not completely anonymous, and they are taxable events. Trading, buying, selling, and staking can all have tax implications, meaning if you’re participating in any of these activities, you likely owe tax.
Reporting your cryptocurrency taxes doesn’t have to be daunting. A crypto tax calculator, like Koinly, uses APIs to collect read-only data from blockchains, exchanges, and wallets to calculate your crypto taxes. This also allows you to manage your portfolio directly in Koinly and generate specialized tax reports you can use to file your taxes.

