0% found this document useful (0 votes)
28 views40 pages

UNIT - 2 Notes

Uploaded by

pavincletus123
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)
28 views40 pages

UNIT - 2 Notes

Uploaded by

pavincletus123
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/ 40

SCHOOL OF COMPUTING

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

UNIT – II- CRYPTOCURRENCY TECHNOLOGIES – SCSA 3059


UNIT- 2

CRYPTOGRAPHY AND BLOCKCHAIN TECHNOLOGY

Cryptography: Hash function - Digital Signature - ECDSA - Memory Hard


Algorithm - Zero Knowledge Proof. Blockchain: Introduction - Advantage over
conventional distributed database - Blockchain Network - Mining Mechanism -
Distributed Consensus - Merkle Patricia Tree - Gas Limit – Transactions and Fee -
Anonymity - Reward - Chain

HASH FUNCTIONS
• 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.
• Values returned by a hash function are called message digest or simply hash
values.
FEATURES OF HASH FUNCTIONS
• Fixed Length Output (Hash Value)
• Hash function coverts data of arbitrary length to a fixed length. This
process is often referred to as hashing the data.
• Hash is much smaller than the input data, hence hash functions are
called as compression functions.
• Efficiency of Operation
• 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


1. Pre-Image Resistance
• This property means that it should be computationally hard to
reverse a hash function.
• In other words, if a hash function h produced a hash value z, then it
should be a difficult process to find any input value x that hashes to z.
• This property protects against an attacker who only has a hash value
and is trying to find the input.
2. 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.
• In other words, if a hash function h for an input x produces hash value
h(x), then it should be difficult to find any other input value y such
that h(y) = h(x).
This property of hash function protects against an attacker who has an input value
and its hash, and wants to substitute different value as legitimate value in place of
original input value.
3. Collision Resistance
• 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.
• In other words, for a hash function h, it is hard to find any two
different inputs x and y such that h(x) = h(y).
• This property makes it very difficult for an attacker to find two input
values with the same hash.
• Also, if a hash function is collision-resistant then it is second pre-
image resistant.

Application of Hash Function


1. Password Storage
• Hash functions provide protection to password storage.
• Instead of storing password in clear, mostly all logon processes store the
hash values of passwords in the file.
• 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.
TYPES OF HASH FUNCTION
There are many hash functions that use numeric or alphanumeric
keys.
1. Division Method.
2. Mid Square Method.
3. Folding Method.
4. Multiplication Method.

1. Division Method:
This is the most simple and easiest method to generate a hash value. The hash
function divides the value k by M and then uses the remainder obtained.
Formula:
h(K) = k mod M
Here,
k is the key value, and
M is the size of the hash table.

It is best suited that M is a prime number as that can make sure the keys are more
uniformly distributed. The hash function is dependent upon the remainder of a
division.
Example:
k = 12345
M = 95
h(12345) = 12345 mod 95 = 90
k = 1276 M = 11
h(1276) = 1276 mod 11 = 0

Pros:
1. This method is quite good for any value of M.
2. The division method is very fast since it requires only a single division
operation.
Cons:
1. This method leads to poor performance since consecutive keys map to
consecutive hash values in the hash table.
2. Sometimes extra care should be taken to choose the value of M.
2. Mid Square Method:
The mid-square method is a very good hashing method. It involves two steps to
compute the hash value-
1. Square the value of the key k i.e. k2
2. Extract the middle r digits as the hash value.
Formula:
h(K) = h(k x k)
Here,
k is the key value.

The value of r can be decided based on the size of the table.


Example:
Suppose the hash table has 100 memory locations. So r = 2 because two digits are
required to map the key to the memory location.
k = 60
k x k = 60 x 60 = 3600
h(60) = 60
The hash value obtained is 60

Pros:
1. The performance of this method is good as most or all digits of the key value
contribute to the result. This is because all digits in the key contribute to
generating the middle digits of the squared result.
2. The result is not dominated by the distribution of the top digit or bottom digit
of the original key value.
Cons:
1. The size of the key is one of the limitations of this method, as the key is of big
size then its square will double the number of digits.
2. Another disadvantage is that there will be collisions but we can try to reduce
collisions.
3. Digit Folding Method:
This method involves two steps:
1. Divide the key-value k into a number of parts i.e. k1, k2, k3,….,kn, where
each part has the same number of digits except for the last part that can have
lesser digits than the other parts.
2. Add the individual parts. The hash value is obtained by ignoring the last carry
if any.
Formula:
k = k1, k2, k3, k4, ….., kn
s = k1+ k2 + k3 + k4 +….+ kn
h(K)= s
Here,
s is obtained by adding the parts of the key k

Example:
k = 12345
k1 = 12, k2 = 34, k3 = 5
s = k1 + k2 + k3
= 12 + 34 + 5
= 51
h(K) = 51

4. Multiplication Method
This method involves the following steps:
1. Choose a constant value A such that 0 < A < 1.
2. Multiply the key value with A.
3. Extract the fractional part of kA.
4. Multiply the result of the above step by the size of the hash table i.e. M.
5. The resulting hash value is obtained by taking the floor of the result obtained
in step 4.
Formula:
h(K) = floor (M (kA mod 1))
Here,
M is the size of the hash table.
k is the key value.
A is a constant value.

Example:
k = 12345 A = 0.357840 M = 100
h(12345) = floor[ 100 (12345*0.357840 mod 1)]
= floor[ 100 (4417.5348 mod 1) ]
= floor[ 100 (0.5348) ]
= floor[ 53.48 ] = 53

Pros:
The advantage of the multiplication method is that it can work with any value
between 0 and 1, although there are some values that tend to give better results
than the rest.
Cons:
The multiplication method is generally suitable when the table size is the power
of two, then the whole process of computing the index by the key using
multiplication hashing is very fast.

HASHING PATTERNS
There are five different patterns of hashing techniques:

1. Independent Hashing: The Hash function transforms each input data


separately.

Independent hashing
2. Repeated Hashing: The Hash functions transforms input data into a hash
value and again this hash value is given as input and produces another output
hash value.

Repeated Hashing
3. Combined Hashing: It enables us to produce singular hash value for more
than one chunk of data. This kind of hashing technique is used when the data size
is very small, because it reduces the utilization of more power to generate a hash
value. If you have noticed it is similar to repeated hashing (during first hashing),
the two hash values obtained as same.

Combined hashing
4. Sequential hashing: Sequential hashing creates an update of a hash value as
soon as new data appears using combined and repeated hashing simultaneously.
The existing hash value is merged with the newly arrived input data and then
hashed to get the updated hash value. This hashing pattern is valuable in case you
require a single hash value and wish to track its development back to the
appearance of new data.
Sequential hashing
5. Hierarchical Hashing: Hierarchical hashing uses combined hashing to create
pairs of hash values which enable the creation of hierarchy. The goal of the
pattern of hierarchical hashing is to create a single hash value for a multitude of
data chunks in a similar way as combined hashing. Compared to combined
hashing, hierarchical hashing has an efficiency advantage as the combined data is
formed by hash values which are fixed in size, hence, reducing the required
computational power and required time.

Hierarchical Hashing
DIGITAL SIGNATURE:
Digital Signature in Cryptography is a value calculated from the data
along with a secret key that only the signer is aware of. The receiver needs to be
assured that the message belongs to the sender. This is crucial in businesses as the
chances of disputes over data exchange are high.

Digital Signature Algorithms:


There are three algorithms at work in Digital Signatures. They are as
follows:
1. Key Generation Algorithms
Key Generation Algorithms help ensure authenticity and integrity or it
would be very easy to tamper with the data. They also prevent anyone from
pretending to be the sender.

2. Signing Algorithms
Signing Algorithms make one-way hashes of the data that has to be
signed. Then they encrypt the hash value using the signature key. The encrypted
hash along with the other information is the Digital Signature.

3. Signature Verification Algorithms


Signature Verification Algorithms help process the Digital Signature
and the verification key to generate some values. The algorithm also processes the
same hash function on the data received and creates a hash value.

Importance of Digital Signature

1. Message Authentication
The private key is only known to the sender. The verifier can use the public
key of the sender to validate that the Digital Signature was created by the
sender.

2. Data Integrity
If at any time the data is attacked, there will be a discrepancy in the hash
value and the verification algorithm as they won’t match. Due to this, the
receiver will end up rejecting the message and declaring a data breach.
3. Non-repudiation
The signer is the only one who is aware of the signature key so, naturally,
they are the only ones who can create a specific signature. Whenever there is
a dispute, the data along with the Digital Signature can be presented as
evidence.
ECDSA (Elliptic Curve Digital RSA (Rivest-Shamir-Adleman)
Signature Algorithm)
ECDSA is a relatively newer algorithm
RSA is a relatively older algorithm. It has
been extensively studied and used for
decades
ECDSA relies on the mathematics of RSA is based on the computational
elliptic curves over finite fields difficulty of factoring large prime numbers
Requires smaller key size but provides the Requires larger key size but provides the
same level of security. same level of security
ECDSA is computationally efficient and RSA is more computationally intensive
requires less processing power compared to ECDSA.
The generation and storage of ECDSA RSA key generation is more time-
keys are generally faster and require less consuming and resource-intensive
storage space
MEMORY-HARD ALGORITHM
• In cryptography, a memory-hard algorithm is designed to make
computational tasks memory-bound, meaning that they require a significant
amount of memory to compute.
• The goal of memory-hard algorithms is to deter or slow down the efficiency
of specialized hardware attacks.
• Memory-hard algorithms are commonly used in password hashing functions,
where the goal is to protect user passwords in case of a database breach.
• These algorithms make it computationally expensive to compute the hash
function, thus increasing the time and resources required to crack passwords.
• One of the most well-known memory-hard algorithms is Argon2, which was
the winner of the Password Hashing Competition in 2015.
APPLICATION OF MEMORY-HARD ALGORITHMS
1. Password Hashing:
Memory-hard algorithms are commonly used for password hashing, where
the goal is to protect user passwords in case of a data breach.
By making the computation memory-bound, these algorithms increase the
time and resources required to crack passwords. They help mitigate the impact of
password leaks by slowing down attackers and making it more difficult to recover
the original passwords.

