A Close Look at Blockchain: Blockchain Architecture

7w7v...c9wj
28 Dec 2023
91


In this article, we will explore from scratch what Blockchain is and delve into the fundamentals of Blockchain technology. Before we begin our discussion, it's essential to understand some basic concepts to grasp Blockchain technology thoroughly. Let's first learn what these fundamental concepts are.

What is Data?
Data is the Turkish equivalent of the word "data." Data is the name given to an unprocessed, pure particle of information. A piece of data alone does not convey any meaning. After data is collected, processing operations such as grouping, sorting, and summarizing, whether manually or by computer, give it meaning. In short, we can refer to data as information particles.
Don't think of data only as information on a computer; data is actually everywhere around you, even inside your body, in the DNA. The process of transforming data into machine language occurred in 1801 when Joseph Jacquard punched holes in cardboard plates. The punched card method was transformed into a device called Homeoscope by Semen Korsakov in Russia in 1832 for the storage and quick retrieval of data.
The processing of data with punched cards maintained its popularity until the 1950s. However, the large volume occupied by punched cards opened the door to new alternatives. The first alternative to punched cards was developed in 1950, known as magnetic storage systems for computers. Magnetic storage systems became a crucial part of UNIVAC computer systems, used in the finance and banking sectors. In this way, data storage solutions evolved and underwent transformations up to the present day.
Of course, there are cloud storage solutions and developments within each of them during this process. However, it is sufficient to know the transformation of rough data storage solutions.
What is a Database?

A database is an area where interconnected pieces of information are stored. It ensures appropriate recording and updating of information. The generation of a vast amount of information and the continuously increasing speed of incoming information necessitated new methods in data storage and access on computers. To fill this gap, a database was created. Although punched cards were used to store data, they were also used as a method to organize data for systematic storage. Many different punched cards were stored in cabinets in an organized manner to be used appropriately for the purpose of the data they contained.
Punched cards met the necessary requirement up to a certain level, but it became inadequate with advancing technology, leading to the exploration of new methods. Techniques rooted in library science and archiving, dating back to ancient times, were used in computer systems, inspiring the logic of today's database. This method gave rise to solutions known as NoSQL. This allowed for very fast searches within large datasets. For example, Google's search engine uses such a database.
The reason for emphasizing the concept of data is to establish a foundation for understanding the basic logic of distributed ledger technology, namely Blockchain technology. In fact, the Blockchain system was once seen merely as a data structure solution.
In the early 2000s, two independent projects, eDonkey and BitTorrent, provided insight into the Peer-To-Peer concept, which was unfamiliar in the internet world. Peer-to-peer (P2P), or peer-to-peer, refers to data sharing directly between users without a central server, unlike a third party. In these systems, data is distributed or shared among machines, which could number in the millions, rather than being stored in a single center. Some of these machines may contain all the data, while others may only include a certain part. When you want to access the data, the system directs you to retrieve it from different machines in the fastest possible way. While downloading data to your computer, you simultaneously serve as a data source to other users. Users of the system can benefit from the system in proportion to the support they provide to the system.
This approach led to the emergence of solutions called Distributed Ledger Systems. Blockchain technology also emerged as a different application of this solution.
Cryptology (Privacy Science)
In the systems we have described, we always talk about data, but the increase in data also brought along another problem: the security of data. Cryptology is derived from the ancient Greek word "kryptos," meaning privacy, and cryptology means the science of privacy. Cryptography, a sub-discipline of cryptology, is also derived from an ancient Greek word, "graphien," meaning writing.
Cryptography refers to the encryption of data (text). Encryption transforms any set of data into a seemingly random set of data using a random or conscious rule structure. This seemingly random set of data can only be decrypted by those who have the key used during encryption. Thus, encrypted data remains meaningful only to the key holder, regardless of where and how the encrypted data is stored.
Blockchain

If we were to ask what Blockchain is, we explained that the concept of Distributed Ledger is not a new concept and has been used in networks in the past, such as eDonkey and Bittorrent. However, in these networks, the data stored was generally unencrypted, meaning anyone could access this data. Could this data be encrypted? Certainly! However, it would be of no use to anyone except the key holder and would bring along different problems. In multilateral or multi-party systems, every data that is desired to be added to the system must have a valid standard. This ensures both the integrity and acceptability of the system in general. This is where the consensus structure, which we call consensus, comes into play.
The foundations of Blockchain were laid in 2008, and it began to be recognized with Bitcoin in 2009. This technology is defined as a distributed ledger. In a more comprehensive definition, Blockchain is a distributed, shareable, encrypted, irreversible, and unalterable information repository. Blockchain is a system that verifies and stores transactions among users using the system.
In Blockchain, transactions are kept in structures called blocks, and these blocks are linked to each other in sequence to create a chain. These blocks are created based on specific rules. Each written block is distributed to distributed ledgers and added as a copy. In other words, each new block created contains data from the previous block.
Whenever any transaction occurs in Blockchain, it is broadcast over the existing network and, using encryption algorithms we will discuss later, is verified to create a new block. Every node, meaning everyone using the system, records this operation by confirming it. This way, the block is verified, and afterward, this information can never be changed or deleted.
A node represents every user in the Blockchain system. Every user joining the system has a copy of the system, namely a ledger or a database. This ledger is added to other nodes using a peer-to-peer protocol, eliminating the need for a third-party intermediary. This is how decentralization is achieved.

