Getting started with Blockchain

·

10 min read

Why Blockchain

Imagine that you have a company that owns a server with 10,000 computers used to maintain a database holding all of its client’s account information. Your company owns a warehouse building that contains all of these computers under one roof and has full control of each of these computers and all of the information contained within them. This, however, provides a single point of failure. What happens if the electricity at that location goes out? What if its Internet connection is severed? What if it burns to the ground? What if a bad actor erases everything with a single keystroke? In any case, the data is lost or corrupted in minutes. So to solve some of the many problems like Privacy, Ease of Acess, Immutablibilty of data a technology i.e Blockchain technology was outlined in 1991 by Stuart Haber and W. Scott Stornetta, two mathematicians who wanted to implement a system where document timestamps could not be tampered with.

What is Blockchain

A blockchain is a distributed database that is shared among the nodes of a computer network. As a database, a blockchain stores information electronically in digital format. Best known for their crucial role in cryptocurrency systems, such as Bitcoin, for maintaining a secure and decentralized record of transactions.

In a nutshell, blockchain is a computer file for storing data. which is an open, distributed database. The data is distributed (i.e. duplicated) across many computers, and the whole blockchain is entirely decentralized which means no one person or entity (say, a government or corporation) has control over the blockchain. This is a radical change from the centralized databases that are controlled and administered by businesses and other entities.

A database usually structures its data into tables, whereas a blockchain, like its name implies, structures its data into chunks (blocks) that are strung together. This data structure inherently makes an irreversible timeline of data when implemented in a decentralized nature. When a block is filled, it is set in stone and becomes a part of this timeline. Each block in the chain is given an exact timestamp when it is added to the chain.

How does it work

The goal of blockchain is to allow digital information to be recorded and distributed, but not edited. In this way, a blockchain is a foundation for immutable ledgers, or records of transactions that cannot be altered, deleted, or destroyed. This is why blockchains are also known as distributed ledger technology (DLT).

In very simple terms, the file is comprised of blocks of data, with each block being connected to the previous block, forming a chain. Hence the name ‘blockchain’. As well as the data itself, each block also contains a record of when that block was created or edited, which makes it very useful for maintaining a detailed system of record that cannot be corrupted or lost.

Because the whole blockchain is duplicated across many computers, any user can view the entire blockchain. Transactions or records are processed not by one central administrator, but by a network of users who work to verify the data and achieve a consensus. If you're also a hands-on person like me, then please check out this demo by Anders Brownworth

Types of Blockchain

  • Private Blockchain -> A private blockchain requires each node to be approved before joining. Because nodes are considered to be trusted, the layers of security do not need to be as robust.
  • Public Blockchain -> A public blockchain, also known as an open or permissionless blockchain, is one where anybody can join the network freely and establish a node. Because of their open nature, these blockchains must be secured with cryptography and a consensus system like proof of work (PoW) or proof of Stake (PoS) that is new in the market.

Is Blockchain Secure, Transparent, and Decentralized

