Skip to content

Latest commit

 

History

165 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ProofPay

KYC-free payments using on-chain proof on Base network

ProofPay is a decentralized payment platform that leverages Ethereum Attestation Service (EAS) on the Base network to enable secure, verified payments without traditional KYC processes.

🌟 Key Features

  • Privacy-Preserving: Use on-chain attestations instead of sharing personal documents
  • Policy-Based Verification: Flexible proof requirements with trusted issuers
  • Session Management: Complete lifecycle from creation to execution
  • Fast & Cheap: Built on Base L2 for lightning-fast transactions with minimal fees
  • Upgradeable: All contracts use UUPS proxy pattern for future improvements
  • Multiple Proof Types: Support for EAS attestations, ZK proofs, and signatures

🏗️ Architecture

Smart Contracts (Solidity + Foundry)

Core Contracts:

  • PolicyManager: Manages payment policies with flexible proof requirements
  • SessionManager: Handles payment session lifecycle with proof verification

Key Features:

  • Multiple proof types (EAS attestations, ZK proofs, signatures)
  • Policy-based verification with trusted issuers
  • Session lifecycle management (Pending → Verified → Executed)
  • Automatic expiration and refund handling
  • UUPS upgradeable proxy pattern

Backend (Python + FastAPI)

  • RESTful API for user and payment management
  • EAS integration service
  • Web3 blockchain interactions
  • Real-time transaction monitoring

Frontend (React + Tailwind CSS)

  • Modern, responsive UI
  • Web3 wallet integration (MetaMask, etc.)
  • Real-time transaction updates
  • Attestation verification interface

🚀 Quick Start

Prerequisites

  • Node.js v18+
  • Python 3.11+
  • Foundry (for smart contracts)
  • MongoDB (for backend)

Using ProofPay

1. Create a Payment Policy:

// Policy with KYC requirement
uint256 policyId = policyManager.createPolicy(
    "KYC Required",
    "Payments require valid KYC attestation",
    block.timestamp,      // Valid from now
    0,                    // No expiration
    1                     // Minimum 1 proof required
);

// Add EAS attestation requirement
policyManager.addProofRequirement(
    policyId,
    ProofType.EASAttestation,
    kycSchemaUID,
    trustedIssuer,
    true,                // Required
    30 days             // Validity period
);

2. Create a Payment Session:

// Create session with 1 ETH payment
bytes32 sessionId = sessionManager.createSession{value: 1 ether}(
    payeeAddress,
    address(0),         // Native ETH
    1 ether,
    policyId,
    block.timestamp + 7 days,  // Expires in 7 days
    "Payment for services"
);

3. Attach Proof and Execute:

// Attach EAS attestation
sessionManager.attachProof(
    sessionId,
    ProofType.EASAttestation,
    attestationUID,
    issuer,
    0                  // No expiration
);

// Verify session
bool verified = sessionManager.verifySession(sessionId);

// Execute payment
sessionManager.executeSession(sessionId);

Installation

  1. Clone the repository
git clone https://github.com/yourusername/ProofPay.git
cd ProofPay
  1. Install smart contract dependencies
cd contracts
forge install
forge build
  1. Install backend dependencies
cd ../backend
pip install -r requirements.txt
cp .env.example .env
# Edit .env with your configuration
  1. Install frontend dependencies
cd ../frontend
yarn install
cp .env.example .env
# Edit .env with your configuration

Running Locally

  1. Start backend
cd backend
uvicorn server:app --reload --port 8001
  1. Start frontend
cd frontend
yarn start
  1. Deploy contracts (local)
cd contracts
anvil  # Start local node
forge script script/DeployBase.s.sol --rpc-url http://localhost:8545 --broadcast

📚 Documentation

🧪 Testing

Smart Contracts

cd contracts
forge test -vvv
forge coverage

Backend

cd backend
pytest tests/ -v --cov

Frontend

cd frontend
yarn test

🔐 Security

  • All smart contracts are upgradeable using UUPS pattern
  • Reentrancy protection on all payment functions
  • Regular security audits (coming soon)
  • Bug bounty program (coming soon)

⚠️ This project is in active development. Do not use in production without thorough security review.

🌐 Deployment

Base Sepolia (Testnet)

Contract Addresses (Testnet):

PolicyManager Proxy:  0xC879C9fe4Dd2ec91125074CE98E64b44218EB970
SessionManager Proxy: 0x4c03a6C94D75933AA7793489CFAf32b646A36887
EAS Registry:         0x4200000000000000000000000000000000000021

Base Mainnet

Contract Addresses (Mainnet):

PolicyManager Proxy:  0x68ec8755100C66FB9599DF8a6a8de2006F1011cC
SessionManager Proxy: 0x6e29216BF4Ee6Ff4c1B3e3eD048B4D0d583e84Ac
EAS Registry:         0x4200000000000000000000000000000000000021

Deployment Instructions

  1. Set up environment variables:
export PRIVATE_KEY="your-private-key"
export BASE_SEPOLIA_RPC_URL="https://sepolia.base.org"
  1. Deploy to Base Sepolia:
cd contracts
forge script script/DeployBase.s.sol:DeployBase \
  --rpc-url $BASE_SEPOLIA_RPC_URL \
  --broadcast \
  --verify \
  -vvvv
  1. Deploy to Base Mainnet:
export BASE_MAINNET_RPC_URL="https://mainnet.base.org"
forge script script/DeployBase.s.sol:DeployBase \
  --rpc-url $BASE_MAINNET_RPC_URL \
  --broadcast \
  --verify \
  -vvvv

Deployment info is automatically saved to deployments/ directory.

🤝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

📞 Contact


Built with ❤️ on Base

About

Proof‑aware payment rail on Base where transfers are gated by EAS attestations and ZK proofs for KYC, access and milestones.

Topics

Resources

Contributing

Stars

24 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages