Blockchain Essentials | Part 1

Introduction to Blockchain

A blockchain is a type of distributed ledger technology (DLT) that consists of growing lists of records, called blocks, that are securely linked together using cryptography.

Each block contains a cryptographic hash of the previous block, a timestamp, and transaction data (generally represented as a Merkle tree).

A blockchain is a decentralized, digital ledger that records transactions across a network of computers. These transactions are grouped together in blocks, and each block is connected to the one before it, forming a chain. This chain of blocks is managed by a network of computers, rather than a central authority.

The most well-known use of blockchain technology is in the creation of cryptocurrencies such as Bitcoin, but the technology has the potential to be used in a wide variety of applications. For example, it could be used to create secure, decentralized systems for recording and verifying transactions in finance, supply chain management, or voting systems.

One of the key features of a blockchain is its ability to maintain a consistent and accurate record of data without the need for a central authority to oversee the process. This is achieved through the use of cryptography and consensus algorithms, which ensure that once a block is added to the chain, it cannot be altered without the consensus of the network.

Because of its decentralized nature, blockchain technology is often associated with the idea of transparency and immutability, since all the parties in the network can have access to the same data.

Additionally, blockchain can also be divided into public, permissionless blockchain and private, permissioned blockchain. Public blockchain is also called permissionless blockchain, which means anyone can access and participate in the network; Private blockchain is also called permissioned blockchain, which means only authorized person can join and participate in the network, and the data inside is also restricted to be seen by authorized people.


History of Blockchain

The concept of a blockchain can be traced back to the early 1990s with the development of a cryptographic protocol called “hashcash.” However, it wasn’t until the release of the Bitcoin whitepaper in 2008 that the first blockchain-based digital currency was proposed. The paper, titled “Bitcoin: A Peer-to-Peer Electronic Cash System,” was published under the pseudonym “Satoshi Nakamoto.”

The Bitcoin blockchain is a decentralized public ledger that records all Bitcoin transactions. It uses a consensus mechanism called “proof of work” to ensure that all participants in the network agree on the state of the ledger. The proof-of-work algorithm requires participants to solve a difficult computational problem in order to add a new block of transactions to the blockchain.

The success of the Bitcoin blockchain led to the development of other blockchain-based digital currencies, such as Litecoin and Ripple. The idea of using blockchain technology for purposes other than digital currencies also began to gain traction. In 2013, Vitalik Buterin proposed the development of Ethereum, a blockchain platform that would allow for the creation of decentralized applications. This led to the emergence of a new class of blockchain known as “smart contract platforms.”

Since then, many organizations and industries have been exploring the use of blockchain technology. Some examples include supply chain management, voting systems, and digital identity. There are various different blockchain platforms, each with their own set of features and characteristics. The most popular ones are Bitcoin, Ethereum and Hyperledger etc.

Types of Blockchains

There are several types of blockchain technology, each with their own characteristics and use cases. Some of the most popular types of blockchain include:

  1. Public blockchain: This type of blockchain is open to anyone and is typically decentralized, meaning that no single entity controls it. Examples of public blockchains include Bitcoin and Ethereum.
  2. Private blockchain: In contrast to a public blockchain, a private blockchain is typically permissioned and only accessible to a certain group of individuals or entities. These are often used by businesses and organizations for specific use cases, such as supply chain management or record-keeping.
  3. Consortium blockchain: A consortium blockchain is a hybrid of the public and private blockchain, where a group of organizations collectively operate and maintain the blockchain.
  4. Permissioned blockchain networks: Businesses who set up a private blockchain will generally set up a permissioned blockchain network. It is important to note that public blockchain networks can also be permissioned. This places restrictions on who is allowed to participate in the network and in what transactions. Participants need to obtain an invitation or permission to join.
  5. Hybrid blockchain: Also a combination of public and private blockchain, but this time with the different features of both, it’s possible to make transaction or smart contracts publicly, but keep records or access restricted for certain parties.
  6. sidechain: A sidechain is a separate blockchain that is connected to a main blockchain. The purpose of a sidechain is to add additional functionality to the main blockchain, such as increased scalability or faster transactions.
  7. Federated Blockchain: This type of blockchain is controlled by a group of pre-selected nodes, called federation, which has the authority to make decisions regarding the blockchain.
  8. Directed Acyclic Graph (DAG) based Blockchain: A different approach in the blockchain technology, it’s a structure of multiple branches rather than just one linear chain, allowing more transactions in parallel and increasing scalability.

These are just a few examples of the different types of blockchain technology, and new variations and use cases are being developed all the time.

