0% found this document useful (0 votes)
10 views25 pages

EVM

The Ethereum Virtual Machine (EVM) is essential for executing smart contracts and decentralized applications on the Ethereum blockchain, utilizing a gas mechanism to manage resources. It operates in a decentralized manner, ensuring no single entity controls contract execution, and supports the programming language Solidity for app development. Smart contracts automate transactions based on predefined rules, enhancing trust and security while offering various applications across industries.

Uploaded by

sahukari raja
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)
10 views25 pages

EVM

The Ethereum Virtual Machine (EVM) is essential for executing smart contracts and decentralized applications on the Ethereum blockchain, utilizing a gas mechanism to manage resources. It operates in a decentralized manner, ensuring no single entity controls contract execution, and supports the programming language Solidity for app development. Smart contracts automate transactions based on predefined rules, enhancing trust and security while offering various applications across industries.

Uploaded by

sahukari raja
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/ 25

EVM

 The Ethereum Virtual Machine (EVM) is key to the Ethereum blockchain, allowing
smart contracts and decentralized applications (DApps) to run.
 When developers write smart contracts in Solidity, the EVM runs them, manages
changes, and executes transactions based on the rules.
 It uses gas to manage computing power and keep things fair.
 The Ethereum Virtual Machine (EVM) is a decentralized system that runs smart contracts
on the Ethereum network.
 It runs Ethereum accounts and smart contracts, allowing developers to create apps
without needing a central authority.
 Decentralization: The EVM runs across many nodes, meaning no one controls how
contracts run.
 Turing Completeness: The EVM can perform any computation that can be described with
an algorithm, as long as there are enough resources.
 Smart Contract Execution: The EVM executes a deployed smart contract, processing
inputs and managing state changes on the blockchain.
 Gas Mechanism: Each operation in the EVM needs "gas," a measure of computing effort.
Users pay gas fees to encourage miners to process transactions.
 Isolation: Each smart contract runs separately, so one contract's execution doesn't affect
another.
 State Management: The EVM keeps track of the current state of all accounts and
contracts on the Ethereum network.

Purpose of EVM

 Execution of Smart Contracts: The EVM runs smart contracts, automating transactions
without trust issues.
 Decentralization: The EVM runs on a distributed network, ensuring no single entity
controls contract execution, increasing trust and security.
 State Management: The EVM keeps track of all accounts and contracts' states, ensuring
consistency.
 Resource Management: The gas system regulates resource usage, preventing misuse
and ensuring fairness.
 Compatibility: The EVM allows developers to use languages like Solidity to create apps
that run on Ethereum, simplifying development.
 Turing Completeness: The EVM can perform any algorithmic computation, offering
flexibility for various applications.
 Security: The EVM isolates contracts to prevent interference, enhancing security.

How Does EVM Work?


 Smart Contract Deployment: Developers write smart contracts in languages like
Solidity, which are compiled into bytecode and deployed via transactions.
 Transaction Processing: Users create transactions to interact with contracts, which are
shared across Ethereum nodes.
 Execution: Each node processes the transaction, running the contract logic and updating
the blockchain state.
 Gas Mechanism: Operations require gas, which users pay for. If gas runs out, the
transaction is reverted, but the gas is still used.
 Stack Management: The EVM uses a stack to manage data, storing temporary data in
memory and permanent data on the blockchain.
 Block Creation and Validation: Miners or validators bundle transactions into blocks,
validate them, and add them to the blockchain.
 Finality: Once in a block, changes are permanent and verifiable.

Architecture of the EVM:

 Stack-Based Architecture: The EVM uses a stack to manage data, with up to 1024
items for calculations.
 Memory: The EVM has temporary memory that is cleared after each transaction.
 Persistent State: Each contract has its own storage on the blockchain to keep its state
between transactions.
 Global State: The EVM tracks all accounts, contracts, and their balances.
 Instruction Set: The EVM uses predefined operations (opcodes) to process data and
interact with memory/storage.
 Gas Management: Each operation uses gas, which prevents excessive resource use and
protects the network.
 Execution Environment: The EVM ensures consistent contract execution, producing the
same result on all nodes.
 Interoperability: Other blockchains can use the EVM to run Ethereum-compatible smart
contracts.
SOLIDITY

Solidity is a programming language created by Ethereum, the second-largest cryptocurrency


network. It was released in 2015 and led by Christian Reitwiessner.

Some key features of solidity are listed below:

 Solidity is a high-level programming language designed for implementing smart


contracts.
 It is a statically typed object-oriented(contract-oriented) language.
 Solidity is highly influenced by Python, c++, and JavaScript which run on the Ethereum
Virtual Machine(EVM).
 Solidity supports complex user-defined programming, libraries, and inheritance.
 Solidity is the primary language for blockchains running platforms.
 Solidity can be used to create contracts like voting, blind auctions, crowdfunding,
multi-signature wallets, etc.

Ethereum

 "Ethereum is a decentralized, open-source blockchain platform that runs smart


