{"id":31443986,"url":"https://github.com/masaun/openbanking.nr-integration-examples","last_synced_at":"2025-09-30T20:36:35.613Z","repository":{"id":305053361,"uuid":"1020539155","full_name":"masaun/openbanking.nr-integration-examples","owner":"masaun","description":"OpenBanking.nr integration examples in Noir","archived":false,"fork":false,"pushed_at":"2025-09-30T08:47:16.000Z","size":1208,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-30T10:28:19.986Z","etag":null,"topics":["noir","openbanking-noir","recursive-proof-system","semaphore-noir","zero-knowledge-proof","zkpassport"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/masaun.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-07-16T03:16:06.000Z","updated_at":"2025-09-30T08:47:21.000Z","dependencies_parsed_at":"2025-07-18T05:18:45.285Z","dependency_job_id":"8c7632ed-8068-4053-bde0-2dc0a466c16e","html_url":"https://github.com/masaun/openbanking.nr-integration-examples","commit_stats":null,"previous_names":["masaun/openbanking.nr-integration-examples"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/masaun/openbanking.nr-integration-examples","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masaun%2Fopenbanking.nr-integration-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masaun%2Fopenbanking.nr-integration-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masaun%2Fopenbanking.nr-integration-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masaun%2Fopenbanking.nr-integration-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/masaun","download_url":"https://codeload.github.com/masaun/openbanking.nr-integration-examples/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masaun%2Fopenbanking.nr-integration-examples/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277754230,"owners_count":25871356,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-30T02:00:09.208Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["noir","openbanking-noir","recursive-proof-system","semaphore-noir","zero-knowledge-proof","zkpassport"],"created_at":"2025-09-30T20:36:33.541Z","updated_at":"2025-09-30T20:36:35.602Z","avatar_url":"https://github.com/masaun.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenBanking.nr Integration Examples\n\n# Overview\n\n- This repo is the experimental repo to test the integrations with the `OpenBanking.nr` library:\n  - `openbanking.nr-circuit`: https://github.com/attested-frontiers/openbanking.nr-circuit\n  - `openbanking.nr-server` (API server for `OpenBanking API`): https://github.com/attested-frontiers/openbanking.nr-server\n\n\u003cbr\u003e\n\n## Run the ZK circuit test\n\n```bash\ncd circuits\nsh sh circuit_test.sh\n```\n\n\u003cbr\u003e\n\n\u003chr\u003e\n\n# Noir + Hardhat Template 🚀\n\nA comprehensive boilerplate that seamlessly integrates [Noir](https://noir-lang.org/) zero-knowledge circuits with [Hardhat](https://hardhat.org/) for Ethereum smart contract development. This template provides everything you need to build, test, and deploy ZK applications with enterprise-grade CI/CD pipelines.\n\n## ✨ Features\n\n- **🔒 Zero-Knowledge Circuit Development** - Write and test Noir circuits with full TypeScript integration\n- **⚡ Hardhat Integration** - Leverage Hardhat's powerful development environment for smart contracts\n- **🧪 Comprehensive Testing** - TypeScript tests for both circuits and smart contracts with dynamic proof generation\n- **🚀 CI/CD Pipeline** - Automated testing, building, and validation\n- **📦 Multiple Proof Formats** - Handle proofs in JSON and binary\n- **🌐 Deployment Ready** - Hardhat Ignition integration for seamless deployment\n- **📋 Code Quality** - ESLint, Solhint, Prettier, Commitlint + Husky for comprehensive code standards\n\n## 🏗️ What You'll Learn\n\nThis template demonstrates a complete **SimpleCounter** example that showcases:\n\n- **Circuit Development**: Create a Noir circuit that verifies arithmetic operations\n- **Proof Generation**: Generate zero-knowledge proofs using the `bb` proving system\n- **Smart Contract Verification**: Verify proofs on-chain using auto-generated Solidity verifiers\n- **Full-Stack Integration**: TypeScript tests that create, verify, and submit proofs dynamically\n- **Production Deployment**: Deploy and interact with your ZK application on Ethereum testnets\n\n## 📋 Prerequisites\n\nBefore getting started, ensure you have:\n\n- **Node.js** (v18 or later) and **Yarn**\n- **Noir toolchain** - Install via [noirup](https://noir-lang.org/docs/getting_started/quick_start#installation)\n- **Barretenberg** (`bb`) - Usually installed with Noir, or install separately\n- **Git** for version control\n\n```bash\n# Install Noir toolchain\ncurl -L https://raw.githubusercontent.com/noir-lang/noirup/main/install | bash\nnoirup\n\n# Verify installations\nnargo --version\nbb --version\n```\n\n## 🚀 Quick Start\n\n1. **Clone and Install**\n\n   ```bash\n   git clone \u003crepository-url\u003e\n   cd noir-hardhat-template\n   yarn install\n   ```\n\n2. **Build the Circuit**\n\n   ```bash\n   yarn circuit:build\n   ```\n\n3. **Test Everything**\n\n   ```bash\n   # Test the Noir circuit\n   yarn circuit:test\n\n   # Test smart contracts with proof verification\n   yarn contracts:test\n   ```\n\n4. **Generate and Verify Proofs**\n\n   ```bash\n   # Generate witness and verification key\n   yarn circuit:witness\n   yarn circuit:vk\n\n   # Create and verify a proof\n   yarn circuit:prove\n   yarn circuit:verify\n   ```\n\n## 📁 Project Structure\n\n```\nnoir-hardhat-template/\n├── circuit/                    # Noir circuit source code\n│   ├── src/main.nr            # Main circuit logic (SimpleCounter)\n│   ├── Nargo.toml             # Circuit configuration\n│   ├── Prover.toml            # Proving parameters\n│   └── target/                # Compiled circuit artifacts\n├── contracts/                  # Solidity smart contracts\n│   ├── SimpleCounter.sol      # Main contract with ZK verification\n│   └── VerifierKeccak.sol     # Auto-generated proof verifier\n├── test/                      # TypeScript test suites\n│   └── SimpleCounter.ts       # Comprehensive integration tests\n├── ignition/                  # Hardhat Ignition deployment modules\n│   └── modules/\n│       └── SimpleCounter.ts   # Deployment configuration\n├── .github/workflows/         # CI/CD pipeline configuration\n└── hardhat.config.ts          # Hardhat configuration\n```\n\n## 🛠️ Available Scripts\n\n### Circuit Operations\n\n```bash\nyarn circuit:build              # Compile Noir circuit\nyarn circuit:test               # Run circuit tests\nyarn circuit:witness           # Generate witness from inputs\nyarn circuit:vk                # Generate verification key\nyarn circuit:prove             # Generate zero-knowledge proof\nyarn circuit:verify            # Verify generated proof\nyarn circuit:solidity_verifier # Generate Solidity verifier contract\n```\n\n### Smart Contract Operations\n\n```bash\nyarn contracts:compile         # Compile Solidity contracts\nyarn contracts:test           # Run smart contract tests\nyarn contracts:deploy         # Deploy to Sepolia testnet\n```\n\n### Development Tools\n\n```bash\nyarn commitlint               # Validate commit messages\nyarn commitlint:last          # Check last commit message\nyarn lint                     # Run ESLint on TypeScript files\nyarn lint:fix                 # Auto-fix ESLint issues\nyarn format                   # Format code with Prettier\nyarn format:check            # Check formatting without changes\nyarn lint:all                # Run linting and format check\n```\n\n## 🎨 Code Quality\n\nThis template includes comprehensive linting and formatting tools to maintain code quality:\n\n### **TypeScript Linting** (ESLint)\n\n- Configured with TypeScript-specific rules and best practices\n- Integrates with Prettier for consistent formatting\n- Catches potential bugs and enforces coding standards\n- Run with `yarn lint` or auto-fix with `yarn lint:fix`\n\n### **Solidity Linting** (Solhint)\n\n- Enforces Solidity best practices and security patterns\n- Configured with recommended rules for modern Solidity development\n- Run with `npx hardhat check`\n- Auto-generated verifier contracts are excluded from linting\n\n### **Code Formatting** (Prettier)\n\n- Ensures consistent code style across TypeScript, Solidity, JSON, and Markdown\n- Configured with sensible defaults for each file type\n- Run with `yarn format` or check with `yarn format:check`\n\n### **Pre-commit Hooks**\n\n- Automatically runs linting and formatting on staged files\n- Prevents committing code that doesn't meet quality standards\n- Powered by Husky and lint-staged\n\n### **CI Integration**\n\nThe CI pipeline includes dedicated jobs for:\n\n- TypeScript linting\n- Solidity linting\n- Formatting verification\n- Commit message validation\n\n### **Noir Language Support**\n\nCurrently, there are no dedicated linting tools for Noir. However:\n\n- VSCode users can install the `vscode-noir` extension for syntax highlighting and LSP support\n- NeoVim users can use the `noir-nvim` plugin\n- The Language Server Protocol (LSP) provides basic error checking via `nargo lsp`\n\n## 🔄 CI/CD Pipeline\n\nOur GitHub Actions pipeline ensures code quality and functionality across all components:\n\n### **Automated Workflows**\n\n- **🔍 Commit Validation** - Enforces conventional commit standards on all PRs and pushes\n- **✨ TypeScript Linting** - ESLint checks for code quality and potential bugs\n- **🔒 Solidity Linting** - Solhint enforces best practices and security patterns\n- **🎨 Format Check** - Prettier ensures consistent code formatting\n- **🔧 Circuit Build** - Compiles Noir circuits and caches artifacts\n- **🧪 Circuit Testing** - Runs all circuit tests with Noir toolchain\n- **🔐 Proof Generation \u0026 Verification** - Full prove/verify cycle validation\n- **📝 Contract Compilation** - Compiles Solidity contracts with optimizations\n- **⚡ Integration Testing** - End-to-end tests with proof verification on contracts\n\n## 💡 Understanding the SimpleCounter Example\n\nThe **SimpleCounter** demonstrates a complete ZK application workflow:\n\n### **The Circuit** (`circuit/src/main.nr`)\n\n```noir\nfn main(x: Field, y: pub Field, z: pub Field) {\n    assert((x != y) \u0026 (y != z));\n}\n\n#[test]\nfn test_main() {\n    main(1, 2, 1);\n}\n```\n\nThis circuit implements a **uniqueness constraint verification**:\n\n- **Private Input** (`x`): A secret value known only to the prover\n- **Public Inputs** (`y`, `z`): Values that are publicly known and verified\n- **Constraint**: Proves that `x` is different from `y` AND `y` is different from `z`\n- **Use Case**: Demonstrates how to prove knowledge of a unique value without revealing it\n\n### **The Smart Contract** (`contracts/SimpleCounter.sol`)\n\n- Stores a counter value on-chain\n- Accepts zero-knowledge proofs of uniqueness constraints\n- Verifies proofs using the auto-generated Solidity verifier\n- Increments the counter only when valid proofs are submitted\n\n### **The Tests** (`test/SimpleCounter.ts`)\n\n- Dynamically generates proofs with different combinations of `x`, `y`, `z` values\n- Demonstrates proof format conversion (binary ↔ JSON)\n- Verifies end-to-end integration between uniqueness circuits and smart contracts\n- Shows how private values can remain hidden while proving constraints\n\n## 🌐 Deployment\n\n### **Environment Setup**\n\nConfigure your deployment environment:\n\n```bash\n# Set your private key and RPC URL\nnpx hardhat vars set SEPOLIA_PRIVATE_KEY\nnpx hardhat vars set SEPOLIA_URL_RPC\nnpx hardhat vars set ETHERSCAN_API_KEY\n```\n\n### **Deploy to Sepolia**\n\n```bash\nyarn contracts:deploy\n```\n\nThe deployment uses **Hardhat Ignition** for:\n\n- ✅ Reproducible deployments\n- ✅ Automatic verification on Etherscan\n\n## 🧪 Development Workflow\n\n1. **Write your circuit** in `circuit/src/main.nr`\n2. **Test circuit logic** with `yarn circuit:test`\n3. **Generate verifier contract** with `yarn circuit:solidity_verifier`\n4. **Write smart contract tests** in TypeScript\n5. **Run full test suite** with `yarn contracts:test`\n6. **Deploy and verify** on testnet\n\n## 📚 Learn More\n\n- **[Noir Documentation](https://noir-lang.org/docs)** - Learn zero-knowledge circuit development\n- **[Hardhat Documentation](https://hardhat.org/docs)** - Master Ethereum development\n- **[Barretenberg](https://github.com/AztecProtocol/aztec-packages/tree/master/barretenberg)** - Understanding the proving system\n\n## 🤝 Contributing\n\nContributions are welcome! Please ensure:\n\n- Follow conventional commit standards (enforced by our CI)\n- Add tests for new features\n- Update documentation as needed\n- All CI checks pass\n\n## 📄 License\n\nThis project is licensed under the MIT License. See [LICENSE](LICENSE) for details.\n\n---\n\n**Built with ❤️ for the Noir and Ethereum communities**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmasaun%2Fopenbanking.nr-integration-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmasaun%2Fopenbanking.nr-integration-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmasaun%2Fopenbanking.nr-integration-examples/lists"}