M1 Blockchain Technology

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 115

Blockchain Technology

Scheme
Objectives/Outcomes
Syllabus
Syllabus
Practicals
Books
Online References
Blockchain
job profiles
Concept

• Blockchain is a shared, immutable ledger that facilitates the process of


recording transactions and tracking assets in a business network.
• Blockchain, sometimes referred to as Distributed Ledger Technology
(DLT), makes the history of any digital asset unalterable and transparent
through the use of decentralization and cryptographic hashing.  
• An asset can be tangible (a house, car, cash, land) or intangible
(intellectual property, patents, copyrights, branding). Virtually anything
of value can be tracked and traded on a blockchain network, reducing
risk and cutting costs for all involved.
Why blockchain is important ?

• Business runs on information.


• The faster it’s received and the more accurate it is, the better.
• Blockchain is ideal for delivering that information because it provides
immediate, shared and completely transparent information stored on
an immutable ledger that can be accessed only by permissioned
network members.
• A blockchain network can track orders, payments, accounts, production
and much more. And because members share a single view of the truth,
you can see all details of a transaction end to end, giving you greater
confidence, as well as new efficiencies and opportunities.
Blockchain is a system of recording information in a way that makes it difficult or
impossible to change, hack, or cheat the system.

Distributed
Ledger A blockchain is essentially a digital ledger of transactions that is duplicated and
distributed across the entire network of computer systems on the blockchain.
Technology
(DLT). Each block in the chain contains a number of transactions, and every time a new
transaction occurs on the blockchain, a record of that transaction is added to
every participant’s ledger.

The decentralised database managed by multiple participants is known as


Distributed Ledger Technology (DLT).
Why is there so much hype around blockchain
technology?

• There have been many attempts to create digital money in the past, but they have
always failed.
• The prevailing issue is trust. If someone creates a new currency called the X dollar,
how can we trust that they won't give themselves a million X dollars, or steal your
X dollars for themselves?
• Bitcoin was designed to solve this problem by using a specific type of database
called a blockchain.
• Most normal databases, such as an SQL database, have someone in charge who
can change the entries (e.g. giving themselves a million X dollars). Blockchain is
different because nobody is in charge;
• it’s run by the people who use it. What’s more, bitcoins can’t be faked, hacked or
double spent – so people that own this money can trust that it has some value.
History of 2008
• Satoshi Nakamoto, a pseudonym for a person or group,
Blockchain publishes “Bitcoin: A Peer to Peer Electronic Cash System."
2009
• The first successful Bitcoin (BTC) transaction occurs between
computer scientist Hal Finney and the mysterious Satoshi
Nakamoto.
2010
• Florida-based programmer Laszlo Hanycez completes the first
ever purchase using Bitcoin — two Papa John’s
pizzas. Hanycez transferred 10,000 BTC’s, worth about $60 at
the time. Today it's worth $80 million. 
• The market cap of Bitcoin officially exceeds $1 million.
2011
• 1 BTC = $1USD, giving the cryptocurrency parity with the US dollar.
• Electronic Frontier Foundation, Wikileaks and other organizations start accepting Bitcoin as
donations.
2012
• Blockchain and cryptocurrency are mentioned in popular television shows like The Good
Wife, injecting blockchain into pop culture.
• Bitcoin Magazine launched by early Bitcoin developer Vitalik Buterin.
2013
• BTC market cap surpassed $1 billion.
• Bitcoin reached $100/BTC for the first time.
• Buterin publishes “Ethereum Project" paper suggesting that blockchain has other possibilities besides
Bitcoin (e.g., smart contracts).
2014
• Gaming company Zynga, The D Las Vegas Hotel and Overstock.com all start accepting Bitcoin as
payment.
• Buterin’s Ethereum Project is crowdfunded via an Initial Coin Offering (ICO) raising over $18 million in
BTC and opening up new avenues for blockchain.
• R3, a group of over 200 blockchain firms, is formed to discover new ways blockchain can be
implemented in technology.
• PayPal announces Bitcoin integration.
2015
• Number of merchants accepting BTC exceeds 100,000.
• NASDAQ and San-Francisco blockchain company Chain team up to test the technology for trading
shares in private companies.
2016
• Tech giant IBM announces a blockchain strategy for cloud-based business solutions.
• The government of Japan recognizes the legitimacy of blockchain and cryptocurrencies.
• 2017
• Bitcoin reaches $1,000/BTC for the first time.
• Cryptocurrency market cap reaches $150 billion.
• JP Morgan CEO Jamie Dimon says he believes in blockchain as a future
technology, giving the ledger system a vote-of-confidence from Wall
Street.
• Bitcoin reaches its all-time high at $19,783.21/BTC.
• Dubai announces its government will be blockchain-powered by 2020.
2018
• Facebook commits to starting a blockchain group and also hints at the possibility of creating its own
cryptocurrency.
• IBM develops a blockchain-based banking platform with large banks like Citi and Barclays signing on.
2019
• China’s President Ji Xinping publicly embraces blockchain as China’s central bank announces it is
working on its own cryptocurrency
• Twitter & Square CEO Jack Dorsey announces that Square will be hiring blockchain engineers to work
on the company’s future crypto plans
• The New York Stock Exchange (NYSE) announces the creation of Bakkt - a digital wallet company that
includes crypto trading
2020
• Bitcoin almost reaches $30,000 by the end of 2020
• PayPal announces it will allow users to buy, sell and hold cryptocurrencies
• The Bahamas becomes the world’s first country to launch its central bank digital currency, fittingly
known as the “Sand Dollar”
• Blockchain becomes a key player in the fight against COVID-19, mainly for securely storing medical
research data and patient information
Module 1:
Basics of
Blockchain
Blockchain Version

