Skip to content

Latest commit

Β 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Decentralized E-Tendering Protocol

A trustless, on-chain procurement system for high-value tenders.

Foundry CI Solidity License: MIT Sepolia


🎯 Overview

This protocol eliminates corporate espionage and corruption in high-value procurement by replacing trusted intermediaries with cryptographic guarantees. It enables sealed-bid auctions for $10M+ tenders entirely on-chain using:

  • Commit-Reveal Cryptography β€” Bids remain secret until the reveal deadline
  • Zero-Knowledge Proofs β€” Range validation without exposing bid amounts
  • Identity Verification β€” Sybil-resistant, authorized-entity-only participation

Status: Research-grade. Deployed to Sepolia testnet. Mainnet deployment pending formal audit.


πŸ”Œ Quick Start

Prerequisites

  • Foundry (forge, cast, anvil)
  • Rust toolchain (for ZK circuits)

Installation

git clone --recurse-submodules https://github.com/your-org/e-tendering.git
cd e-tendering
forge install

Build

forge build

Test

# Unit tests
forge test --match-path "test/unit/*"

# Integration tests
forge test --match-path "test/integration/*"

# Invariant (fuzz) tests
forge test --match-path "test/invariants/*"

# All tests
forge test

πŸ—οΈ Architecture

The protocol operates as a finite state machine ensuring tenders progress irreversibly through valid states:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ CREATED β”‚ ──▸ β”‚ OPEN β”‚ ──▸ β”‚ REVEAL β”‚ ──▸ β”‚ EVALUATION β”‚ ──▸ β”‚ AWARDED β”‚ ──▸ β”‚ RESOLVED β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                   β”‚              β”‚                                  β”‚
                   β–Ό              β–Ό                                  β–Ό
              Commitments    ZK Proofs +                        Disputes
              + Bonds        Reveals                            + Finalize

πŸ“„ Full State Machine Specification β†’


πŸ“‚ Project Structure

e-tendering/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ core/              # Tender.sol, TenderFactory.sol
β”‚   β”œβ”€β”€ crypto/            # ZK verifiers (Halo2), commitment schemes
β”‚   β”œβ”€β”€ identity/          # Identity verifiers (signature, ZK-nullifier)
β”‚   β”œβ”€β”€ strategies/        # Bid evaluation (ZK, LowestPrice, Weighted)
β”‚   β”œβ”€β”€ compliance/        # Regulatory logging module
β”‚   └── interfaces/        # Contract interfaces
β”œβ”€β”€ test/
β”‚   β”œβ”€β”€ unit/              # Per-function tests
β”‚   β”œβ”€β”€ integration/       # Cross-contract scenarios
β”‚   └── invariants/        # Stateful fuzzing (solvency, monotonicity)
β”œβ”€β”€ script/                # Deployment scripts
β”œβ”€β”€ circuits/              # Halo2 ZK circuits (Rust)
└── docs/                  # Specifications & security docs

πŸ“Š Evaluation Strategies

At deployment, each Tender is configured with exactly one evaluation strategy:

Strategy Purpose When to Use
ZKAuctionStrategy ZK range proofs + cryptographic validation Privacy-preserving, spam-resistant
LowestPriceStrategy Lowest valid bid wins Simple, transparent auctions
WeightedScoreStrategy Multi-criteria (price, delivery, compliance) Complex procurement

πŸ“„ Full Strategy Documentation β†’

πŸ”’ Security Model

Attack Vectors Mitigated

Attack Mitigation
Bid Leakage EIP-712 typed commitments hide bid contents
Front-Running Salted hashes prevent MEV copy-cat attacks
Retroactive Bidding Immutable block.timestamp enforces deadlines
Sybil Attacks Identity verifiers ensure 1-entity-1-bid
Invalid Bids ZK range proofs reject out-of-range values

Identity Verification Modes

The protocol supports two distinct identity verification strategies:

Verifier Type Description
ZKNullifierVerifier Public / Permissionless Open to all. Uses Zero-Knowledge Nullifiers to enforce "One Person, One Bid" without revealing identity. Prevents spam while preserving anonymity.
SignatureVerifier Permissioned Restricted. Only addresses signed by a trusted off-chain Issuer (allowlist) can participate. No anonymity guarantees.

Accepted Risks

Risk Assumption
L1 Downtime Underlying chain remains live
Off-chain Collusion Protocol ensures process integrity, not social integrity

πŸ“„ Full Threat Model β†’


πŸ§ͺ Testing & Verification

We employ a comprehensive testing strategy beyond unit tests:

Type Tool Coverage
Unit Tests Foundry Per-function behavior
Integration Tests Foundry Cross-contract flows
Stateless Fuzzing forge fuzz Input edge cases
Stateful Fuzzing forge invariant System invariants

Key Invariants Proven

  • Solvency β€” Contract ETH balance β‰₯ sum of active deposits
  • State Monotonicity β€” Tender state never reverts to a previous state
  • Commitment Integrity β€” Revealed values always match commitments

πŸ” Zero-Knowledge Integration

The protocol uses Halo2 (KZG polynomial commitments) for zero-knowledge range proofs:

Property Value
Proof System Halo2 with KZG
Setup Universal SRS (Powers of Tau)
Proof Size ~192 bytes
Verification Gas ~20,500

ZK Contracts

Contract Description
Halo2Verifier.sol Core pairing-based verification
ZKRangeVerifier.sol Public input formatting adapter
ZKAuctionStrategy.sol Verification + bid scoring

πŸ“„ Full ZK Integration Guide β†’


πŸŒ‰ Cross-Chain Integration (CCIP)

The protocol supports cross-chain bid submission via Chainlink CCIP:

Chain Contract Address
Sepolia CCIPBidReceiver 0x645921f2...4839
Fuji CCIPBidSender 0x2a026858...b7fc

Features:

  • Submit bids from any CCIP-supported chain
  • Automatic bidder ID computation for cross-chain identity
  • Replay protection via message ID tracking
  • Access-controlled sender authorization

πŸ“„ Full Cross-Chain Guide β†’


πŸš€ Deployments

Sepolia Testnet (Production)

Contract Address
Halo2Verifier 0x03Fa...57BD
ZKRangeVerifier 0xd1aD...0d8a
ZKAuctionStrategy 0xFf91...b969

πŸ“„ Full Deployment History β†’


πŸ“š Documentation

Document Description
State Machine Tender lifecycle states & transitions
Threat Model Security analysis & attack vectors
Trust Assumptions Protocol dependencies & guarantees
ZK Integration Halo2 proof system details
Deployments Contract addresses & gas costs

⚠️ Disclaimer

This is research-grade software. While rigorously tested with fuzzing and invariant proofs, it:

  • Relies on the integrity of the Identity Oracle
  • Assumes L1 consensus liveness
  • Has not undergone formal security audit
  • Is not recommended for production use without further verification

πŸ“„ License

This project is licensed under the MIT License β€” see LICENSE for details.


Built with Foundry Β· Verified on Ethereum Sepolia

About

This protocol eliminates corporate espionage and corruption in high-value procurement by replacing trusted intermediaries with cryptographic guarantees.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages