Unit 1 Blockchain Introduction.pptx
Unit 1 Blockchain Introduction.pptx
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”
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
...
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
☹ Architectural complexity
☹ Cost
☹ Security
☹ Lack of standards
☹ Lack of experience
Client
Block ops
Read Datanodes Datanodes
replication
B
Blocks
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
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)
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…