Blockchain System's Fundamental Criteria
The Blockchain system has some fundamental criteria and is built upon these standards.
Distributed: Considered the most fundamental feature of Blockchain. Data is not stored in a single location but is recorded in a distributable way and can be stored by all users.
Transparent: The record of data is transparent to every node, and data can be retrospectively verified.
Independent: Without a central authority, every node in the system can securely transfer data.
Immutable: Data added to Blockchain cannot be updated, deleted, and is permanently stored.
Identity Privacy: In the Blockchain system, nodes, meaning individuals, can transfer data without revealing their identity. Knowledge of their Blockchain address is sufficient for this process.

Blockchain Record Structure
In Blockchain technology, data is always recorded in a systematic order. To better understand this, let's create a fictional but simple scenario where a teacher conducts an experiment to explain the blockchain structure to students using an attendance system. Each student writes their name, surname, signature, and date on a paper from the beginning. In this analogy, names represent data, each line represents a block, and the overall system represents Blockchain.
The Blockchain registration system is similar to this analogy. The names written on paper represent data, and each line, a block, has its unique signature. The date on the paper corresponds to the timestamp in Blockchain, indicating the flow of time. Blocks, each with its signature, containing data created at a specific moment, are lined up consecutively to form the Blockchain. The first record is called the Genesis block since it is the starting block in this structure.

Blockchain Order Structure
Let's continue with the attendance example we provided to understand the order structure. The teacher introduces a rule to explain the order structure. To prevent verification, later additions, and signing on behalf of each other, and to hold accountable for any incorrect signature, everyone will verify and sign the line of the person after them.
Now, in this new structure, when carefully checking the attendance register (our chain), it can be easily understood when the sequence is broken. As this continues, except for the first person, in addition to our friend who writes their name and signs for each new name, the signature of the previous person is also added.
The first created block is called Genesis, meaning the starting block, and it carries only its digital signature since there is no block before it. However, each subsequent block will contain its own signature and the unique signature of the previous one. Thus, in a sequential record structure, a digital order is made possible in the digital world.
Blockchain Distributed Structure
The method the teacher uses to explain the distributed structure is as follows: everyone is given a blank sheet of paper, and everyone writes the names of everyone on the paper in the same order and asks them to sign those names to the people they own and, as we explained in the order structure, everyone also verifies and signs the person coming after them. In other words, everyone has a copy of the chain that has been copied but verified and confirmed.
Now we have a structure with a specific record and order, and copies of the generated chain are distributed to everyone. In this case, any manipulation or cheating by a person on the order will now be noticed. Because the majority can continue to trust the structure agreed upon by comparing the records they have and those of others and those trying to cheat will be noticed.
Blockchain technology exactly offers us the same structure. Data is recorded not only by a central or a central group but by everyone involved in the system. Here, it is not necessary for the parties to know each other, and what provides trust is not the relationships between individuals but the rules determined at the beginning of the system and the distribution of the record chain produced within these rules to everyone.
All blocks where Blockchain records are distributed communicate with each other, confirming that the system is not compromised. If a link is removed or changed in the data record chain structure, the chain breaks, and the entire system removes the point with the broken/corrupted link from the distributed ledger network. Thus, the remaining ones continue to use the system by agreeing that the chain continues without breaking.

Encryption in Blockchain Networks
When it comes to Blockchain and cryptocurrencies, security is perhaps the most important issue, and encryption and decryption between two parties mean that a third party cannot understand or misuse it. We have already mentioned that the main purpose of cryptography is privacy, as we can understand from its name.
Let's explain a simple form of encryption through an example: first, let's create a key for encryption. Let this key be valid for the text format and progress by accepting the letter that comes after each letter in the alphabet. Let's choose "HELLO WORLD" as an example. When we use the key, our text will look like this: "IFMMP XPSME". This seemingly meaningless text can only be reversed by someone who has the key used during encryption. Thus, encrypted data remains meaningful only to the key holder, regardless of where and how the encrypted data is stored.
In Blockchain, there are three encryption methods:

Symmetric Encryption:
Symmetric encryption is a method where the same key is used for both encrypting and decrypting data. This is sometimes also called "secret key encryption." This encryption method works, but it is not sufficient; using the same key for both encryption and decryption poses risks within the system, and if an attacker gains access to the key, they can misuse it. Therefore, it is not a highly preferred method.
Asymmetric Encryption:
Asymmetric encryption is a method that uses two keys, a public key and a private key. The public key is used to encrypt data, while the private key is used to decrypt it. In other words, the public key transforms plaintext into encrypted text, and the private key transforms the encrypted text back into plaintext. For example, the Bitcoin network operates on an asymmetric system, providing users with a private key and then generating a public key to work with.

Hashing:
Hashing refers to the process of converting entered data into a fixed output of a certain pattern through a mathematical process. Hashing algorithms are often used to produce a "hash value" that is based on the plaintext input. Hash functions are widely used because of their security; the generated hash value, regardless of the original data, is a set of characters that are difficult to reverse. Passwords or various data are never stored in plain text. For example, when signing up for a site, the password you choose is not stored in the database in its original form. It is encrypted with a one-way algorithm and transformed into a set of characters consisting of letters and numbers that do not resemble the real password. An attacker who remotely accesses the system with encrypted data will not be able to use it because it is a one-way encryption and is very difficult to reverse.
The real technical process behind the hash operation is quite complex, and that's why mining is very favorable for some cryptocurrencies. The contribution of computing resources spent on a network for hashing is called the hash rate, and a good hash rate usually means that the network is secure.
Especially in Bitcoin, the SHA-256 encryption algorithm is used. This algorithm is impossible to retroactively decipher, and it always provides a 64-character output in the hexadecimal number system, regardless of what is written. You can try this out and check other algorithms at this link.

Consensus Mechanism (Mutual Agreement) - What Is It?
Consensus, also called mutual agreement, is defined as "general agreement reached by a group in a controversial matter." More generally and simply put, it means deciding or reaching an agreement within a group. Consensus mechanisms ensure the collaboration and security of distributed systems. These mechanisms have been used for many years to provide consensus among database nodes, application servers, and other enterprise infrastructures. To better understand this, let's take Ethereum as an example.
In recent years, new consensus mechanisms have been invented for systems like Ethereum to reach an agreement on the state of the network. The consensus mechanism, especially, helps prevent certain types of economic attacks. Theoretically, an attacker can endanger consensus by controlling 51% of the network. This is where consensus mechanisms are designed to make a "51% attack" impossible.

Smart Contracts - What Are They?

Smart contracts, especially pioneered by Ethereum, are the fundamental building blocks of Ethereum applications. They are computer programs stored on the blockchain that turn traditional contracts into digital parameters. Smart contracts can be considered a type of Ethereum account. This means they have a balance, and they can send transactions on the network. However, they are not controlled by a user; instead, they are distributed on the network and operate as programmed. Users can interact with smart contracts by sending transactions to them, invoking functions defined in the smart contracts.
Smart contracts essentially work on a simple logic. They are flexible and can be subject to change, which raises questions about their objectivity, especially when decisions are made by humans influenced by various factors, such as emotions. The human factor, as seen in traditional contracts, can lead to failures.
For example, two individual judges can interpret a traditional contract in different ways. Their interpretations can lead to different decisions and outcomes. Smart contracts eliminate the possibility of different interpretations. There is no going back in smart contracts. The system that strictly follows the rules defined in the contract, alongside human decision-makers who are free to act in their interests, is more acceptable and secure for everyone.
Nick Szabo introduced the term "smart contract" in 1994. In 1996, he proposed a theory that was so far-fetched that the current capabilities of smart contracts could not be imagined at the time. The concept of such a system as imagined has become a reality with the vision of Ethereum.
Smart contracts, like traditional contracts, can be verified and checked before signing. More importantly, due to the transparency of the contract terms, everyone can review them in advance.
The areas of application for smart contracts are not limited and depend on your imagination. They can already perform calculations, create currency, store data, mint NFTs, send communications, and even create graphics. When examining smart contracts more closely, you find standards that enhance their efficiency, which can be considered as smaller components that improve efficiency.

Merkle Tree Structure
The Merkle tree is an approach used to verify large datasets. It takes data not in its full form but in a summarized form. In a Merkle tree structure, a binary tree structure is created, and the pieces in the data set are placed at the lowest level. Then, moving upwards in a binary way, a summary value is generated, and a unique summary value (Merkle root value) is created for the entire tree structure.

Proof of Work (PoW)
Proof of Work is essentially a protocol developed to prevent attacks or spam, meaning unwanted messages, aimed at disrupting the system's operation. This protocol emerged from a paper presented by computer experts Cynthia Dwork and Moni Naor in 1993.
Proof of Work aims to provide a consensus mechanism to protect the system's operation from attacks and spam. This protocol helps prevent various types of attacks, particularly the "51% attack," where an attacker could control the majority of the system and compromise the consensus.
Proof of Work involves participants, often referred to as miners, solving complex mathematical problems. The first participant to solve the problem gets the right to add the next block to the blockchain and is rewarded with newly created cryptocurrency coins. This process requires significant computational power and electricity consumption.
This protocol helps maintain the integrity of the system by ensuring that participants follow the rules, and it provides a fair way to distribute newly created coins. It has been the primary consensus mechanism used in cryptocurrencies like Bitcoin.

Proof of Work, particularly in the 1990s, was initially employed to prevent attacks on computer systems aimed at rendering them inoperable, such as DDoS (Denial of Service) attacks. However, it took on a different form when introduced in the technical documentation of Bitcoin published on October 31, 2008. Here, a peer-to-peer electronic cash system was presented through the Proof of Work protocol, demonstrating a reliable payment system and how a cryptocurrency could come into existence.

How Does Proof of Work Work?
Bitcoin and other cryptocurrencies are blockchain systems protected through networks formed by nodes. The primary task of these systems is to ensure the sustainability and continuity of the network. Within the network, there are operators known as miners, responsible for adding new blocks to the chain. The addition of these blocks requires solving complex mathematical problems. Due to the difficulty of solving these problems, powerful processors are needed.
The miner who solves the problem and verifies the transactions in the block earns the right to broadcast the transaction to the network, claiming the predefined cryptocurrency reward and the transaction fees paid for the transactions in the block.

Proof of Stake (PoS)
Proof of Stake is an alternative protocol to Proof of Work, taking into account ownership of assets. It emerged as an alternative to the high energy consumption of Proof of Work in 2012, introduced by blockchain developers Sunny King and Scott Nadal. The first cryptocurrency to use the PoS protocol was Peercoin. Unlike the PoW protocol, PoS does not distribute network power based on processor power but relies on operators who simultaneously fulfill several combinations to produce the next block.

Delegated Proof of Stake (DPoS)
In Proof of Stake, users affirm ownership of assets to verify transactions and have the right to produce blocks. DPoS utilizes the consensus-solving power of users who vote to reach an agreement. In DPoS, a social system is used to achieve consensus in the blockchain network. The goal is for cryptocurrency owners to have a say in the management of the network.
In contrast to the Proof of Stake system, users delegate their crypto assets to another user rather than transferring them from their wallets. The crypto assets are considered as owned by the delegated user, increasing their influence in the network. The user receiving delegation rights from others receives a larger share of network income and shares the earnings proportionally with their delegators.

Leased Proof of Stake (LPoS)
In Proof of Stake, not every user is eligible to verify transactions and earn rewards. LPoS allows users to lease a certain percentage of an entire node, encouraging small investors to participate in the system. Users in the LPoS protocol lease their assets to other users who are verified to validate transactions. Although the leased amount does not leave the user's wallet, a proof-of-stake mechanism is provided. Users engaging in mining activities in LPoS receive higher rewards than the income generated and share their earnings with their stakeholders.

Forks
Forks occur when significant technical upgrades or changes are required in the network. They are often initiated by Ethereum Improvement Proposals (EIPs) and alter the "rules" of the protocol. Unlike traditional, centrally controlled software, blockchain forks work differently because there is no central ownership. Rule changes can create a temporary division in the network, where new blocks can be created based on either new or old rules. Forks are usually pre-planned, ensuring that customers smoothly adopt changes, and the fork becomes the main chain alongside upgrades. However, in rare cases, disagreements over forks can lead to a temporary separation of the network.

Hard Fork
A Hard Fork signifies a sharp divergence on the blockchain network. It involves creating a new blockchain as an alternative to the existing one. Since the code has changed significantly, the new version is not backward compatible with old blocks, resulting in a hard fork. With a hard fork, either both forks coexist independently, or one becomes more dominant.
Hard forks bring strict regulations since users who choose the new fork have no option to revert to the old version. An example is the DAO (Decentralized Autonomous Organization) fork, created in response to the hacking of 50 million ETH. During that period, the Ethereum community debated what to do, and the majority decided to use a hard fork.

Soft Fork
A Soft Fork refers to making innovations on the blockchain network that are compatible with the old software. Think of a soft fork as a software upgrade for the blockchain. When universally adopted by users, it becomes the new standard for the currency. Users migrating to the new network can choose to return to the old one if they wish. Soft forks require miners and users to mostly accept the new network for full success. They are often used in Bitcoin and Ethereum to introduce new features or functionalities at the programming level. Since the network does not change, the upgrade can work retroactively.

Write & Read to Earn with BULB

Learn More

Enjoy this blog? Subscribe to resnodes

23 Comments

B
No comments yet.
Most relevant comments are displayed, so some may have been filtered out.