• Blockchain 1.0: Currency


• Example Bitcoin
• enabler of an Internet of Money
• Blockchain 2.0: Smart Contracts
• small computer programs that "live" in the blockchain
• Blockchain 3.0: Dapps
• decentralized application
• A DApp can have frontend code
Blockchain Components
A hash function takes an input string (numbers, alphabets,
media files) of any length and transforms it into a fixed length.

Blockchain The fixed bit length can vary (like 32-bit or 64-bit or 128-bit or
256-bit) depending on the hash function which is being used.

Hash
Function The fixed-length output is called a hash.

This hash is also the cryptographic byproduct of a hash


algorithm. We can understand it from the following diagram.
Hash Function

•https://anders.com/blockcha
in/hash.html
•  the blockchain uses this cryptographic hash function's properties in its
consensus mechanism.
• A cryptographic hash is a digest or digital fingerprints of a certain
amount of data.
• In cryptographic hash functions, the transactions are taken as an input
and run through a hashing algorithm which gives an output of a fixed
size.
Basic
Components
of Bitcoin
Bitcoin
• is basically a software at the core that defines what a
bitcoin is, as well as how a bitcoin gets transferred.
• It identifies what the rules of a valid bitcoin, who can be
inside bitcoin, who cannot be inside bitcoin, what is valid,
what is not, etc. Everything is based on software, which is
the bitcoin software.
• The bitcoin software is always operated in 24*7.
Cryptography
• The software, at its core, uses cryptography and bitcoin as a
cryptocurrency. Bitcoin uses cryptography to regulate the
transfer of bitcoin between parties, as well as the creation
of new units of bitcoin. Without cryptography, Bitcoin
would simply not be possible. So, we've got that this
software uses cryptography to control the transfer of
bitcoin over the internet.
• Cryptography is a mathematical approach which is solvable
by computers and not by humans. So all the stuff that
protects your data is served by the cryptography.
Hardware

• To run and solve cryptography, it needs HARDWARE. This hardware is


composed of those thousands of miners around the world running their
computers. So there are thousands of computers around the world that
are basically running the Bitcoin software or the Bitcoin client. This
hardware is specially designed for finding Nonce to validate block and
hash. It requires a lot of CPU power to complete a simple task on the
bitcoin blockchain.
• If you try to mine bitcoin right now with your smartphone or home
computer, then you will End up losing your computer along with a hefty
electric bill.
Mining(Gaming Theory)

• Miners are users who involved in a gaming theory because bitcoin is


truly a game which is run by these miners around the world.
• In the above, we have seen that the first component is software for
bitcoin that issues a cryptography challenge in every 10 minutes.
• The cryptography challenge involves in trying to find a Nonce which will
make the hash for a specific block valid.
• All the hashes and validations are done by these miners. After successful
creation of the block, the new block is added to the blockchain.
Let's see how gaming theory works!

