0% found this document useful (0 votes)
2 views62 pages

Unit 1 Blockchain Introduction.pptx

Blockchain

Uploaded by

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

Unit 1 Blockchain Introduction.pptx

Blockchain

Uploaded by

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

Unit 1: Blockchain Introduction

By
Sagar Patil
Blockchain
• Definition: Blockchain is a decentralized, distributed ledger technology
that enables secure and transparent record-keeping through a chain of
blocks.
• A Blockchain is a data structure that makes it possible to create a digital
ledger of data and share it among a network of independent parties .
• Blockchain is a distributed database that a group of individuals controls
and store and share information.
• Key Features of Blockchain: Transparency, immutability, decentralization,
and security are the key features of blockchain technology.
• Working of blockchain : Blocks containing transaction data are linked and
secured using cryptographic hashes, forming a chain. This mechanism
ensure trust and agreement among network participants.
Distributed Database Systems
• Multiple processors ( + memories)
• Heterogeneity and autonomy of “components”

Why do we need Distributed Databases?


• Example: IBM has offices in London, New York, and Hong Kong.
• Employee data:
– EMP(ENO, NAME, TITLE, SALARY, …)
• Where should the employee data table reside?
London New York
Payroll app Payroll app
Annual
Bonus app

Lon, NY
Emp NY, HK
London
New York Emp

Internet
Hong Kong
Payroll app Replication improves
availability
Hong Kong

HK, Lon
Emp
4
Homogeneous Vs heterogeneous Distributed Databases
• In a homogeneous distributed database
– All sites have identical software
– Are aware of each other and agree to cooperate in processing user requests.
– Each site surrenders part of its autonomy in terms of right to change schemas or software
– Appears to user as a single system
• In a heterogeneous distributed database
– Different sites may use different schemas and software
• Difference in schema is a major problem for query processing
• Difference in software is a major problem for transaction processing
– Sites may not be aware of each other and may provide only
limited facilities for cooperation in transaction processing
DB architectures
(1) Shared memory

P P ... P

6
DB architectures

(2) Shared disk


P P P
...
M M M

...

7
DB architectures
(3) Shared nothing

P P ... P

M M M

8
DB architectures
(4) Hybrid example – Hierarchical or Clustered

P P ... P

M
P P ... P

M
9
Issues for selecting architecture
• Reliability
• Scalability
• Geographic distribution of data
• Performance
• Cost

10
Conclusion- Advantages of DDBMSs

Reflects organizational structure


• Improved shareability and local autonomy
• Improved availability
• Improved reliability
• Improved performance
• Economics
• Modular growth
Conclusion- Disadvantages of DDBMSs

☹ Architectural complexity

☹ Cost

☹ Security

☹ Integrity control more difficult

☹ Lack of standards

☹ Lack of experience

☹ Database design more complex


