Blockchain for Beginners: The New Digital Frontier

Blockchain for Beginners: The New Digital Frontier

ยท

5 min read

Why Blockchain?

  • Inflating Currencies: Government has been printing currencies left right and center. This leads to increasing inflation, price of everything goes up.

    Holding on to cash is a losers bet in the long run. Holding on to any asset (Gold, Stock, real estate) is better compared to currencies like USD, INR.

  • Random Bailouts: The 2008 financial crisis was caused by a financial instrument called mortgage-backed securities. Even though the banks on Wall Street were at fault, the government used taxpayer money to bail them out.
  • Need for Better Currency: A currency that is open, transparent, and immune to arbitrary printing is essential.
  • Fractional Reserve Banking: Banks don't have all your money. They lend out most of it. If there is a bank run (everyone goes to the bank to withdraw their money), banks won't be able to pay everyone.
  • Currency Depreciation: Traditional currencies lose value over time due to inflation.
  • Lack of Backing: Modern currencies are not backed by tangible assets like gold or silver.

    The Big Short (film) gives insight into financial crises and highlights the need for better financial systems.

What is Blockchain?

Blockchain is a digital ledger that is decentralized and spread across many computers. It records transactions securely and transparently. It works without a central authority, using cryptography to verify and add new transactions.

Main Characteristics of Blockchain:

  1. Decentralization: Blockchain is managed across multiple nodes (machines), ensuring no single entity controls the data. Each node stores the entire blockchain, providing access to all data on the blockchain.
  1. Immutability: Once data is recorded on a blockchain, it cannot be easily altered or deleted, ensuring the integrity of the records.
  1. Transparency: All transactions recorded on a blockchain are visible to all participants, promoting openness and trust.
  1. Consensus Mechanisms: Nodes in the network follow consensus mechanisms (e.g., Proof of Work, Proof of Stake) to validate transactions and add them to the blockchain.

Purpose of Blockchain:

The purpose of blockchain is to create a network of computers that agree upon a common state of data. This ensures that:

  • Any person or organization can participate in the process.
  • No single person or organization can control the process.

Blockchain enables secure, transparent, and tamper-proof transactions without the need for a central authority.

How to Create a New Currency with Blockchain ?

There is a need for trustless, anonymized, and decentralized form of money, blockchain solves it for us.

Key points:

  1. Avoiding Central Ownership:

    • Centralized control over currency can lead to misuse of power and lack of transparency.

    • Blockchain technology eliminates the need for a central authority, distributing control among multiple nodes.

  1. Trustless System:

    • Blockchain enables the creation of currency without needing to trust a central authority.

    • Transactions are verified by consensus mechanisms, ensuring security and integrity.

  1. Anonymization: Blockchain technology supports anonymized transactions, protecting the privacy of users while maintaining transparency of the overall system.
  1. Decentralization: Decentralized money operates on a network of nodes, preventing any single entity from having control and reducing the risk of manipulation or failure.

By leveraging these principles, blockchain technology allows for the creation of new currencies that are secure, transparent, and free from centralized control.

Hashing

Transforms input data of any size into a fixed-size string of characters.

  • Properties:

    • Deterministic: Same input always produces the same output.

    • Fast Computation: Hash value can be quickly verified for any data.

    • Pre-image Resistance: Difficult to reverse the hash function to find the original input.

    • Small Changes in Input Produce Large Changes in Output: Tiny input changes drastically alter the hash output.

    • Collision Resistance: Difficult to find two different inputs that produce the same hash output.

  • Example - SHA-256:

    • Secure Hash Algorithm 256-bit: Produces a 256-bit (32-byte) hash value from any input. code example :

    •   const crypto = require('crypto');
      
        const input = "Mahesh";
        const hash = crypto.createHash('sha256').update(input).digest('hex');
      
        console.log(hash)
      

      Hashing vs. Encryption

      • Hashing:

        • Converts data into a fixed-size string.

        • Irreversible (one-way function).

        • Used for data integrity verification (e.g., password storage, file verification).

  • Encryption:

    • Converts data into a different format.

    • Reversible (two-way function) using a key.

    • Used for data confidentiality (e.g., securing communication, data storage).

Hashing vs Encryption vs Salting โ€“ What's The Difference? ๐Ÿคท๐Ÿฝโ€โ™‚๏ธ

How Does Blockchain Work?

  • Blocks:

    • Data is stored in "blocks."

    • Each block contains:

      • A list of transactions.

      • A timestamp.

      • A cryptographic hash of the previous block.

  • Chain:

    • Blocks are linked together in a chronological order.

    • This creates a "chain" of blocks, hence the name "blockchain."

๐Ÿ’ก

Blockchain Demo - Blockchain Demo (andersbrownworth.com)

Important Terms

  • Nonce

    • A unique number that miners must find to produce a valid hash.

    • Used only once, it ensures the resulting hash satisfies the blockchain's difficulty conditions.

  • Finding Nonce

    • Miners and Compute Power

      • Miners produce blocks in the blockchain.

      • The probability of producing the next block and earning the reward increases with more compute power.

      • Compute power is needed to calculate the correct nonce.

    • Nonce

      • The nonce is a number that, when added to the block data and hashed, produces a hash meeting the network's difficulty criteria.

      • The process of finding this nonce is known as Proof of Work (POW).

  • Consensus Mechanism

    • A method ensuring all participants agree on the blockchain's state and the validity of transactions.

    • Acts as a rulebook for validating transactions and blocks.

  • Proof of Work (POW)

    • A consensus mechanism used in blockchain networks.

    • Requires solving complex mathematical problems to find the correct nonce.

    • Ensures the security and integrity of the blockchain by validating transactions and adding new blocks.

ย