@@ -7,11 +7,10 @@ A comprehensive boilerplate that seamlessly integrates [Noir](https://noir-lang.
77- ** 🔒 Zero-Knowledge Circuit Development** - Write and test Noir circuits with full TypeScript integration
88- ** ⚡ Hardhat Integration** - Leverage Hardhat's powerful development environment for smart contracts
99- ** 🧪 Comprehensive Testing** - TypeScript tests for both circuits and smart contracts with dynamic proof generation
10- - ** 🚀 CI/CD Pipeline** - Automated testing, building, and validation with GitHub Actions
11- - ** 📦 Multiple Proof Formats** - Handle proofs in JSON, binary, and Solidity-compatible formats
12- - ** 🌐 Deployment Ready** - Hardhat Ignition integration for seamless Sepolia deployment
10+ - ** 🚀 CI/CD Pipeline** - Automated testing, building, and validation
11+ - ** 📦 Multiple Proof Formats** - Handle proofs in JSON and binary
12+ - ** 🌐 Deployment Ready** - Hardhat Ignition integration for seamless deployment
1313- ** 📋 Code Quality** - Commitlint + Husky for conventional commits and code standards
14- - ** 🔧 Development Tools** - Hot reloading, error handling, and debugging support
1514
1615## 🏗️ What You'll Learn
1716
@@ -136,36 +135,39 @@ Our GitHub Actions pipeline ensures code quality and functionality across all co
136135- ** 📝 Contract Compilation** - Compiles Solidity contracts with optimizations
137136- ** ⚡ Integration Testing** - End-to-end tests with proof verification on contracts
138137
139- ### ** Quality Assurance**
140-
141- - ** Parallel Execution** - Jobs run concurrently for faster feedback
142- - ** Artifact Caching** - Optimized build times with intelligent caching
143- - ** Multi-Environment** - Consistent testing across different Node.js versions
144- - ** Fail-Fast** - Early detection of issues with comprehensive error reporting
145-
146138## 💡 Understanding the SimpleCounter Example
147139
148140The ** SimpleCounter** demonstrates a complete ZK application workflow:
149141
150142### ** The Circuit** (` circuit/src/main.nr ` )
151143``` noir
152- // Verifies that x + y = result
153- fn main(x: Field, y: Field, result: pub Field) {
154- assert(x + y == result);
144+ fn main(x: Field, y: pub Field, z: pub Field) {
145+ assert((x != y) & (y != z));
146+ }
147+
148+ #[test]
149+ fn test_main() {
150+ main(1, 2, 1);
155151}
156152```
157153
154+ This circuit implements a ** uniqueness constraint verification** :
155+ - ** Private Input** (` x ` ): A secret value known only to the prover
156+ - ** Public Inputs** (` y ` , ` z ` ): Values that are publicly known and verified
157+ - ** Constraint** : Proves that ` x ` is different from ` y ` AND ` y ` is different from ` z `
158+ - ** Use Case** : Demonstrates how to prove knowledge of a unique value without revealing it
159+
158160### ** The Smart Contract** (` contracts/SimpleCounter.sol ` )
159161- Stores a counter value on-chain
160- - Accepts zero-knowledge proofs to increment the counter
162+ - Accepts zero-knowledge proofs of uniqueness constraints
161163- Verifies proofs using the auto-generated Solidity verifier
162- - Emits events for successful verifications
164+ - Increments the counter only when valid proofs are submitted
163165
164166### ** The Tests** (` test/SimpleCounter.ts ` )
165- - Dynamically generates proofs for different input values
166- - Tests both valid and invalid proof scenarios
167+ - Dynamically generates proofs with different combinations of ` x ` , ` y ` , ` z ` values
167168- Demonstrates proof format conversion (binary ↔ JSON)
168- - Verifies end-to-end integration between circuits and contracts
169+ - Verifies end-to-end integration between uniqueness circuits and smart contracts
170+ - Shows how private values can remain hidden while proving constraints
169171
170172## 🌐 Deployment
171173
@@ -187,8 +189,6 @@ yarn contracts:deploy
187189The deployment uses ** Hardhat Ignition** for:
188190- ✅ Reproducible deployments
189191- ✅ Automatic verification on Etherscan
190- - ✅ State management and rollback capabilities
191- - ✅ Multi-network deployment support
192192
193193## 🧪 Development Workflow
194194
0 commit comments