{"id":46566602,"url":"https://github.com/sip-protocol/circuits","last_synced_at":"2026-03-07T07:12:07.656Z","repository":{"id":326614201,"uuid":"1104928404","full_name":"sip-protocol/circuits","owner":"sip-protocol","description":"Noir ZK circuits for SIP Protocol - Funding, Validity, Fulfillment proofs","archived":false,"fork":false,"pushed_at":"2026-03-01T00:15:53.000Z","size":100,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-01T03:41:24.905Z","etag":null,"topics":["barretenberg","blockchain","cross-chain","cryptography","halo2","near-protocol","noir","privacy","rust","solana","zero-knowledge-proofs","zk-snarks","zksnark"],"latest_commit_sha":null,"homepage":"https://sip-protocol.org","language":"Noir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sip-protocol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-26T22:25:13.000Z","updated_at":"2026-03-01T00:15:57.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sip-protocol/circuits","commit_stats":null,"previous_names":["sip-protocol/circuits"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sip-protocol/circuits","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sip-protocol%2Fcircuits","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sip-protocol%2Fcircuits/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sip-protocol%2Fcircuits/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sip-protocol%2Fcircuits/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sip-protocol","download_url":"https://codeload.github.com/sip-protocol/circuits/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sip-protocol%2Fcircuits/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30209484,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T05:23:27.321Z","status":"ssl_error","status_checked_at":"2026-03-07T05:00:17.256Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["barretenberg","blockchain","cross-chain","cryptography","halo2","near-protocol","noir","privacy","rust","solana","zero-knowledge-proofs","zk-snarks","zksnark"],"created_at":"2026-03-07T07:12:07.003Z","updated_at":"2026-03-07T07:12:07.644Z","avatar_url":"https://github.com/sip-protocol.png","language":"Noir","readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cpre\u003e\n███████╗ ██╗ ██████╗      ██████╗██╗██████╗  ██████╗██╗   ██╗██╗████████╗███████╗\n██╔════╝ ██║ ██╔══██╗    ██╔════╝██║██╔══██╗██╔════╝██║   ██║██║╚══██╔══╝██╔════╝\n███████╗ ██║ ██████╔╝    ██║     ██║██████╔╝██║     ██║   ██║██║   ██║   ███████╗\n╚════██║ ██║ ██╔═══╝     ██║     ██║██╔══██╗██║     ██║   ██║██║   ██║   ╚════██║\n███████║ ██║ ██║         ╚██████╗██║██║  ██║╚██████╗╚██████╔╝██║   ██║   ███████║\n╚══════╝ ╚═╝ ╚═╝          ╚═════╝╚═╝╚═╝  ╚═╝ ╚═════╝ ╚═════╝ ╚═╝   ╚═╝   ╚══════╝\n\u003c/pre\u003e\n\n# SIP Circuits\n\n\u003e **Privacy is not a feature. It's a right.**\n\n**Zero-knowledge proof circuits for SIP Protocol — prove without revealing**\n\n*Funding proofs • Validity proofs • Fulfillment proofs • Browser-compatible*\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n[![Noir](https://img.shields.io/badge/Noir-1.0.0--beta.15-8B5CF6)](https://noir-lang.org/)\n[![Barretenberg](https://img.shields.io/badge/Backend-UltraHonk-purple)](https://github.com/AztecProtocol/barretenberg)\n[![Tests](https://img.shields.io/badge/Tests-19_passing-brightgreen)](.)\n\n**🏆 Winner — [Zypherpunk Hackathon](https://zypherpunk.xyz) ($6,500: NEAR $4,000 + Tachyon $500 + pumpfun $2,000) | #9 of 93 | 3 Tracks**\n\n\u003c/div\u003e\n\n---\n\n## Table of Contents\n\n- [What are SIP Circuits?](#-what-are-sip-circuits)\n- [Circuits Overview](#-circuits-overview)\n- [Quick Start](#-quick-start)\n- [Circuit Details](#-circuit-details)\n- [Architecture](#%EF%B8%8F-architecture)\n- [Cryptographic Primitives](#-cryptographic-primitives)\n- [Integration](#-integration)\n- [Development](#-development)\n- [Specifications](#-specifications)\n- [Related Projects](#-related-projects)\n- [License](#-license)\n\n---\n\n## 🛡️ What are SIP Circuits?\n\nSIP Circuits are **zero-knowledge proof circuits** written in Noir that enable privacy-preserving operations without revealing sensitive data. They're the cryptographic backbone of SIP Protocol.\n\n```\nTraditional Transaction  → Everyone sees balance, amount, recipient\nSIP with ZK Proofs       → Prove validity without revealing anything\n```\n\n**Prove you have enough. Prove you're authorized. Prove it's correct. Reveal nothing.**\n\n---\n\n## 📊 Circuits Overview\n\n| Circuit | Purpose | ACIR Opcodes | Tests |\n|---------|---------|--------------|-------|\n| **funding_proof** | Prove balance ≥ minimum without revealing balance | 972 | 5 |\n| **validity_proof** | Prove intent authorization without revealing sender | 1,113 | 6 |\n| **fulfillment_proof** | Prove swap execution correctness | 1,691 | 8 |\n\n**Total: 3 circuits, 3,776 ACIR opcodes, 19 tests passing**\n\n### What Each Circuit Proves\n\n```\n┌─────────────────────────────────────────────────────────────────┐\n│  FUNDING PROOF                                                  │\n│  \"I have enough balance\"                                        │\n│  ─────────────────────                                          │\n│  Public:  commitment_hash, minimum_required, asset_id           │\n│  Private: actual_balance, blinding_factor                       │\n│  Proves:  balance \u003e= minimum (without revealing balance)        │\n├─────────────────────────────────────────────────────────────────┤\n│  VALIDITY PROOF                                                 │\n│  \"I authorized this intent\"                                     │\n│  ─────────────────────────                                      │\n│  Public:  intent_hash, sender_commitment, nullifier, timestamps │\n│  Private: sender_address, signature, secrets                    │\n│  Proves:  valid signature from committed sender                 │\n├─────────────────────────────────────────────────────────────────┤\n│  FULFILLMENT PROOF                                              │\n│  \"The swap was executed correctly\"                              │\n│  ─────────────────────────────────                              │\n│  Public:  intent_hash, output_commitment, recipient, min_output │\n│  Private: actual_output, oracle_attestation                     │\n│  Proves:  output \u003e= min_output with oracle verification         │\n└─────────────────────────────────────────────────────────────────┘\n```\n\n---\n\n## 🚀 Quick Start\n\n### Prerequisites\n\n- [Nargo CLI](https://noir-lang.org/docs/getting_started/installation)\n\n### Installation\n\n```bash\n# Install Nargo (Noir's package manager)\ncurl -L https://raw.githubusercontent.com/noir-lang/noirup/main/install | bash\nnoirup\n\n# Clone the repository\ngit clone https://github.com/sip-protocol/circuits.git\ncd circuits\n```\n\n### Compile \u0026 Test\n\n```bash\n# Compile a circuit\ncd funding_proof\nnargo compile\n\n# Run tests\nnargo test\n\n# Get circuit info (constraint count)\nnargo info\n\n# Generate a proof (requires Prover.toml)\nnargo prove\n\n# Verify a proof\nnargo verify\n```\n\n### Run All Tests\n\n```bash\n# From circuits root\ncd funding_proof \u0026\u0026 nargo test \u0026\u0026 cd ..\ncd validity_proof \u0026\u0026 nargo test \u0026\u0026 cd ..\ncd fulfillment_proof \u0026\u0026 nargo test \u0026\u0026 cd ..\n```\n\n---\n\n## 🔐 Circuit Details\n\n### 1. Funding Proof\n\nProves that a user has sufficient balance without revealing the actual amount.\n\n**Use case:** Pre-validate that user can afford a swap before execution.\n\n```noir\n// Public Inputs\ncommitment_hash: [u8; 32]   // Hash of Pedersen commitment to balance\nminimum_required: u64       // Minimum balance required\nasset_id: Field             // Asset identifier\n\n// Private Inputs (never revealed)\nbalance: u64                // Actual user balance\nblinding: Field             // Commitment blinding factor\n```\n\n**Verification:**\n1. Recompute commitment from `balance` and `blinding`\n2. Verify commitment hash matches public input\n3. Assert `balance \u003e= minimum_required`\n\n### 2. Validity Proof\n\nProves intent authorization without revealing sender identity.\n\n**Use case:** Authorize a swap intent while hiding who's swapping.\n\n```noir\n// Public Inputs\nintent_hash: Field                  // Hash of the intent\nsender_commitment_x: Field          // Commitment X coordinate\nsender_commitment_y: Field          // Commitment Y coordinate\nnullifier: Field                    // Prevents double-spending\ntimestamp: u64                      // Current timestamp\nexpiry: u64                         // Intent expiry time\n\n// Private Inputs (never revealed)\nsender_address: Field               // Actual sender address\nsender_blinding: Field              // Commitment blinding\nsender_secret: Field                // For nullifier derivation\npub_key_x: [u8; 32]                 // ECDSA public key X\npub_key_y: [u8; 32]                 // ECDSA public key Y\nsignature: [u8; 64]                 // ECDSA signature\nmessage_hash: [u8; 32]              // Signed message hash\nnonce: Field                        // Unique nonce\n```\n\n**Verification:**\n1. Verify ECDSA signature on message\n2. Verify sender commitment matches address\n3. Verify nullifier derivation\n4. Check timestamp within expiry\n\n### 3. Fulfillment Proof\n\nProves correct swap execution with oracle attestation.\n\n**Use case:** Verify solver delivered correct output amount.\n\n```noir\n// Public Inputs\nintent_hash: Field                  // Intent being fulfilled\noutput_commitment_x: Field          // Output commitment X\noutput_commitment_y: Field          // Output commitment Y\nrecipient_stealth: Field            // Stealth delivery address\nmin_output_amount: u64              // Required minimum output\nsolver_id: Field                    // Solver identifier\nfulfillment_time: u64               // When fulfilled\nexpiry: u64                         // Must fulfill before\n\n// Private Inputs (never revealed)\noutput_amount: u64                  // Actual delivered amount\noutput_blinding: Field              // Commitment blinding\nsolver_secret: Field                // Derives solver_id\noracle_recipient: Field             // Oracle-attested recipient\noracle_amount: u64                  // Oracle-attested amount\noracle_tx_hash: [u8; 32]            // Transaction hash\noracle_block: u64                   // Block number\noracle_signature: [u8; 64]          // Oracle signature\noracle_message_hash: [u8; 32]       // Signed message\noracle_pub_key_x: [u8; 32]          // Oracle public key\noracle_pub_key_y: [u8; 32]\n```\n\n**Verification:**\n1. Verify oracle signature on attestation\n2. Verify output commitment matches amount\n3. Assert `output_amount \u003e= min_output_amount`\n4. Verify solver_id derivation\n5. Check fulfillment within expiry\n\n---\n\n## 🏗️ Architecture\n\n### Project Structure\n\n```\ncircuits/\n├── funding_proof/\n│   ├── Nargo.toml                  # Circuit manifest\n│   ├── src/\n│   │   └── main.nr                 # Circuit implementation\n│   └── target/\n│       └── funding_proof.json      # Compiled artifact\n│\n├── validity_proof/\n│   ├── Nargo.toml\n│   ├── src/\n│   │   └── main.nr\n│   └── target/\n│       └── validity_proof.json     # ✅ Compiled\n│\n├── fulfillment_proof/\n│   ├── Nargo.toml\n│   ├── src/\n│   │   └── main.nr\n│   └── target/\n│       └── fulfillment_proof.json  # ✅ Compiled\n│\n├── README.md\n└── CLAUDE.md\n```\n\n### Proof Flow\n\n```\nPrivate Inputs + Public Inputs → Noir Circuit → ACIR → Barretenberg → Proof\n                                                              │\n                                                              ▼\n                                                    SDK Verifies Proof\n                                                    (Browser or Server)\n```\n\n---\n\n## 🔢 Cryptographic Primitives\n\n| Primitive | Usage | Noir Standard Library |\n|-----------|-------|----------------------|\n| **Pedersen Hash** | Commitments, nullifiers | `std::hash::pedersen_hash` |\n| **BLAKE3** | Commitment binding, message hashing | `std::hash::blake3` |\n| **ECDSA secp256k1** | Signature verification | `std::ecdsa_secp256k1::verify_signature` |\n\n### Why These Primitives?\n\n- **Pedersen**: Additively homomorphic, efficient in ZK circuits\n- **BLAKE3**: Fast, secure, small circuit size\n- **ECDSA secp256k1**: Compatible with Ethereum/Bitcoin signatures\n\n---\n\n## 🔌 Integration\n\n### SDK Integration\n\nCompiled JSON artifacts are used by the SDK's `NoirProofProvider`:\n\n```typescript\nimport { NoirProofProvider } from '@sip-protocol/sdk'\n\n// Initialize provider (loads WASM)\nconst provider = new NoirProofProvider()\nawait provider.initialize()\n\n// Generate a funding proof\nconst result = await provider.generateFundingProof({\n  balance: 100n,\n  minimumRequired: 50n,\n  blindingFactor: new Uint8Array(32),\n  assetId: '0xABCD',\n})\n\nconsole.log(result.proof)       // Proof bytes\nconsole.log(result.publicInputs) // Public inputs\n```\n\n### Browser Proving\n\nCircuits are optimized for browser execution via WASM:\n\n```typescript\nimport { BrowserNoirProvider } from '@sip-protocol/sdk'\n\n// Browser-compatible proving\nconst provider = new BrowserNoirProvider()\nawait provider.initialize()\n\n// Proof generation happens client-side\nconst proof = await provider.generateFundingProof({ ... })\n```\n\n---\n\n## 💻 Development\n\n### Commands\n\n```bash\nnargo compile    # Compile circuit to ACIR\nnargo test       # Run circuit tests\nnargo info       # Show constraint count\nnargo prove      # Generate proof (needs Prover.toml)\nnargo verify     # Verify proof\nnargo check      # Type check without compiling\n```\n\n### Writing Tests\n\n```noir\n// In src/main.nr\n#[test]\nfn test_valid_funding() {\n    let balance = 100;\n    let minimum = 50;\n    let blinding = 12345;\n\n    // This should pass\n    main(\n        pedersen_hash(balance, blinding),\n        minimum,\n        1, // asset_id\n        balance,\n        blinding\n    );\n}\n\n#[test(should_fail)]\nfn test_insufficient_balance() {\n    let balance = 30;\n    let minimum = 50;\n    // This should fail: 30 \u003c 50\n    main(...);\n}\n```\n\n### Adding a New Circuit\n\n1. Create directory: `mkdir new_circuit \u0026\u0026 cd new_circuit`\n2. Initialize: `nargo init`\n3. Implement circuit in `src/main.nr`\n4. Add tests\n5. Compile: `nargo compile`\n6. Integrate with SDK\n\n---\n\n## 📋 Specifications\n\nDetailed specifications in documentation:\n\n| Spec | Link |\n|------|------|\n| Funding Proof | [docs.sip-protocol.org/specs/funding-proof](https://docs.sip-protocol.org/specs/funding-proof) |\n| Validity Proof | [docs.sip-protocol.org/specs/validity-proof](https://docs.sip-protocol.org/specs/validity-proof) |\n| Fulfillment Proof | [docs.sip-protocol.org/specs/fulfillment-proof](https://docs.sip-protocol.org/specs/fulfillment-proof) |\n\n---\n\n## 🔗 Related Projects\n\n| Project | Description | Link |\n|---------|-------------|------|\n| **sip-protocol** | Core SDK (uses compiled circuits) | [GitHub](https://github.com/sip-protocol/sip-protocol) |\n| **docs-sip** | Circuit specifications | [docs.sip-protocol.org](https://docs.sip-protocol.org) |\n| **Noir** | ZK DSL documentation | [noir-lang.org](https://noir-lang.org/docs) |\n| **Barretenberg** | Proving backend | [GitHub](https://github.com/AztecProtocol/barretenberg) |\n\n---\n\n## 📄 License\n\n[MIT License](LICENSE) — see LICENSE file for details.\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n**🏆 Zypherpunk Hackathon Winner ($6,500) | #9 of 93 | 3 Tracks**\n\n*Privacy is not a feature. It's a right.*\n\n[Documentation](https://docs.sip-protocol.org/specs) · [Noir Docs](https://noir-lang.org/docs) · [Report Bug](https://github.com/sip-protocol/circuits/issues)\n\n*Part of the [SIP Protocol](https://github.com/sip-protocol) ecosystem*\n\n\u003c/div\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsip-protocol%2Fcircuits","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsip-protocol%2Fcircuits","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsip-protocol%2Fcircuits/lists"}