Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zkFetch Proof Verification Example

This project demonstrates how to generate a proof using Reclaim's zkFetch and verify it on-chain using ethers.js. It fetches the Ethereum price from the CoinGecko API, generates a proof for the fetched data, and then verifies the proof on a smart contract deployed on the blockchain.

Prerequisites

Setup

  1. Clone the Repository

    git clone https://gitlab.reclaimprotocol.org/starterpacks/zkfetch-ethers-example.git
    cd zkfetch-ethers-example
  2. Install Dependencies

    npm install
  3. Create a .env File:

    Create a .env file in the root directory and populate it with the content mentioned in the .env.example Make sure to replace the placeholders with your actual values.

  4. Running the Script To execute the proof verification script, run:

    node index.js

    The script will:

    • Fetch the Ethereum price from the CoinGecko API (As an Example).
    • Generate a proof for the fetched data.
    • Verify the proof on-chain using the provided contract address.

Project Structure

  • index.js: The main script for generating and verifying proofs.
  • contractABI.json: The ABI for the smart contract with the verifyProof function.
  • .env: Environment variables for configuring the script (You need to create it with the help of .env.example).

Notes

  • Make sure your wallet has enough funds to pay for gas fees on the specified network.
  • The script uses the Base Sepolia test network by default. You can change the RPC_URL and CONTRACT_ADDRESS to point to your preferred network and contract.

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages