Skip to content

trish404/Defi-Escrow-Project

Repository files navigation

🛡️ zk-SNARK Escrow System with Circom and Poseidon

This project implements a privacy-preserving escrow system using zk-SNARKs (via Circom circuits), Poseidon hash functions, and Ethereum smart contracts. Users can deposit funds with commitments that hide the deposit amount and secret, ensuring anonymity and trustless verification.


🔧 Features

  • 🧠 zk-SNARK Commitments: Leverages Circom circuits and Poseidon hash to create secure, private commitments.
  • 📝 Commit Generator: generate_commit.js produces a JSON input for the circuit using Poseidon hashing.
  • 📜 Smart Contract Integration: Smart contracts for escrow and verification are deployed and referenced in contracts.json.
  • 🔒 Privacy by Design: Hash-based commitments using secrets ensure confidentiality of the deposit details.

📁 Project Structure

├── app.py                      # Backend API for proof generation or contract interaction
├── artifacts/                 # Hardhat build artifacts
├── cache/                     # Temporary build cache
├── circuits/                  # Circom circuit files and input JSONs
├── contracts/
│   └── contracts.json         # Addresses of deployed contracts
├── cookie                     # (Unclear usage – possibly placeholder or token)
├── generate_commit.js         # Generates zk-SNARK input with Poseidon hash
├── hardhat.config.js          # Hardhat configuration for deployment/testing
├── ignition/                  # Hardhat Ignition deployment scripts
├── node_modules/              # NPM dependencies
├── package.json               # Project metadata and dependencies
├── package-lock.json          # Lockfile for npm installs
├── poseidon-hash.js           # Standalone Poseidon hash test script
├── pot14.ptau                 # Powers of Tau file for trusted setup (phase 1)
├── pot14_contributed.ptau     # Contributed phase 1 ptau
├── pot14_final.ptau           # Final ptau used in setup
├── README.md                  # Project documentation
├── scripts/                   # Custom scripts for automation or deployment
├── test/                      # Hardhat tests (JavaScript or TypeScript)

🚀 Getting Started

1. Clone the Repo

git clone https://github.com/your-username/zk-escrow-circom.git
cd zk-escrow-circom

2. Install Dependencies

npm install circomlibjs

🧪 Testing & Deployment

  • Ensure your Circom circuit is compiled and verifier contract is deployed.
  • Run tests to validate correctness of proof generation and on-chain verification.

Contributors

  • Bhavika Gandham
  • Sarayu Krishna
  • Trisha V

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published