Introduction to BlockChain

·

10 min read

Introduction to BlockChain

1. What is Blockchain

A blockchain is a decentralized, distributed and public digital ledger that is used to record transactions across many computers so that the record cannot be altered retroactively without the alteration of all subsequent blocks and the consensus of the network.

Basically, a blockchain platform enables users and developers to build new applications on top of existing blockchain infrastructure. One example is Ethereum, which has its own cryptocurrency called ether (ETH). However, the Ethereum blockchain enables the development of smart contracts, programmable tokens used in initial coin offerings (ICOs), and non-fungible tokens (NFTs). These are all built around the Ethereum technology and safeguarded by Ethereum network nodes.

Blockchain technology was invented by Satoshi Nakamoto in 2008 so that he can do it in the cryptocurrency bitcoin, according to his public transaction ledger. The main aim of Satoshi Nakamoto behind doing all this was that he wanted to create a decentralized Bitcoin ledger—the blockchain—that gives people the ability to control their money so that no third party, or anyone The government, too, could not access or monitor this money.

Satoshi, the creator of Bitcoin, vanished in the year 2011, leaving behind this open-source software that Bitcoin users can use and update and improve.

Many believe that this is not a person named Satoshi Nakamoto, it is just a fictional character. By the way, the correct information is not available from anyone about its veracity.

The invention of the blockchain for bitcoin is the first digital currency that can solve the double-spending problem without the help of any trusted central authority or central server. That's why this Blockchain Technology has also been the inspiration for many other applications.

2. What is Blocks in Blockchain

Blockchain technology has been used brilliantly in the banking industry. Financial institutions were unable to handle the additional demand following demonetization, stressing the necessity for a centralized specialist to handle financial transactions.

Blocks are used to store batches of valid transactions that have been hashed and encoded into a Merkle tree. Each block contains the cryptographic hash of the previous block in the blockchain, which connects the two. A chain is formed by the linked blocks.

3. Why Blockchain

Blockchain helps in the verification and traceability of multistep transactions needing verification and traceability. It can provide secure transactions, reduce compliance costs, and speed up data transfer processing. Blockchain technology can help contract management and audit the origin of a product.

  • It is an immutable public digital ledger, which means when a transaction is recorded, it cannot be modified

  • Due to the encryption feature, Blockchain is always secure

  • The transactions are done instantly and transparently, as the ledger is updated automatically

  • As it is a decentralized system, no intermediary fee is required

  • The authenticity of a transaction is verified and confirmed by participants

4. Different between cryptocurrencies and Blockchain

Blockchain is the technology that allows cryptocurrencies to exist (among other things). Bitcoin is the most well-known cryptocurrency, and it was for it that blockchain technology was established.

The use of blockchain for currency is currently the most common use of this technology. Bitcoin, Ethereum, and other wide-scale cryptocurrency coins use blockchain to process and record transactions securely. This technology makes it possible to ensure transparency and protect the financial information and identity of crypto buyers and sellers.

5. The Three Pillars of Blockchain Technology

  • Decentralization

    This refers to the fact that blockchain networks are not owned or controlled by a single entity or authority, but rather are run by a network of users who validate and maintain the system through a consensus mechanism. Decentralization is considered a key feature of blockchain technology because it increases security, reduces the risk of central points of failure, and fosters trust among participants.

  • Immutability

    Blockchains are immutable because the data that is recorded on the respective blockchain is irreversible and cannot be altered. If a transaction is conducted, the transaction details will be logged on the blockchain and can be publicly viewed in perpetuity. This is possible due to the decentralized nature of blockchain. Since the records cannot be altered, this means that any data – whether it is a receipt for a transaction, a vote, or a property deed – can be trusted to be accurate.

  • Transparency

    All transactions on a blockchain are recorded on a public ledger that can be viewed by anyone on the network. This transparency ensures that all participants have access to the same information and can verify the authenticity of transactions. Transparency is also essential for maintaining the integrity of the blockchain network and preventing fraudulent activity.

6. Crypto Wallets

A blockchain wallet is a software program that allows you to store, send, and receive cryptocurrencies. It is a digital equivalent of a physical wallet, but instead of storing cash, it stores cryptocurrency.

Blockchain wallets work by storing your cryptocurrency's public and private keys. The public key is like your email address, and it can be shared with anyone who wants to send you cryptocurrency. The private key is like your password, and it should be kept secret.

When you send cryptocurrency from your blockchain wallet, you sign the transaction with your private key. This ensures that only you can authorize the transaction.

There are two main types of blockchain wallets: hot wallets and cold wallets. Hot wallets are connected to the internet, which makes them more convenient to use. However, they are also more vulnerable to hacking. Cold wallets are not connected to the internet, which makes them more secure. However, they are also less convenient to use.

