0% found this document useful (0 votes)
124 views27 pages

BCT - Unit-2

Uploaded by

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

BCT - Unit-2

Uploaded by

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

19ITC12 - BLOCKCHAIN TECHNOLOGY

Unit-II: Distributed Computing And


Cryptography Basics
Introduction- Distributed Computing- issues in Distributed Computing-
Atomic Broadcast, Consensus, Byzantine Models of fault tolerance- Hash
functions, Puzzle friendly Hash, Collision resistant hash, digital signatures,
public key crypto, verifiable random functions, Zero-knowledge system.
---------------------------------------------------------------------------------------------------------------------------

Introduction- Distributed Computing


Distributed computing is the method of making multiple computers work
together to solve a common problem. It makes a computer network appear as
a powerful single computer that provides large-scale resources to deal with
complex challenges.
Distributed computing is one of the fundamental computing principles that drive
the Blockchain technology. In the simplest terms possible, Distributed
Computing is merely a network where different computers come together to
form one system.
The systems can be physically connected to form a local network or they can be
geographically dispersed and connected online. It is an old principle that has
been fine-tuned over the years to suit the requirements.
For example, distributed computing can encrypt large volumes of data;
solve physics and chemical equations with many variables; and render high-
quality, three-dimensional video animation. Distributed systems, distributed
programming, and distributed algorithms are some other terms that all refer to
distributed computing.

1
Components of Distributed Computing

There are several key components of a Distributed Computing System :


● Devices or Systems: The devices or systems in a distributed system have
their own processing capabilities and may also store and manage their own
data.
● Network: The network connects the devices or systems in the distributed
system, allowing them to communicate and exchange data.
● Resource Management: Distributed systems often have some type of
resource management system in place to allocate and manage shared
resources such as computing power, storage, and networking.
Advantages of Distributed Computing :
Distributed systems bring many advantages over single system computing. The
following are some of them.
Scalability
Distributed systems can grow with your workload and requirements. You can
add new nodes, that is, more computing devices, to the distributed computing
network when they are needed.

Availability
Your distributed computing system will not crash if one of the computers goes
down. The design shows fault tolerance because it can continue to operate even
if individual computers fail.
Consistency
Computers in a distributed system share information and duplicate data between
them, but the system automatically manages data consistency across all the
different computers. Thus, you get the benefit of fault tolerance without

2
compromising data consistency.
Transparency
Distributed computing systems provide logical separation between the user and
the physical devices. You can interact with the system as if it is a single
computer without worrying about the setup and configuration of individual
machines. You can have different hardware, middleware, software, and
operating systems that work together to make your system function smoothly.
Efficiency
Distributed systems offer faster performance with optimum resource use of the
underlying hardware. As a result, you can manage any workload without
worrying about system failure due to volume spikes or underuse of expensive
hardware.
Disadvantages of Distributed Computing :
Complexity
Distributed systems can be more complex than centralized systems, as they
involve multiple devices or systems that need to be coordinated and managed.
Security
It can be more challenging to secure a distributed system, as security measures
must be implemented on each device or system to ensure the security of the
entire system.
Performance
Distributed systems may not offer the same level of performance as centralized
systems, as processing and data storage is distributed across multiple devices or
systems.
Distributed Computing use cases:
Distributed computing is everywhere today. Mobile and web applications are
examples of distributed computing because several machines work together in
the backend for the application to give you the correct information.
The Following distributed Computing applications are:
1. Healthcare and life sciences
Healthcare and life sciences use distributed computing to model and simulate
complex life science data. Image analysis, medical drug research, and gene
structure analysis all become faster with distributed systems.
2. Engineering research
Engineers can simulate complex physics and mechanics concepts on distributed
systems. They use this research to improve product design, build complex
structures, and design faster vehicles.
3. Financial services
Financial services firms use distributed systems to perform high-speed
economic simulations that assess portfolio risks, predict market movements, and
support financial decision-making.

3
4. Energy and environment
Energy companies need to analyze large volumes of data to improve operations
and transition to sustainable and climate-friendly solutions. They use distributed
systems to analyze high-volume data streams from a vast network of sensors
and other intelligent devices.
Distributed Computing Architecture
Client-Server Architecture
Client-server is the most common method of software organization on a
distributed system.
The functions are separated into two categories: clients and servers.
Client
An Entity which communicates with the server in order to complete their task.
They are usually connected to the server on the Internet.
Server
An Entity that is responsible to offer the services to the client, server provides
services like data processing, storage, deploying applications, etc.

How does distributed computing work?


Distributed computing works by computers passing messages to each other
within the distributed systems architecture. Communication protocols or rules
create a dependency between the components of the distributed system. This
interdependence is called coupling, and there are two main types of coupling.
Loose coupling
In loose coupling, components are weakly connected so that changes to one
component do not affect the other. For example, client and server computers
can be loosely coupled by time. Messages from the client are added to a server
queue, and the client can continue to perform other functions until the server
responds to its message.
Tight coupling

4
High-performing distributed systems often use tight coupling. Fast local area
networks typically connect several computers, which creates a cluster. In cluster
computing, each computer is setto perform the same task. Central control
systems, called clustering middleware, control and schedule the tasks and
coordinate communication between the different computers.
Issues in Distributed Computing
● The lack of global knowledge
● Naming
● Scalability
● Compatibility
● Process synchronization (requires global knowledge)
● Resource management (requires global knowledge)
● Security
● Fault tolerance
● Error recovery

Lack of Global Knowledge


● Communication delays are at the core of the problem
● Information may become false before it can be acted upon

Naming
● Named objects: computers, users, files, printers, services
● Namespace must be large
● Unique (or at least unambiguous) names are needed
● Logical to physical mapping needed

Scalability
● How large is the system designed for?
● How does increasing number of hosts affect overhead?
● broadcasting primitives, directories stored at every computer -- these
design options will not work for large systems.

Compatibility
● Binary level: same architecture (object code)
● Execution level: same source code can be compiled and executed (source
code).
● Protocol level: only requires all system components to support a common
set of protocols.

5
Process synchronization
● Test-and-set instruction won't work.
● Need all new synchronization mechanisms for distributed systems.

Resource Management
● Data migration: data are brought to the location that needs them.
o Distributed filesystem (file migration)
o Distributed shared memory (page migration)
● Computation migration: the computation migrates to another location.

o Remote procedure call: computation is done at the remote machine.


o Processes migration: processes are transferred to other processors.

Security
● Authetication: guaranteeing that an entity is what it claims to be.
● Authorization: deciding what privileges an entity has and making only
those privileges available.

Atomic Broadcast
Atomic Broadcast explicitly talk about sending multiple messages in an
agreed-upon order. Atomic broadcasts are an important distributed computing
primitive.
In fault-tolerant distributed computing, an atomic broadcast or total order
broadcast is a broadcast where all correct processes in a system of multiple
processes receive the same set of messages in the same order; that is, the
same sequence of messages.
Atomic Broadcast is a communication primitive that ensures total ordering
of messages in distributed systems.
This primitive is particularly useful to maintain the consistency of replicated
information despite concurrency and failures.

Atomic Broadcast Structure :

6
Atomic broadcast is a group communication primitive to order messages
across a set of distributed processes.

Properties of Atomic Broadcast :


The problem of atomic broadcast is defined in a synchronous system model as a
broadcast primitive which satisfies The Following Three Properties:

1. Atomicity
2. Order
3. Termination.

7
Consensus
It refers to an agreement on any subject by a group of participants.
Fundamental problem in distributed computing and multi-agent systems is to
achieve overall system reliability in the presence of a number of faulty
processes.
This often requires coordinating processes to reach consensus, or agree on some
data value that is needed during computation.
Applications of consensus include agreeing on what transactions to commit to a
database in which order, state machine replication, and atomic broadcasts.
Consensus means achieving a state of a decision on which all network
participants agree.

The purpose of the Consensus mechanism in a decentralized network is to allow


a group of independent nodes to distribute the right to update as well as validate
the change in the network equally. Therefore, decide on the next update of a
decentralized network.”
Real-world applications often requiring consensus include:
1. Cloud computing
2. Clock synchronization

8
3. PageRank
4. Smart power grids
5. State Estimation
A Consensusproperties :
1.Termination

Every correct process decides some value.

2. Integrity

If all the correct processes proposed the same value , then any correct
process must decide .

3. Agreement

Every correct process must agree on the same value.


Types of consensus algorithms :
1. Proof of Work (PoW)
● The PoW algorithm is one of the oldest types of consensus algorithms.
● the central idea of PoW is to have nodes solve complex mathematical
puzzles and make as many guesses as possible in the fastest possible time.

2. Delayed Proof of Work (DPoW)


Delayed Proof of Work (DPoW) is a modified version of the PoW consensus
algorithm.
In this consensus method, the blockchain network takes periodic snapshots of
itself which are then written into a block on the network as part of a notarization
process. This process helps to create a backup of the entire system on the
blockchain.

3. Proof of Stake (PoS)


PoS requires little specialized hardware or software resources to mine
cryptocurrencies since it doesn't involve solving complex computational
problems.

4. Delegated Proof of Stake (DPoS)


Delegated Proof of Stake (DPoS) isbased on a voting system in which delegates
or witnesses vote for their favorite validators to achieve consensus during the
generation and validation of blocks.

5. Proof of Authority (PoA)

9
a PoA-based blockchain network is secured by a limited number of validating
nodes. These nodes are trusted parties that are arbitrarily chosen and pre-
approved to verify blocks and transactions.

Byzantine Models Of Fault Tolerance


Byzantine Fault Tolerance(BFT) is the feature of a distributed network to
reach consensus(agreement on the same value) even when some of the nodes in
the network fail to respond or respond with incorrect information.
Byzantine Fault Tolerance (BFT) is a consensus approach that resists a
system to get into the Byzantine Generals’ problem. It also means the system
should stay entire even if one of the nodes (or general) fails.

The Byzantine Fault Tolerance was developed as inspiration in order to address


the Byzantine General’s Problem. The Byzantine General’s Problem, a logical
thought experiment where multiple generals must attack a city, is where the idea
for BFT originated.
● Byzantine Fault Tolerance is one of the core characteristics of developing
trustworthy blockchain rules or features is tolerance.
● When two-thirds of the network can agree or reach a consensus and the
system still continues to operate properly, it is said to have BFT.
● Blockchain networks’ most popular consensus protocols, such as proof-of-
work, proof-of-stake, and proof-of-authority, all have some BFT
characteristics.
● In order to create a decentralized network, the BFT is essential.

Byzantine General’s Problem in a Distributed Computing


● In the Byzantine agreement issue, an arbitrary processor initializes a single

10
value that must be agreed upon, and all nonfaulty processes must agree on
that value.
● The Byzantine army’s position can be seen in computer networks.
● The divisions can be viewed as computer nodes in the network, and the
commanders as programs running a ledger that records transactions and
events in the order that they occur.
● The ledgers are the same for all systems, and if any of them is changed, the
other ledgers are updated as well if the changes are shown to be true, so all
distributed ledgers should be in agreement.
Types of Byzantine Failures:
There are two categories of failures that are considered. One is fail-stop(in
which the node fails and stops operating) and other is arbitrary-node
failure. Some of the arbitrary node failures are given below :
● Failure to return a result
● Respond with an incorrect result
● Respond with a deliberately misleading result
● Respond with a different result to different parts of the system

Hash Functions
● Hash functions are mathematical functions that transform or "map" a
given set of data into a bit string of fixed size, also known as the "hash
value."
● Hash functions are used in cryptography and have variable levels of
complexity and difficulty.
● Hash functions are used for cryptocurrency, password security, and
message security.
● Hash functions are extremely useful and appear in almost all information
security applications.
● A hash function is a mathematical function that converts a numerical
input value into another compressed numerical value. The input to the
hash function is of arbitrary length but output is always of fixed length.

11
Applications of Hash Functions :
There are two direct applications of hash function based on its cryptographic
properties :

1.Password Storage
● Hash functions provide protection to password storage.
● The Password file consists of a table of pairs which are in the form (user id,
h(P)).

2.Data Integrity Check


● Data integrity check is a most common application of the hash functions. It
is used to generate the checksums on data files. This application provides
assurance to the user about correctness of the data.

Features of Hash Functions


The typical features of hash functions are −

1. Fixed Length Output (Hash Value)


