Good Article On Blockchain
Good Article On Blockchain
The blockchain is used for the secure transfer of items like money,
property, contracts, etc. without requiring a third-party intermediary like
bank or government. Once a data is recorded inside a blockchain, it is very
difficult to change it.
Sometimes the term used for Bitcoin Block chain or The Ethereum
Blockchain and sometimes it's other virtual currencies or digital tokens.
However, most of them are talking about the distributed ledgers.
Blockchain Architecture
What is a Block?
1. Data
2. Hash
3. Hash of the previous block
Therefore, changing a single block can quickly make all following blocks
invalid.
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 few minutes, an attacker can tamper
with a block, and then recalculate all the hashes of other blocks to make
the blockchain valid again.
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 mechanism make a blockchain secure.
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.
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.
After doing all these, your tampered block become accepted by everyone
else. This is next to impossible task. Hence, Blockchains are so secure.
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.
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 share ledger is available between all stack
holders.
Blockchain versions
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 Variants
Public:
Private:
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.
Sector Usage
In the year 2016, smart Dubai office introduced Blockchain strategy. Using
this technology entrepreneurs and developers will be able to connect with
investor and leading companies. The objective is to implement blockchain
base system which favors the development of various kind of industries to
make Dubai 'the happiest city in the world.'
In January 2017 the united nations world food program started a project
called humanitarian aid. The project was developed in rural areas of the
Sindh region of Pakistan. By using the Blockchain technology,
beneficiaries received money, food and all type of transactions are
registered on a blockchain to ensure security and transparency of this
process.
What is Cryptocurrency?
What is Bitcoin?
Bitcoin was launched in 2009 by an unknown person called Satoshi
Nakamoto. Bitcoin is a Peer-to-Peer technology which is not governed by
any central authority or banks. Currently, issuing Bitcoins and managing
transactions are carried out collectively in the network. It is presently the
dominant cryptocurrency of the world. It is open source and designed for
the general public means nobody owns the control of the Bitcoin. In fact,
there are only 21 million Bitcoins issued. Currently, Bitcoin has a market
cap of $12 billion.
Anyone can use bitcoin without paying any process fees. If you are
handling Bitcoin, the sender and receiver transact directly without using a
third party.
The blockchain is the technology behind Bitcoin. Bitcoin is the digital token,
and blockchain is the ledger that keeps track of who owns the digital
tokens. You can't have Bitcoin without blockchain, but you can have
blockchain without Bitcoin.
Ethereum
Bitcoin Cash
Ripple
Litecoin
Multi-master
Consensus Most of the peers agree on the outcome Distributed transactions which held in tw
of transactions. phases commit and Paxos.
Validation Global rules enforced on the whole Offers only local integrity constraints
blockchain system.
Smart contracts are always legal It only executes parts of some legal contracts
Risk of error: There is always a risk of error, as long as the human factor
is involved. In case a blockchain serves as a database, all the incoming
data has to be of high quality. However, human involvement can quickly
resolve the error.
Wasteful: Every node that runs the blockchain has to maintain consensus
across the blockchain. This offers very low downtime and makes data
stored on the blockchain forever unchangeable. However, all this is
wasteful, because each node repeats a task to reach consensus.
Summary
A Blockchain is a chain of blocks that contain information
The blockchain is not Bitcoin, but it is the technology behind Bitcoin
Every block contains hash.
Each block has a hash of the previous block
Blockchain require Proof of Work before a new block is added
The blockchain database is disturbed amongst multiple peers and is
not centralized.
Block chain technology is Resilience, Decentralize, Time reducing,
reliable and its offers unalterable transitions
Three versions of Blockchain are Blockchain 1.0: Currency,
Blockchain 2.0: Smart Contracts and Blockchain 3.0: DApps
The blockchain is Available in three different variants 1) Public 2)
Private 3) Consortium
Higher cost, slower transactions, small ledger, the risk of error are
some disadvantage of using this technology
Dubai- The Smart City, Incent Customer retention, and Blockchain
for Humanitarian Aid are the real-life use cases of Blockchain
Bitcoin uses blockchain technology which is not governed by any
central authority or banks
Bookmark
Email Post
The growth of Bitcoin and Blockchain technology has been so rapid, that even those
who haven’t heard of cryptocurrency or know about its working, are looking to invest
and explore this field. This Blockchain tutorial blog will essentially provide you with
all the fundamental knowledge you need regarding Bitcoin and Blockchain in the
following sequence:
You may go through this recording of Blockchain Tutorial where our instructor has
explained the topics in a detailed manner with examples that will help you to
understand this concept better.
Any existing system will have some issues. Let us look at some of the most
commonly faced issues with the Banking system:
Here, Chandler is sending $100 to Joe but it must pass through a trusted third party
like a Bank or Financial service company before Joe can receive it. A transaction fees
of 2% is deducted from this amount and Joe only receives $98 at the end of the
transaction. Now this may not seem a big amount but imagine if you were sending
$100,000 instead of $100, then the transaction fees also increases to $2,000 which is a
big amount. As per a report from SNL Financial and CNNMoney, JPMorgan Chase,
Bank of America and Wells Fargo earned more than $6 billion from ATM and
overdraft fees in 2015.
Double Spending
Double-spending is an error in digital cash scheme in which the same single digital
token is spent twice or more. To help you understand this problem better, let me give
you an example:
Imagine giving all your saving to someone you trust only to know that they have gone
and lost it somewhere else. That’s what happened in the 2007-08 when Banks and
Investment Organisations had borrowed heavily and lent it as subprime mortgages to
people who could not even pay back these loans. This in turn lead to one of the
greatest financial crisis ever seen and was estimated to have caused losses close to
$11 Trillion ($11,000,000,000,000) worldwide. This was just one of the most popular
examples, how often have we heard of Banks and Financial service companies crash
due to internal frauds? The whole third-party system is something that is built on
blind trust on the middle man.
We have seen some of the most common problems faced by everyone. Wouldn’t it be
great to have a system that overcame these problems and provided us with a That’s
exactly what Blockchain Technology does.
Let us now try understand how Blockchain and Bitcoins solve these issues as the next
part of this Blockchain tutorial blog.
How does Blockchain solve these issues?
Below are some of the ways through which the Blockchain technology tackles the
above mentioned issues:
Decentralized System
Public Ledgers
The ledger which holds the details of all transactions which happen on the
Blockchain, is open and completely accessible to everyone who is associated with the
system. Once you join the Blockchain network, then you can download the complete
list of transaction since its initiation. Even though the complete ledger is publicly
accessible, the details of the people involved in the transactions remains completely
anonymous.
The transaction fees are usually not applicable but certain variants of Blockchain do
implement certain minimal transactions fees. These transaction fees are however
relatively quite less when compared to the fees implied by banks and other financial
organisations. If a transaction needs to be completed on priority then an additional
transaction fees can be added by the user so as to have the transaction verified on
priority.
Now that we have spoken about the issues with the current existing system and
understood how the Blockchain technology overcomes these challenges, I am quite
sure you must have got some understanding of the Blockchain System.
At this point you might still be wondering as to what exactly is the Blockchain and
Bitcoin. So let’s try to understand these important concepts in the next part of this
Blockchain tutorial.
Get Certified With Industry Level Projects & Fast Track Your CareerTake A Look!
What is Blockchain and Bitcoin?
The Bitcoin system is peer-to-peer network based and transactions take place between
users directly, without an intermediary. These transactions are verified by network
nodes and recorded in a public distributed ledger called a Blockchain. Since the
system works without a central repository or single administrator, Bitcoin is called the
first decentralized digital currency.
Bitcoin production makes them a unique currency. Unlike normal currencies, Bitcoins
cannot be created as needed. Only 21 Million Bitcoins can be created, of with 17
million have already been created. Bitcoin get created whenever a block containing
valid transactions is added to the Blockchain. This is the only means for creating
Bitcoins and through various mathematical and encryption algorithms we ensure no
fake Bitcoins are created or circulated. Let us now understand more Blockchain.
What is Blockchain ?
Blockchain can be called the spine of the entire crypto-currency system. Blockchain
technology not only helps with the users perform transactions using crypto-currencies
but also ensures the security and anonymity of the users involved. It is a continuously
growing list of records called blocks, which are linked and secured using
cryptographic techniques. A Blockchain can serve as “an open and distributed ledger,
that can record transactions between two parties in a verifiable and permanent way.”
This ledger that is shared among everyone in the network is public for all to view.This
brings in transparency and trust into the system.
A block is the ‘current’ part of a Blockchain which records some or all of the recent
transactions, and once completed goes into the Vlockchain as permanent database.
Each time a block gets completed, a new block is generated.
You may go through this short animated video of What is Blockchain to understant the
topics with examples that will help you to understand this concept better.
What Is Blockchain | What Is Bitcoin | Blockchain Tutorial |
Edureka
Now I hope you have a better understanding of both Bitcoin and Blockchain. Moving
ahead in our Blockchain tutorial blog, let us look at the features of Blockchain
technology to help us understand why it has become so popular.
Features of Blockchain
Below are the most important features of Blockchain technology that has made it a
revolutionary technology:
The core hash alogorithm used in blockchain technology is the SHA256. The purpose
of using a hash is because the output is not ‘encryption’ i.e it cannot be decrypted
back to the original text. It is a ‘one-way’ cryptographic function, and is a fixed size
for any size of source text. To get a better understanding, let us look at an example
below:
If you look at the first example, we are feeding the input as “Hello World” and getting
an output as
“a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e”.
However, by just adding an “!” at the end, the output completely changes to
“7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9069”. If we
change “H” to “h” and “W” to “w”, then the output value changes to
“7509e5bda0c762d2bac7f90d758b5b2263fa01ccbc542ab5e3df163be08e6ca9”.
I hope with this example you have understood how complex the algorithm is as even
the slightest change in the input can cause a massive change in the output.
This cryptographic technique helps the user by creating a set of keys referred as
Public key and Private key. Here the Public key is shared with others whereas the
Private key is kept as a secret by the user. To understand the roles of these keys, Let
us look at the example below to get a better understanding:
If Chandler sends some bitcoins to Joey, that transaction will have three pieces of
information:
Now all this data along with an encrypted digital signature is sent through the network
for verification. The Digital signature is again a hash value achieved by the
combination of the Chandler’s bitcoin address and the amount he is sending to joey.
This digital signature is encrypted by the private key. Once this data is received by a
miner who has to verify this transaction, there are 2 process he does simultaneously:
1. He takes all the un-encrypted data like transaction amount and public keys of
both Joey and Chandler, and feeds it to a hash algorithm to get a hash value
which we shall call Hash1
2. He takes the digital signature and decrypts it using chandler’s public key to get
a hash value which we will call as Hash2
If both Hash1 and Hash2 are the same then it means that this a valid transaction.
Every single person on the network has a copy of the ledger. There is no single
centralized copy. Let me help in you understanding what a ledger is with the
following example: Suppose you need to send 10 Bitcoins to your friend John where
your Bitcoin balance is 974.65 and John here with a balance of 37. Your balance will
be deducted by 10 BTC and credited into John’s account.
Blockchain has a unique way to implement this. There are no accounts and balances
in the Bitcoin Blockchain ledger. Every transaction from the first one is stored on a
continuous growing database called Blockchain. There are blocks averaging around
2050 transactions and as of today, there are 484,000 blocks in the Blockchain with
around 250 million transactions.
This ledger is distributed across all users of Bitcoin Blockchain, i.e., the ledger has no
central location where it is stored. Everyone on the network owns a copy of the ledger
and the true copy is the collection of all the distributed ledgers.
Proof Of Work
You might be wondering if everyone equally owns the ledger, who adds blocks to the
Blockchain? How can people trust this person?
For this, we have the concept of proof of work. It is basically like solving a very big
puzzle. It requires lots of computational effort. This work is done by people in the
Bitcoin network we call miners. The work of these miners is to verify the transactions
and solve a complex mathematical puzzle associated with the block being created.
The difficulty of the problem is adjusted so that on average a block is solved in 10
minutes. Miners search for a specific nonce(mathematical value) which gives the
desired hash which is predetermined. The current difficulty level is such that you need
to try about 20.6 quadrillion nonce to get the correct hash.
Each block has a hash value which is the combination of the previous block’s final
hash, transaction data’s hash value and the nonce. The final resulting hash for the
block must start with a specified number of trailing zeroes. It is this computation to
find the nonce which satisfies the condition that makes mining so computationally
expensive.
So the person who finds this nonce is the successful miner and he/she can add their
block to the blockchain. Through our P2P distributed network, he/she broadcasts their
block and everyone verifies if hashes match, updates their blockchain and moves on
to solving the next block immediately.
Incentives for Validation
The last step of a Bitcoin transaction is to giving a reward to the miner who has
created the latest block. This rewards is provided by the Blockchain system for
validating the transactions and maintaining the Blockchain. Currently the reward per
block is 12.5 BTC (Rs 3,427,850/- or $ 53,390). This is the most interesting part of
Bitcoin Mining.
Bitcoin incentives is the only way to generate new currency into the system and it is
believed that by 2140, all 21 million bitcoins will be mined.
With this, I hope you now have more understanding and appreciation towards the
Blockchain technology. Blockchain is much more than Bitcoin. Finance is just one of
the many industries Blockchain aims to disrupt. Moving ahead with our Blockchain
tutorial, let us now look at one such example of IBM and Maersk, to understand how
the Supply Chain Industry is disrupted by blockchain.
Business need:
Being a part of an extremely dynamic Supply Chain industry, tracking the slightest
change is of highest priority for the client. They needed a solution that could enable
them to complete the shipping process without having the delay in paper work. A
solution that would be able to bring together all the stakeholders of the system and
provide a real-time status on the shipment.
Challenges:
Today, 90% of the goods in global trade are carried by the shipping industry. This
supply chain is flowed by the complexity and sheer volume of point-to-point
communication. These communications are across a loosely coupled web of land
transportation providers .freight forwarders, customs, brokers, government’s ports and
ocean carriers processing. Documents and information for a container shipment is
estimated to cost more than twice that of the actual physical transportation.
Solution:
IBM and Maersk are addressing this problem with a distributed permission platform
accessible by the supply chain ecosystem designed to exchange event data and
handled document workflows.
Merck and IBM are employing Blockchain technology to create a global tamper proof
system by the digitizing trade workflow and tracking shipments end-to-end. This
eliminates frictions including costly point-to-point communications. The collaboration
will launch with potential ability to track millions of container journeys per year and
integrate with customs authorities on selected trade lanes.
Results:
Provided a secure Data Exchange platform for all the stakeholders involved
in the supply chain system.
Established a Tamper proof repository to store all the documents involved as
part of the process.
Regular shipping events help reduce significant Delays and Frauds, saving
Billions of dollars annually.
Reduced the barrier between trade organisations thereby increasing
worldwide GDP by 3%.
Helped increase the overall trade volume by 12%.
This is how Blockchain technology helped Maersk and has been helping many other
companies worldwide. Finally as part of this Blockchain tutorial, we will look at a
demo as to how you set up a private autonomous Blockchain on your system.
Blockchain Tutorial: Demo
We will implement a digital bank using Ethereum Blockchain. Ethereum is an open-
source, public, blockchain-based distributed computing platform. The systems will
allow us to:
1. Make a cryptocurrency with a fixed market supply and tokens to represent real
world asset values.
2. Create an autonomous private Blockchain with rules on spending money.
3. Mine for a new Ether by validating transactions.
geth is the the command line interface for running a full ethereum node implemented
in Go. By installing and running geth, you can take part in the ethereum frontier live
network and
Cloning the geth repository from github. To do this, open a new terminal and execute
the following command:
$ cd go-ethereum
$ git tag
$ git checkout tags/v1.6.7 -b EdurekaEthereumV1.6.7
$ git branch
$ make all
A genesis block is the first block of a block chain. Changing the genesis block is a
way to definitively fork yourself away from the bitcoin blockchain, i.e, start a new
network with it’s own separate history. To create the genesis file, execute the
following commands:
$ cd go-ethereum
$ mkdir genesis
$ cd genesis
$ gedit genesis.json
Step 3 : Making Rules for our Blockchain
The rules for our Blockchain will be included in the genesis.json file we have created.
Add the following code in your genesis.json file:
1
2
{
3 { "config":{
4 "chainId": 123,
5 "homesteadBlock": 0,
6 "eip155Block": 0,
"eip158Block": 0,
7 },
8 "nonce": "0x3",
9 "timestamp": "0x0",
10 "parentHash": "0x0000000000000000000000000000000000000000000000000000",
11 "extraData": "0x0",
"gasLimit": "0x4c4b40",
12 "difficulty": :0x400",
13 "mixhash": "0x0000000000000000000000000000000000000000000000000000",
14 "coinbase": "0x000000000000000000000000000000000",
15 "alloc":{
}
16 }
17
18
nonce: A 64-bit hash, which proves, combined with the mix-hash, that a sufficient
amount of computation has been carried out on this block.
timestamp: A scalar value equal to the reasonable output of Unix time() function at
this block inception.
mixhash: A 256-bit hash which proves, combined with the nonce, that a sufficient
amount of computation has been carried out on this block.
difficulty: A scalar value corresponding to the difficulty level applied during the
nonce discovering of block.
parentHash: The Keccak 256-bit hash of the entire parent block header (including its
nonce and mixhash).
extraData: An optional free, but max. 32-byte long space to conserve smart things for
ethernity.
gasLimit: A scalar value equal to the current chain-wide limit of Gas expenditure per
block.
coinbase: The very first transaction included in the block by the miners.
Now we need to initialize the blockchain. You can do that by using the following
command:
Now that we have initialized the blockchain, it’s time that we give geth control access
to it. Execute the following command to start the geth console:
$ /home/edureka/go-ethereum/build/bin/geth --datadir ~/ethereum/net3/ --networkid 3
console
eth.accounts: it helps you check the various accounts which are part of your
blockchain
eth.blockNumber(): this helps you to identify the number of blocks that are part of
your blockchain
With this we have successfully mined ether and completed our Banking Demo. This
brings us to the end of this blog. I hope you liked this Blockchain tutorial blog. This
was the first blog of the Blockchain tutorial series. This Blockchain tutorial blog will
be followed by my next blog, which will focus on Blockchain technologies and
Bitcoin Transactions. Do read them as well to learn more about Blockchain.
If you wish to learn Blockchain and build a career in Blockchain Technologies, then
check out our Blockchain Certification Training which comes with instructor-led live
training and real-life project experience. This training will help you understand
Blockchain in depth and help you achieve mastery over the subject.
Got a question for us? Please mention it in the comments section and we will get back
to you.
12 Comments