• Bitcoin software creates a challenge. Now, there is a game begins, and there is a race that goes off.
The race involves all these miners competing against each other to solve the challenges.
• This task or challenge will take approximately 10 minutes to be completed.
• Every single miner starts trying to find the solution to that one Nonce that will satisfy the hash for the
block.
• At some specific point, one of those miners in the global community with higher speed and great
hardware specs will solve the cryptography challenge and be the winner of that race.
• Now, the rest of the community will start verifying that block which is mined by the winner. This
makes Bitcoin so strong, because in one stage of this cycle, the miners are competing against each
other, and in the next stage of the cycle, the rest of the community rallies together to ensure that
that solution is correct.
• If the Nonce is correct, it will end up with the new block which will be added to the blockchain.
• For this task or challenge, the winner will earn a reward. That reward is currently 12.5 bitcoins.
• Proof of Work(PoW) is the original consensus algorithm in
a blockchain network.
• The algorithm is used to confirm the transaction and
creates a new block to the chain. In this
algorithm, minors (a group of people) compete against
Blockchain each other to complete the transaction on the network.

Proof of work • The process of competing against each other is


called mining.
• As soon as miners successfully created a valid block, he
gets rewarded.
• The most famous application of Proof of Work(PoW) is
Bitcoin.
• Producing proof of work can be a random process with low probability.
• In this, a lot of trial and error is required before a valid proof of work is
generated.
• The main working principle of proof of work is a mathematical puzzle
which can easily prove the solution.
• Proof of work can be implemented in a blockchain by the Hashcash
proof of work system.
• In the below image, you can see that this block is composed of a block
number, data field, cryptographic hash associated with it and a nonce.
• The nonce is responsible for making the block valid.
• In the puzzle game, bitcoin software creates a challenge, and there is a
game begins. This game involves all miners competing against each
other to solve the challenges, and this challenge will take approximately
10 minutes to be completed. Every single miner starts trying to find the
solution to that one Nonce that will satisfy the hash for the block. At
some specific point, one of those miners in the global community with
higher speed and great hardware specs will solve the cryptography
challenge and be the winner of the game. Now, the rest of the
community will start verifying that block which is mined by the winner.
If the nonce is correct, it will end up with the new block that will be
added to the blockchain. The concept of generating a block provides a
clear explanation of proof of work(PoW).
No Blockchain Database
1. Blockchain is decentralized because there is no admin or in- The database is centralized because it has admins and in-
charge. charge.
2. Blockchain is permissionless because anyone can access it. The database required permission because it can be
accessed only by entities who have rights to access.
3. Blockchains are slow. Databases are fast.
4. It has a history of records and ownership of digital records. It has no history of records and ownership of records.

5. Blockchain is fully confidential. The database is not fully confidential.


6. Blockchain has only Insert operation. The database has Create, Read, Update, and Delete
operation.
7. It is a fully robust technology. It is not entirely robust technology.
8. Disintermediation is allowed with blockchain. Disintermediation is not allowed with the database.
9. Anyone with the right proof of work can write on the Only entities entitled to read or write can do so.
blockchain.
10. Blockchain is not recursive. Here, we cannot go back to The database is recursive. Here, we can go back to repeat
repeat a task on any record. a task on a particular record.
• a small change to a message
should change the hash
value so extensively that a
new hash value appears avalanche effect
uncorrelated with the old
hash value
Crypto currency
• Cryptocurrency, sometimes called crypto-currency or
crypto, is any form of currency that exists digitally or
virtually and uses cryptography to secure transactions.
• Cryptocurrencies don't have a central issuing or regulating
authority, instead using a decentralized system to record
transactions and issue new units.
• Cryptocurrency is a digital payment system that doesn't rely on banks to verify
transactions.
• 
It’s a peer-to-peer system that can enable anyone anywhere to send and receive payme
nts
.
• Instead of being physical money carried around and exchanged in the real world, crypto
currency payments exist purely as digital entries to an online database describing
specific transactions.
• When you transfer crypto currency funds, the transactions are recorded in a public
ledger. Cryptocurrency is stored in digital wallets.
• Cryptocurrency received its name because it uses encryption to verify transactions.
• This means advanced coding is involved in storing and transmitting crypto currency data
between wallets and to public ledgers.
• The aim of encryption is to provide security and safety.
Coinbase Transaction

