Decoding the Fundamentals of Blockchain Architecture: A Comprehensive Guide
The total value locked (TVL) in decentralized finance (DeFi) protocols has increased significantly in recent years, reaching a peak of over $200 billion in November 2021, according to DeFi Pulse.
Blockchain gained popularity because it offers a decentralized and transparent way of recording and verifying transactions and data.
We, at SumatoSoft, decided to summarize some fundamental knowledge of blockchain in this article. We wrote it from the perspective of developers since we are a blockchain development service provider. This article is for those who want to get a grasp on Web3 and Blockchain technology and understand it as well as for novice programmers who are faced with the choice of the direction in which they want to develop. More experienced developers, in turn, can systematize their knowledge on blockchain and web3.
Definitions
For a complete understanding of the material, the following definitions are required:
- A DLT (also called a shared ledger or distributed ledger) is a consensus of replicated, shared, and synchronized digital data that is geographically dispersed (distributed) across many sites, countries, or institutions. Unlike a centralized database, a distributed registry doesnât require a central administrator and therefore doesnât have a single (central) point of failure.
- A node is a computer permanently connected to a particular blockchain network.
- Mining is the process of creating a new block in the blockchain. Itâs necessary for the normal functioning of the blockchain network.
- The protocol is the set rules for blockchain operations. The protocol defines the interaction rules between the network nodes, rules for data transactions, and confirmation of the generation of a new block.
- The consensus algorithm is the rule by which blocks are generated in the blockchain.
- Validators are nodes that can check that blocks created by different participants follow the consensus rules.
- Cryptography (in this article) is a set of methods of hiding content and information. The basis of which is the functional transformation of information.
- A peer-to-peer network is a network of multiple computers communicating directly without a central element.
- Transaction (in this article) is an operation consisting of transferring funds from one account to another.
- Hash is a string of fixed length. Hash is the result of the data transformation according to a given mathematical algorithm. The amount of information on a page can be translated, for example, into the following string â25AE3AC4EA3300E517579B5253D5B47CFBA5B60E3C20DB03F963A02C007C61C1â using the SHA-256 algorithm. Hash allows quickly checking the integrity of the received information because it is faster to check one line than several hundred pages.
What Is Blockchain
Blockchain is a type of Distributed Ledger Technology (DLT) that consists of a growing list of records, called blocks, that are securely linked to each other using cryptography, or, more simply, a chain of securely linked blocks. This is the ideological definition of blockchain.
On the physical (low-level) side, blockchain is a peer-to-peer network that has its own protocol and consensus algorithm.
The most famous example of blockchain usage is cryptocurrency transactions, where each transaction is recorded as a “block” on the blockchain. The blockchain provides a secure and decentralized ledger that tracks the ownership and transfer of digital assets, such as Bitcoin, without the need for intermediaries like banks. Each block is cryptographically linked to the previous block, creating an unbreakable chain of transaction history that is resistant to tampering or fraud. This enables secure and transparent transactions without the need for a trusted third party.
What Is Blockchain Architecture
Blockchain architecture is a complete blockchain with all its components.
Usually, this architecture is divided into 4-5 levels:
- hardware layer;
- data layer
- network layer;
- consensus layer;
- application layer.
Since blockchain architecture isnât the topic of discussion in this article, we wonât plunge into it. Further in the article, weâll get a birdâs-eye view of the blockchain as a whole and its separate components
Blockchain History – Timeline
The history of the idea of blockchain as a distributed ledger dates back to the 1970s, long before the release of the founding document for Bitcoin in 2008 (authored by an anonymous author with the pseudonym Satoshi Nakamoto).
1979
The idea of immutably linking blocks of information to a cryptographic hash function originated in Ralph Merkle’s 1979 thesis, in which the author explains how information can be linked in a structure now known as a “Merkle tree”. Merkle tree is a hierarchical data structure in which each node has no more than two children. Nodes contain hashes from data blocks. Parent vertices contain hashes from the addition of values in child vertices. The tree’s root node contains a hash of the entire data set.
1990 – 1991
Subsequently, in 1990-91, Stuart Haber and Scott Stornetta applied these ideas in âHow to Timestamp a Digital Documentâ, establishing Surety company in 1994. Looking at this document, you can find ideas for what is now called a blockchain. However, this document only includes some of the elements and methods of blockchain.
To prevent an attacker from undue influence on the block generation process, many systems require new blocks to include “proof of (computational) work”.
1992
In 1992, Cynthia Dwork and Moni Naor proposed proof-of-computing to combat spam. But the idea and construction behind Proof of Work (PoW) can be seen in its nascent form in 1974’s Merkle Mysteries. Bitcoin was the first to use PoW for both mining and consensus building.
2008
The Bitcoin document published in 2008 is known as the “Bitcoin White Paper” and was authored by an individual or group of individuals using the pseudonym Satoshi Nakamoto. The white paper outlined the concept of a decentralized digital currency that would allow for peer-to-peer transactions without the need for intermediaries like banks.
2012
On September 27, 2012, the Bitcoin Foundation was formed by a group of prominent members of the Bitcoin community, including Gavin Andresen, Charlie Shrem, and Jon Matonis. The foundation aimed to promote the development and widespread adoption of Bitcoin, work towards standardizing the Bitcoin protocol, and protect the digital currency from threats and regulatory challenges. It played a significant role in advocating for Bitcoin and supporting its infrastructure during its early years.
2014
Ethereum, a significant advancement in the blockchain ecosystem, was proposed by a young programmer named Vitalik Buterin in late 2013. Ethereum went live on July 30, 2014, after a successful crowdsale. Ethereum introduced the concept of “smart contracts,” which are self-executing contracts with the terms of the agreement directly written into code. This new blockchain platform opened up new possibilities for decentralized applications (DApps) and inspired a wave of innovation in the blockchain space.
2017
On August 1, 2017, Bitcoin underwent a hard fork, resulting in the creation of a new cryptocurrency called Bitcoin Cash (BCH). The hard fork was initiated due to disagreements within the Bitcoin community over proposed solutions to the network’s scalability problem. Bitcoin Cash increased the block size from 1 MB to 8 MB, allowing for more transactions to be processed per block. The event highlighted the potential for divisions within blockchain communities and the importance of consensus-building.
2020
Decentralized Finance (DeFi) saw explosive growth in 2020, with the total value locked in DeFi platforms surpassing $10 billion by September. DeFi refers to financial services built on top of blockchain platforms, primarily Ethereum, that aim to disintermediate traditional financial institutions. DeFi projects offer services such as lending, borrowing, trading, and yield farming, all powered by smart contracts. This surge in DeFi adoption marked a new era for blockchain technology, as it began to gain traction in the financial sector and showcased the potential for decentralized financial services.
Decentralized or Distributed?
Some people confuse decentralization and a distributed ledger. Everything is simple here.
A decentralized system is one where there is no central authority, organization, or entity that has control over the network or its resources. In a blockchain, this means that decision-making and control are spread across all the participants (nodes) in the network, rather than being concentrated in a single central entity like a bank, a government, or a corporation. Decentralization ensures that no single entity can manipulate or take control of the blockchain
A distributed system is one where the components of the system (such as data, computing resources, or decision-making) are spread across multiple locations or devices, rather than being centralized in one place. In the context of blockchain, this refers to the fact that the blockchain ledger (the record of all transactions) is stored and maintained by multiple nodes across the network.
Each node in a blockchain network keeps a complete copy of the blockchain, and every time a new block is added, this information is propagated to all the nodes, which then update their local copies. This distributed nature of the blockchain ensures that the system remains resilient to failures and attacks, as even if one node goes offline or gets compromised, the other nodes in the network can continue to function and maintain the integrity of the ledger.
Almost all blockchain cryptocurrencies (protocols) are decentralized and distributed.
Blockchain Types: Private, Public, Consortium
Public Blockchain | Private Blockchain | Blockchain consortium | |
Anonymity | Yes | No | No |
Publicity | Yes | No | No (may be publicly read records) |
Owner | No | Yes | Several |
Operation speed | Low | High | High |
Usage | Global network (online stores, startups, decentralized applications) | In the company for their needs, for example, for accounting and accounting of any data | For transactions or information exchange between multiple companies (ideally the same industry) |
There are three types of blockchains that differ by the level of access to the network:
Public blockchain
In this network, anyone can connect, make transactions, watch records, check block generation (if connected as a node).
Anonymity: Yes
Publicity: Yes
Owner: No
Operation speed: Low
Usage: Global network (online stores, startups, decentralized applications).
Private blockchain
On the other hand, sets its own rules for who can connect, make transactions, and watch network records. Such blockchains are partially distributed by their structure.
Anonymity: No
Publicity: No
Owner: Yes
Transaction speed: High (low cost)
Usage: In the company for their needs, for example, for bookkeeping and data accounting
Blockchain consortium
They are on the border between the first and second types, combining both properties.
Anonymity: No
Public: No (may be publicly read records)
Owner: Several
Transaction speed: High
Usage: For transactions and information exchange between multiple companies (ideally within the same industry).
Blocks and Data: Definition, Role
In the blockchain, the term âblockâ means âa data recordâ. Every block features a data structure. Structures may vary from network to network, and itâs definned inside a protocol.
Usually, the data inside the block has a hash of this block, a hash of the previous block, and transaction data.
It is cryptographic hashing and chain storage of hashes of previous blocks that ensure network security.
The first block in the chain is slightly different. It has a zero parent block hash because there is no block in front of it. Such a block is called a genesis block.
Letâs consider the Ethereum network. In its blocks, information is divided into execution-level data and consensus-level data.
Letâs consider some of the items in the consensus-level data:
- the block size;
- block creation time;
- gas (block creation fee);
- transactions;
- block hash;
- parent block hash;
- system state in the form of a Merkle tree.
Consensus data refers to the data that is used to reach consensus among nodes in the blockchain network about the validity of the transactions or smart contract executions recorded in the block. Among the data of the consensus level, you can see information related to the blocks themselves and network validators.
Execution data refers to the data that is used to record the actual transactions or smart contract executions that occur on the blockchain. This data includes information such as the sender and receiver addresses, the amount of cryptocurrency being transferred, and any other relevant details about the transaction or contract execution.
It is worth noting that blocks can be viewed by anyone who can connect to this network, unless we are talking about private and consortium blockchains (more on that later).
Consensus Algorithms
Proof of Work
Proof of Work (PoW, or Proof-of-Work) is a bitcoin consensus algorithm that led to the emergence of a new profession on the market – a miner. The meaning, as always, lies in the name. To participate in the transaction, network members need to solve an arbitrary mathematical puzzle to find the hash and publicly prove the work done in order to avoid cheating the system. The first one who was lucky enough to find the right solution gets the opportunity to add a block to the chain and the opportunity to receive a reward for the work done, this is the main motivator for participating in this protocol.
Examples of use: Bitcoin, Litecoin
Flaws:
- Large and senseless energy consumption, which is fundamentally unenvironmental. After all, miners use the power of computers in parallel, but the work of only one is accepted – the fastest, who coped with the task. (In 2015, it was estimated that a single bitcoin transaction required an amount of electricity comparable to the energy needed to power 1.57 American homes a day. Therefore, PoS was introduced to conserve energy.)
- Mining has become not so much a tool to maintain the network as a way to cash in on rewards.
- May reduce network scalability. It was the case with Etherium blockchain which limits its transaction speed to around 30 transactions per second. Etherium switched to te proof-of-stake mechanism in 2022.
Benefits:
- The main benefit is that this algorithm follows the initial blockchain principles: decentralization, security, fairness.
Proof o Stake
Proof of Stake (Pos or Proof-of-Stake) was created as an alternative to Proof-of-Work and seeks to cover its shortcomings. This mechanism reduces the amount of computational work required to validate the blocks and transactions that ensure the security of the blockchain, as a result, reducing power consumption. Computing power for checking blocks is replaced by staking, whereby a person’s mining ability is randomized by the network. Instead of buying $1,000 worth of mining hardware, members can lock up the equivalent of $1,000 worth of crypto. Itâs called âstakingâ or âstcke their tokensâ. Users can then simply vote for the desired block on the network and digitally sign their vote. If done correctly, they add a block to the chain and are rewarded for their contribution. The block with the most votes wins, after which it is added to the chain. However, if a user proposes to add a block that is known to be wrong or a block with a lower number of votes, he loses part of his staking assets as a penalty.
Usage examples: Ethereum, NXT, Tezos, Peercoin, Blackcoin
Flaws:
- Motivation for the concentration of funds appears. This can lead to the centralization of the network.
Benefits:
- Energy efficiency. PoS doesn’t require miners to solve complex mathematical puzzles to validate transactions and add new blocks to the chain. Instead, validators are selected to validate transactions based on the amount of cryptocurrency they hold and “stake” as collateral.
Proof-of-Burn
Proof-of-Burn (PoB) – to apply it, the miner sends coins to a random address, from which it is almost impossible to spend funds. For burning coins the miner gets a constant chance to find a PoB block and be rewarded. The chances of mining increase as the number of coins burned increases. Economically, burning coins can be considered buying a drilling rig for mining.
This algorithm can be used, for example, to transfer from an old to a new cryptocurrency on the same blockchain. The miners burn the old coins to get new ones. This algorithm is used on the Slimcoin platform.
Flaws:
- At an early stage of cryptocurrency development, everything can âstallâ due to a lack of âfuelâ for burning.
These are the most popular consensus algorithm. We list other existing algorithms without describing them as they are not so widespread in usage.
- Proof of Capacity (PoC)
- Proof of Identity (PoI)
- Proof of Activity (PoA)
- Proof of Elapsed Time (PoET)
Why Is Blockchain So Hard to Hack?
If an attacker tries to change the data on the chain, the network will find and fix the bad block, and the attacker will fail. How does it work? Well, letâs examine it step by step.
Firstly, Blockchain Cryptography Is Complicated
For example, Bitcoin uses SHA-256 hashing functions, Ethereum uses KECCAK-256. Hashing has the following characteristics:
- It works one-way – a hash is not decoded back into data.
- It is deterministic – the same information is translated into the same hash.
- It works fast.
- Has no avalanche effect. The effect does not allow preserving the similarity of hashes by changing, for example, just a symbol. If one hashed information is even slightly different from the other, then the output is two completely different hashes.
Secondly, All Blocks Are Interconnected
Each block has its own hash and the hash of the previous block, that is, in order to hack, information needs to be changed in several blocks.
Thirdly, All Nodes Store Blockchain
The blockchain, as already mentioned, is a peer-to-peer system. All nodes are interconnected and keep a copy of the entire blockchain in memory. According to the consensus algorithm, all nodes determine whether to add a new block to the chain or not.
Security in Nutshell
As a result, if an attacker tries to change the data of the block, then the block hash changes dramatically. It generated the wrong chain of blocks which the nodes will cut off using the consensus algorithm and replace with the correct one.
Edges and Drawbacks of Blockchain
Edges (for a Network Without Restrictions):
- Openness: everyone can become a member of the network, and no checks and permissions are needed.
- Transparency: everyone can see when, how many and by whom certain transactions were performed.
- Immutability: You can’t change records that have already been added. Ite means no retroactive transactions or fake edits.
- Anonymity: thanks to some tools, you can achieve complete anonymity in the blockchain network. No one will trace the path to your wallet in the transaction. In Ethereum, for example, this can be done using the âTornadoâ utility. Moreover, no one will know the owner of the wallet.
- Security: Strong cryptography and modern hashing make it possible to store data with the lowest possible chance of being hacked.
- Fault Tolerance: Constantly exchanging data and storing it in memory will not allow the peer-to-peer network to fail, and also allows you to eliminate any interference in the network.
- Cost savings and trust: In finance and business, it is important to trust your partner when closing deals. With the help of blockchain and smart contracts, you can save money and time by conducting transactions directly with your partner without intermediates.
Flaws:
- Scalability: Blocks store a limited amount of information and cannot be expanded.
- Energy consumption: Quite a lot of networks operate using the PoW algorithm that requires a huge volume of electricity. In general, it isnât environmentally friendly.
- Time-consuming: Calculating a new hash and adding new blocks to the chain takes time. Although transactions go quickly, they may take some time.
- Legality: Blockchain is illegal in a number of countries.
- Data storage: Blockchain is getting bigger over time. There may be problems connecting new nodes in the future.
How to Build Your Own Blockchain
Programming languages such as C ++, Python, JavaScript, Rust, Ruby are mainly used for this purpose. For example, you can use Solidity or Rust to develop smart contracts.Â
However, building a market-competitive blockchain requires great technical skills and knowledge of data structures, consensus methods, decentralized ledgers, cryptography, and cryptocurrencies.
The Usage of Blockchain
Today, blockchain has found application in many areas and industries. We wrote about the top 20 blockchain consulting companies and blockchain business ideas. Here we want to mention some examples of blockchain usage:
Medicine
There are many successful projects in this area. Transparency, immutability, security and anonymity help store and send data, and communicate with medical staff safely and efficiently. Several companies have successfully implemented blockchain technology in this area:
- Drug supply chain management: Blockchain technology helps in tracking and verifying the provenance of pharmaceutical drugs, ensuring their authenticity and preventing counterfeit medicines from entering the supply chain. It enables transparency, immutability, and real-time tracking of drug movement from the manufacturer to the end consumer, improving the overall safety and efficiency of the distribution process. Examples: MediLedger project, IBM blockchain for supply chain.
- Patient data management: Blockchain can be used to create a decentralized, secure, and tamper-proof platform for storing and sharing patient medical records. This allows healthcare providers to access a comprehensive and accurate patient history, while ensuring the privacy and security of sensitive information, ultimately improving diagnosis, treatment planning, and coordination of care. Examples: MedRec, Healthbank.
Finance
Smart contracts may cover a lot of financial transactions without referring to intermediaries. Securities signing, consensus, vesting, transactions, transaction accounting, accounting and much more can make it faster and easier to use blockchain in this area.
- Cross-border Payments: Blockchain technology allows for faster, more secure, and cost-effective cross-border transactions by eliminating intermediaries, reducing transaction fees, and decreasing processing times. Examples: Ripple (XRP)б Stellar Lumens (XLM)
- Decentralized Finance (DeFi): DeFi is an ecosystem of financial applications built on blockchain networks that provide users with decentralized alternatives to traditional financial services, such as lending, borrowing, and trading. Examples: Compound Finance. Uniswap.
Charity
Due to its transparency, blockchain crowdfunding is more trustworthy than regular fees. After all, you can not only track where the money went, but also get acquainted with the conditions for depositing funds (if a smart contract was used for this).
- Transparent donation tracking: Blockchain technology enables donors to track their contributions and ensure that their donations reach the intended recipients or causes, improving transparency and accountability in the charity sector. Examples: Alice, GiveTrack.
- Decentralized crowdfunding: Blockchain platforms can facilitate decentralized crowdfunding campaigns, enabling individuals and organizations to raise funds directly from a global network of donors without intermediaries. Examples: Giveth, WeTrust Spring.
SumatoSoft – Practitioners in Blockchain Development
We are a talented software development team that uses modern technologies to digitalize businesses. Weâve worked for 10 years on the market of custom software development services and have become a reliable technical partner to our Clients. Blockchain development services are one of the areas of our expertise along with:
To learn more about us, check out the page about us.
Consider yourself a talented specialist? Try yourself in the interview for some open positions. We need such a specialist!
Plan to develop a blockchain project? Contact us, and we will tackle your projects in days!
Conclusion
In conclusion, blockchain technology has evolved significantly over the years, and various consensus algorithms like Proof-of-Work, Proof-of-Stake, and Proof-of-Burn have been developed to meet different needs and preferences. Blockchain’s inherent security features, such as complex cryptography and the interconnected nature of blocks, make it incredibly difficult to hack. Additionally, the numerous benefits of blockchain, including transparency, immutability, and cost savings, have led to its widespread adoption across various industries like medicine, finance, and charity.
However, it is crucial to consider the drawbacks of blockchain technology, such as scalability, energy consumption, and legality, when developing or adopting a blockchain-based solution. Developing a blockchain project requires extensive technical knowledge and skills in data structures, consensus methods, decentralized ledgers, cryptography, and cryptocurrencies.
As blockchain technology continues to advance, it will undoubtedly find new and innovative applications in various industries, revolutionizing the way we store and transact data.
Letâs start
If you have any questions, email us info@sumatosoft.com