● Hash function covers data of arbitrary length to a fixed length. This process
is often referred to as hashing the data.

2. Efficiency of Operation
● Generally for any hash function h with input x, computation of h(x) is a fast
operation.
● Computationally hash functions are much faster than a symmetric
encryption.

Properties of Hash Functions


In order to be an effective cryptographic tool, the hash function is desired to
possess following properties −
Pre-Image Resistance
● This property means that it should be computationally hard to reverse a hash
function.
Second Pre-Image Resistance
● This property means given an input and its hash, it should be hard to find a
different input with the same hash.
Collision Resistance

12
● This property means it should be hard to find two different inputs of any
length that result in the same hash. This property is also referred to as
collision free hash function.

Types of Hash functions


There are many hash functions that use numeric or alphanumeric
keys.

1. Division Method.
2. Mid Square Method.
3. Folding Method.
4. Multiplication Method.

Puzzle Friendly Hash


A hash function H is said to be puzzle friendly if for every possible n-bit
output value y, if k is chosen from a distribution with high min-
information, then it is infeasible to find x such that H(k || x) = y, in time
significantly less than 2n.
Uses of Puzzle Friendly Hash
Some uses of Puzzlefriendly hashfunctions in cryptography are as follows:

● Digital signatures: To sign a message, we first take a cryptographic hash


of the message and then encrypt it with the receiver's public key.
● Storing passwords in a database: Hashes of passwords are used instead
of storing in plain text so that even if the database is compromised, the

13
hacker cannot get access to the user's passwords as cryptographic hash
functions are pre-image resistant.
● Data integrity: Take a hash of all our files before leaving a system and
then recompute the hash to check if the files have been changed or not.

Bitcoin puzzles
Bitcoin uses the transaction data, and ‘chains’ the previous block’s hash value
as a starting input for the next block’s. Miners then race to tack on massive
random numbers until they find one that produces a hash that matches a specific
pattern with a certain level of difficulty.

The blockchain is protected from modification because the hash-puzzle takes


(on average) about a one-hundred-billion-billion attempts to find it.

How Puzzle Friendly Hash can work


In order to solve a cryptogram puzzle, you must crack the code and figure out
the hidden message. The code is a simple substitution cipher where each letter
in a puzzle (called a cryptoletter) represents a different letter of the alphabet in
the solution. This holds true for every instance where a cryptoletter appears.

Cryptographic Hash Puzzle


A cryptographic hash function is a mathematical function used in
cryptography.
Typical hash functions take inputs of variable lengths to return outputs of a
fixed length.
A cryptographic hash function combines the message-passing capabilities of
hash functions with security properties.

Computational Puzzle
A computational puzzle is a moderately hard problem, the answer of which
can be computed within a reasonable time and verified efficiently.

Collision Resistant Hash


Collision Resistance is a property of cryptographic hash functions: a hash
function H is collision-resistant if it is hard to find two inputs that hash to the
same output; that is, two inputs a and b where a ≠ b but H(a) = H(b).
Example :
An example where weak collision resistance is typically enough is storing
passwords as hashes in a database. In this case, only those who created the

14
password know the input that generated the hash.

Types of HashCollision Algorithm:


There are different types of probing that take place when a hash collision
happens and this method is implemented.
Some types of probing are :
1. Linear Probing
2. Double Hashing
3. Quadratic Probing.

Collision Resistance
Hashing mechanisms resistant to collisions is a challenge primarily related to
the design of the hashing function.

1.Weak Collision Resistance

Weak collision resistance is: given an input X and a hashing function H(), it is
very difficult to find another input X’ on which H(X) = H(X’).

2.Strong Collision Resistance

strong collision resistance is: given a hashing function H() and two arbitrary
inputs X and Y, there exists an absolute minimum chance of H(X) being equal

15
to H(Y).

Digital Signatures
● A Digital Signature is a mathematical technique used to validate the
authenticity and integrity of a message, software or digital document.

● A digital signature is an electronic, encrypted, stamp of authentication


on digital information such as email messages, macros, or electronic
documents. A signature confirms that the information originated from the
signer and has not been altered.

● Digital signatures are a standard element of most cryptographic


protocol suites, and are commonly used for software distribution, financial
transactions, contract management software, and in other cases where it is
important to detect forgery

Digital Signature Example


To get a better understanding of the process, let’s look at a Digital Signature
example step-by-step.

Keys in Digital Signature


A digital signature has two kinds of keys, a private key and a public key, to
efficiently verify the security of the message’s content.

16
1. Public key

When encryption is sent to the receiving computer system by the sender’s


computer to allow the person on the receiving computer to have free access to
the data being sent is called a public key. However, to access the data, the
person present on the receiving end of the computer is required to use the public
key from the sender’s computer and their private key.

2. Private key

A private key is significantly different. It enables a computer system to encrypt


the contents of a message before it even touches the network as it has a secret
code.

The sender’s and the receiver’s computers must have this private key installed
for them to have access to the important data or to connect on the same network.
Essentially, it is a message written in coded language that only a computer
system has a private key. Hence it is incredibly more secure.

17
● A Digital Signature, which should not be confused with a digital certificate,
is a mathematical technique used to validate the authenticity and
integrity of a message, software or a digital document.
● A Digital Signature, as opposed to a traditional signature, is not a name
but two “keys” or sequences of separated characters. It applies
cryptographic measures to the content of a message or document in order to
show the following to the message’s recipient:
● That the sender of the message is real (authentication);
● That the sender cannot deny that they sent the message (non-repudiation);
● That the message has not been altered since it was sent (integrity).

How do Digital Signatures work?


Digital signatures are based on public-key cryptography, also known as
asymmetric cryptography.

1.Creation of two keys that are mathematically linked: an algorithm provides a


private key together with its corresponding public key.
2.Signature: this algorithm produces a signature when a private key and the
message that is being signed is received.
3.Verification: this algorithm checks the authenticity of the message verifying it
together with the signature and the public key.

18
A Digital Signature scheme typically consists of Three Algorithms:

1. A key generation algorithm : It selects a private key uniformly at


random from a set of possible private keys. The algorithm outputs the private
key and a corresponding public key.
2. A signing algorithm: It given a message and a private key, produces a
signature.
3. A signature verifying algorithm: It given the message, public key and
signature, either accepts or rejects the message's claim to authenticity.
Importance of Digital Signatures

The digital signature, which uses public-key cryptography, is said to be the most
important and useful way to get information security among all the options of
cryptographic primitives.

They are the most secure method of electronic signatures and are extremely
trustworthy, which makes them the best option for legal contracts and
documents. It is extremely difficult to forge or manipulate the information
present in the digital signature

19
Applications of Digital Signatures

1. Confidentiality refers to certain rules and guidelines usually executed


under confidentiality agreements which ensure that the information is restricted
to certain people or places.
2. Data integrity refers to maintaining and making sure that the data stays
accurate and consistent over its entire life cycle.
3. Authentication is the process of making sure that the piece of data being
claimed by the user belongs to it.
4. Non-repudiation refers to ability to make sure that a person or a party
associated with a contract or a communication cannot deny the authenticity of
their signature over their document or the sending of a message.
Cryptography
Cryptography is a method of protecting information and communications
through the use of codes.
The information is intended can read and process it.
The prefix "crypt-" means "hidden" or "vault" -- and the suffix "-graphy" stands
for "writing."
Cryptography refers to secure information and communication techniques
derived from mathematical concepts and a set of rule-based calculations called
algorithms.
Cryptography Techniques
Cryptography is closely related to the disciplines of cryptology and
cryptanalysis.
It includes techniques such as microdots, merging words with images, and other
ways to hide information in storage or transit.
Cryptography is used to convert Plaintext into Ciphertext is known as
Encryption. then back again Ciphertext into Plaintext is known as Decryption.
Encryption : Known to Unknown
Decryption : Unknown to Known

