Categories
2. Blockchain technology from beginning

Why is blockchain important?

We are all now used to sharing information through a decentralized online platform: the internet. But when it comes to transferring value – e.g. money, ownership rights, intellectual property, etc. – we are usually forced to fall back on old-fashioned, centralized institutions or establishments like banks or government agencies. Even online payment methods which have sprung into existence since the birth of the internet – PayPal being the most obvious example – generally require integration with a bank account or credit card to be useful.

Blockchain technology offers the intriguing possibility of eliminating this “middleman”. It does this by filling three important roles – recording transactions, establishing identity and establishing contracts – traditionally carried out by the financial services sector.

This has huge implications because, worldwide, the financial services market is the largest sector of industry by market capitalization. Replacing even a fraction of this with a blockchain system would result in a huge disruption of the financial services industry, but also a massive increase in efficiencies.

The third role, establishing contracts, opens up a treasure trove of opportunities. Apart from a unit of value (like a bitcoin), blockchain can be used to store any kind of digital information, including computer code.

That snippet of code could be programmed to execute whenever certain parties enter their keys, thereby agreeing to a contract.  The same code could read from external data feeds — stock prices, weather reports, news headlines, or anything that can be parsed by a computer, really — to create contracts that are automatically filed when certain conditions are met.

These are known as “smart contracts,” and the possibilities for their use are practically endless.

For example, your smart thermostat might communicate energy usage to a smart grid; when a certain number of wattage hours has been reached, another blockchain automatically transfers value from your account to the electric company, effectively automating the meter reader and the billing process.

Or, smart contracts might be put to use in the regulation of intellectual property, controlling how many times a user can access, share, or copy something. It could be used to create fraud-proof voting systems, censorship-resistant information distribution, and much more.

The point is that the potential uses for this technology are vast, and I predict that more and more industries will find ways to put it to good use in the very near future.

Categories
2. Blockchain technology from beginning

History of Blockchain

Blockchain isn’t just a database, it’s a new technology stack with ‘digital trust’ that is revolutionizing the way we exchange value and information across the internet, by taking out the ‘gatekeepers’ from the process.

Blockchain history goes back farther than you might imagine, but we’ve condensed it by answering four critical questions:

Who Invented Blockchain?

The first blockchain-like protocol was proposed by cryptographer David Chaum in 1982. Later in 1991, Stuart Haber and W. Scott Stornetta wrote about their work on Consortiums.

But it was Satoshi Nakamoto (presumed pseudonym for a person or group of people) who invented and implemented the first blockchain network after deploying the world’s first digital currency, Bitcoin.

Cryptography is a deep and fascinating discipline with a history that goes back further than blockchain.

Who Owns Blockchain Technology?

Because blockchain technology is the technology behind the blockchain, it cannot be owned. It’s like the internet. But anyone can use the technology to run and own their own blockchains.

Who Founded Bitcoin?

Satoshi Nakamoto.

Who Sent and Received the First Bitcoin Transaction?

Nakamoto sent ten bitcoins to Hal Finney, who built the first reusable proof-of-work system in 2004.

Categories
2. Blockchain technology from beginning

Blockchain Variants

Public:

In this type of blockchains, ledgers are visible to everyone on the internet. It allows anyone to verify and add a block of transactions to the blockchain. Public networks have incentives for people to join and free for use. Anyone can use a public blockchain network.

Private:

The private blockchain is within a single organization. It allows only specific people of the organization to verify and add transaction blocks. However, everyone on the internet is generally allowed to view.

Private Blockchain

Consortium:

In this Blockchain variant, only a group of organizations can verify and add transactions. Here, the ledger can be open or restricted to select groups. Consortium blockchain is used cross-organizations. It is only controlled by pre-authorized nodes.

Categories
2. Blockchain technology from beginning

Blockchain versions

Now in this Blockchain development tutorial, let’s learn about Blockchain versions.

Blockchain Versions

Blockchain 1.0: Currency

The implementation of DLT (distributed ledger technology) led to its first and obvious application: cryptocurrencies. This allows financial transactions based on blockchain technology. It is used in currency and payments. Bitcoin is the most prominent example in this segment.

Blockchain 2.0: Smart Contracts

The new key concepts are Smart Contracts, small computer programs that “live” in the blockchain. They are free computer programs that execute automatically, and check conditions defined earlier like facilitation, verification, or enforcement. It is used as a replacement for traditional contracts.

Blockchain 3.0: DApps:

DApps is an abbreviation of decentralized application. It has their backend code running on a decentralized peer-to-peer network. A DApp can have frontend Blockchain example code and user interfaces written in any language that can make a call to its backend, like a traditional Apps.

Categories
2. Blockchain technology from beginning

Why do we need Blockchain?

Here, are some reasons why Blockchain technology has become so popular.

Resilience: Blockchains is often replicated architecture. The chain is still operated by most nodes in the event of a massive attack against the system.

Time reduction: In the financial industry, blockchain can play a vital role by allowing the quicker settlement of trades as it does not need a lengthy process of verification, settlement, and clearance because a single version of agreed-upon data of the shared ledger is available between all stack holders.

Reliability: Blockchain certifies and verifies the identities of the interested parties. This removes double records, reduces rates and accelerates transactions.

Unchangeable transactions: By registering transactions in chronological order, Blockchain certifies the unalterability, of all operations which means when any new block has been added to the chain of ledgers, it cannot be removed or modified.

Fraud prevention: The concepts of shared information and consensus prevent possible losses due to fraud or embezzlement. In logistics-based industries, blockchain as a monitoring mechanism act to reduce costs.

Security: Attacking a traditional database is the bringing down of a specific target. With the help of Distributed Ledger Technology, each party holds a copy of the original chain, so the system remains operative, even a large number of other nodes fall.

Transparency: Changes to public blockchains are publicly viewable to everyone. This offers greater transparency, and all transactions are immutable.

Collaboration – Allows parties to transact directly with each other without the need for mediating third parties.

Decentralized: There are standards rules on how every node exchanges the blockchain information. This method ensures that all transactions are validated and all valid transactions are added one by one.

Categories
2. Blockchain technology from beginning

How Blockchain Transaction Works?

Blockchain Transaction Process

Step 1) Some person requests a transaction. The transaction could be involved cryptocurrency, contracts, records or other information.

Step 2) The requested transaction is broadcasted to a P2P network with the help of nodes.

Step 3) The network of nodes validates the transaction and the user’s status with the help of known algorithms.

Step 4) Once the transaction is complete, the new block is then added to the existing blockchain. In such a way that is permanent and unalterable.

Categories
2. Blockchain technology from beginning

Distributed P2P Network

However, there is one more method which is used by blockchains to secure themselves, and that’s by being distributed. Instead of using a central entity to manage the chain, Blockchains use a distributed peer-peer network, and everyone is allowed to join. When someone enters this network, he will get the full copy of the blockchain. Each computer is called a node.

Distributed P2P Network

Let’s see what happens when any user creates a new block. This new block is sent to all the users on the network. Each node needs to verify the block to make sure that it hasn’t been altered. After complete checking, each node adds this block to their blockchain.

Distributed P2P Network

All these nodes in this network create a consensus. They agree about what blocks are valid and which are not. Nodes in the network will reject blocks that are tampered with.

So, to successfully tamper with a blockchain

  1. You will need to tamper with all blocks on the chain
  2. Redo the proof-of-work for each block
  3. Take control of greater than 50% of the peer-to-peer network.

After doing all these, your tampered block becomes accepted by everyone else. This is next to an impossible task. Hence, Blockchains are so secure. Next, in this beginner’s Blockchain development tutorial, we will learn how a Blockchain transaction works?

Categories
2. Blockchain technology from beginning

Proof of Work

Hashes are an excellent mechanism to prevent tempering, but computers these days are high-speed and can calculate hundreds of thousands of hashes per second. In a matter of a few minutes, an attacker can tamper with a block, and then recalculate all the hashes of other blocks to make the blockchain valid again.

To avoid the issue, blockchains use the concept of Proof-of-Work. It is a mechanism which slows down the creation of the new blocks.

A proof-of-work is a computational problem that takes certain to effort to solve. But the time required to verify the results of the computational problem is very less compared to the effort it takes to solve the computational problem itself.

In the case of Bitcoin, it takes almost 10 minutes to calculate the required proof-of-work to add a new block to the chain. Considering our example, if a hacker would to change data in Block 2, he would need to perform proof of work (which would take 10 minutes) and only then make changes in Block 3 and all the succeeding blocks.

Block Architecture of Blockchain

This kind of mechanism makes it quite tough to tamper with the blocks so even if you tamper with even a single block, you will need to recalculate the proof-of-work for all the following blocks. Thus, hashing and proof-of-work mechanisms make a blockchain secure.

Categories
2. Blockchain technology from beginning

Understanding SHA256 – Hash

A block also has a hash. A can be understood as a fingerprint which is unique to each block. It identifies a block and all of its contents, and it’s always unique, just like a fingerprint. So once a block is created, any change inside the block will cause the hash to change.

What is SHA256 Hash

Therefore, the hash is very useful when you want to detect changes to intersections. If the fingerprint of a block changes, it does not remain the same block.

Each Block has

  1. Data
  2. Hash
  3. Hash of the previous block

Consider the following example, where we have a chain of 3 blocks. The 1st block has no predecessor. Hence, it does not contain has the previous block. Block 2 contains a hash of block 1. While block 3 contains Hash of block 2.

Block Architecture of Blockchain

Hence, all blocks are contain hashes of previous blocks. This is the technique that makes a blockchain so secure. Let’s see how it works –

Assume an attacker is able to change the data present in Block 2. Correspondingly, the Hash of the Block also changes. But, Block 3 still contains the old Hash of Block 2. This makes Block 3, and all succeeding blocks invalid as they do not have the correct hash of the previous block.

Block Architecture of Blockchain

Therefore, changing a single block can quickly make all following blocks invalid.

Categories
2. Blockchain technology from beginning

Blockchain Architecture

Now in this Blockchain Technology tutorial, let’s study the Blockchain architecture by understanding its various components:

What is a Block?

Block Architecture of Blockchain

A Blockchain is a chain of blocks which contain information. The data which is stored inside a block depends on the type of blockchain.

For Example, A Bitcoin Block contains information about the Sender, Receiver, number of bitcoins to be transferred.

Bitcoin Block

The first block in the chain is called the Genesis block. Each new block in the chain is linked to the previous block.