Two General Problem
Byzantine General problem and Fault Tolerance
• The Byzantine Generals' Problem is a classic problem in
distributed computing and computer science, specifically in the
context of consensus algorithms.
• It was introduced in 1982.
• The problem is framed as a metaphorical scenario involving a
group of Byzantine generals trying to coordinate their attack or
retreat, and it explores the challenges of reaching consensus in
a distributed system when some of the participants may be
faulty or malicious.
• The generals face the following challenges:
• Reliability: Some generals may be traitors, providing false
information intentionally.
• Communication: Generals can only communicate by sending
messages to each other, and there is a risk of messages being
intercepted or altered.
• Consensus: The loyal generals need to reach a consensus on
whether to attack or retreat, despite the presence of traitorous
generals spreading conflicting information.
Byzantine general problem
Solution:
• To address the Byzantine Generals' Problem, a consensus algorithm must be
designed to allow the loyal generals to reach an agreement even in the presence
of traitorous generals. One well-known solution is the Byzantine Fault Tolerance
(BFT) algorithm.
• In the context of BFT, a consensus protocol ensures that the loyal generals agree
on a common decision, even if up to one-third of the generals are traitors. This is
achieved through a series of rounds of message exchanges and voting. The loyal
generals exchange their views, and through a process of voting and weighted
averaging, they converge on a decision.
• One of the most famous Byzantine Fault Tolerance algorithms is the Practical
Byzantine Fault Tolerance (PBFT), PBFT ensures consensus in a network where up
to one-third of the nodes can be faulty or malicious.
• The Byzantine Generals' Problem and its solutions have broader applications in
distributed systems, blockchain technology, and consensus algorithms where
ensuring trust and agreement among nodes or participants is crucial for the
system's reliability and security.
Byzantine Fault Tolerance (BFT):
• Description: Byzantine Fault Tolerance is a solution to the Byzantine Generals'
Problem. It refers to the ability of a distributed system to maintain its integrity
and functionality even when some of its nodes (participants) are faulty or
malicious. BFT ensures that the system can reach a consensus among honest
participants despite the presence of Byzantine (traitorous) participants.
• Key Characteristics:
– Achieving consensus in the presence of up to one-third of Byzantine faults.
– Reliability and consistency in the face of adversarial behavior.
– The ability to tolerate arbitrary and potentially malicious actions by some participants.
• Applications: BFT algorithms are widely used in distributed systems, blockchain
networks, and any scenario where maintaining trust and agreement among
participants is critical.
Byzantine Fault Tolerance Algorithms:
• Practical Byzantine Fault Tolerance (PBFT): Introduced by Miguel
Castro and Barbara Liskov, PBFT is a classic BFT algorithm designed
for use in asynchronous networks. It provides consensus even when
up to one-third of the participants are Byzantine faults.
• Tendermint: A BFT consensus algorithm that is commonly used in
blockchain systems. It ensures safety and liveness properties even in
the presence of Byzantine faults.
Majority voting principal
• Key Takeaways:
• The Byzantine Generals' Problem highlights the challenges of
consensus in a distributed system with potentially malicious
participants.
• Byzantine Fault Tolerance addresses these challenges by providing
algorithms and protocols that enable reliable and consistent
operation despite the presence of Byzantine faults.
• BFT has applications in various fields, including blockchain
technology, where maintaining consensus is crucial for the integrity
of the ledger and the security of transactions.
Hadoop Distributed File System
• Highly fault-tolerant
• High throughput
• Suitable for applications with large data sets
• Streaming access to file system data
• Can be built out of commodity hardware
Who uses Hadoop?
• Amazon
• Facebook
• Google
• New York Times
• Yahoo!
• …. many more
Goals of HDFS
• Very Large Distributed File System
– 10K nodes, 100 million files, 10PB
• Assumes Commodity Hardware
– Files are replicated to handle hardware failure
– Detect failures and recover from them
• Optimized for Batch Processing
– Data locations exposed so that computations can move to where data
resides
– Provides very high aggregate bandwidth
HDFS Architecture
Metadata(Name, replicas..)
Metadata ops Namenode (/home/foo/data,6. ..

Client
Block ops
Read Datanodes Datanodes

replication
B
Blocks

Rack1 Write Rack2

Client
Namenode and Datanodes
⚫ Master/slave architecture
⚫ HDFS cluster consists of a single Namenode, a master server that manages
the file system namespace and regulates access to files by clients.
⚫ There are a number of DataNodes usually one per node in a cluster.
⚫ The DataNodes manage storage attached to the nodes that they run on.
⚫ HDFS exposes a file system namespace and allows user data to be stored in
files.
⚫ A file is split into one or more blocks and set of blocks are stored in
DataNodes.
⚫ DataNodes: serves read, write requests, performs block creation, deletion,
and replication upon instruction from Namenode.
NameNode Metadata
• Metadata in Memory
– The entire metadata is in main memory
– No demand paging of metadata
• Types of metadata
– List of files
– List of Blocks for each file
– List of DataNodes for each block
– File attributes, e.g. creation time, replication factor
• A Transaction Log
– Records file creations, file deletions etc
Distributed hash tables

38
• A hash table is a data structure that is used to map keys to
values.
• Internally, a hash function is used to calculate an index into an
array of buckets from which the required value can be found.
• Buckets have records stored in them using a hash key and are
organized into a particular order.
• Distributed Hash Table (DHT) as a data structure where data is
spread across various nodes, and nodes are equivalent to
buckets in a peer-to-peer network.

39
ASIC Resistance
• What does ASIC-resistance mean?
• we want to disincentivize the use of custom-built hardware for
mining
• in reality our goal is a more modest one: coming up with a
puzzle that reduces the gap between the most cost-effective
customized hardware and what most general-purpose
computers can do.

40
41
42
Memory-hard puzzles/ Algorithm
• puzzles that require a large amount of memory to compute,
instead of, or in addition to, a lot of CPU time
• A similar but different concept is memory-bound puzzles in
which the time to access memory dominates the total
computation time

43
• Scrypt . The most popular memory-hard puzzle is called
scrypt.
• Password hashing has a similar goal of ASIC-resistance, because
for security
• we want an attacker with customized hardware to not be able
to compute password hashes much faster than the legitimate
user or server, who presumably have only general-purpose
computers.

44
Time-memory tradeoffs Verification cost

45
Other approaches to ASIC-resistance
• Recall that our original goal was simply to make it hard to build
ASICs with dramatic performance speedups.
• Memory-hardness is only one approach to this goal, and there
are others.
• X11
• which is simply a combination of eleven different hash
functions introduced by an altcoin called Darkcoin (later
renamed DASH)

46
Arguments against ASIC-resistance
• We’ve seen that it may be impossible to achieve
ASIC-resistance in the long run.
• There are also arguments that it is risky to move away from the
relatively proven SHA-256 mining puzzle towards a new puzzle
that might be weaker cryptographically

47
Turing Complete
• In Satoshi Nakamoto’s original plan, there were three steps, only
two of which have been implemented in Bitcoin 1.0. These are the
blockchain (the decentralized public transaction ledger) and the
Bitcoin protocol (the transaction system to move value between
parties without third-party interaction)
• applications such as the recording and transfer of more complex
assets like smart property and smart contracts, we need the third
step—a more robust scripting system—and ultimately, Turing
completeness (the ability to run any coin, protocol, or blockchain)

48
• Ethereum is a platform and a programming language for building and publishing
distributed applications.
• More fundamentally, Ethereum is a foundational general purpose cryptocurrency
platform that is a Turing-complete virtual machine (meaning that it can run any
coin, script, or cryptocurrency project)
• Ethereum has its own distributed ecosystem, which is envisioned to include file
serving, messaging, and reputation vouching.
• The first component is Swarm (“Ethereum-Swarm,” not to be confused with the
crowd funding site Swarm) as a decentralized file-serving method.
• A second component is Whisper (“Ethereum-Whisper,” also not to be confused
with other similarly named projects), which is a peer-to-peer protocol for secret
messaging and digital cryptography.
• A third component is a reputation system, a way to establish reputation and reduce
risk between agents in trustless networks,

49
hash function
• hash function is a mathematical function with the following three
properties:
• Its input can be any string of any size. It produces a fixed size output.
For the purpose of making the discussion in this chapter concrete,
we will assume a 256-bit output size. However, our discussion holds
true for any output size as long as it is sufficiently large. It is
efficiently computable. Intuitively this means that for a given input
string, you can figure out what the output of the hash function is in
a reasonable amount of time. More technically, computing the hash
of an n -bit string should have a running time that is O( n )

50
• Those properties define a general hash function, one that
could be used to build a data structure such as a hash table.
We’re going to focus exclusively on cryptographic hash
functions. For a hash function to be cryptographically secure,
we’re going to require that it has the following three additional
properties: (1) collision-resistance, (2) hiding, (3)
puzzle-friendliness.

51
Property 1: Collision-resistance

52
Property 2: Hiding
• The hiding property asserts that if we’re given the output of
the hash function y = H(x) , there’s no feasible way to figure out
what the input, x , was.
• Consider the following simple example: we’re going to do an
experiment where we flip a coin.

53
Property 3: Puzzle friendliness

• If a search puzzle is puzzle-friendly, this implies that there’s no


solving strategy for this puzzle which is much better than just
trying random values of x .

• Various families of hash functions are available, such as MD,


SHA1, SHA-2, SHA-3, RIPEMD, and Whirlpool. Hash functions
are commonly used for digital signatures and message
authentication codes, such as HMACs.

54
Digital Signatures

55
ECDSA
• Bitcoin uses a particular digital signature scheme that’s called the Elliptic Curve Digital
Signature Algorithm (ECDSA)
• Bitcoin uses ECDSA over the standard elliptic curve “secp256k1” which is estimated to
provide 128 bits of security (that is, it is as difficult to break this algorithm as performing 2
^128 symmetric-key cryptographic operations such as invoking a hash function)

• Private key: 256 bits


• Public key, uncompressed: 512 bits
• Public key, compressed: 256 bits
• Message to be signed: 256 bits
• Signature: 512 bits

• With ECDSA, a good source of randomness is essential because a bad source of


randomness will likely leak your key

56
Zero-knowledge proofs
• Zero-Knowledge Proofs (ZKPs) were introduced by Goldwasser,
Micali, and Rackoff in 1985.
• These proofs are used to prove the validity of an assertion without
revealing any information whatsoever about the assertion.
• There are three properties of ZKPs that are required: completeness,
soundness, and the zero-knowledge property.
• Zero-knowledge proofs are cryptographic techniques that allow one
party (the prover) to prove to another party (the verifier) that they
possess certain information or knowledge without revealing the
actual information itself.
• Zero-knowledge proofs have significant implications for privacy and
security in various cryptographic applications, including blockchain
technology.
57
• Note that during this process, Peggy has not revealed the secret at
all, but still managed to convince Victor with high probability that
she does know the secret.
58
• A ZKP comprises the following phases:
• 1. Witness phase: In this phase, the prover sends proof of the
statement and sends it to the verifier.
• 2. Challenge phase: In this phase, the verifier chooses a
question (challenge) and sends it to the prover.
• 3. Response phase: In this phase, the prover generates an
answer and sends it as a response to the verifier. The verifier
then checks the answer to ascertain whether the prover really
knows the statement.

59
• Zcash cryptocurrency. In Zcash, the zero-knowledge Succinct
Non-interactive ARgument of Knowledge (zk-SNARK) is
implemented to provide anonymity and confidentiality.
60
• Types of Zero-Knowledge Proofs:
• Interactive Zero-Knowledge Proofs (iZKPs): The prover and verifier
engage in multiple rounds of interaction to establish the
zero-knowledge proof.
• Non-Interactive Zero-Knowledge Proofs (NIZKPs): The proof is
generated in a single round, and it can be verified without further
interaction.

• Security Properties:
– Completeness: A correct prover will convince an honest verifier of the truth
of the statement.
– Soundness: A dishonest prover cannot convince an honest verifier of a false
statement.
– Zero-Knowledge Property: A verifier learns nothing about the secret
information being proved other than the statement's truth.
Question?
• A good question deserve a good grade…

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy