Delving Deeper into Blockchain’s Network

Migavel Dharmaraj
hackgenius
Published in
11 min readMar 25, 2024

Blockchain Introduction:

Each and every block are connected together ,this can be done by each one holding the address of the previous one .It doesn’t have any central authority , each one have a access , each transaction are stored in blocks , it tampered proof , and it is transparent and immutable.

“They solve the mathematical puzzle to create the block”

Consensus mechanism :

Consensus mechanism is nothing but a everyone in the blockchain network who agree the block validation and block creations , In this consensus mechanism use a lot of protocols in blockchain ,this makes the data’s in the blockchain network are immutable and data’s stored in the block is tamperproof .

The consensus mechanisms are:

1.Proof of Stake

2.Proof of work

These two are the most popularly used mechanisms used in bitcoin and Ethereum blockchains.

Smart contract:

smart contract is a self-executing contract with the terms of the agreement directly written into code. In blockchain, it runs on a decentralized network, ensuring transparency and immutability Is a way to communicate with the blockchain.

Smart contracts are digital contracts stored on a blockchain that are automatically executed when predetermined terms and conditions are met.

Decentralized : peer to peer network here the information stored .

Distributed Ledger :

Everyone in the network having the chain of records, which means in the blockchain network suppose if the transaction happen between two friends it will be stored as a record(here technically we use a term called Ledger). That’s why it is more difficult to hack by hackers , because the changes in block , it wont affect the other blocks .

In blockchain , If you make a changes of data inside a block , it changes its hash address, This will going to be the previous or parent hash for the next block (Like a Linked list), it make destroy the entire connection start from the date of the block where you change .

Centralized: Every information is stored on one place. Like in the concept of server and client.

Eg:

1.Imagine four friends, all of the decided to split the expenses among each other

2.Instagram, Spotify and Whatsapp they maintain all the data in the centralized server. In case of any problem every data’s on that server will vanish out , And it has a privacy risks ,for instance Here you are the owner of your Instagram account you have a access to do anything as well Instagram also .If you delete something on whatsapp or Instagram means it just physically delete from your device but it doesn’t on the server.So this type of problems will be completely changed by blockchain network such as Dapp, Defi and so on.

📌Possible failures while money transfer:

📌Technical issues

📌Account hacked by someone

📌Exceeding the money limit

📌High transfer charges

Cryptocurrencies: cryptocurrencies are a form of digital or virtual currencies That run on a technology is known as blockchain.

Blockchain

🔒And it is protected by strong complex encrypted algorithms.

Web 1.0:

This refers to the early stage of the World Wide Web, characterized by static web pages and limited interactivity websites offered information in a read-only format,

Web 2.0:

This represents the current era of the internet, emphasizing dynamic and interactive content.(Static) fostering a two-way communication model

Web 2.0 brought about the rise of social media, user-generated content, blogging, and collaborative platforms. (Dynamic)

Web3.0-more decentralized and user-centric web. It envisions a shift towards increased privacy, security, and user control over data

In markets more than thousands of cryptocurrencies like

🪙litecoin

🪙Ethereum z cash

🪙supreme bitcoin

Ledger:⛓📦

Phil ,ted ,sam send two bitcoinsto jack.

Block creation:

Phil send two bitcoins to jack so record is created that is called block ,similarly all blocks will be created when sending bitcoins from one to another🧍‍♂️➡️🧍‍️.

The details between them is permanently inscribed in this block.

Each block holds the transaction details and how many bitcoins are reserved.

Each block takes the reference of the previous one , like a linked list 📦⛓📦there use a pointer but here we use a hash address

The number of bitcoins, each brand owns this chain of records or block is called ledger

For the above example jack has already a 5 bitcoins and rest of 2 bitcoins was sent by Phil , now Phil has a 1 bitcoin remaining

In this shared among all friends, which means each one have a copy of the ledger this is called public distributive ledger this forms a blockchain

Why blockchain is more secure?

We know already Phil has only one bitcoin, now Phil tries to send 2 bitcoins to Jack ,the transaction will not go through this , because all his friends have a copy of the ledger , so it’s clear Phil has only one bitcoins ,so rest of the Phil’s friends will flag this transaction as invalid.

Public key:

Public keys are visible to all users in the network, and sometimes even beyond the network too. Essentially, public keys act like an account number. They make each wallet uniquely identifiable to participants on the network. Like the private key, a public key is made up of a long sequence of numbers. Typically, it’s generated using the private key, but that’s not always the case. It also allows you to create something you’re probably more familiar with, a blockchain address. Usually, your blockchain address is just a hashed version of that public key.

Eg: email of the user, it is just a simple example , here in block chain it is a hash address.

Private key:

Private keys are at the base of every blockchain account, and necessary for even the simplest of actions. For starters, when people say they “own” cryptocurrencies, what they really own is the private key to the wallet that stores those assets. To clarify, cryptocurrencies are always stored on the blockchain network, not within a crypto wallet itself. Instead, you own the private key that allows access to the account.

It is a unique address which unique but it is only accessible by the knowledge of user .

Eg: password of user, Here in blockchain the receiver in the network they have the private key to access data.Because in actual encryption how does it work means , for example In the blockchain network A is the sender and B is the Receiver , how the transaction works between them is sender A uses a B’s public key to encrypt the data and it is decrypted by reciver’s B’s private key.

Types of Encryption Algorithms:

In the most common algorithms are used in blockchain network is ,

📌Symmetric

📌Asymmetric

Lets see how does it work,

Symmetric:

Asymmetric:

Now Let’s comming into the transaction:

Phil send a money to jack ,Phil’s wallet address and his details are encrypted by hashing algorithms and it has a unique private key

(Phil’s) like SHA-256 ,Ethash🔒

Encrypted Wallet address and data’s are digitally signed

But is now transmitted across the world using public key with this message or transaction can be only decrypted🔑 by Jack’s private key

Bitcoin-> SHA-255 Ethereum->Ethash🔒

These all transactions are taking place all around the world

These all transactions are validated and then added block by block ,the people who validate the these blocks are called miners

For a block to be validated and then added to blockchain ,miners need to solve a complex mathematical problem to validate and adds to blockchain.

Walmart in blockchain:

Walmart has been exploring the use of blockchain technology to enhance supply chain transparency and traceability. They’ve implemented blockchain for certain food products to improve the accuracy of tracking and quickly identify sources of contamination if issues arise.

This technology helps in creating a more efficient and secure supply chain ecosystem.

Centralised:

in a centralized blockchain, a single entity or group has control over the network, acting as a central authority. This can be more efficient but poses a risk of single points of failure or manipulation.

Decentralised:

A decentralized blockchain distributes control among multiple nodes, promoting transparency and security. Decentralization reduces the risk of manipulation and enhances trust by requiring consensus among participants for transaction validation.

Difficulty target in blockchain :

In blockchain, the difficulty target is typically set by the network protocol. It adjusts automatically based on the total computational power of the network to maintain a consistent block creation time, ensuring a stable and secure system.

1. Supply Chain Management and Blockchain:

• Blockchain is used in supply chain management to keep a secure and transparent record of transactions. This ensures that every step in the supply chain is traceable and trustworthy.

2. NFTs (Non-Fungible Tokens) & FT(Fungible Tokens):

• NFTs use blockchain to certify ownership of unique digital items like digital art. When you create an NFT, you become the owner, and blockchain ensures safe transactions when selling or transferring ownership.

  • Fungible Tokens : Fungible tokens or assets are divisible and non-unique. For instance, fiat currencies like the dollar are fungible: A $1 bill in New York City has the same value as a $1 bill in Miami. A fungible token can also be a cryptocurrency like Bitcoin: 1 BTC is worth 1 BTC, no matter where it is issued.

3. Example for NFT : OpenSea and NFT Trading:

• Platforms like OpenSea make it easy to buy and sell NFTs securely. This is particularly popular for digital art and other unique digital assets.

4. Nodes in Blockchain:

• Nodes are like participants in the blockchain network. Full nodes store all transactions and can actively participate in the network. Lite nodes have a summary of transactions and can only view them. Archive nodes store complete data but require a lot of memory.