Working of Blockchain

A blockchain is a decentralized, distributed ledger that is used to record transactions across a network of computers. Each block in the chain contains a number of transactions, and every time a new transaction is added to the blockchain, it is added to a block. Once a block is added to the blockchain, it cannot be altered, ensuring the integrity and immutability of the data stored on the blockchain.

At its core, a blockchain is a digital ledger of transactions that is duplicated and distributed across the entire network of computer systems on the blockchain. Each block in the chain contains a number of transactions, and every time a new transaction is added to the blockchain, a record of that transaction is added to every participant’s ledger. The decentralized database managed by multiple participants is known as a distributed ledger.

One of the key features of a blockchain is that it is managed by a peer-to-peer network collectively adhering to a protocol for validating new blocks. Once a block is added to the blockchain, it is very difficult to alter or delete. This is because every block contains a record of all the previous blocks in the chain, and any alteration to a single block would require the alteration of all subsequent blocks and the consensus of the network.

The most common type of blockchain is the one which uses a consensus mechanism called “Proof-of-Work” (PoW) . In PoW, the nodes in the network, also known as “miners,” compete to solve a difficult mathematical problem, and the first one to solve it gets to add the next block to the blockchain. This process is also known as “mining.”

Another type of blockchain called “Proof-of-Stake” (PoS) is also gaining popularity. In PoS-based blockchain, the nodes that validate transactions and create new blocks are chosen via various combinations of random selection and wealth or age (i.e the stake).

Blockchain technology is used to create and manage digital currencies like Bitcoin and Ethereum, but it has the potential to be used for a wide range of other applications, such as supply chain management, voting systems, and more.

Step by step working of Blockchain

  1. As each transaction occurs, it is recorded as a “block” of data: Those transactions show the movement of an asset that can be tangible (a product) or intangible (intellectual). The data block can record the information of your choice: who, what, when, where, how much and even the condition — such as the temperature of a food shipment.
  2. Each block is connected to the ones before and after it: These blocks form a chain of data as an asset moves from place to place or ownership changes hands. The blocks confirm the exact time and sequence of transactions, and the blocks link securely together to prevent any block from being altered or a block being inserted between two existing blocks.
  3. Transactions are blocked together in an irreversible chain: a blockchain: Each additional block strengthens the verification of the previous block and hence the entire blockchain. This renders the blockchain tamper-evident, delivering the key strength of immutability. This removes the possibility of tampering by a malicious actor — and builds a ledger of transactions you and other network members can trust.

In short, a blockchain is a decentralized, digital ledger that is used to record transactions across a network of computers. It uses a peer-to-peer network and consensus algorithms to ensure the integrity and immutability of the data stored on the blockchain.

What is Ledger

It is the collection of Transactions in the form of Blocks.

A ledger is a record of financial transactions. It is used to keep track of the flow of money in and out of a business or organization. Ledgers can be physical books that are manually updated, or they can be electronic systems that are updated automatically.

In the context of blockchain technology, a ledger is a digital record of all the transactions that have taken place on a particular blockchain network. Each block in the blockchain contains a number of transactions, and every time a new transaction is added to the block, it is added to the end of the chain of blocks. This creates a permanent and unchangeable record of all transactions on the blockchain.

A key feature of a blockchain ledger is that it is decentralized and distributed across a network of computers, rather than being maintained by a central authority. This makes it highly resistant to tampering and fraud. In a public blockchain network, anyone can participate in maintaining the ledger by becoming a node and validating transactions.

In contrast, in a private or permissioned blockchain, the ledger is maintained by only authorized participants, it could be a company, a consortium.

The transactions recorded on the blockchain ledger are grouped into blocks and linked together using cryptographic methods, creating a chain of blocks. This is why it is called a blockchain. The ledger is also continually updated and reconciled, making it extremely difficult to alter or delete previous transactions.

In summary, a blockchain ledger is a digital record of all transactions on a blockchain network that is maintained by a decentralized network of computers, creating a transparent and tamper-proof record of all transactions on the blockchain.

Distributed Ledger

In this, each Peer node shares a copy of the ledger.

A distributed ledger is a type of database that is spread across a network of computers. Each copy of the database is identical, and updates to the database are made simultaneously across all copies. This means that there is no central point of control or failure, which makes the system more resilient and secure.

One of the most well-known examples of a distributed ledger is the blockchain, which is the technology that underlies cryptocurrencies like Bitcoin. In a blockchain, transactions are grouped together into blocks, and each block is added to a chain of blocks in a linear, chronological order. This creates a permanent, unchangeable record of all transactions on the network. The fact that each node in the network has a copy of the entire blockchain also makes it very difficult for a bad actor to alter the history of transactions.