contracts—programs that automatically execute as written, without fraud, third-party
interference, censorship, or downtime."
 It serves as a platform for nearly 2,60,000 different cryptocurrencies.
 "Ether is a digital currency earned by miners for helping to keep the Ethereum network
safe and running."

ADD CONTENT OF EVM AND SMART CONTRACTS


SMART CONTRACTS

 A smart contract is a computer program that sends digital money or items when rules are
followed.
 A smart contract is like a regular contract, but it also makes sure the rules are followed
automatically.
 Smart contracts are computer programs that follow the instructions given by their creators
exactly.
 Just like regular contracts are enforced by law, smart contracts are enforced by computer
code.
 The Bitcoin network was the first to use smart contracts to send value from one person to
another.
 The smart contract makes sure the sender has enough value before transferring it.
 Later, Ethereum became more powerful because it allowed developers to create custom
contracts using a flexible programming language.
 Bitcoin contracts used a basic language, which limited what they could do.
 Common smart contract platforms include Ethereum, Solana, Polkadot, and Hyperledger
Fabric.
Features of Smart Contracts

 Distributed: Everyone on the network has a copy, and no one can change it alone.
 Deterministic: The outcome is always the same if the conditions are met.
 Immutable: Once created, it can't be changed, only removed if necessary.
 Autonomy: No third parties are involved; the contract runs on the network.
 Customizable: The contract can be customized before launch.
 Transparent: The contract's code is visible to everyone on the blockchain.
 Trustless: No third parties are needed to verify the contract's actions.
 Self-verifying: The contract checks if conditions are met automatically.
 Self-enforcing: The contract enforces the rules when conditions are met.

Capabilities of Smart Contracts

 Accuracy: They do exactly what they’re programmed to do.


 Automation: They automate tasks that are usually done manually.
 Speed: They speed up processes by using code.
 Backup: Each blockchain node keeps a copy of the contract.
 Security: Cryptography keeps assets safe and hard to tamper with.
 Savings: They save money by removing middlemen and paperwork.
 Manage information: They store and organize information like agreements.
 Multi-signature accounts: Funds are released when everyone agrees.
Types of Smart Contracts
1. Smart Legal Contract:

 There are legal guarantees for smart contracts


 They work like regular contracts: “If this happens, then that happens.” Legal smart
contracts are more transparent than traditional ones because they are stored on a
blockchain and can’t be changed.
 Contracts are executed by the parties using digital signatures.
 Smart legal contracts can act on their own if conditions are met, like paying a debt on a
set date.
 If stakeholders don't follow the terms, there could be serious legal consequences.

2. Decentralized Autonomous Organizations (DAOs):

 DAOs are democratic organizations where voting power is given by a smart contract.
 DAOs are democratic organizations where voting power is given by a smart contract.
 There is no executive or president in a DAO.
 The organization's operations and asset distribution are managed by blockchain rules in
the contract's code.
 An example of this type of smart contract is VitaDAO, which uses technology to support
a community focused on scientific research.

3. Application Logic Contracts:

 Application logic contracts (ALCs) are codes that handle and connect with several other
blockchain contracts.
 It allows devices to interact with each other, such as integrating blockchain and the
Internet of Things (IoT).
 These are signed between computers and contracts, instead of between people or
organizations like other smart contracts.

Smart Contract Working

1. Identify Agreement: Parties agree on goals, like business processes or asset swaps.
2. Set Conditions: Smart contracts start when conditions like market changes or GPS
locations are met.
3. Code Business Logic: A program is made to run automatically when conditions are met.
4. Encryption and Blockchain: Encryption ensures secure messaging and verification.
5. Execution and Processing: After agreement, the code runs, and results are recorded.
6. Network Updates: After execution, all nodes update their ledgers, and the record is
permanently added to the blockchain.
Applications of Smart Contracts

 Real Estate: Smart contracts can reduce fees paid to middlemen by transferring
apartment ownership once the agreed payment is made to the seller’s account.
 Vehicle Ownership: A smart contract can track vehicle maintenance and ownership. For
example, it could require maintenance every six months, with penalties for non-
compliance.
 Music Industry: Smart contracts can record music ownership and automatically pay
royalties when the song is used commercially, also helping to resolve ownership disputes.
 Government Elections: Once votes are logged on a blockchain, it’s almost impossible to
alter the results, increasing trust in the election process.
 Management: Smart contracts can automate and streamline decisions in management,
ensuring transparency and efficiency. For example, triggering raw material supply when
production reaches a certain amount.
 Healthcare: Smart contracts can prevent fraud by automating healthcare payments.
Treatments are recorded, and patients can’t leave the hospital until the bill is paid.

Advantages of Smart Contracts:

 Recordkeeping: Transactions are stored securely on the blockchain, ensuring


transparency while protecting privacy.
 Autonomy: Direct transactions between parties remove the need for intermediaries,
enabling clear and transparent relationships.
 Reduce Fraud: Changing the blockchain is hard, and violations are automatically
