0% found this document useful (0 votes)
33 views45 pages

Fundamentals of Blockchain Technology Module 1 Blockchain Basics

Uploaded by

vbharathi.se
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views45 pages

Fundamentals of Blockchain Technology Module 1 Blockchain Basics

Uploaded by

vbharathi.se
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 45

Fundamentals of Blockchain Technology

Module 1

Blockchain Basics

A. Chandra Shaker
Assistant Professor

July 30, 2024 Module 1 1


Fundamentals of Blockchain Technology

Module 1: Blockchain Basics


• Introduction to Blockchain
• The Double-Spend Problem
• Byzantine Generals’ Computing Problem
• Public Key Cryptography
• Hashing
• Distributed Systems
• Distributed Consensus

July 30, 2024 Module 1 2


Fundamentals of Blockchain Technology

Introduction to Blockchain

What is Blockchain?

July 30, 2024 Module 1 3


Fundamentals of Blockchain Technology

What is a Blockchain?

It was a technology created to support the


famous cryptocurrency, Bitcoin.

Blockchain uses a peer-to-peer network design


and cryptographic functions to create a
distributed ledger of immutable, or tamperproof,
transactions.
July 30, 2024 Module 1 4
Fundamentals of Blockchain Technology

Why do we need Blockchain?

July 30, 2024 Module 1 5


Fundamentals of Blockchain Technology

Why do we need Blockchain?

Blockchain enables peer-to-peer transfer of


digital assets without any intermediaries, unlike
traditional methods.

July 30, 2024 Module 1 6


Fundamentals of Blockchain Technology

Blockchain itself has taken a life of its own and


permeated a broad range of applications across
many industries, including finance, healthcare,
government, manufacturing, and distribution.

July 30, 2024 Module 1 7


Fundamentals of Blockchain Technology

Blockchain paved the way to innovate and transform a


wide range of applications:
• Goods transfer, for example, supply chain.
• Digital media transfer, for example, the sale of art.
• Remote services delivery, for example, travel and
tourism.
• Platform for decentralized business logic, for
example, moving computing to data sources.
• Distributed intelligence, for example, education
credentialing.

July 30, 2024 Module 1 8


Fundamentals of Blockchain Technology

Additional applications of blockchain include:


• Distributed resources, for example, power generation
and distribution.
• Crowd funding, for example, startup fundraising.
• Crowd operations, for example, electronic voting.
• Identity management, for example, one ID for all
your life's functions.
• Government public records and open governing.

July 30, 2024 Module 1 9


Fundamentals of Blockchain Technology

• Moreover, blockchain can enable an inclusive


economy.
• It can enable a person in a remote corner of the
world to take part in a democratic process.
• Opportunities for innovative applications are
endless.
• There is more need for critical thinkers, designers,
and developers who can envision and create newer
application models on blockchain to benefit the
world.
July 30, 2024 Module 1 10
Fundamentals of Blockchain Technology

The Double-Spend Problem

• Double-spending is a problem that arises when


transacting digital currency that involves the same
tender being spent multiple times.
• The primary reason for double-spending is that
digital currency can be very easily reproduced.
• There are primarily two ways to combat double-
spending – central clearing counterparty and
blockchain.

July 30, 2024 Module 1 11


Fundamentals of Blockchain Technology

• The challenges of implementing a centralized


authority are the creation and maintenance costs.
• Assigning a bank as a centralized authority will
result in commission cuts on digital currency
transactions.
• It can be expensive, especially in cases where more
than two agents and/or banks are involved in the
transfer, processing, and authenticating of funds
being transferred.

July 30, 2024 Module 1 12


Fundamentals of Blockchain Technology

• Decentralized digital currencies, such as Bitcoin,


utilize consensus mechanisms that verify
transactions with certainty.
• The consensus mechanisms are alternatively known
as proof-to-work. Practically, the mechanism ensures
that each participant node verifies the transaction.
• Therefore, Bitcoin comes with a historical public
ledger facilitated through blockchain that provides
empirical verification of property rights and transfer.

July 30, 2024 Module 1 13


Fundamentals of Blockchain Technology

• In order for a market participant to fraudulently


double spend, they need to use a significant amount
of computing power to eliminate the previous blocks
in the chain, and effectively double-spend the
transaction.
• Additionally, as time passes, confirmations of the
block exponentially grow, further protecting the
integrity of the transaction.

July 30, 2024 Module 1 14


Fundamentals of Blockchain Technology

Byzantine Generals’ Computing Problem or


Byzantine Generals’ Problem

• Several divisions of the Byzantine army are camped


outside an enemy city, each division commanded by
its own general.
• The generals can communicate with one another
only by messenger.
• After observing the enemy, they must decide upon a
common plan of action.

July 30, 2024 Module 1 15