Well, since you're reading this then you may have a question like "Hey!!, till how much..or what is the extent of Blockchain being Secure, Transparent and Decentralized??". We're going to understand that part now using an example that was there in the starting.

  • Blockchain Decentralization

    1. Blockchain allows the data held in that database to be spread out among several network nodes at various locations. This creates redundancy but also maintains the fidelity of the data stored therein—if somebody tries to alter a record at one instance of the database, the other nodes would not be altered and thus would prevent a bad actor from doing so.
    2. If one user tampers with Bitcoin’s record of transactions, all other nodes would cross-reference each other and easily pinpoint the node with the incorrect information. This system helps to establish an exact and transparent order of events. This way, no single node within the network can alter information held within it. Because of this, the information, and history (such as of transactions of a cryptocurrency) are irreversible. Such a record could be a list of transactions (such as with a cryptocurrency), but it also is possible for a blockchain to hold a variety of other information like legal contracts, state identifications, or a company’s product inventory.
  • Blockchain Transparency

    1. Because of the decentralized nature of Bitcoin’s blockchain, all transactions can be transparently viewed by either having a personal node or using blockchain explorers that allow anyone to see transactions occurring live. Each node has its own copy of the chain that gets updated as fresh blocks are confirmed and added. This means that if you wanted to, you could track Bitcoin wherever it goes
    2. For example, consider a scenario where exchanges have been hacked in the past, were those who kept Bitcoin on the exchange lost everything. While the hacker may be entirely anonymous, the Bitcoins that they extracted are easily traceable. If the Bitcoins stolen in some of these hacks were to be moved or spent somewhere, it would be known.
    3. The records stored in the Bitcoin blockchain are encrypted. This means that only the owner of a record can decrypt it to reveal their identity (using a public-private key pair). As a result, users of blockchains can remain anonymous while preserving transparency.
  • Blockchain Security

    1. New blocks are always stored linearly and chronologically. they are always added to the “end” of the blockchain. After a block has been added to the end of the blockchain, it is extremely difficult to go back and alter the contents of the block unless a majority of the network has reached a consensus to do so.
    2. That’s because each block contains its own hash, along with the hash of the block before it, as well as the previously mentioned time stamp. Hash codes are created by a mathematical function that turns digital information into a string of numbers and letters. If that information is edited in any way, then the hash code changes as well.
    3. Let’s say that a hacker, who also runs a node on a blockchain network, wants to alter a blockchain and steal cryptocurrency from everyone else. If they were to alter their own single copy, it would no longer align with everyone else’s copy. When everyone else cross-references their copies against each other, they would see this one copy stand out, and that hacker’s version of the chain would be cast away as illegitimate.
    4. Succeeding with such a hack would require that the hacker simultaneously control and alter 51% or more of the copies of the blockchain so that their new copy becomes the majority copy and, thus, the agreed-upon chain. Such an attack would also require an immense amount of money and resources, as they would need to redo all of the blocks because they would now have different time stamps and hash codes.
    5. Due to the size of many cryptocurrency networks and how fast they are growing, the cost to pull off such a feat probably would be insurmountable. This would be not only extremely expensive but also likely fruitless.
    6. Doing such a thing would not go unnoticed, as network members would see such drastic alterations to the blockchain. The network members would then hard fork off to a new version of the chain that has not been affected. This would cause the attacked version of the token to plummet in value, making the attack ultimately pointless, as the bad actor has control of a worthless asset. The same would occur if the bad actor were to attack the new fork of Bitcoin. It is built this way so that taking part in the network is far more economically incentivized than attacking it.

Benefits of Blockchains

Apart from Being Decentralized, Secure, and Transparent. Blockchain has some more following benefits.

Cost Reductions

Blockchain eliminates the need for third-party verification and, with it, their associated costs. For example, business owners incur a small fee whenever they accept payments using credit cards because banks and payment-processing companies have to process those transactions.

Efficent Transcation

Transactions placed through a central authority can take up to a few days to settle. If you attempt to deposit a check on Friday evening, for example, you may not actually see funds in your account until Monday morning. Whereas financial institutions operate during business hours, usually five days a week, blockchain is working 24 hours a day, seven days a week, and 365 days a year. Transactions can be completed in as little as 10 minutes and can be considered secure after just a few hours. This is particularly useful for cross-border trades, which usually take much longer because of time zone issues and the fact that all parties must confirm payment processing.

Drawbacks of Blockchains

Well blockchain is good they provide us with this wonderful democratic power, but at what cost or as a Marvel Fan says "With Great Power comes Great Responsibility"

Technology Cost

Although blockchain can save users money on transaction fees, the technology is far from free. For example, the PoW system which the bitcoin network uses to validate transactions consumes vast amounts of computational power. In the real world, the power from the millions of computers on the bitcoin network is close to what Denmark consumes annually link.

Despite the costs of mining bitcoin, users continue to drive up their electricity bills to validate transactions on the blockchain. That’s because when miners add a block to the bitcoin blockchain, they are rewarded with enough bitcoin to make their time and energy worthwhile. When it comes to blockchains that do not use cryptocurrency, however, miners will need to be paid or otherwise incentivized to validate transactions.

Some solutions to these issues are beginning to arise. For example, bitcoin-mining farms have been set up to use solar power, excess natural gas from fracking sites, or power from wind farms.

Speed and Data Inefficiency

Bitcoin’s PoW system takes about 10 minutes to add a new block to the blockchain. At that rate, it’s estimated that the blockchain network can only manage about seven transactions per second (TPS). Although other cryptocurrencies such as Ethereum perform better than bitcoin, they are still limited by blockchain.

The other issue is that each block can only hold so much data. The block size debate has been and continues to be, one of the most pressing issues for the scalability of blockchains going forward.

Regulation

Many in the crypto space have expressed concerns about government regulation over cryptocurrencies. While it is getting increasingly difficult and near impossible to end something like Bitcoin as its decentralized network grows, governments could theoretically make it illegal to own cryptocurrencies or participate in their networks. But we as developers hope that it can be resolved quickly.

What's next

In the next blog, we're going to develop our own Hello World DApp (Decentralized application) with requisites being close to none.

So that's a little-deep intro about the Blockchain world, this world is very fascinating, fast-paced, and very raw. Feel free to learn more about it if my blog inspired you about Blockchain, Upvote this so others can also benefit from this it helped me a lot. With that Keep Learning and Grinding