detected and rejected.
 Fault-tolerance: The decentralized system ensures the contract stays intact even if one
node fails.
 Enhanced Trust: Smart contracts are automatically executed and enforced, making
agreements unbreakable.
 Cost-efficiency: Removing intermediaries and paperwork saves both time and money.

Challenges of Smart Contracts:

 No Regulations: The lack of global regulations makes it difficult to monitor smart


contracts.
 Difficult to Implement: Creating smart contracts is complex and still under research.
 Immutable: Once created, smart contracts can't be changed, requiring a new contract for
updates.
 Alignment: Smart contracts may not always reflect all parties' intentions, which can
cause issues.

SOME ATTACKS ON SMART CONTRACTS:

1. Reentrancy Attack: An attacker repeatedly calls a contract’s function before the first
call finishes, draining its funds or causing errors.
2. Front-Running Attack: An attacker intercepts and modifies a pending transaction,
paying a higher gas fee to get their transaction executed first.
3. Denial of Service (DoS) Attack: Overloading the contract with requests, causing it to
become unresponsive or fail.
4. Integer Overflow/Underflow Attack: Manipulating number values to cause unexpected
results by exceeding or going below limits.
5. Unsecured Use of tx.origin: Using tx.origin for access control, making it easier for
attackers to trick users into calling malicious contracts.
6. Timestamp Dependence Attack: Manipulating block timestamps to exploit contract
behavior that depends on time.
7. Unprotected Selfdestruct Function: An attacker can destroy a contract by triggering the
selfdestruct function if it’s not protected.
8. Gas Limit and Loops Attack: Exploiting contracts with loops or inefficient code to use
too much gas, causing failures or delays.
9. Cross-Contract Vulnerability: Weaknesses when contracts interact, which can be
exploited if not properly secured.
10. Flash Loan Attack: Borrowing large amounts of crypto without collateral to exploit
weaknesses in decentralized protocols in one transaction.
11. Short Address Attack: Exploiting contracts that don’t validate address lengths, causing
errors or exploits.
12. Uninitialized Variables Attack: Exploiting contracts with uninitialized variables that
cause unexpected behavior.
13. Delegatecall Attack: Using delegatecall to execute malicious code from another
contract, leading to vulnerabilities.
14. Storage Collision Attack: When multiple contracts share storage slots, one can
overwrite data, causing errors or breaking logic.
15. Function Visibility Attack: Making sensitive functions public or external, allowing
unauthorized access or manipulation.
16. Block Gas Limit Attack: Forcing a contract to exceed the gas limit, causing transactions
to fail or block other transactions.
17. Malicious Contract Deployment: Deploying contracts with hidden vulnerabilities or
malicious code to steal funds or cause harm.
18. Oracle Manipulation Attack: Manipulating external data provided to a smart contract,
such as price feeds or weather data.
19. Governance Attack: Exploiting decentralized governance to manipulate decisions or
control the network.
20. Bridge Attack: Exploiting weaknesses in cross-chain bridges to steal funds or alter
transactions.
UNIT-5

ZERO KNOWLEDGE PROOFS IN BLOCK CHAIN

 Zero-Knowledge Proofs (ZKPs) are a powerful cryptographic tool used in blockchain


technology to enhance privacy, security, and scalability
 A zero-knowledge proof (ZKP) is a cryptographic method where one party (the prover)
can convince another party (the verifier) that a statement is true.
 A zero-knowledge proof shows something is true without revealing anything else.
 You can prove you know something without saying what it is.
 Zero-Knowledge Proof (ZKP) is a security method first created by MIT researcher Shafi
Goldwasser.
 Zero-knowledge protocols depends on probability, so they’re not as certain as revealing
all the information.
 They provide separate pieces of information that suggest the assertion is probably true.
 Zero-knowledge proofs (ZKPs) have three key features completeness, soundness, and
zero-knowledge.
 These properties enable a prover to prove the truth of a statement to a verifier without
revealing any extra details.

The "Cave of Ali Baba" analogy is often used to explain Zero-Knowledge Proofs (ZKPs) in a
simplified and intuitive way. Let's break it down step-by-step:

The Setup

 The Cave: Imagine a cave with two doors, A and B. These doors are connected by a
tunnel, but one of the doors (let's say, Door A) has a hidden secret passage that allows a
person to travel between both doors without going through the tunnel.
 You (the Prover): You know which door (A or B) has the secret passage, but your goal
is to prove this knowledge without revealing which door it is.
 Your Friend (the Verifier): They stand outside the cave and want to verify that you
know the secret passage without learning which door has it.

The Problem

 The main challenge here is that you want to prove to your friend that you know which
door has the secret passage (and thus can exit from either door when asked) without
revealing which door it is. This is the essence of a Zero-Knowledge Proof: Prove your
knowledge without revealing any additional information.

The Zero-Knowledge Proof Process (Step-by-Step)

1. Entering the Cave:


o You enter the cave and choose a door at random, say Door A.
2. Choosing the Door:
o You go through Door A, which could either be the door with the secret passage or
the regular door.
3. The Verifier Calls a Door:
o After you’ve entered, your friend calls out either "A" or "B," asking you to come
out through that door.
4. If You Know the Secret Passage:
o If you know the secret passage, you can always come out through the door your
friend asks you to, regardless of which door you entered. If you went in through
Door A and they call for Door B, you can exit through the secret passage. If they
call Door A, you can just exit through the same door.
5. Repeat the Process:
o The process repeats multiple times. Your friend continues to call out "A" or "B,"
and you continue to exit through the requested door, proving that you know the
secret passage.

Why It's Zero-Knowledge

 After several rounds, your friend becomes convinced that you know the secret passage
because you consistently exit through the correct door, even when they call for a door
different from the one you initially entered.
 However, they still don’t know which door has the secret passage. They only know
that you are able to move between the two doors at will, but they don’t learn anything
about which specific door contains the secret passage.

Thus, you’ve proven your knowledge (the secret passage) without revealing the secret —
that's what makes this a Zero-Knowledge Proof. You prove you know the secret without
disclosing any information about the secret itself.

Key Takeaways

 Zero-Knowledge: The verifier is convinced you know the secret, but they don’t learn
any new information.
 Security: The more rounds the process repeats, the more confident the verifier becomes
that you know the secret passage, but they never learn which door it is.

Features:

Completeness:
 If a statement is true, an honest prover can successfully convince an honest verifier.
 This means that if the prover knows the secret and the statement is true, the verifier will
be convinced of its validity.
Soundness:
 If a statement is false, a dishonest prover cannot convince an honest verifier.
 This property prevents cheating or misrepresentation.
Zero-Knowledge:
 The verifier only learns whether the statement is true, without gaining any additional
details.
 The proof only confirms the statement's truth without revealing any underlying
information.

Types of zero knowledge proofs:

 Zero-knowledge proofs (ZKPs) can be broadly categorized into two main


types: interactive and non-interactive.
 Interactive ZKPs involve back-and-forth communication between the prover and verifier.
 non-interactive ZKPs require only a single communication round.
 Specific types of non-interactive ZKPs include zk-SNARKs (Succinct Non-interactive
Argument of Knowledge) and zk-STARKs (Scalable Transparent Argument of
Knowledge).
Interactive Zero-Knowledge Proofs (iZKPs):
 It requires multiple rounds of communication between the prover and the verifier.
 The verifier challenges the prover, and the prover responds to convince the verifier of the
statement's truth.
 While providing strong security, iZKPs can be computationally demanding and require
ongoing communication.
Non-Interactive Zero-Knowledge Proofs (NIZKPs):
 Require only one communication round between the prover and verifie.
 The prover generates a proof that can be verified by anyone who has knowledge of the
proof.
 Examples include zk-SNARKs and zk-STARKs.
 They are more efficient and scalable, making them ideal for large-scale applications like
blockchain networks.

zk-SNARKs
 zk-SNARKs are a cryptographic system that allows one party to prove to another that
they know a secret without exposing the secret itself.
 They are known for their efficiency, providing small proof sizes and fast verification
times.
 zk-SNARKs are commonly used in cryptocurrencies like Zcash to achieve privacy and
scalability.

zk-STARKs

 Zero-Knowledge Scalable Transparent Arguments of Knowledge (zk-STARKs) are a


zero-knowledge proof system used in blockchain to verify transactions while keeping the
underlying data private.
 They solve the scalability and privacy challenges of traditional blockchains, allowing for
faster and more secure transactions.
Applications of zero knowledge proofs in blockchain

Zero-knowledge proofs (ZKPs) have several powerful applications in blockchain technology,


primarily enhancing privacy, scalability, and security. Here are some key applications:

1. Privacy-Preserving Transactions

 Example: Zcash uses zk-SNARKs to allow private transactions where sender, receiver,
and amount are hidden, but still verified by the network.
 Benefit: Maintains user privacy without sacrificing security.

2. Scalability Solutions

 zk-Rollups: Aggregate many transactions off-chain and use a ZKP to prove their validity
on-chain (e.g., zkSync, StarkNet).
 Benefit: Reduces on-chain data, lowers gas fees, and increases throughput.

3. Identity Verification (Without Revealing Identity)

 Use Case: Proving someone is over 18 or holds a specific credential without revealing
their full identity.
 Benefit: Enables compliance (like KYC) without exposing sensitive data.

4. Secure Voting

 Use Case: Prove that a vote was cast correctly without revealing who voted for whom.
 Benefit: Increases trust in blockchain-based voting systems.

5. Access Control and Authentication

 Use Case: Prove access rights to smart contracts or systems without revealing the access
key or password.
 Benefit: Enhances security and reduces risk of leaks.

6. Cross-Chain Communication

 Use Case: Prove events happened on one chain to another chain without revealing
sensitive details.
 Benefit: Enables private and secure interoperability between blockchains.

Real World Examples:

Here are some real-world examples of how Zero-Knowledge Proofs (ZKPs) are being used in
blockchain and beyond:
1. Zcash – Privacy-Preserving Cryptocurrency

 Use of ZKPs: zk-SNARKs


 Purpose: Allows users to hide sender, receiver, and transaction amount while still
proving the transaction is valid.
 Impact: Provides full anonymity on a public blockchain.

2. zk-Rollups on Ethereum – Scalable Layer 2 Solutions

 Projects:
o zkSync
o StarkNet
o Polygon zkEVM
 Use of ZKPs: zk-SNARKs / zk-STARKs
 Purpose: Bundles thousands of transactions off-chain, then posts a single ZKP to the
Ethereum mainnet.
 Impact: Greatly increases transaction throughput and lowers gas fees.

3. Polygon ID – Zero-Knowledge Digital Identity

 Use of ZKPs: zk-SNARKs


 Purpose: Users can prove attributes about themselves (like age, nationality, or
credentials) without revealing actual personal data.
 Use Cases:
o Online age verification
o KYC (Know Your Customer) without data exposure

4. zkVoting – Privacy-Preserving Voting Systems

 Use Case: Voters can prove they voted and that their vote was valid without revealing
who they voted for.
 Example Project: Semaphore by the Ethereum Foundation
 Impact: Enables anonymous yet verifiable voting on-chain.

5. Aleph Zero – Private Smart Contracts

 Use of ZKPs: zk-SNARKs + Secure Multiparty Computation (sMPC)


 Purpose: Offers confidential smart contracts for businesses.
 Impact: Enables use cases like private DeFi, corporate contracts, and confidential asset
transfers.
SNARK

zk-SNARKs
 zk-SNARKs are a cryptographic system that allows one party to prove to another that
they know a secret without exposing the secret itself.
 They are known for their efficiency, providing small proof sizes and fast verification
times.
 zk-SNARKs are commonly used in cryptocurrencies like Zcash to achieve privacy and
scalability.

Key Features and Benefits:


 Zero-Knowledge: The prover proves knowledge of a secret without revealing the secret.
 Succinct: Proofs are relatively small and easy to verify.
 Non-Interactive: The prover and verifier do not need to communicate after the initial
proof generation.
 Scalability: zk-SNARKs can be used to increase the scalability of blockchain systems.
 Privacy: They are used in cryptocurrencies like Zcash to enable private transactions.

How zk-SNARKs Work:


 Proving Key Generation: The prover generates a secret key and a public proving key.
 Proof Generation: The prover uses the secret key and the public proving key to generate
a zk-SNARK proof.
 Proof Verification: The verifier uses the public verification key and the zk-SNARK
proof to verify the validity of the statement.

APPLICATIONS
 zk-SNARKs (Zero-Knowledge Succinct Non-Interactive Arguments of Knowledge) help
blockchains be more private and efficient. Here's a simpler breakdown:
 Privacy: zk-SNARKs let someone prove they know something (like a valid transaction)
without showing the actual information. So, sensitive data stays private but is still
verified.
 Scalability: zk-SNARKs make it faster to check if data is correct by not needing to
process all the details. This keeps the blockchain efficient and helps it scale better.
 This is done using small, quick proofs that don’t require back-and-forth communication,
making it easy and fast to verify transactions and calculations.

Here’s a simpler version of zk-SNARKs use cases:

1. Private Transactions: Cryptos like Zcash use zk-SNARKs to hide transaction details
while ensuring they’re valid.
2. Rollups: zk-SNARKs process transactions off-chain and verify them on-chain with one
proof, making things faster and cheaper.
3. Scalability: zk-SNARKs combine many transactions into one proof, improving
blockchain efficiency.
4. Anonymous Payments: zk-SNARKs keep identities and transaction details private in
payment channels.
5. zkVMs: zk-SNARKs run computations without revealing any data.
6. Secure Voting: zk-SNARKs let users prove they voted without showing how or for
whom.
7. Confidential Finance: zk-SNARKs keep financial services private, like lending or DeFi.
8. Identity Verification: zk-SNARKs let users prove who they are without revealing
personal details.
9. Data Integrity: zk-SNARKs verify data is accurate without showing the actual data.
10. Compliance: zk-SNARKs prove legal compliance without sharing sensitive information.
11. Software Updates: zk-SNARKs ensure software updates are valid without exposing
private code.
12. Biometric Verification: zk-SNARKs allow users to prove identity with biometrics,
keeping data private.

Here’s a simplified comparison of zk-SNARKs and zk-STARKs:


 Trusted Setup: zk-SNARKs need a trusted setup, but zk-STARKs don’t.
 Proof Size & Verification: zk-SNARKs have smaller proof sizes and faster verification,
while zk-STARKs have larger proofs but may be quicker to generate in some cases.
 Security: zk-STARKs are considered more secure and transparent because they don’t
rely on a trusted setup.

ZERO KNOWLEDGE PROOF PROTOCOLS

Zero-Knowledge Proof (ZKP) protocols allow one party to prove they know something without
revealing the actual information. These protocols ensure privacy while confirming validity.
There are different types of ZKPs, each with specific use cases:

1. Interactive Zero-Knowledge Proofs (IZKPs):

 The prover and verifier communicate back and forth.


 The prover answers random questions from the verifier to prove they know a secret.
 Example: Proving knowledge of a secret password without revealing it.

2. Non-Interactive Zero-Knowledge Proofs (NIZKPs):

 No communication is needed between the prover and verifier.


 A single proof is created that anyone can verify.
 Examples: zk-SNARKs and zk-STARKs are used in blockchains for privacy and speed.
3. zk-SNARKs:

 Proofs are small and quick to verify.


 No need for communication between prover and verifier.
 Used in cryptocurrencies like Zcash to hide transaction details while proving their
validity.

4. zk-STARKs:

 Similar to zk-SNARKs but do not rely on trusted setups.


 More scalable, handling larger computations.
 Used for blockchain scalability and privacy.

5. Bulletproofs:

 Used for proving that a number is within a specific range.


 Commonly used in privacy-focused cryptocurrencies like Monero to hide transaction
amounts.

6. Sigma Protocols:

 A type of interactive proof used for specific types of claims.


 Involves three steps: commit, challenge, and response.
 Example: Proving knowledge of a discrete logarithm.

7. Fiat-Shamir Heuristic:

 Turns interactive proofs into non-interactive proofs using cryptographic hashing.


 Makes proofs more practical for real-world use.

Key Features of ZKPs:

1. Completeness: A truthful prover will always convince the verifier.


2. Soundness: A dishonest prover cannot easily trick the verifier.
3. Zero-Knowledge: The verifier learns nothing about the secret other than the fact that the
statement is true.

Use Cases:

 Privacy-Preserving Cryptocurrencies (e.g., Zcash, Monero)


 Scalable Blockchain Solutions (e.g., Ethereum 2.0 rollups)
 Authentication (proving identity without revealing details)
 Secure Voting (proving a vote was cast without revealing how)

ZKPs are powerful tools for protecting privacy while ensuring security in various applications.
Here’s a structured summary of various Zero-Knowledge Proof (ZKP) protocols and their use
cases:

1. zk-SNARKs (Zero-Knowledge Succinct Non-Interactive Argument of Knowledge)

 Use Case: Private transactions in cryptocurrencies like Zcash.


 Description: Provides small, quick-to-verify proofs, ensuring transaction privacy without
revealing details.

2. zk-STARKs (Zero-Knowledge Scalable Transparent Argument of Knowledge)

 Use Case: Scalable and transparent ZKPs.


 Description: Does not require a trusted setup, is more scalable, and provides
transparency in proofs.

3. Bulletproofs

 Use Case: Efficient range proofs and confidential transactions.


 Description: Allows for proving that a number lies within a specified range, used in
privacy-focused cryptocurrencies like Monero.

4. zk-Rollups

 Use Case: Scalable and private transactions on Ethereum.


 Description: Processes transactions off-chain, but validates them on-chain, reducing load
on the main blockchain.

5. PLONK (Permutations over Lagrange-bases for Oecumenical Noninteractive arguments of


Knowledge)

 Use Case: Efficient and scalable ZKPs.


 Description: A universal and efficient ZKP that supports scalable applications.

6. Halo

 Use Case: Recursive ZKPs and scalable proof systems.


 Description: Allows for recursive proofs, enabling more efficient scalability in
blockchain systems.

7. Groth16

 Use Case: Efficient and scalable ZKPs.


 Description: A widely-used protocol in zk-SNARKs that allows efficient proofs and
verification in a wide range of blockchain applications.
8. zkPoD (Zero-Knowledge Proof of Data Possession)

 Use Case: Secure data storage and verification.


 Description: Verifies that data exists and is stored securely without revealing the data
itself.

9. zkLedger

 Use Case: Secure and private ledger systems.


 Description: Enables privacy and integrity of transaction records in ledger-based
systems.

10. AZTEC Protocol

 Use Case: Private and secure transactions on Ethereum.


 Description: Uses zk-SNARKs to allow private transactions on Ethereum, focusing on
shielding transaction details.

11. Nightfall

 Use Case: Private and scalable transactions on Ethereum.


 Description: Uses zk-Rollups to enable private transactions while maintaining scalability
on Ethereum.

12. ZKOPs (Zero-Knowledge One-Out-of-Many Proofs)

 Use Case: Efficient and private membership proofs.


 Description: Allows proving membership in a set without revealing which specific
member.

13. Sigma Protocols

 Use Case: Efficient and scalable ZKPs.


 Description: A class of interactive proofs used for specific types of statements, with
three main steps: commit, challenge, and response.

14. zkDAPs (Zero-Knowledge Decentralized Anonymous Payment Systems)

 Use Case: Private and secure payment systems.


 Description: Supports decentralized payment systems with privacy protections.

15. Homomorphic Hiding (HH)

 Use Case: Homomorphic encryption and ZKPs.


 Description: Allows computation on encrypted data while preserving privacy, ensuring
data isn't revealed during processing.
16. Pedersen Commitments

 Use Case: Hiding and binding values in ZKPs.


 Description: Provides a way to commit to a value without revealing it, while ensuring
that the commitment cannot be changed.

17. zkSNARKs-based zkEVM

 Use Case: Private and scalable smart contract execution.


 Description: A zk-SNARKs implementation for Ethereum’s virtual machine, enabling
private and efficient contract execution.

Applications of ZKP Protocols:

 Private Transactions: Ensuring privacy in cryptocurrencies and financial applications.


 Scalable Blockchain Solutions: Reducing data load and improving throughput (e.g.,
Ethereum scaling).
 Secure Data Storage & Verification: Ensuring data integrity without revealing content.
 Identity Management & Authentication: Proving identity without revealing personal
information.
 Private Smart Contract Execution: Ensuring privacy and efficiency in blockchain-
based contracts.

Z CASH

 Zcash is a cryptocurrency based on Bitcoin that focuses on privacy and anonymity.


 It uses zk-SNARKs to hide transaction details like addresses and amounts.
 Zcash uses a public blockchain, but shielded transactions add extra privacy.
 Launched in October 2016 by scientists including Zooko Wilcox, Zcash is based on
Bitcoin but adds privacy features.
 Zcash is a cryptocurrency that focuses on user privacy. It uses zk-SNARKs to enable
shielded transactions, hiding the sender, receiver, and amount. It also supports transparent
transactions, like Bitcoin. Zcash is known for low fees and fast transactions, making it a
more efficient option than Bitcoin in some cases.

Zcash Features

Privacy:

 Shielded Addresses (Z-addresses): Zcash uses zk-SNARKs (zero-knowledge proofs) to


hide transaction details like the sender, receiver, and amount.
 Transparent Addresses (T-addresses): Users can also use public addresses, like in
Bitcoin, where all details are visible.
 Selective Disclosure: Users can share specific transaction details with trusted parties,
like auditors, without exposing everything.
 Zero-Knowledge Proofs (zk-SNARKs): This technology lets users prove something is
true without revealing the actual data.

Functionality:

 Bitcoin-Based Code: Zcash is built on Bitcoin’s code but with added privacy features
and the same 21 million coin limit.
 Proof-of-Work (PoW): Like Bitcoin, Zcash uses miners to validate transactions through
complex problem-solving.
 Fast & Low Fees: Zcash offers quicker transactions and lower fees than Bitcoin.
 Self-Funded Development: Developers are paid by the network to keep improving
Zcash.
 Zcash Foundation: A non-profit group that helps manage and upgrade the protocol.

Other Key Features:

 Private Messages: Users can send encrypted messages with their transactions.
 User Control: As a decentralized network, users fully control their Zcash.
 Open Access: Anyone with internet access can use Zcash.

Working of Zcash:

1. Mining: Zcash uses a proof-of-work consensus algorithm to secure its network.


2. Transaction Verification: Transactions are verified using zk-SNARKs, ensuring the validity
of transactions without revealing sensitive information.
3. Blockchain: Zcash's blockchain stores a record of all transactions, ensuring the integrity and
security of the network.

Use Cases:

 Private Payments: Individuals who prioritize privacy.


 Enterprise Use: Companies needing confidential transactions (e.g., healthcare, finance).
 Regulatory Compliance: Optional disclosure for compliance with regulations.

Challenges:

 Regulatory Scrutiny: Governments may investigate privacy coins for potential misuse.
 Competition: Competes with other privacy coins like Monero and Dash.
EATHEREUM WALLETS (UNIT-4)

 An Ethereum wallet is a software application or device that enables users to store,


manage, and transact with their Ether (ETH) and other Ethereum-based tokens.
 It essentially acts as a digital interface for interacting with the Ethereum blockchain.

Types of Wallets

There are several types of Ethereum wallets, each offering different levels of security, user-
friendliness, and control over your private keys. The main types of Ethereum wallets are:

1. Software Wallets

These are applications or software that you can install on your computer or mobile device. They
offer convenience but may be less secure compared to hardware wallets.

 Desktop Wallets: Installed on your computer.


o Examples: Exodus, Mist, Ethereum Wallet (by ConsenSys)
 Mobile Wallets: Installed on your smartphone or tablet.
o Examples: Trust Wallet, MetaMask, Coinomi

2. Hardware Wallets

These are physical devices that store your private keys offline. They are considered one of the
most secure options for storing Ethereum.

 Examples: Ledger Nano S/X, Trezor Model T

3. Web Wallets

Web wallets are accessed through your web browser. These are generally easy to use but depend
on the security of the service provider.

 Examples: MyEtherWallet (MEW), MetaMask (also works as a browser extension)

4. Paper Wallets

A paper wallet is a physical document that contains your private and public keys. It’s considered
highly secure because it's offline, but it can be easily lost or damaged.

 Examples: MyEtherWallet provides a service to generate paper wallets.

5. Cold Wallets

These are wallets that are not connected to the internet, such as hardware wallets and paper
wallets. They are used for long-term storage, making them immune to online attacks.
6. Hot Wallets

Hot wallets are connected to the internet and can be accessed anytime, which makes them
convenient for daily transactions. However, they can be vulnerable to hacks.

7. Multisignature Wallets

These wallets require more than one private key to authorize a transaction, offering an extra layer
of security. Multisig wallets are commonly used for organizational or group purposes.

 Examples: Gnosis Safe

Each type of wallet offers different trade-offs in terms of convenience, security, and control over
your Ethereum assets. For most everyday users, software or mobile wallets like MetaMask or
Trust Wallet work well. For those looking for maximum security, hardware wallets like Ledger
or Trezor are recommended.

Here are some additional Ethereum wallets, each with different features:

1. MyEtherWallet (MEW)

A web wallet that lets you control your keys and interact with Ethereum.

 Features: Open-source, supports hardware wallets.

2. Coinbase Wallet

A mobile wallet linked to Coinbase for easy crypto transfers.

 Features: Easy to use, supports dApps and NFTs.

3. MetaMask

A browser extension and mobile wallet for Ethereum and dApps.

 Features: Supports multiple networks, DeFi-friendly.

4. Trust Wallet

A mobile wallet for Ethereum and other cryptos with dApp support.

 Features: Secure, staking, DEX access.

5. ZenGo

A mobile wallet using facial recognition for security.


 Features: No private keys, simple setup.

6. Argent

A mobile wallet with built-in DeFi and social recovery.

 Features: No private keys, DeFi integration.

7. Exodus

A wallet for desktop and mobile with an integrated exchange.

 Features: Exchange, supports multiple cryptos.

8. ImToken

A mobile wallet for Ethereum and ERC-20 tokens with dApp support.

 Features: Multi-chain support, dApp access.

9. BlockFi Wallet

A wallet that earns interest on your Ethereum and other assets.

 Features: Interest-earning, crypto borrowing.

10. Fortmatic

A wallet that lets you sign in with email or phone.

 Features: Simple login, dApp-focused.

11. Keeper

A wallet with multi-signature and enhanced security features.

 Features: Multi-signature, secure key management.

These wallets offer different levels of convenience, security, and features for various users. For
instance, Trust Wallet is great for mobile users, while Exodus and MetaMask are popular for
DeFi and desktop use.

Features :

Public and Private Keys:


 Ethereum wallets utilize public-private key cryptography. The public key acts as the
wallet address, allowing users to receive ETH. The private key is a secret that grants
access to the wallet and is essential for signing transactions.
Transaction Management:
 Wallets allow users to send and receive ETH by inputting recipient addresses and
specifying transaction amounts. They also facilitate gas fee adjustments, allowing users
to optimize transaction speed and cost.
Token Support:
 Ethereum wallets can manage a wide range of Ethereum-based tokens, including ERC-
20 and ERC-721 tokens.
DApp Interaction:
 Ethereum wallets enable users to interact with dApps built on the Ethereum blockchain,
providing access to a wide range of decentralized services.
Smart Contract Interaction:
 Ethereum wallets often offer features for interacting with smart contracts, allowing
users to execute their logic and participate in decentralized protocols.
Security:
 Many Ethereum wallets prioritize security by offering features like 2FA (two-factor
authentication), cold storage (offline key storage), and advanced encryption.
User Interface:
 Ethereum wallets come with various user interfaces, ranging from simple touchscreen
interfaces to more advanced options with integration with other wallets or third-party
services.
Backup and Recovery:
 Wallets often offer backup and recovery options to help users recover their wallets in
case of lost or damaged devices.

Popular Ethereum Wallets

Here’s a simplified version of the list of popular Ethereum wallets:

Software Wallets

 MetaMask: Browser extension wallet supporting 5,000+ tokens.


 Trust Wallet: Mobile wallet with support for 100+ networks and staking.
 Exodus: Multi-device wallet for 260+ cryptocurrencies.
 MyEtherWallet (MEW): Ethereum-focused wallet with staking rewards.
 Rainbow Wallet: Beginner and developer-friendly Ethereum wallet.
 Rabby Wallet: Multi-chain wallet supporting 200+ tokens.

Hardware Wallets

 Ledger Nano X: Secure cold wallet supporting 5,000+ coins, Bluetooth-enabled.


 Trezor Model T: Secure wallet with touchscreen, supports 1,600+ cryptocurrencies.
 Trezor Safe 3: Affordable hardware wallet with multi-chain support.
 ELLIPAL Titan 2.0: Secure Ethereum wallet with robust features.
 Ngrave Zero: Air-gapped wallet with biometric security.

Other Options

 Coinbase Wallet: Web3 wallet supporting 200+ tokens.


 Binance Wallet: Wallet with DEX and DeFi access, enhanced security.
 OKX Wallet: Wallet with DEX, DeFi, and advanced security.
 Bybit Wallet: Custodial and non-custodial options with MPC technology.

You might also like