Wallets are critical for decentralization. If your users don't control (take custody of) their private keys, you are a centralized point of failure for their account. But requiring a potential user to stop using your app and set up a wallet is at odds with accessibility. Imagine your app is for non-technical users, but the only way to access the app is to "sign in with GitHub." There are three main ways to handle wallets for your app.

  • Centralized Accounts

    This is the default approach of Web2. Your typical email/password. Centralized exchanges like Coinbase and Binance do this for their users. You make the account's public key known but hold the private key yourself. This opens you up to hacking and puts a lot of responsibility on you as the developer. Not to mention it defeats the purpose of decentralization. I don't recommend this approach.

  • Non-custodial Accounts

    The default approach of Web3. Wallet hardware/software for users to manage their private keys. If you're only targeting users already using blockchains, just do this. It's decentralized, but it puts the burden on the end-user. If your users don't properly manage their private keys, they could lose access to their account and have no way to recover it. If you want to offer an experience ready for mass adoption, you need an improved user experience over the default. At the very least, help your users set up a wallet without leaving your app and warn them of the responsibility.

  • Supporting Both

    Offering more than one method for wallet management is a workaround to provide the UX your users want. Technical users who care about decentralization can use their wallets. Non-technical users who just want to use the app can create a centralized account on your platform. On blockchains with high gas fees, this is probably the best option. The downside is it requires you to implement authorization both ways and still take on the responsibility of managing accounts for your users.

  • Smart Contract Wallets

    What users really need is a safe way to use dapps and manage their accounts. Holding tokens inside a smart contract lets you map ownership to private keys and a typical email login without a centralized dependency. You can provide account recovery features and a lot of other security precautions as well. This option isn't popular on Ethereum because it would cost more Ether than the default non-custodial wallet. Fee-less blockchains like Koinos allow you to use smart contract wallets without spending money. This is my preferred option for setting up new accounts for non-technical users because it's decentralized and safer. You'll be able to support "normal" wallets with little or no effort.​You probably don't want to build your own smart contract wallet for your dapp (but you could). The Kondor wallet is currently being developed for Koinos and should support the capabilities I describe here.

7. Blockchain Hash Function

The hashing process involves jumbling up unprocessed data to such an extent that it is impossible to reassemble it into its original format. By hashing, you are taking a piece of data and sending it through a function, which then applies mathematical operations to the plaintext of the data. This function is known as the hash function, and the value or digest that it produces is referred to as the hash value.

A hash function converts an input string (numbers, alphabets, or media files) of any length into a fixed size. Depending on the hash function used, the set bit length can vary (for example, 32-bit, 64-bit, 128-bit, or 256-bit). The output with a fixed size is known as a hash. A hash algorithm's cryptographic byproduct is also this hash.

Because the Hash function is one-way, there is no way to recover the entire text from the generated hash. This differs from traditional cryptographic operations such as encryption, in which you can encrypt something using the key and then decrypt the message to its original form using decryption.

The hash algorithm has the following characteristics:

  • It generates a one-of-a-kind output (or hash).

  • It only works in one direction.

A hash is like a unique fingerprint for each block. It uniquely identifies a block and all of its contents. Once you create a block, any change within the block will change the hash. The Bitcoin blockchain employs the SHA-256 (Secure Hash Algorithm) hashing algorithm.

Each block in the blockchain contains:

  • Data

  • Hash

  • Hash of the previous block

The hash is handy when you want to detect changes to block. If, by any chance, the fingerprint (hash) of a block changes, it does not remain the same block.

Consider the following example, where we have a chain of 3 blocks. The first block has no predecessor. Block 2 contains a hash of block 1. While block 3 contains the hash of block 2

From the above diagram, it's clear that all blocks contain hashes of the previous block. This is the reason why blockchain technology remains so secure.

Let's now assume that an attacker changes the data present in block 3. This will force the hash of the block to change. Block 4 still contains the old hash of block 3. This will cause block 4 and other succeeding blocks to get invalid because they do not have the correct hash of the previous block.

As a result, changing a single block can quickly render all subsequent blocks invalid.

8. Proof of Work

we have seen that hashes are an excellent mechanism for preventing tampering. Still, nowadays, modern computers are super fast and can calculate hundreds of thousands of hashes per second. A hacker can tamper with a block in minutes and then quickly recalculate all the hashes of other blocks to make the blockchain valid again. Blockchains use the Proof-of-Work concept to avoid this problem. It is a mechanism that slows the production of new blocks. Proof of work is a consensus mechanism used to confirm that network participants, called miners, calculate valid alphanumeric codes (called hashes) to verify transactions and add the following block to the blockchain. The winning miner validates the block and earns a reward paid in cryptocurrency with proof of work. Crypto miners require support from vast networks of computers to quickly provide proof of work.

In the case of Bitcoin, calculating the required proof-of-work to add a new block to the chain takes nearly 10 minutes. In Bitcoin, a block contains more than 500 transactions on average. The average size of a block seems to be 1MB

If a hacker wanted to change data in Block 3, he would first need to perform proof of work (which would take 10 minutes) before making changes in Block 3 and all subsequent blocks.

Because this mechanism makes it very difficult to tamper with the blocks, even if you tamper with a single block, you will need to recalculate the proof-of-work for all subsequent blocks. As a result, hashing and proof-of-work mechanisms ensure the security of a blockchain.

9. Advantages and Disadvantages of Blockchain

  • Advantage :

    • Trustworthy Distributed Systems

    • No Government Interference

    • Increased Stability

    • Instant Payments at Reduced Costs

    • Improved Security & Financial Efficiency

  • Disadvantages :

    • Private Key Issues

    • Extremely Volatile

    • Issues in Scalability

    • Security Issues

    • Data Modification is Difficult

    • Speed and Performance

    • Some Blockchain Solutions Consume Too Much Energy

10. Reference

https://www.theproduct.house/learn/web3-academy

That's all for this blog, I hope you will learn something new. And feel free to share your thoughts and feedback, Thanks for reading.

Connect with me on socials 👀

Twitter 🖱

LinkedIn 🖱

Github 🖱

Did you find this article valuable?

Support Hashnode by becoming a sponsor. Any amount is appreciated!