• A coinbase transaction is
the first transaction in a block.
• It is a unique type of bitcoin
transaction that can be created by a
miner.
• The miners use it to collect the block
reward for their work and any other
transaction fees collected by the miner
are also sent in this transaction.
• Each transaction executed on the bitcoin
• network are combined together to form a block. When a block is
formed, immediately, it will be added in the blockchain.
• Now, these blocks are immutable and tamper-proof for all transactions
that are made on the bitcoin network.
• Each block must contain one or more transactions, and the first
transaction in the block is called the coinbase transaction.
•The miners are always responsible for creating a
block. When a block is successfully created, he
will be rewarded from bitcoin for their work. The
bitcoin block reward is always dependent on the
number of blocks from the genesis block and the
number of fees included in the transactions of
the block. The total amount of rewards that a
miner will collect is the sum of the block reward
and the transaction fees taken from all the
transactions that have been included in the
block.
• In the start of the bitcoin, the block reward is 50 bitcoin per block. The block reward is reduced by
half after every 210, 000 blocks, i.e. approximately in every four years.
• The current reward for successfully creating a block is 12.5 bitcoin.
• It will be going to get reduced 6.25 bitcoin per block in the year 2020.
• There is one important feature of a coinbase transaction is that bitcoins involved in the transaction
cannot be spent until they have received at least 100 block confirmations in the blockchain.
Distributed
Database • Distributed Database Systems is a kind of DBMS
where databases are present at different locations
System and connected via a network.
• Each site in a Distributed Database is capable of
accessing and processing local data as well as
remote data.
disadvantages

• Complex nature :
Distributed Databases are a network of many computers present at different locations
and they provide an outstanding level of performance, availability and of course
reliability. Therefore, the nature of Distributed DBMS is comparatively more complex
than a centralized DBMS. Complex software are required for Distributed DBMS . Also,
It ensures no data replication, which adds even more complexity in its nature.

• Overall Cost :
Various costs such as maintenance cost, procurement cost, hardware cost,
network/communication costs, labor costs, etc, adds up to the overall cost and make it
costlier than normal DBMS.
• Security issues:
In a Distributed Database, along with maintaining no data redundancy,
the security of data as well as network is a prime concern. A network
can be easily attacked for data theft and misuse.
• Integrity Control:
In a vast Distributed database system, maintaining data consistency is
important. All changes made to data at one site must be reflected to all
the sites. The communication and processing cost is high in Distributed
DBMS in order to enforce the integrity of data.
• Term coined by Nick Szabo,cryptographer in 1966
Smart • Szabo claimed that smart contracts can be realized
with the help of public ledger
Contracts • Blockchain can be a pioneering technology to
realize smart contracts
Contracts in a centralized
platform-Crowdfunding
• Both the product team and the supporters need to
trust the crowdfunding platform
The • The product team expects the money to be get
paid based on the project progress
crowdfunding • The supporters expect money to go to the project
platform • However, the crowdfunding platform, the
middleman takes significant charge to manage
entire process
Crowfunding Platform
using Smart Contracts
• The contract is written in a code
which is available to all the
stakeholders- the supporters and
the product team
• Immutable: No party will be able to change once it
is fixed and written to public ledger
• Distributed: All the steps of the contract can be
Smart validated by every participating part-no one can
claim later that the contract was not validated
Contracts -The
Advantage • Why blockchain
• The blocks are immutable
• The information is open-everyone can check
and validate
Smart contracts platforms
The Block in a Blockchain-Securing Data Crypptographically

• Digitally signed and encrypted


transactions verified by the peers
• Cryptographic security
• Ensures that participants can only
view information on the ledger
that they are authorized to see
Block
structure
• Mining The mechanism to generate the hash
Block header • The mechanism to generate hash
• Bitcoin mining Hk=Hash(Hk-1 || T || Nounce)
• find the nounce such that Hk has certain predefined
complexity ( number of zeros at the prefix)
Merkle Tree
• Merkle tree is a fundamental part of blockchain
technology.
• It is a mathematical data structure composed of hashes of
different blocks of data, and which serves as a summary of
all the transactions in a block. 
• Both Bitcoin and Ethereum use Merkle Trees structure.
• Merkle Tree is also known as Hash Tree.
• Merkle Root is stored in the block header
Merkle trees have three benefits:
• It provides a means to maintain the integrity and
validity of data.
• It helps in saving the memory or disk space as
the proofs, computationally easy and fast.
• Their proofs and management require tiny
amounts of information to be transmitted across
networks.
Transactions • Transactions are organized as merkle tree. The merkle root is used to
construct the block hash
in Block • If you change a transaction, you need to change all the subsequent
block
• The difficulty of the mining algorithm determines the toughness of
tampering with a block in a blockchain
• The Block contains two
parts: The header and
the data(Transactions)
• The header of a block
connecrs the
The Block in a transactions -any change
in any transactionwill
Blockchain resultin a change at the
block header

