Blockchain architecture refers to the components and subcomponents or layers that make up a complete blockchain system. Each layer has a unique role, from storing data to maintaining network connectivity and ensuring consensus across the system.
Understanding these layers is crucial for blockchain developers and start-up entrepreneurs seeking to leverage blockchain technology effectively.
This article aims to demystify the intricacies of blockchain architecture by breaking down its layers and their respective functionalities. Our goal is to help you navigate the complexities of blockchain design, optimize performance, and identify potential security vulnerabilities.
Generally speaking, there are four types of blockchains: public, private, consortium, and hybrid. Naturally, the specifics of blockchain architecture depend on the type.
|Type of Blockchain||Description||Scalability||Examples|
|Public Blockchain||A decentralized blockchain accessible to anyone with an internet connection||Limited||Bitcoin, Ethereum|
|Private Blockchain||A blockchain that is only accessible to a select group of individuals or organizations||High||Hyperledger Fabric, Corda|
|Hybrid Blockchain||A blockchain that combines the features of both public and private blockchains||High||Dragonchain, EWF Baseline|
|Consortium Blockchain||A blockchain that is governed by a consortium of organizations||High||R3 Corda, Hyperledger Fabric|
Public blockchains are open to everyone and are not restricted by permissions. They can employ a variety of consensus mechanisms, although scalability can be challenging due to the increasing demands of a broad user base. Bitcoin and Ethereum are classic examples.
Private blockchains are created for enterprise needs. It is a permissioned blockchain that is only accessible to a selected few, typically for business organizations. Hyperledger Fabric is one of the most prominent private blockchains.
Public and private blockchains have their pros and cons. The idea behind a hybrid blockchain, like Dragonchian, is to get the best of the two worlds.
Consortium blockchains, such as R3 Corda, are owned and governed in partnership, i.e., when several private nodes form a consortium blockchain.
Depending on a blockchain type, there are different ways to implement its architecture, and there is no standard for it. However, most blockchains typically have the following structure:
|Layer||What it does||Components|
|Application||Hosts applications that interact with the blockchain.||Smart Contract, User Interface, Decentralized Applications|
|Services & Optional Components||Enhances the functionality of the blockchain with additional services.||Governance/DAOs, Oracles, Wallets, Blockchain Monitor|
|Protocol/Consensus||Defines and regulates how nodes in a blockchain come into agreement.||Consensus, Sidechains, Permissioned and Permissionless, Propagation Protocol, Virtual Machines|
|Network||Facilitates effective discovery and interaction among nodes.||Communication Mechanisms, Trusted Execution Environments, Recursive Length Prefix|
|Data||Caters for the creation, management, and encryption of data.||Digital Signatures, Hash, Merkle Tree, Data Blocks, Asymmetric Encryption, Storage|
|Hardware/Infrastructure||Provides the physical resources needed to host a blockchain.||Mining, Nodes, Tokens, Servers|
Provides blockchain-based applications for the end user.
The application layer is the end product of the entire system offering specific products for the users, i.e., wallet, lending, staking, etc.
The application layer starts with a smart contract, a programmable code that governs state transitions. It can function as an escrow, payment channel, or vault and is known by different names in various ecosystems, like “programs” in Solana and “chaincode” in Hyperledger. Smart contracts are a frequent target for hackers, as any critical error in its code can be exploited for illegal gains.
Usually, users don’t interact with the smart contract directly. Instead, they rely on a front end of a Web3 application or an API. The Uniswap website is an example of a decentralized app combining UI and smart contracts.
Amplifies blockchain capabilities with additional features.
The services layer creates Web3 interconnection, removing barriers and enabling smooth interactions. Optional elements include Decentralized Autonomous Organisations (DAOs), aiding administration and communication in networks like Arbitrum and Polygon, but absent in Bitcoin and Ethereum. Oracles bridge Web3 applications with real-world data on asset pricing, aiding off-chain computations. Hot wallets store on-chain assets but also serve as access points, for example, Metamask or Kaikas – a native wallet for Klaytn. Lastly, block explorers track chain health, helping detect technical glitches and security breaches and mitigate issues early.
Set rules for node agreement on the state.
The protocol layer sets the rules for blockchain participation, with the consensus mechanism being its key component. Consensus ensures agreement among nodes for block mining and processing and outlines validator requirements, varying across proof-of-work, proof-of-stake, and other consensus mechanisms. Propagation protocol broadcasts decisions, while protocol audits ensure security against threats like 51% attacks.
Blockchains can be permissioned (limiting access) or permissionless (open to all). Sidechains, operating parallel to main chains with separate consensus mechanisms, offer enhanced capabilitiesю An example is the Polygon-Ethereum relationship.
Provides for peer node interaction.
The network layer enables effective discovery and interaction among peers called nodes. Typically, a node locates a bootnode, which scans for available peers and initiates bonding. As information circulates, it’s safeguarded through a Trusted Execution Environment (TEE) to maintain integrity. Node session maintenance varies across networks; for example, Ethereum employs Recursive Length Prefixes, defining the time nodes take to locate, authenticate, and share data.
Ensures secure and confident message transmission.
The data layer of blockchain technology is primarily concerned with data storage and structure. It houses the blockchain, a linear succession of blocks that store transaction information. Depending on the specific blockchain, the data structure can range from a simple transaction list, such as the one used by Bitcoin, to a more intricate structure, like Ethereum’s state trie, which stores contract state information.
While the specifics of transaction addition and hashing used aren’t the focus here, it is important to note that the data layer does play a role in maintaining integrity and privacy. This is the layer where most cryptographic primitives used in the protocol – signature algorithms, cryptographic libraries, and public-private key pairs — are defined and should be tied to high-security standards.
Asymmetric encryption is a critical component, with a public-private key pair keeping the data confidential. The public key is associated with a wallet address, and the private key grants control over assets tied to that address.
Every transaction is accompanied by a digital signature, a cryptographic mechanism that validates the control of the correct private key without revealing it, thus ensuring security. Cryptographic signatures are generated by signature algorithms such as The Elliptic Curve Digital Signature Algorithm, Rivest–Shamir–Adleman, and so on.
Provides the necessary capacities to host a blockchain.
Blockchain architecture extends to hardware and infrastructure. In this layer—In Proof-of-Work consensus protocols—miners and validators operate, with miners creating new blocks using specialized equipment (GPU, ventilator, stabilizer) and electricity, and validators running nodes for block mining. As for data storage, some blockchains opt for third-party decentralized data hostings, such as Filecoin, IPFS, Arweave, or Firebase, due to capacity limitations.
Nodes, or clients, come in three types: full, light, and archive nodes. Full nodes store the entire chain’s state, participate in consensus processes, and provide data upon request. Light nodes host only block summaries, while archive nodes store transaction data from the genesis block to the present, available for user queries.
The infrastructure layer also includes virtual machines, which act like operating systems and host smart contracts. Blockchains often have native virtual machines, such as the Avalanche Virtual Machine for Avalanche and the Ethereum Virtual Machine for Ethereum. However, a blockchain can also be compatible with other virtual machines.
Application, Services, Protocol, Network, Data, and Infrastructure layers make up a complete blockchain. However, it’s also important to understand L1 vs. L2 scalability solutions, as these are the “layers” you’ll come across most often.
|Layer 1||Independent, Secure, Permissionless||Sharding, Forks||Ethereum, Bitcoin, Solana|
|Layer 2||Dependent, Scalable, Fast||State Channels, Nested Blockchains, Rollups, Sidechains||Polygon, Lightning Network, Arbitrum|
Ethereum and Bitcoin are the two most dominant L1s in Web3. Layer 1 blockchains are foundational and self-sustaining chains. They are mostly public and permissionless. A typical layer 1 blockchain has all components of blockchain architecture.
The scalability of most L1s, however, can be quite modest due to their technical bottlenecks. Some L1s have been proactive with native scaling solutions. For instance, Ethereum is implementing sharding to fast-track its throughput.
Layer 2 blockchains provide scaling in the form of higher throughput and lower gas while relying on L1 for security and underlying operations. But they typically implement a different consensus layer.
There are various creative ways L2 carries out its scaling activities: running a side chain, state channels, rollups, or nested blockchains. The Lightning Network and Stack are remarkable examples of an L2 in the Bitcoin ecosystem.
A blockchain is an eventual product of different compartments and layers. These layers provide it with various factors it needs to function properly.
Note, however, that one of the greatest pain points of blockchain technology is security breaches. Each layer of the blockchain is prone to vulnerabilities. To that end, the protocol, dApp, and smart contracts should be comprehensively audited to block off potential security threats.
A blockchain needs 5 main layers in its architecture: Application Layer, Protocol (Consensus) Layer, Network Layer, Data Layer, and Hardware/Infrastructure Layer.
Different types of blockchain architecture include public blockchains, private blockchains, hybrid blockchains, and consortium blockchains.
A blockchain has different components based on why it was created. Generally, the components often include consensus algorithms, P2P nodal interactions, hash, system management, etc.
Subscribe to our newsletter
Enter your email address to subscribe to Hacken Reseach and receive notifications of new posts by email.