Other examples of distributed ledgers include Hash graph and Tangle (IOTA) . These are different from Blockchain in terms of consensus mechanism.

Distributed ledgers can be used for a wide variety of applications beyond just cryptocurrency, such as supply chain management, voting systems, digital identity, and more.

Cryptographic Hash

Cryptographic Hash is a Hash function that takes random size input and yields a fixed-size output.

A cryptographic hash is a mathematical function that takes an input (or ‘message’) and returns a fixed-size string of characters, which is usually a ‘digest’ that is unique to the unique input. The same input will always produce the same output, but even a small change to the input will produce a very different output.

Cryptographic hashes are often used to ensure the integrity of data, because any change to the input will result in a different output. For example, a file’s hash value can be calculated and then stored separately from the file. Later, when the file is downloaded or otherwise received, the hash value can be recalculated and compared to the stored value. If the two values match, it is very likely that the file has not been tampered with.

Hashes are also widely used in Cryptography for verifying the authenticity of digital signatures and for key derivation. The best-know hashing functions are MD5, SHA-1, SHA-2 and SHA-3 (SHA3-256, SHA3-512) are common and widely used for these purposes.

One of the important property of cryptographic hash is it should be computationally infeasible to find two different inputs that produce the same output, called “collision-resistant”.

Hash is also called Message Digest or Digital Fingerprint and It is one-way function. i.e. it cannot be reversed.

Computational Power – Consensus Algorithm

A consensus algorithm is a procedure through which all the peers of the Blockchain network reach a common agreement about the present state of the distributed ledger. In a blockchain, a consensus algorithm is used to reach agreement on the state of the shared ledger among all the nodes participating in the network. This agreement is crucial for ensuring the integrity and security of the blockchain. There are several different consensus algorithms that can be used, each with its own trade-offs and characteristics.

Few Consensus Algorithms include:

1. Proof of work (PoW): One of the most widely used consensus algorithms in blockchain is called Proof of Work (PoW). In a PoW system, nodes called “miners” compete to solve a complex mathematical puzzle, and the first miner to solve the puzzle is allowed to add the next block to the blockchain. The puzzle is designed to be difficult to solve, but easy to verify, so that once a miner finds a solution, other nodes can quickly verify its correctness. The process of solving the puzzle requires computational power, and the miner who solves the puzzle is rewarded with a cryptocurrency or tokens.

2. Proof of Stake (PoS): Another popular consensus algorithm is called Proof of Stake (PoS). In a PoS system, instead of solving mathematical puzzles, nodes (referred to as “validators”) are chosen to add the next block to the blockchain based on how many tokens or cryptocurrency they are willing to “stake” as collateral. Since validating a block does not require as much computational power as mining does, the energy consumption is much lower.

3. Practical Byzantine Fault Tolerance (PBFT): Practical Byzantine Fault Tolerance (PBFT) is a consensus algorithm that is designed to function in the presence of Byzantine failures. Byzantine failures refer to situations in which some of the nodes in a distributed system exhibit arbitrary behavior, such as failing to respond or providing false information.

In summary, the computational power required for a blockchain network depends on the consensus algorithm that is being used. The PoW algorithm requires a significant amount of computational power, which can be costly in terms of energy consumption. PoS and DPoS, on the other hand, require significantly less computational power.

Centralized vs Distributed vs Decentralized Systems

  1. Centralized: Centralized systems are those in which a single entity controls and manages all the components of the system. For example, a traditional client-server architecture is a centralized system, where the server is the central point of control and all clients (computers or devices) connect to it to access the resources or services it provides. In this architecture, the server is a single point of failure, meaning if it goes down, the entire system becomes unavailable.
  2. Distributed: In contrast, distributed systems are ones in which the components are spread out across multiple locations, but they still rely on a central point of control. These systems are designed to provide increased reliability, scalability, and availability by distributing resources and responsibilities among multiple entities. For example, in a distributed database system, multiple servers work together to store and manage the data, and they communicate with each other to keep the data consistent.
  3. Decentralized: Decentralized systems, on the other hand, do not rely on a single central point of control. Instead, they distribute the control and decision-making across all the components of the system. In a decentralized system, there is no single point of failure, and the system can continue to operate even if some of its components fail. Bitcoin is an example of decentralized system, where the system does not rely on any centralized intermediary or institution to process or verify transactions, but instead uses a distributed network of nodes to validate the transactions and update the ledger.