• The headers of
subsequesnt blocks are
connected in a chain: the
entire blockchain needs
to be updated if you
want to make any
change anywhere
• Every peer in a
The Blockchain network
maintains a local copy of
Blockchain the Blockchain
• Requirements
replicas • All the replicas need
to be updated with
the last mined block
• All the replicas need
to be consistent the
copies of the
blockchain at
different peers need
to be exactly similar
The notion of
distributed • Ensure that different nodes in the network see the same
data at nearly the same point of time
Consensus • All nodes in the network need to agree or consent on a
regular basis that the data stored by them is the same
• No single point of failure : the data is decentralized
• The system can provide service even in the presence of
failures
Flowchart of the Mining Process
to Construct a Block Header
• Can we achieve consensus even when the network is
arbitrarily large and no participants in the network really
knew all other participants?
• An open network scenario the permission less protocol you
do not record your identity while participating in the
Consensus consensus system
• A challenge response based system the network would
pose a challenge and each node in the network would
attempt to solve the challenge
• the basic philosophy is based on message passing inform
your state to others so that everyone can match their
current state with others in the network
Challenge
Response to • Challenge response protocol
Permission • The nodes in the network tries to solve the challenge
posed by the network
less Consensus • the nodes or the participants do not need to revel their
identity
• The node that is able to solve the challenge first ,would get
to dictate what the next set of data or state elements
• This will continue at different rounds
Challenge
Response to • Design of a good challenge
Permission • Ensures that different nodes will run the challenge at
different runs
less Consensus
• This ensures that no node would be able to control
network
• Bitcoin network algorithm ensures consensus over
permission less based on challenge response
The
Economics
Behind • The mining ensures that no node has the power to
Blockchain sabotage the network and gain control

Consensus • No one can hold the control of the cryptocurrency


• The computational effort expended by the nodes in
achieving consensus would be paid by cryptocurrency
generated and managed by the network
• Blockchain ensures that currency is secure and tamper
proof
Distributed
Consensus in
Distributed • A procedure to reach a common agreement in a distributed
or decentralized multi-agent platform.
Systems • Proof of Work (PoW):
• Proof of Stake (PoS):
• Proof of Burn (PoB):
• Proof of Capacity:
• Mining, in the context of
blockchain technology, is
the process of adding
transactions to the large
distributed public ledger
of existing transactions,
known as the blockchain.
• Bitcoin mining rewards
people who run mining
operations with more
bitcoins.
Mining
Mining is NOT about creating new bitcoins. Mining is the
mechanism that allows the blockchain to be a decencentralized
security.
What is
Mining?

It secures the bitcoin system and enable a system without a central


authority
Types of Mining
Prevention of Hacking
Fork
The permission less model

• Works in an open environment and over a large


network of participants
• The users do not need to know the identity of the
peers and hence the users do not need to revel
their identity to others
• Good for financial application like banking using
crypto currency
Privacy and security

• The system is tamper proof -it is extremely hard


to make a change in the blockchain
• tampering the system becomes harder as the
chain grows
• for bitcoin the transactions are pseuso
anonymous
• transactions are sent to public key address
cryptographically generated address computed
by the wallet applications.
Peer addresses

• Addresses in bitcoin is synonymous to an Account


in a bank
• the wallet listens for transactions addressed to an
account
• Encrypts the transactions by the public key of the
target address
• Only the target node can decrypt the transaction
and accept it
The permissioned (Private ) Model
Blockchain 2.0

• Blockchain can be applied just beyond


cryptocurrency
• The underlying notions of consensus, security and
distributed replicated ledgers can be applied to even
closed or permissioned network settings
• Most enterprise use cases only involve a few ten to
few hundred known participants
Permissioned Blockchain Applications

• Provenance tracking: Tracking the origin and movement of high value


items across a supply chain such as luxury goods
pharmaceuticals ,cosmetics electronics
• When the high value item is created a corresponding digital token is
issued by a trusted entity which acts to authenticate its point of origin
• Every time the physical item changes hands the digital token is moved
in parallel--> he real world chain of custody is precisely mirrored by a
chain of transactions on the blockchain
• the token is acting as a virtual certificate of authenticity which is far
harder to steal or forge than a piece of paper
• The InterPlanetary File System is
a protocol and peer-to-peer
network for storing and sharing
data in a distributed file system.
• IPFS uses content-addressing to
uniquely identify each file in a
global namespace connecting all
computing devices
• Each file and all of the blocks within it are
given a unique fingerprint based on a
How IPFS cryptographic hash
• IPFS removes duplicates across the network
works and track version history for every file
• Each network node stores only the content it
is interested in and some indexing
information that helps to figure out who us
etoring what
• when looking up file, you ask the network to
find nodes storing the content behind a
unique hash
• Every file can be found by human readable
names using a decentralized naming system
called IPNS

You might also like