Fundamentals of Blockchain Technology

July 30, 2024 Module 1 16


Fundamentals of Blockchain Technology

• Generals should reach a ATTACK


!
consensus on the plan.
• It could be an ATTACK.
ATTACK
!
ATTACK
!

ATTACK
!

July 30, 2024 Module 1 17


Fundamentals of Blockchain Technology

• Generals should reach a


consensus on the plan. RETREAT
!
• Or RETREAT.

RETREAT RETREAT
! !

RETREAT
!

July 30, 2024 Module 1 18


Fundamentals of Blockchain Technology

• But there might be


traitors. ATTACK
!
• All loyal generals should
reach a consensus.

ATTACK
ATTACK
!
!

ATTACK
!

July 30, 2024 Module 1 19


Fundamentals of Blockchain Technology

• But traitors can act ATTACK


!
arbitrarily.
• All loyal generals should
reach a consensus.
ATTACK
!
ATTACK
!

Let’s RETREAT!
ATTACK
!

July 30, 2024 Module 1 20


Fundamentals of Blockchain Technology

Opps!

???
Opps!

Haha!

July 30, 2024 Module 1 21


Fundamentals of Blockchain Technology

Simplified Version of Byzantine Generals’ Problem

• A commanding general sends an order to his n-1


lieutenant generals such that:
IC1. All loyal lieutenants obey the same order.
(Consistency/Agreement)
IC2. If the commanding general is loyal, then every
loyal lieutenant obeys the order he sends.
(Validity)

ICs - Interactive consistency conditions


July 30, 2024 Module 1 22
Fundamentals of Blockchain Technology

Public Key Cryptography

• Two techniques are predominantly used for securing


the blockchain and for efficient validation and
verification are:
 Hashing, and
 Asymmetric key encryption.

• These techniques depend on several complex proven


algorithms.

July 30, 2024 Module 1 23


Fundamentals of Blockchain Technology

• Blockchains have decentralized network participants,


and are not necessarily known to each other.

• Credentials cannot be checked by conventional


means such as verifying who you are with your
identity card.

• Participants can join and leave the chain as they


wish.

• They operate beyond the boundaries of trust.


July 30, 2024 Module 1 24
Fundamentals of Blockchain Technology

• In this context
 How to identify the peer participants?
 How to authorize and authenticate the
transactions?
 How to detect forged or faulty transactions?

• These things can be done using Public Key


Cryptography algorithm.

July 30, 2024 Module 1 25


Fundamentals of Blockchain Technology

• Let us start with a simple symmetric key encryption.

• The same key is used for encryption and decryption,


so it is called a symmetric key.

• For example, Ceasar encryption is the simplest one


with alphabets of a message that are shifted by a
fixed number, and this number is called the Key.

July 30, 2024 Blockchain Technology 26


Fundamentals of Blockchain Technology

Image Source: Coursera


July 30, 2024 Module 1 27
Fundamentals of Blockchain Technology

• Issues with Symmetric-Key Encryption


 Easy to derive the secret key from the encrypted data.
 How do you pass the key to the participant
transacting?

• Public Key Cryptography addresses these issues:


• Instead of a single secret key, it employs two different
keys (public and private keys) that take care of both
the issues of symmetric key encryption.
• Public-key is published, private key is kept safe and
locked. Typically using a passphrase.

July 30, 2024 Module 1 28


Fundamentals of Blockchain Technology

• The public-private key pair has the unique quality


that even though data is encrypted with the private
key, it can be decrypted with the corresponding
public key and vice versa.

• Let, lowercase i and uppercase I be the private-


public key pair for a participant in India.
• Let lowercase n and uppercase N be the pair of keys
for the participant in Nepal.

July 30, 2024 Module 1 29


Fundamentals of Blockchain Technology

• Let's say a participant in India wants to transact with


the participant in Nepal. Instead of sending just a
simple message, a participant in India will send a
transaction data encrypted by India's private key, and
then encrypted by Nepal's public key.
• Participant in Nepal will first decrypt the data using
its own private key, then use India's public key to
decrypt assigned transaction data.
• This ensures that only participant in Nepal can
decrypt and receive the data, and that only India
could have sent the data.
July 30, 2024 Module 1 30
Fundamentals of Blockchain Technology

• A popular implementation of public key, private key


is the Rivest Shamir Adleman (RSA) algorithm.
• Common application of RSA is password-less user
authentication.
• Though RSA is very commonly used in many
applications, blockchains need a more efficient and
stronger algorithm.
• Efficiency is a critical requirement since public key
pair is frequently used in many different operations
in blockchain protocol.

July 30, 2024 Module 1 31


Fundamentals of Blockchain Technology

• Elliptic Curve Cryptography, ECC family of