In summary, centralized systems are controlled by one entity, distributed systems rely on a central point of control, and decentralized systems distribute the control and decision-making across all the components of the system.

Benefits of Blockchain

Blockchain technology has the potential to bring a number of benefits to various industries, including:

  1. Decentralization: One of the most significant benefits of blockchain is that it is a decentralized system, meaning that no single entity controls it. This decentralization allows for a more secure and transparent way of conducting transactions.
  2. Security: Blockchain technology uses advanced cryptography to secure transactions and ensure that once a block is added to the chain, it cannot be tampered with. This level of security makes it a useful technology for industries that require high levels of security, such as finance and healthcare.
  3. Transparency: Blockchain technology is transparent by design, which means that every transaction is recorded on the public ledger and can be viewed by anyone. This transparency can help to build trust among parties, which is especially important in industries where trust is a critical factor.
  4. Efficiency: Blockchain technology can help to reduce costs and increase efficiency in a number of ways. By removing the need for intermediaries, transactions can be completed faster and at a lower cost. Additionally, smart contracts can automate the execution of certain tasks, further increasing efficiency.
  5. Immutability: once something is written in blockchain it can not be altered. This property makes it useful in supply chain management and voting system.
  6. Digital Identity: Blockchain can help to provide secure and verifiable digital identities, which can be useful in a variety of contexts, such as for voting and for verifying the identity of individuals in financial transactions.
Bitcoin Currency

While these are some of the key benefits of blockchain technology, it’s important to note that not all blockchain use cases will require or benefit from all of these features. It’s also worth noting that blockchain is still a relatively new technology, and more benefits may be discovered as it continues to evolve.

Related Questions

Why Blockchain is Immutable?

Blockchain is immutable because of the way it is designed and the properties of the technology it uses.

Blockchains are decentralized networks of computers, called nodes, that all have a copy of the same database, called a ledger. Each time a new transaction is added to the blockchain, it is grouped together with other transactions into a block, which is then added to the existing chain of blocks, hence the name “blockchain.”

One of the key properties of a blockchain is that once a block is added to the chain, it cannot be modified or deleted. This is because each block contains a unique code, called a “hash,” that is based on the contents of the block and all the blocks that came before it. If you change even a small piece of information in a block, it will change the hash of that block and all the blocks that come after it. This means that the entire blockchain would be invalidated and would need to be rebuilt from the beginning, which is not possible given the distributed nature of the network.

Another key property of blockchains is that they use consensus algorithms to agree on the contents of the blockchain. This means that, in order for a new block to be added to the chain, a majority of the nodes on the network must agree on the contents of the block. This helps to prevent fraud or malicious actors from modifying the blockchain without the agreement of the majority of the network.

Because of these properties, blockchains are considered to be immutable: once a block is added to the chain, it cannot be modified or deleted, and the contents of the chain are agreed upon by the majority of the nodes on the network. This makes them useful for storing sensitive information, such as financial transactions or personal data, that needs to be kept secure and tamper-proof.

Why Blockchain is Peer-to-Peer?

Blockchain is peer-to-peer (P2P) because it allows for direct communication and transaction between different parties without the need for a central intermediary.

In traditional centralized systems, transactions are processed and verified by a central authority, such as a bank or a government. This central authority acts as a gatekeeper, controlling access to the system and maintaining a record of all transactions.

In contrast, a blockchain network is composed of a large number of nodes, which are all equal participants in the network. Each node has a copy of the ledger, and transactions are verified and processed by consensus of the network’s participants.

Because there is no central authority controlling access to the network, each participant can communicate and transact directly with any other participant. This is what makes blockchain a peer-to-peer system. The transactions are done between peers (individuals or organizations) directly and with trust, relying on the network’s consensus algorithm for verification and security. This eliminates the need for a third-party intermediary, and allows for greater autonomy and control for the participants in the network.

P2P network allows more transparency, security, and lower costs compared to centralized systems. It also allows for faster and more efficient transaction processing, as there is no need to go through a central intermediary. Additionally, P2P networks are more resilient and resistant to failures or failures of a central point of control, or single point of failure.

How Bitcoin handles the Double Spending Problem?

The double-spending problem is a potential issue with digital currencies in which a user could potentially make a copy of a digital token and spend it multiple times. In traditional digital systems, this problem is solved by having a central intermediary, such as a bank, that keeps a record of all transactions and verifies that a digital token has not already been spent.

Blockchain technology, which underlies most cryptocurrencies, addresses the double-spending problem by using a decentralized, distributed ledger to record and verify transactions. Each transaction is grouped into a block with other transactions, and the blocks are added to the chain in a linear, chronological order.