5. Smart Contracts:

• Smart contracts are like self-executing contracts with coded rules. When triggered, they automatically execute actions. In a one-to-one contract, details are stored securely in a distributed ledger. When a request comes in, the smart contract processes it and provides the specified details, ensuring a secure and automated agreement. solidity: statically typed language :

strucred programming language . byper

Remix -IDE : it is a integrated development environment

solidity -open source, and it is a compiled language , when we press CTRL+S , it make it compile the code.

And its contracts are self executable,once it is deployed means,it executes autonomously.

// SPDX-License-Identifier: MIT- here the mit denotes it is a open source pragma solidity version;

gas fee :

The operation or transaction we perform in blockchain, it consumes some gas fee ,that fee incentives for miners

Introduction to Blockchain Mining:

Blockchain mining is a crucial process in decentralized networks like Bitcoin and Ethereum. It involves adding new transactions to the blockchain and securing the network through the validation of these transactions. Miners perform complex computational tasks to validate transactions and create new blocks, thereby contributing to the security and integrity of the blockchain.

Purpose of Mining:

Transaction Validation: Miners validate transactions by ensuring that they comply with the rules of the network, such as double-spending prevention and consensus mechanisms.

Block Creation: Miners create new blocks that contain a batch of verified transactions. These blocks are added to the existing blockchain in a chronological order.

Consensus Mechanism: Mining serves as a consensus mechanism to agree on the state of the blockchain and prevent malicious actors from tampering with the data. Mining Algorithm:

The mining algorithm used in blockchain networks varies based on the consensus mechanism employed. The two most common algorithms are Proof of Work (PoW) and Proof of Stake (PoS).

Proof of Work (PoW):

PoW is the original mining algorithm introduced by Bitcoin.

Miners compete to solve a computationally intensive mathematical puzzle known as the “hash puzzle” or “proof of work.”

The first miner to find the solution is rewarded with newly minted cryptocurrency (e.g., Bitcoin) and transaction fees.

The difficulty of the puzzle adjusts dynamically to ensure that new blocks are created at a consistent rate (e.g., every 10 minutes in Bitcoin).

Examples: Bitcoin, Ethereum (transitioning to PoS).

Proof of Stake (PoS):

In PoS, validators (or forgers) are chosen to create new blocks based on the number of coins they hold and are willing to “stake” as collateral.

Validators are selected through a deterministic algorithm that considers factors such as stake size, age of coins, and randomness.

PoS is more energy-efficient compared to PoW, as it doesn’t require extensive computational power.

Examples: Ethereum 2.0, Cardano, Tezos. Mining Process:

Transaction Selection: Miners select a set of unconfirmed transactions from the network mempool to include in the new block.

Block Header Creation: Miners construct a block header containing metadata such as the previous block hash, timestamp, Merkle root of transactions, and a nonce.

Mining: Miners repeatedly hash the block header using the mining algorithm, adjusting the nonce value with each attempt.

Finding the Solution: Miners aim to find a hash value that meets the difficulty target set by the network. This involves brute-force computation until a valid hash (below the target) is discovered.

Block Propagation: Once a miner finds a valid solution, it broadcasts the new block to the network for validation and inclusion in the blockchain.

Consensus and Reward: Other nodes in the network validate the new block, ensuring that the transactions are valid and the block adheres to the consensus rules. The successful miner receives the block reward (e.g., cryptocurrency) and transaction fees.

Which the the miner who first solve the mathematical or hash buzzle they get block reward and transaction fee .The other miner who beside the winners ,they also sove a mathematical buzzle and create a block that block added as a ommer block ,The miners didn’t win the block ,they are called ommers. Ommers will get some amount of incentives not much from the total gas points as a consolation and for network security.

Conclusion:

Blockchain mining is a fundamental process that underpins the security and decentralization of blockchain networks. By incentivizing miners to validate transactions and secure the network, blockchain technology enables trustless and censorship-resistant systems that operate without centralized control. Understanding the intricacies of mining algorithms and processes is essential for anyone interested in blockchain technology and its applications.🖋️

--

--