20
Objectives of Cryptography
Cryptography concerns with the following Four objectives:
Confidentiality: the information cannot be understood by anyone for whom it
was unintended.
Integrity: the information cannot be altered in storage or transit between sender
and intended receiver without the alteration being detected.
Non-repudiation: the creator/sender of the information cannot deny at a later
stage his or her intentions in the creation or transmission of the information.
Authentication: the sender and receiver can confirm each other's identity and
the origin/destination of the information.
Types of Cryptography
1. Single-key or Symmetric-key Cryptography.
2. Public-key or Asymmetric-key Cryptography.
1. Single-key or Symmetric-key Cryptography :
Symmetric cryptography is based on the use of just one key is used to both
Encrypt and Decrypt the messages ( only Private Key or Secret Key )
2. Public-key or Asymmetric-key Cryptography :
Asymmetric cryptography, also known as public-key cryptography, Here Two
keys are used to Encrypt and Decrypt the messages (Both Private and Public
Key)
Single-key or Symmetric-key Cryptography

21
Public-key or Asymmetric-key Cryptography

Verifiable Random Functions (VRF)


Verifiable Random Function(VRF) is a public-key pseudorandom function
that provides proofs that its outputs were calculated correctly.
The owner of the secret key can compute the function value as well as an

22
associated proof for any input value.
A verifiable random function is a cryptographic function that takes a series of
inputs, computes them, and produces a pseudorandom output, along with a
proof of authenticity that can be verified by anyone.
How It Works
They execute a function (the VRF) that takes as input the following:

● The "secret key", a key specifically made for these die rolls.
● An epoch randomness value, which is the hash of VRF values from the
blocks in the epoch before last (N-2), so past randomness affects the
current pending randomness (N).
● The slot number.

Applications of VRF

1. Internet security—VRF is used to help secure domain name system


(DNS) messages.

2. Zero-knowledge technology—VRF is used in the protocol design for


zero-knowledge proofs and zero-knowledge databases.

3. Non-interactive lottery systems—VRF enables provably fair and


efficient outcomes for lotteries.

4. Verifiable transaction escrow schemes—VRF can help support


automated escrow services that preserve user anonymity.

5. Blockchains and smart contracts—VRF has become an important part


of decentralized protocols and applications.

23
Zero-Knowledge System
In cryptography, aZero-Knowledge System or Zero-Knowledge Proofis a
method by which one party can prove to another party that a given statement is
true while the prover avoids conveying any additional information apart from
the fact that the statement is indeed true.
Why We Need Zero-Knowledge Proofs?
Zero-knowledge proofs represented a breakthrough in applied cryptography, as
they promised to improve security of information for individuals.

24
Properties of Zero Knowledge System

1. Zero-Knowledge –
If the statement is true, the verifier will not know that the statement or was.
Here statement can be an absolute value or an algorithm.
2. Completeness –
If the statement is true then an honest verifier can be convinced eventually.
3. Soundness –
If the prover is dishonest, they can’t convince the verifier of the soundness of
the proof.

Types of Zero Knowledge System

1. Interactive Zero Knowledge System


It requires the verifier to constantly ask a series of questions about the
“knowledge” the prover possess.
2. Non-Interactive Zero Knowledge System
Non-interactive Zero-Knowledge System do not require an interactive process,
avoiding the possibility of collusion.
It requires picking a hash function to randomly pick the challenge by the
verifier.

25
Algorithms in Zero Knowledge System
The Following Three Algorithms are :
1. Key Generator
A key generator establishes a parameter to generate a key pair.
2. Prover
The prover gets proving key and needs to prove his knowledge. He will receive
and verify the private key and then shall forward the statement.
3. Verifier
The verifier will get the input from the prover and will validate the statement’s
authenticity.

Advantages of Zero-Knowledge System


1. Simplicity
It does not require any software knowledge to operate but can offer superior
solutions that impact our daily lives.
2. Secure
ZKSis extremely secure when it comes to sharing information.
3. Time saver
ZKS shorten the time required in blockchain transactions, offering value to
users in a noble manner.
4. Privacy
Safeguarding the privacy of its users is the most appreciated characteristic of
ZKS. It never requires sensitive data-sharing.
5. Safety
Users of ZKSis aware of the need for ZKS to share data, and they can stay away
from any company that needs access to personal information without a valid
reason.

Disadvantages of Zero-Knowledge System


1. Hardware costs
2. Proof verification costs
3. Trust assumptions

Applications of Zero-Knowledge System

26
1. Anonymous Verifiable Voting.
2. Private Exchange and Settlement of Digital Assets.
3. Privacy on Public Blockchains.

27

You might also like