This means that once a transaction has been added to a block and the block has been added to the blockchain, it cannot be modified or deleted. Additionally, the consensus algorithms used in most blockchains make it difficult for a single user to add a block with a fraudulent transaction without being detected by the network.

For Example: Let us suppose you have 1 BTC and try to spend it twice. You made the 1 BTC transaction to Alice. Again, you sign and send the same 1 BTC transaction to Bob. Both transactions go into the pool of unconfirmed transactions where many unconfirmed transactions are stored already. The unconfirmed transactions are transactions which do not pick by anyone. Now, whichever transaction first got confirmations and was verified by miners, will be valid. Another transaction which could not get enough confirmations will be pulled out from the network. In this example, transaction T1 is valid, and Alice will receive the bitcoin.

Bitcoin, as a decentralized digital currency, solves the double-spending problem using a combination of several techniques:

  1. Transactions are grouped into blocks and added to the blockchain in a linear, chronological order. This means that if a user attempts to spend the same coin in multiple transactions, only the first one will be included in the blockchain and the others will be rejected.
  2. Bitcoin uses a consensus algorithm called “proof of work” to add new blocks to the blockchain. In this algorithm, nodes (called “miners”) compete to solve a complex mathematical problem in order to create a new block. The first miner to solve the problem gets to add the block to the blockchain and is rewarded with newly minted bitcoins.
  3. Because the blockchain is a public, decentralized ledger, a copy of which is stored on multiple computers around the world, it is very difficult for a user to make a fake copy of a bitcoin and spend it multiple times without being detected.
  4. To prevent double spending, the network checks for the longest chain and validate that spend, this will make sure that the coin is not spent on multiple transactions, if a malicious miner attempts to add a block with conflicting transaction, it won’t be considered valid because it deviates from the longest chain.

All of these measures combined make it extremely difficult to double-spend bitcoins, effectively solving the double-spending problem and enabling the use of a decentralized digital currency without the need for a central intermediary.

What happened if both the transactions are taken simultaneously by the miners?

If two miners simultaneously add different blocks to the blockchain that include conflicting transactions, it creates a fork in the blockchain.

When a fork happens, the network will typically adopt the longest chain as the valid one. This is because the longest chain is considered to be the one that has been verified by the most computational work (or the most number of blocks added to it).

The miner who added the block that ends up on the shorter fork will have their block added to the network, But it will not be considered valid and thus won’t be rewarded with the block reward and the transaction fees. This also means that the transactions included in that block will be considered invalid and won’t be added to the ledger.

If the conflicting transactions were for the same coin, this means that the miner who added the block to the shorter fork wasted their computational resources trying to add that block, and that the person who spent that coin also wasted the money, because the transaction will not be added to the ledger.

In most cases, forks are quickly resolved and the network reaches consensus on the longest chain. However, in some rare cases, a fork can persist for a longer period of time, creating two separate versions of the blockchain. This is called a chain split.

Ultimately the blockchain is designed in a way that the longest chain will be considered as the true chain, this mechanism makes sure that the double spending problem is handled by the network and is not left to the miner’s discretion.

What is digital signature in blockchain?

A digital signature is a method used to authenticate and verify the integrity of digital data, such as a transaction on a blockchain. It is similar to a traditional signature on a physical document, but it is created and verified using digital means. Digital signatures use public key cryptography, where each user has a unique pair of public and private keys. The private key is used to create the signature, and the public key is used to verify it. A digital signature on a blockchain transaction ensures that the transaction was sent by the rightful owner of the funds and that the transaction has not been tampered with.

In the context of blockchain, a digital signature is used to provide proof of ownership and authenticity for a digital transaction on the blockchain network. A digital signature is created by the use of a private key, which is known only to the owner of the signature. This private key is used to encrypt a hash of the transaction data, creating a digital signature. This signature can then be verified by anyone using the corresponding public key.

* The material and content uploaded on this website are for general information and reference purposes only and don’t copy the answers of this website to any other domain without any permission or else copyright abuse will be in action.

Please do it by your own first! Protection Status

To understand more about Solidity language,

5 1 vote
Article Rating
Notify of

Newest Most Voted
Inline Feedbacks
View all comments
4 months ago

I don’t understand how much bitcoin is there if we keep on buying all of it it never ends?


[…] Blockchain Essentials | Part 1 […]


[…] Blockchain Essentials | Part 1 […]


[…] Blockchain Essentials | Part 1 […]

close button
close button
Would love your thoughts, please comment.x