algorithms is used in the Bitcoin as well as Ethereum
blockchain for generating the key pair.
• ECC is stronger than RSA for a given number of
bits. 256-bit ECC key pair is equal in strength to
about 3072 bits of RSA key pair.

July 30, 2024 Module 1 32


Fundamentals of Blockchain Technology

Hashing

• A hash function or hashing transforms and maps an


arbitrary length of input data value to a unique fixed
length value.
• Input data can be a document, tree data, or block
data.
• Even a slight difference in the input data would
produce a totally different hash output value.

July 30, 2024 Module 1 33


Fundamentals of Blockchain Technology

Image Source: Coursera


July 30, 2024 Module 1 34
Fundamentals of Blockchain Technology

• The following are two basic requirements of a hash


function.
• Algorithm should be a one-way function
• And, it should be collision-free

• The first requirement is to make sure that no one can


derive the original items hashed from the hash value.
• The second requirement is to make sure that the hash
value uniquely represents the original items hashed.
There should be an extremely low probability that
two different datasets map onto the same hash value.

July 30, 2024 Module 1 35


Fundamentals of Blockchain Technology

• These requirements are achieved by choosing a


strong algorithm such as secure hash, and by using
an appropriately large number of bits in the hash
value.
• Most common hash size now is 256 bits and the
common functions are SHA-3, SHA-256 and
Keccak.
• A 256-bit hash value space is very large.
• 2^256 possible combinations of values.
• Approximately 10^77.

July 30, 2024 Module 1 36


Fundamentals of Blockchain Technology

• Two different approaches for hashing based on how


the constituent elements are organized.
 Simple hash
 Merkle tree hash

• In the simple hash approach, all the data items are


linearly arranged and hashed.

• In a Merkle tree-structured approach, the data is at


the leaf nodes of the tree, leaves are pairwise hash to
arrive at the same hash value as a simple hash.
July 30, 2024 Module 1 37
Fundamentals of Blockchain Technology

• We can illustrate simple hashing with ADD as a hash


function. We use the data 10, 4, 6, 21 and 19 and
ADD as a hash function.

Image Source: Coursera


• Actual hashing functions are quite complex and are
variations of SHA-3, and the data values are much
larger, mainly 256 to 512 bit values.
July 30, 2024 Module 1 38
Fundamentals of Blockchain Technology

• Considering the same example with Merkle tree


hashing.

Image Source: Coursera


July 30, 2024 Module 1 39
Fundamentals of Blockchain Technology

• When is a simple hash used?


• Use simple hash when:
• Fixed number of items to be hashed (e.g., block
header)
• Verifying composite block integrity (not individual
item integrity).
• When is a tree-structured hash used?
• Use Merkle tree hash when:
• When number of items differ from block to block,
• Transaction hash
• State hash
• Receipt hash
July 30, 2024 Module 1 40
Fundamentals of Blockchain Technology

Distributed Systems

• Let us understand centralized versus decentralized


network using a common scenario.
• Consider a scenario where customer wants to buy an
item using credit card. There are lot of intermediaries
involved in accomplishing this task.
Customer  Credit card agency  Customer bank  Credit
cards bank  Exchange  Merchant's bank  Merchant
• This is an example of a centralized system.

July 30, 2024 Module 1 41


Fundamentals of Blockchain Technology

• Now compare the same with a system where peers


can transact directly with each other irrespective of
where they are located.
• Functions of the intermediaries are shifted to the
periphery to the peer participant in the blockchain
infrastructure.
• Peers are not necessarily known to each other.
• This is a decentralized system.
• Public (decentralized) blockchains are built as
distributed systems and, so they do not rely on a
central authority.
July 30, 2024 Module 1 42
Fundamentals of Blockchain Technology

• How do we establish trust among the peers in such a


decentralized system?
• By having a process to validate, verify, and confirm
transactions.
• Record the transaction in a distributed ledger of blocks,
create a tamper-proof record of blocks, chain of blocks,
and implement a consensus protocol for agreement on the
block to be added to the chain.
• So, validation, verification, consensus, and immutable
recording lead to the trust and security of the blockchain.

July 30, 2024 Module 1 43


Fundamentals of Blockchain Technology

Distributed Consensus

• Distributed consensus ensures a consensus of data


among nodes in a distributed system reaches an
agreement on a proposal.
• The distributed nodes need to agree on the validity
of transactions, where consensus algorithm come
into play.
• A consensus algorithm may be defined as the
mechanism through which a blockchain network
reach consensus.

July 30, 2024 Module 1 44


Fundamentals of Blockchain Technology

• Consensus algorithm assures that the protocol rules


are being followed and guarantee that all
transactions occur in a trustless way, so the coins are
only able to be spent once.

July 30, 2024 Module 1 45

You might also like