2. Proof-of-Work (PoW) Systems:


Memory-hard algorithms are often used in blockchain and
cryptocurrency systems like Bitcoin, memory-hard algorithms are used to solve
computational puzzles to validate and add new blocks to the blockchain.
By making the computations memory-bound, they aim to ensure that the
block validation process is resource-intensive, requiring significant computational
and memory resources.

3. Denial-of-Service (DoS) Protection:


Memory-hard algorithms can also be employed for defending against
certain types of Denial-of-Service attacks.
By requiring significant memory resources, these algorithms make it
difficult for an attacker to overwhelm a system with a flood of requests or
computational tasks.
The memory requirements act as a bottleneck, limiting the effectiveness of
such attacks and allowing legitimate users to access the system more reliably.

4. Hardware Resistance:
Memory-hard algorithms are designed to resist attacks from specialized hardware.
By relying on memory access patterns and requiring a large amount of memory,
these algorithms make it harder to achieve significant performance gains through
specialized hardware optimizations.
ZERO-KNOWLEDGE PROOF
A zero-knowledge proof is a way of proving the validity of a statement
without revealing the statement itself. The ‘prover’ is the party trying to prove a
claim, while the ‘verifier’ is responsible for validating the claim.
A zero-knowledge protocol is a method by which one party (the prover)
can prove to another party (the verifier) that something is true, without revealing
any information apart from the fact that this specific statement is true.

PROPERTIES OF ZERO-KNOWLEDGE PROOF


1. Completeness: if the statement is true, an honest verifier will be convinced
of this fact by an honest prover.
2. Soundness: if the statement is false, no cheating prover can convince an
honest verifier that it is true, except with some small probability.
3. Zero-knowledge: if the statement is true, no verifier learns anything other
than the fact that the statement is true. In other words, just knowing the
statement (not the secret) is sufficient to imagine a scenario showing that the
prover knows the secret.

TYPES OF ZERO KNOWLEDGE PROOF


1. Interactive Zero Knowledge Proof –
It requires the verifier to constantly ask a series of questions about the
“knowledge” the prover possess.
2. Non-Interactive Zero Knowledge Proof –
Non-interactive Zero-Knowledge Proof 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.

ELEMENTS OF ZERO-KNOWLEDGE
In basic form, a zero-knowledge proof is made up of three
elements: witness, challenge, and response.
Witness: With a zero-knowledge proof, the prover wants to prove knowledge of
some hidden information. The secret information is the “witness” to the proof, and
the prover's assumed knowledge of the witness establishes a set of questions that
can only be answered by a party with knowledge of the information. Thus, the
prover starts the proving process by randomly choosing a question, calculating the
answer, and sending it to the verifier.
Challenge: The verifier randomly picks another question from the set and asks the
prover to answer it.
Response: The prover accepts the question, calculates the answer, and returns it to
the verifier. The prover’s response allows the verifier to check if the former really
has access to the witness. To ensure the prover isn’t guessing blindly and getting
the correct answers by chance, the verifier picks more questions to ask. By
repeating this interaction many times, the possibility of the prover faking
knowledge of the witness drops significantly until the verifier is satisfied.

Example:
In this example, you and a competitor discover that you are buying the same
materials from the same supplier. You want to find out if you are paying the same
price per kilogram. However, there isn’t enough trust between the both of you to
divulge the prices you are each paying, and you are also contractually bound to not
share this information.
Assuming the market rate for the materials can only be 100, 200, 300 or 400 per
kilogram, we can set up a zero-knowledge proof for this situation. Let’s follow
these steps to explain the idea:

1. You and a competitor want to know if you are paying the same price without
revealing how much each of you are paying.
2. We obtain 4 lockable lockboxes, each with a small slot that can take only a piece
of paper. They are labelled 100, 200, 300, and 400 for the price per kilogram, and
placed in a secure, private room.

3. You go into the room alone first. Since you are paying 200 per kilogram, you
take the key from the lockbox that is labelled 200 and destroy the keys for the
other boxes. You leave the room.

4. Your competitor goes into the room alone with 4 pieces of paper, 1 with a check,
and 3 with crosses. Because your competitor is paying 300 per kilogram, they slide
the paper with a check inside the lockbox that is labelled 300, and slide the papers
with crosses into the other lockboxes. They leave the room.
5. After they leave, you can return with your key that can only open the lockbox
labelled 200. You find a piece of paper with a cross on it, so now you know that
your competitor is not paying the same amount as you.

6. Your competitor returns and sees that you have a piece of paper with a cross on
it, so now they also know that you are not paying the same amount as them.
If you get a piece of paper with a check on it, both of you would know that you are
paying the same amount. Since you got the paper with a cross on it, both of you
know that you are not paying the same amount, but also without knowing how
much the other is paying.
Both of you leave knowing only that you are not paying the same amount, but
neither of you has gained knowledge of what the other is paying.
This is another analogy of an interactive zero-knowledge proof with a primitive
semi-range proof. It is important to note that all of the examples have limitations
and have to take on certain assumptions, but they adequately illustrate the ways
they could work.

BLOCKCHAIN :
A blockchain is “a distributed database that maintains a continuously
growing list of ordered records, called blocks.” These blocks “are linked using
cryptography. Each block contains a cryptographic hash of the previous block, a
timestamp, and transaction data.

A blockchain is a decentralized, distributed and public digital ledger


that is used to record transactions across many computers so that the record cannot
be altered retroactively without the alteration of all subsequent blocks and the
consensus of the network.

The primary benefit of blockchain is as a database for recording


transactions, but its benefits extend far beyond those of a traditional database. Most
notably, it removes the possibility of tampering by a malicious actor, as well as
providing these business benefits:
 Time savings. Blockchain slashes transaction times from days to minutes.
Transaction settlement is faster because it doesn’t require verification by a
central authority.
 Cost savings. Transactions need less oversight. Participants can exchange
items of value directly. Blockchain eliminates duplication of effort because
participants have access to a shared ledger.
 Tighter security. Blockchain’s security features protect against tampering,
fraud, and cybercrime.
Blockchain technology is the concept or protocol behind the
running of the blockchain. Blockchain technology
makes cryptocurrencies (digital currencies secured by cryptography) like
Bitcoin work just like the internet makes email possible.

The blockchain is an immutable (unchangeable, meaning a


transaction or file recorded cannot be changed) distributed digital ledger
(digital record of transactions or data stored in multiple places on a computer
network) with many use cases beyond cryptocurrencies.
Types of Blockchains :
There are four types of blockchains:

1. Public Blockchains
Public blockchains are open, decentralized networks of computers accessible to
anyone wanting to request or validate a transaction (check for accuracy). Those
(miners) who validate transactions receive rewards.
Public blockchains use proof-of-work or proof-of-stake consensus mechanisms
(discussed later).
Examples: Bitcoin and Ethereum (ETH) blockchains.

2. Private Blockchains
Private blockchains are not open, they have access restrictions. People who want to
join require permission from the system administrator. They are typically governed
by one entity, meaning they’re centralized.
Example: Hyperledger is a private, permissioned blockchain.

3. Hybrid Blockchains or Consortiums


Consortiums are a combination of public and private blockchains and contain
centralized and decentralized features.
Example: Energy Web Foundation, Dragonchain, and R3.

4. Sidechains
A sidechain is a blockchain running parallel to the main chain. It allows users to
move digital assets between two different blockchains and improves scalability and
efficiency.
Example : Liquid Network.
ADVANTAGE OF BLOCKCHAIN OVER CONVENTIONAL
DISTRIBUTED DATABASE :
Blockchain offers several advantages over conventional distributed databases. Here
are some key advantages:
1. Decentralization and Trust: Conventional distributed databases typically
rely on a central authority or trusted third party to validate and maintain the
database. In contrast, blockchain operates in a decentralized manner, where
multiple participants or nodes collectively validate and agree on the
transactions. This decentralized approach eliminates the need for a central
authority, reduces the risk of single points of failure, and enhances trust
among participants.
2. Immutable and Tamper-Resistant: Blockchain provides immutability and
tamper-resistance of data. Once a transaction is recorded on the blockchain
and confirmed by the network, it becomes nearly impossible to alter or
delete that transaction. The use of cryptographic hash functions and
consensus mechanisms ensures the integrity of the data stored in the
blockchain.
3. Transparency and Auditability: Blockchain offers transparency by
providing all participants with access to the same set of data. Every
transaction recorded on the blockchain is visible to the participants, enabling
them to independently verify and audit the data. This transparency enhances
accountability, reduces fraud, and fosters trust among participants.
4. Security: Blockchain employs advanced cryptographic techniques to secure
transactions and data. Each transaction is digitally signed and verified,
ensuring the authenticity and integrity of the data. The distributed nature of
blockchain makes it resilient against attacks and makes it difficult for
malicious actors to manipulate the data.
5. Disintermediation and Cost Efficiency: Blockchain eliminates the need for
intermediaries or trusted third parties in transactions. By enabling peer-to-
peer transactions and direct interactions, blockchain reduces costs associated
with intermediaries, such as financial institutions or clearinghouses. This
disintermediation can lead to increased efficiency and cost savings in
various industries.
6. Smart Contracts: Blockchain platforms often support smart contracts,
which are self-executing contracts with the terms of the agreement directly
written into code. Smart contracts automatically execute actions when
predefined conditions are met. This automation eliminates the need for
intermediaries, streamlines processes, and reduces the risk of human error.
7. Data Consistency and Synchronization: In conventional distributed
databases, achieving data consistency and synchronization across multiple
nodes can be challenging. Blockchain provides a shared, distributed ledger
where all participants have access to the same data, ensuring consistency
across the network. The consensus mechanisms employed by blockchain
platforms help maintain the integrity and synchronization of the data.
8. Resilience and Fault Tolerance: Blockchain is designed to be resilient and
fault-tolerant. The distributed nature of the blockchain ensures that even if
some nodes fail or are compromised, the network can continue to operate
and maintain the integrity of the data. This resilience makes blockchain
suitable for applications where data availability and continuity are crucial.

BLOCKCHAIN NETWORK :
A blockchain network is basically a technical network that is
providing ledger and smart contract (chaincode) services to the applications.
Primarily, these smart contracts are used to generate transactions which are
subsequently distributed among every peer node in the network where they are
unalterably recorded on their copy of the ledger. The users of applications must be
end users using client applications.
Blockchain networks are driven by aligned system incentives.a
blockchain with proper functioning requires a community of users, node operators,
developers and miners who work in a mutually beneficial network.
Bitcoin is the largest cryptocurrency with the help of market
capitalization and well known usage of blockchain technology.

Types of blockchain networks


There are two kinds of blockchain network—public and private. Both are
P2P networks, where the ledger is distributed among those that can participate in
the transaction. The ledger copy is replicated among participants, and those parties
that can execute append-only transactions to the ledger will hold a copy of the
ledger and will participate to reach a consensus to add a block to the blockchain.
Along with being public or private, a blockchain can be both permissionless (such
as Bitcoin or Ethereum) and permissioned (such as the Hyperledger blockchain
framework).
PERMISSIONLESS BLOCKCHAIN :
 A permissionless blockchain is also known as a public blockchain because
anyone can join the network.
 Permissionless P2P systems do not require a set amount of peers to be online
and are generally slower.
 Parties communicate on a permissionless blockchain without verifying the
transacting parties' identities. Anyone can join a permissionless blockchain
such as Ethereum and can perform read and write transactions.

PERMISSIONED NETWORKS :
 Permissioned networks are the blockchain networks where only pre-
authorized users or organizations can perform write transactions.
 They are faster and inexpensive, can comply with regulations, and can easily
be maintained.
 Pre-verification of the participating parties is mandatory for a permissioned
blockchain and, hence, transacting parties are made.
 Permissioned P2P networks have to guarantee uptime and require a high
level of quality of service on communication links.

Although there are two kinds of blockchain network—public and private – on


permissions, they can be classified as :
 PUBLIC AND PERMISSIONLESS
 PUBLIC AND PERMISSIONED
 PRIVATE AND PERMISSIONLESS
 PRIVATE AND PERMISSIONED
Public and permissionless blockchain:
 These are open and transparent and offer disintermediation and
anonymity.
 They are trustless and offer immutability.
 This means they are open for anybody to join the blockchain network.
The user (on a node) can enable his/her system with the required
software and join the blockchain network.
 Public blockchain removes intermediaries, which reduces the cost,
reduces the time it takes for reconciliation, and
offers transparency in the network.
 Public blockchains are trustless, and trust is in the consensus.
 Transactions are replicated to each participating node, and consensus
takes care of validation and synchronizes the transactions to be
added to the blockchain.
 This allows trustless parties to execute transactions with confidence.
The more nodes there are, the more impossible it becomes to undo a
transaction; hence, public blockchain is immutable.
 Although transactions can be read by anyone, the identities of users
are protected, hence offering anonymity.

Public and permissioned blockchain:


 These are scalable, cost-effective, transparent, and offer disintermediation
and anonymity.
 Public and permissioned blockchain allows anyone to read transactions, but
only a few permissioned users can write transactions (for example,
government employees' salaries and real-estate registries).
 Alternatively, it can allow a few to read transactions and everyone to write
transactions (for example, voting).
 If a public and permissioned blockchain is of the type where it allows
anyone to read it and only a few permissioned participants to write on it,
then such a system does not need to be based on expensive consensus
algorithms such as PoW. Such blockchain networks can be scalable.
 Not everyone will participate for validation, and a validator is chosen.
Hence, it is not slow and costly compared to a public and permissionless
network.
 Although there are no intermediaries, only a few institutes can read or write.

Private and permissionless blockchain:


 Only individual or selected members can run a full node to transact, validate,
and read transactions.
 A few can execute write transactions and validate transactions, while
everyone can read.
 All of the permissions are central to an enterprise; hence, they are not
decentralized, and they can just be distributed.
 On the positive side, it allows the enterprise to be compliant and meet
privacy needs to implement blockchain.
 Moreover, it allows cryptographic auditing. However, the whole idea of a
decentralized network is lost.
Private and permissioned blockchain:
 Public blockchain leads to scenarios where we run one full node, which
means the node is performing computation for all of the applications for
that network.
 This slows down the performance of the blockchain network.
 In addition, they need a blockchain network where parties are identifiable
(not necessarily trusted) and permissions can be granted.
 In addition, the privacy of data can be guaranteed between a certain set
of participants, even if all of the participants are on the same blockchain
network.
 Furthermore, consensus is controlled by a predefined set of nodes, which
leads to a faster and low-cost business network.
.
Private and permissioned blockchain/consortia offer the following:
 Better governance than public blockchain
 Cost-effective
 Privacy and security

The following table highlights the similarities and differences between different
types of blockchain from the permissions perspective:
Public and Public and Private and Private and
Permissionless Permissioned Permissionless Permissioned

Open and Restricted yet Restricted (hybrid


Open and restricted.
transparent. read transparent. approach).

Write all and read Write all and read Write restricted Write restricted and
all. restricted. and read all. read restricted.

Everyone can
Everyone can join and
Everyone can join, join, nobody can Nobody can join,
transact, but only
transact, read, and transact, and transact, read, and
permissioned users can
audit. everyone can read audit.
read and audit.
and audit.
Anyone in the
Anyone can network can
Anyone who meets the
download the participate and Only consortium
predefined criteria can
protocol and validate members can
download the protocol
participate with transactions. validate the
and participate with
validate However, this is transaction.
validate transactions.
transactions. only within the
enterprise.

The following table highlights the similarities and differences between different
types of blockchain from a transaction and anonymity perspective:

Public and Public and Private and Private and


Permissionless Permissioned Permissionless Permissioned

Transactions are Transactions are Transactions are


Transactions are
anonymous and not anonymous not anonymous
anonymous and
not read and are read and not
transparent.
transparent. transparent. transparent.

Write transactions A write transaction


can be authored or is performed by A write
Write
initiated by few and it can be transaction can be
transactions can
anyone; for read by anyone. authored or
be authored or
example, I'm For example, an initiated by
initiated by
casting my vote. authorized party authorized users;
anyone; for
However, whom I writes about the for example, I'm
example, I'm
have cast my vote source of the sending 10 USD
sending 10
for can be counted inventory, and to Bill.
Bitcoin to Bill.
by the authorized subsequent writes Authorized
Everyone will
institution only. are performed by a institutions will
know that 10
Another example few other know that 10
bitcoins were
is that a write can intermediary USD was
transacted.
be performed by parties or devices; transacted.
few and it can be however, it can be
read by all. read by anyone.

Everyone will
Nobody can Nobody can Nobody can
participate in
participate in participate in participate in
transaction
transaction transaction transaction
validation, and
validation, and the validation, and the validation, and
the validators are
validators are the validators are the the validators are
not the chosen
chosen ones. chosen ones. the chosen ones.
ones.

Truly
democratic: full Full write equity. Full read equity. Restricted.
equity.

Transaction Transaction
approval is long. approval is long. It Transaction Transaction
It usually takes usually takes approval is short. approval is short.
minutes. minutes.

MINING MECHANISM:
Blockchain mining is used to secure and verify bitcoin transactions.
Mining involves Blockchain miners who add bitcoin transaction data to Bitcoin’s
global public ledger of past transactions. In the ledgers, blocks are secured by
Blockchain miners and are connected to each other forming a chain.

This process of verifying transactions is called mining. It is


probably referred to as mining as it is analogous to mining of commodities like
gold—mining gold requires a lot of effort and resources, but then there is a limited
supply of gold; hence, the amount of gold that is mined every year remains roughly
the same.
The term ‘Blockchain mining’ is used to describe the process of
adding transaction records to the bitcoin blockchain. This process of adding
blocks to the Blockchain is how transactions are processed and how money moves
around securely on Bitcoins.
This process of Blockchain mining is performed by a community of
people around the world called ‘Blockchain miners.’

Types of Mining :
The process of mining can get really complex and a regular desktop
or PC cannot cut it. Hence, it requires a unique set of hardware and software that
works well for the user. It helps to have a custom set specific to mining certain
blocks.

The mining process undertaking can be divided into three categories:


1. Individual Mining
When mining is done by an individual, user registration as a miner is
necessary. As soon as a transaction takes place, a mathematical problem is given to
all the single users in the blockchain network to solve. The first one to solve it gets
rewarded.
Once the solution is found, all the other miners in the blockchain
network will validate the decrypted value and then add it to the blockchain. Thus,
verifying the transaction.

2. Pool Mining
In pool mining, a group of users works together to approve the
transaction. Sometimes, the complexity of the data encrypted in the blocks makes
it difficult for a user to decrypt the encoded data alone. So, a group of miners
works as a team to solve it. After the validation of the result, the reward is then
split between all users.

3. Cloud Mining
Cloud mining eliminates the need for computer hardware and
software. It’s a hassle-free method to extract blocks. With cloud mining, handling
all the machinery, order timings, or selling profits is no longer a constant worry.
While it is hassle-free, it has its own set of disadvantages. The
operational functionality is limited with the limitations on bitcoin hashing in
blockchain. The operational expenses increase as the reward profits are low.
Software upgrades are restricted and so is the verification process.

DISTRIBUTED CONSENSUS :
Distributed consensus refers to the process by which participants in a
decentralized network agree on a shared state or order of events without relying on
a central authority. It ensures that all nodes in the network reach a consensus on the
validity and order of transactions or data.
In a distributed consensus protocol, the goal is to achieve agreement
among a set of participants, even in the presence of faults or malicious actors. This
consensus is crucial for maintaining the integrity and trustworthiness of a
distributed system, such as a blockchain.
There are several well-known distributed consensus protocols, including:
1. Proof-of-Work (PoW): PoW is a consensus algorithm used by Bitcoin and
some other cryptocurrencies. Miners compete to solve computationally
intensive puzzles, and the first one to find a valid solution broadcasts it to
the network. Consensus is reached when the majority of participants agree
on the validity of the solution. PoW ensures that the majority of participants
collectively control the network and prevents malicious actors from easily
tampering with the blockchain.
2. Proof-of-Stake (PoS): PoS is an alternative consensus mechanism where
the probability of a participant being chosen to validate new transactions or
create new blocks is based on the number of cryptocurrency tokens they
hold and are willing to "stake" as collateral. This eliminates the need for
extensive computational power, as in PoW. PoS protocols include
Ethereum's upcoming Ethereum 2.0, Cardano, and Tezos.
3. Delegated Proof-of-Stake (DPoS): DPoS is a variant of PoS where a
limited number of participants, known as "delegates," are chosen to validate
transactions and create new blocks on behalf of the entire network. The
selection of delegates is often based on voting by token holders. Examples of
DPoS blockchains include EOS and Tron.
4. Practical Byzantine Fault Tolerance (PBFT): PBFT is a classical
consensus algorithm that works in a permissioned setting, where a fixed set
of known participants is present. It ensures consensus even in the presence
of Byzantine faults (e.g., malicious nodes). PBFT requires a certain
threshold of honest nodes to reach consensus. Hyperledger Fabric is an
example of a blockchain framework that employs a modified version of
PBFT.

MERKEL TREE :
Merkle Trees enable the secure and efficient verification of large
datasets.
A Merkle tree is a binary tree in which the inputs are first placed at
the leaves and then the values of pairs of child nodes are hashed together to
produce a value for the parent node (internal node), until a single hash value
known as a Merkle root is achieved. This structure helps to quickly verify the
integrity of the entire tree, but just by verifying the Merkle root on top the Merkle
tree, because if any change occurs in any of the hashes in the tree, the Merkle root
will also change.

Advantage of Merkle Tree :

 Integrity of the system can be verified quickly by just looking at the Merkle
root.
 In Merkle tree, there is no requirement to store large amounts of data, only
the hashes of the data, which are fixed-length digest of the large dataset. Due
to this property, the storage and management of Merkle tree are easy and
efficient as they take up a very small amount of space for storage.

MERKLE PATRICIA TREE :

A trie, or a digital tree, is an ordered tree data structure used to store


a dataset. The Pratical Algorithm to Retrieve Information Coded in
Alphanumeric(PATRICIA) tree, also known as Radix tree, is a compact
representation of a trie in which a node that is the only child of a parent is
merged with its parent. The keys represent the path to reach a node. The nodes
that share the same key can share the same path, thus making it an efficient way
of finding common prefixes while utilizing a small amount of memory.

A Merkle-Patricia tree is a tree that has a root node that contains


the hash value of the entire data structure. The Merkle-Patricia tree combines
Merkle and Patricia trees where Patricia is used for efficient storage and Merkle
enables tamper-proof data validation. Patricia tree is also modified to store
hexadecimal strings instead of bits and support 16 branches.
GAS LIMIT :
Gas is the fee required to successfully conduct a transaction or execute a
contract on the Ethereum blockchain platform. Fees are priced in tiny fractions of
the cryptocurrency ether (ETH)—denominations called gwei (10 -9 ETH). Gas is
used to pay valuators’ for the resources needed to conduct transactions.

The exact price of the gas is determined by supply, demand, and network
capacity at the time of the transaction.

The term gas limit refers to the maximum price a cryptocurrency user is
willing to pay when sending a transaction, or performing a smart contract function,
in the Ethereum blockchain. These fees are calculated in gas unit, and the gas limit
defines the maximum value that the transaction or function can "charge" or take
from the user. As such, the gas limit works as a security mechanism that prevents
high fees from being incorrectly charged due to a bug or error in a smart contract.

Some wallets and service provide setup the gas prices and gas limit
automatically, but in some cases, users are also able to adjust them manually,
according to their needs. In general, a regular Ether (ETH) transaction would be
made with, at least, a 21,000 gas limit. If the gas limit and gas price (Gwei) are set
to a higher level, the operation will occur much faster. Still, faster operations will
likely charge higher fees. On the other hand, a very low gas limit and gas price
would be risky because transactions could take too long to be confirmed, or even
get stuck (fail).

TRANSACTION AND FEES :

Transaction fees are essential to the blockchain. They serve two main purposes:

1. They incentivize and reward miners/validators who process the


transactions,
2. And they help protect the network from spam attacks.

Transactions on the blockchain have to be checked, validated, and


added to the blockchain— a process that requires a considerable amount of
computational power.

This power is provided by “miners” with sophisticated software that


solves complex mathematical problems. The transaction fees are therefore an
incentive to participate in maintaining the integrity of the decentralized ledger and
a reward for doing so.
In terms of protection, the simple fact that conducting any sort of
transaction on the blockchain incurs a fee, acts as a deterrent to bad actors. People
are less likely to spam if they have to pay to do it.

It’s worth noting that transaction fees are not the same as the fees
charged by crypto exchanges. Those additional processing fees go directly to the
exchange, while blockchain transaction fees go to the miner of the block.

How Do Transaction Fees Work?


Generally, fees are tied to the size of the transaction and the throughput of the
network.
The more complex the transaction, the higher the fees. For example, executing a
smart contract on Ethereum requires more computational power than a standard
transaction, therefore, it costs more.
When a blockchain is heavily congested, users can attach a higher transaction fee
to entice miners to prioritize their transactions and validate them first. Blocks
contain a limited amount of space so miners tend to focus on adding transactions
with higher fees first.
This creates a sort of bidding war for users who want to have their transactions
validated, which pushes the fee price up.

ANONYMITY:
Anonymity in blockchain refers to the ability of participants within a
blockchain network to transact and interact without revealing their true identities.
Blockchain technology, which underlies cryptocurrencies like Bitcoin, offers
certain degrees of anonymity, but it's essential to understand the nuances and
limitations involved.
1. Pseudonymity: Blockchain transactions are linked to cryptographic
addresses rather than real-world identities. These addresses are random
strings of characters that users can generate for each transaction or use
repeatedly. While these addresses don't reveal personal information, they
still provide a level of traceability within the blockchain.

2. Privacy-focused cryptocurrencies: Some cryptocurrencies, like Monero


and Zcash, prioritize privacy by implementing advanced cryptographic
techniques. These technologies, such as ring signatures and zero-knowledge
proofs, help obfuscate transaction details and shield the identity of the
participants involved.

3. Stealth addresses: Stealth addresses are used in certain blockchain


protocols to enhance privacy. When a user shares a stealth address with
another party, it generates a one-time address that is publicly visible on the
blockchain but cannot be easily linked to the user's identity. This helps
protect the recipient's privacy.

4. Mixing services: Mixing services, also known as tumblers or mixers, aim to


enhance anonymity by combining multiple transactions and obscuring the
link between the sender and recipient addresses. These services pool
transactions together, shuffle them, and then distribute the funds to new
addresses, making it difficult to trace individual transactions.

REWARD :
In the context of blockchain, rewards typically refer to incentives provided to
participants in the network for their contributions or participation. These rewards
can take different forms depending on the specific blockchain protocol or
cryptocurrency involved. Here are a few common types of rewards in blockchain:

1. Mining Rewards: In many blockchain networks that use proof-of-work


(PoW) consensus algorithms, such as Bitcoin, miners compete to solve
complex mathematical puzzles to validate and add new blocks to the
blockchain. Miners who successfully mine a block are rewarded with a
certain amount of cryptocurrency. This reward serves as an incentive for
miners to contribute their computational power and secure the network.
2. Staking Rewards: In blockchain networks that utilize proof-of-stake (PoS)
or delegated proof-of-stake (DPoS) consensus algorithms, participants can
lock up or stake their cryptocurrency as collateral to validate transactions
and secure the network. In return for their contribution, these participants are
often rewarded with additional cryptocurrency, commonly referred to as
staking rewards. The amount of reward typically depends on factors such as
the amount of cryptocurrency staked and the duration of the stake.

3. Masternode Rewards: Some blockchain networks, like Dash and PIVX,


implement masternodes—a special type of node that performs additional
network functions, such as instant transactions or privacy features.
Masternode operators usually need to hold a certain amount of the
cryptocurrency and fulfill specific requirements. In return for their services,
masternode operators receive rewards in the form of additional
cryptocurrency.

4. Validator Rewards: In blockchain networks that employ proof-of-stake or


similar consensus mechanisms, validators play a role in confirming and
validating transactions. Validators are responsible for ensuring the
correctness and integrity of the blockchain. As a reward for their services,
validators often receive incentives in the form of additional cryptocurrency.

CHAIN :
In the context of blockchain technology, a "chain" refers to the series of blocks that
are sequentially linked together. Each block contains a list of transactions or data,
along with a unique identifier called a cryptographic hash, which is generated
based on the contents of the block.

The blockchain operates as a decentralized and distributed ledger, where each


block is connected to the previous block through the use of cryptographic hashes.
This linking mechanism creates a chain-like structure, hence the name
"blockchain."

The chain serves multiple purposes in a blockchain:


1. Integrity and Immutability: The chain structure ensures the integrity and
immutability of the data recorded on the blockchain. Once a block is added
to the chain, it is extremely difficult to alter or tamper with previous blocks.
Changing the data in one block would require altering all subsequent blocks
in the chain, making it computationally impractical and highly secure.

2. Transaction History: The chain stores a complete record of all transactions


or data entries that have occurred on the blockchain. This transaction history
is transparently available to all participants in the network, allowing them to
verify and audit the integrity of the data.

3. Consensus and Security: The chain plays a crucial role in achieving


consensus and maintaining the security of the blockchain. Consensus
algorithms, such as proof-of-work (PoW) or proof-of-stake (PoS), rely on
the chain structure to ensure that participants agree on the valid state of the
blockchain. By building upon the longest valid chain, these algorithms help
prevent double-spending and other malicious activities.

4. Block Validation: Each block in the chain contains a reference (hash) to the
previous block, forming a cryptographic link. This link enables participants
to validate the authenticity and integrity of each block, ensuring that the data
contained within the block has not been modified.

You might also like