Startertutorials Blog
Tutorials and articles related to programming, computer science, technology and others.
Subscribe to Startertutorials.com's YouTube channel for different tutorial and lecture videos.
Suryateja Pericherla Categories: Blockchain. No Comments on Basics of Blockchain Technology
0
(0)

In this article we will learn the basic concepts of blockchain technology like what is a blockchain? the blockchain architecture and how does a blockchain work?

 

In 2008, a groundbreaking paper, entitled Bitcoin: A Peer-to-Peer Electronic Cash System, was written on the topic of peer-to-peer e-cash under the pseudonym of Satoshi Nakamoto. It introduced the term chain of blocks. No one knows the actual identity of Satoshi Nakamoto. The term “chain of blocks” evolved over the years into the word “blockchain.”

 

What is a Blockchain?

There are different ways for defining a blockchain. The two most accepted definitions of a blockchain are as follows:

 

Layman’s definition (informal definition): Blockchain is an ever-growing, secure, shared recordkeeping system in which each user of the data holds a copy of the records, which can only be updated if all parties involved in a transaction agree to update.


Subscribe to our monthly newsletter. Get notified about latest articles, offers and contests.


 

Technical definition (formal definition): Blockchain is a peer-to-peer (decentralized), distributed ledger that is cryptographically secure, append-only, immutable (extremely hard to change), and updateable only via consensus or agreement among peers.

 

Peer-to-Peer

Peer-to-Peer or P2P means there is no central controller who looks over or controls the nodes in a network. All the nodes talk to each other directly. This allows transactions to be performed directly among the participants (nodes) without any involvement of a third-party such as a bank. A famous example of P2P software is BitTorrent.

 

Distributed Ledger

The ledger (set of transactions) is distributed across all the peers (nodes) in the network. Each peer will have a separate copy of the complete ledger.

 

Cryptographically Secure

Cryptography techniques are used to make the ledger secure against tampering and misuse. The techniques include non-repudiation, data integrity, and data origin authentication.

 

Append-only

The new data can only be added to the blockchain in a time-sequential order. It means that once the data is added to the blockchain, it cannot be changed and is immutable.

 

However, remember that it can be changed in rare scenarios wherein collusion against the blockchain network by bad actors succeeds in gaining more than 51 percent of the power.

 

Otherwise, the blockchain is practically immutable. There may be some legitimate reasons to change data in the blockchain once it has been added, such as the “right to be forgotten” or “right to erasure”.

 

Updatable via Consensus

Any update made to the blockchain is validated against strict criteria defined by the blockchain protocol and added to the blockchain only after a consensus has been reached among all participating peers/nodes on the network. This allows for the decentralization of blockchain.

 

Blockchain Architecture

Blockchain can be thought of as a layer of a distributed peer-to-peer network running on top of the internet, as can be seen in the following diagram. It is analogous to SMTP, HTTP, or FTP running on top of TCP/IP.

Blockchain architecture diagram

 

The lowest layer is the Network. It is generally the Internet which provides a base communication layer for any blockchain. A peer-to-peer network runs on top of the Network layer, which consists of information propagation protocols such as gossip or flooding protocols.

 

After this comes the Cryptography layer, which contains crucial cryptographic protocols that ensure the security of the blockchain. This layer consists of public key cryptography and relevant components such as digital signatures and cryptographic hash functions.

 

Next comes the Consensus layer, which is concerned with the usage of various consensus mechanisms to ensure agreement among different participants of the blockchain.

 

Further to this, we have the Execution layer, which can consist of virtual machines, blocks, transactions, and smart contracts. This layer, as the name suggests, provides execution services on the blockchain and performs operations such as value transfer, smart contract execution, and block generation.

 

Finally, we have the Applications layer, which is composed of smart contracts, decentralized applications, DAOs, and autonomous agents. This layer can effectively contain all sorts of various user level agents and programs that operate on the blockchain. Users interact with the blockchain via decentralized applications.

 

Generic Elements of a Blockchain

The generic structure of a blockchain can be visualized with the help of the following diagram:

Generic elements of Blockchain

 

The elements that can be found in a generic blockchain are described below one by one.

 

Address: Addresses are unique identifiers used in a blockchain transaction to denote senders and recipients. An address is usually a public key or derived from a public key.

 

Transaction: A transaction is the fundamental unit of a blockchain. A transaction represents a transfer of value from one address to another.

 

Block: A block is composed of multiple transactions and other elements, such as the previous block hash (hash pointer), timestamp, and nonce. A block is composed of a block header and a selection of transactions bundled together and organized logically. A block contains several elements, which are as follows:

  • A reference to a previous block is also included in the block unless it is a genesis block. This reference is the hash of the header of the previous block. A genesis block is the first block in the blockchain that is hardcoded at the time the blockchain was first started. The structure of a block is also dependent on the type and design of a blockchain.
  • A nonce is a number that is generated and used only once. A nonce is used extensively in many cryptographic operations to provide replay protection, authentication, and encryption. In blockchain, it’s used in PoW consensus algorithms and for transaction replay protection. A block also includes the nonce value.
  • A timestamp is the creation time of the block.
  • Merkle root is a hash of all of the nodes of a Merkle tree. In a blockchain block, it is the combined hash of the transactions in the block. Merkle trees are commonly used to allow efficient verification of transactions. Merkle root in a blockchain is present in the block header section of a block, which is the hash of all transactions in a block. Verifying only the Merkle root is required to verify all transactions present in the Merkle tree instead of verifying all transactions one by one.
  • In addition to the block header, the block contains transactions that make up the block body.

 

The following diagram depicts the generic structure of a block in blockchain. A block’s structure can change from one blockchain to another.

Elements in a block of blockchain

 

Peer-to-Peer Network: As the name implies, a peer-to-peer network is a network topology wherein all peers can communicate with each other and send and receive messages.

 

The scripting or programming language: Scripts or programs perform various operations on a transaction in order to facilitate various functions. Examples of scripting languages are the Script language of Bitcoin, which is not Turing complete and Solidity language of Ethereum, which is Turing complete.

 

Virtual Machine: A virtual machine allows Turing complete code to be run on a blockchain (as smart contracts); whereas a transaction script is limited in its operation. However, virtual machines are not available on all blockchains.

 

State Machine: A blockchain can be viewed as a state transition mechanism whereby a state is modified from its initial form to the next one by nodes on the blockchain network as a result of transaction execution.

 

Smart Contracts: These programs run on top of the blockchain and encapsulate the business logic to be executed when certain conditions are met. These programs are enforceable and automatically executable.

 

The smart contract feature is not available on all blockchain platforms. Smart contracts have many use cases, including but not limited to identity management, capital markets, trade finance, record management, insurance, and e-governance.

 

Node: A node in a blockchain network performs various functions depending on the role that it takes on. A node can propose and validate transactions and perform mining to facilitate consensus and secure the blockchain.

 

Nodes can also perform other functions such as simple payment verification (lightweight nodes), validation, and many other functions depending on the type of the blockchain used and the role assigned to the node.

 

How does a Blockchain Work?

Let’s understand how a blockchain actually works. Nodes are either miners who create new blocks and mine cryptocurrency (coins) or block signers who validate and digitally sign the transactions.

 

A critical decision that every blockchain network has to make is to figure out which node will append the next block to the blockchain. This decision is made using a consensus mechanism.

 

We will look at the general steps involved in creating blocks. This scheme is presented here to give you a general idea of how blocks are generated and what the relationship is between transactions and blocks:

  1. Transaction is initiated: A node starts a transaction by first creating it and then digitally signing it with its private key. A transaction can represent various actions in a blockchain. Most commonly, this is a data structure that represents the transfer of value between users on the blockchain network. The transaction data structure usually consists of some logic of transfer of value, relevant rules, source and destination addresses, and other validation information.
  2. Transaction is validated and broadcast: A transaction is propagated (broadcast) usually by using data-dissemination protocols, such as Gossip protocol, to other peers that validate the transaction based on preset validity criteria. Before a transaction is propagated, it is also verified to ensure that it is valid.
  3. Find new block: When the transaction is received and validated by special participants called miners on the blockchain network, it is included in a block, and the process of mining starts. This process is also sometimes referred to as “finding a new block.” Here, nodes called miners race to finalize the block they’ve created by a process known as mining.
  4. New block found: Once a miner solves a mathematical puzzle (or fulfils the requirements of the consensus mechanism implemented in a blockchain), the block is considered “found” and finalized. At this point, the transaction is considered confirmed. Usually, in cryptocurrency blockchains such as Bitcoin, the miner who solves the mathematical puzzle is also rewarded with a certain number of coins as an incentive for their effort and the resources they spent in the mining process.
  5. Add new block to the blockchain: The newly created block is validated, transactions or smart contracts within it are executed, and it is propagated to other peers. Peers also validate and execute the block. It now becomes part of the blockchain (ledger), and the next block links itself cryptographically back to this block. This link is called a hash pointer.

 

The above steps are illustrated in the figure below:

How blockchain works diagram

 

Benefits, Features, and Limitations of Blockchain

Some of the benefits of blockchain technology are as follows:

  • Decentralization: There is no need for a trusted third party or intermediary to validate transactions; instead, a consensus mechanism is used to agree on the validity of transactions.
  • Transparency and trust: As blockchains are shared and everyone can see what is on the blockchain, this allows the system to be transparent. As a result, trust is established.
  • Immutability: Once the data has been written to the blockchain, it is extremely difficult to change it back. It is not genuinely immutable, but because changing data is so challenging and nearly impossible, this is seen as a benefit to maintaining an immutable ledger of transactions.
  • High availability: As the system is based on thousands of nodes in a peer-to-peer network, and the data is replicated and updated on every node, the system becomes highly available.
  • Highly secure: All transactions on a blockchain are cryptographically secured and thus provide network integrity. Any transactions posted from the nodes on the blockchain are verified based on a predetermined set of rules. Only valid transactions are selected for inclusion in a block.
  • Faster dealings: In the financial industry, especially in post-trade settlement functions, blockchain can play a vital role by enabling the quick settlement of trades. Blockchain does not require a lengthy process of verification, reconciliation, and clearance because a single version of agreed-upon data is already available on a shared ledger between financial organizations.
  • Cost-saving: As no trusted third party or clearing house is required in the blockchain model, this can massively eliminate overhead costs in the form of the fees, which are paid to such parties.
  • Platform for smart contracts: A blockchain is a platform on which programs can run that execute business logic on behalf of the users. This is a very useful feature but not all blockchains have a mechanism to execute smart contracts; however, this is a very desirable feature.
  • Smart property: It is possible to link a digital or physical asset to the blockchain in such a secure and precise manner that it cannot be claimed by anyone else. You are in full control of your asset, and it cannot be double-spent or double-owned.

 

Some of the challenges/problems of blockchain that need to be addressed are as follows:

  • Scalability: Currently, blockchain networks are not as scalable as, for example, current financial networks. This is a known area of concern and a very ripe area for research.
  • Adoption: Often, blockchain is seen as a nascent technology. Even though this perspective is rapidly changing, there is still a long way to go before the mass adoption of this technology. The challenge here is to allow blockchain networks to be easier to use so that adoption can increase.
  • Regulation: Due to its decentralized nature, regulation is almost impossible on blockchain. In blockchain networks, no regulatory authority and control exists, which is an inhibiting factor for many consumers.
  • Relatively immature technology: As compared to traditional IT systems that have benefited from decades of research, blockchain is still a new technology and requires a lot of research to achieve maturity.
  • Privacy and confidentiality: Privacy is a concern on public blockchains such as Bitcoin where everyone can see every single transaction. This transparency is not desirable in many industries such as the financial, law, or medical sectors.

 

 

How useful was this post?

Click on a star to rate it!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Suryateja Pericherla

Suryateja Pericherla, at present is a Research Scholar (full-time Ph.D.) in the Dept. of Computer Science & Systems Engineering at Andhra University, Visakhapatnam. Previously worked as an Associate Professor in the Dept. of CSE at Vishnu Institute of Technology, India.

He has 11+ years of teaching experience and is an individual researcher whose research interests are Cloud Computing, Internet of Things, Computer Security, Network Security and Blockchain.

He is a member of professional societies like IEEE, ACM, CSI and ISCA. He published several research papers which are indexed by SCIE, WoS, Scopus, Springer and others.

Leave a Reply

Your email address will not be published. Required fields are marked *

Blogarama - Blog Directory