create-izi-noir 0.2.18 → 0.2.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +15 -17
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -316,7 +316,7 @@ function createGitProgress() {
316
316
  function generatePackageJson(options) {
317
317
  const isSolana = options.provider === "arkworks";
318
318
  const dependencies = {
319
- "@izi-noir/sdk": "^0.1.13",
319
+ "@izi-noir/sdk": "^0.1.14",
320
320
  "@noir-lang/acvm_js": "1.0.0-beta.13-1d260df.nightly",
321
321
  "@noir-lang/noirc_abi": "1.0.0-beta.13-1d260df.nightly",
322
322
  "react": "^18.3.1",
@@ -395,21 +395,19 @@ function generateBalanceProof() {
395
395
  return `/**
396
396
  * Balance Proof Circuit
397
397
  *
398
- * Proves that two private values sum to a public total.
399
- * This demonstrates a real-world use case: proving you have sufficient balance
400
- * without revealing the individual amounts.
398
+ * Proves you have enough balance to cover a required amount.
399
+ * This is a real-world use case: proving solvency without revealing your actual balance.
401
400
  *
402
- * Example: Prove that a=30 + b=20 = total=50
401
+ * Example: Prove balance=1000 >= threshold=500
403
402
  *
404
- * @param total - The expected sum (public)
405
- * @param a - First private value (not revealed)
406
- * @param b - Second private value (not revealed)
403
+ * @param threshold - The minimum required amount (public)
404
+ * @param balance - Your actual balance (private, not revealed)
407
405
  */
408
406
  export function balanceProof(
409
- [total]: [number],
410
- [a, b]: [number, number]
407
+ [threshold]: [number],
408
+ [balance]: [number]
411
409
  ): void {
412
- assert(a + b == total);
410
+ assert(balance >= threshold);
413
411
  }
414
412
  `;
415
413
  }
@@ -1218,9 +1216,9 @@ function getCircuitOptions(template) {
1218
1216
  {
1219
1217
  name: 'balanceProof',
1220
1218
  fn: balanceProof,
1221
- publicInputKeys: ['total'],
1222
- privateInputKeys: ['a', 'b'],
1223
- defaultInputs: { total: '50', a: '30', b: '20' },
1219
+ publicInputKeys: ['threshold'],
1220
+ privateInputKeys: ['balance'],
1221
+ defaultInputs: { threshold: '500', balance: '1000' },
1224
1222
  },
1225
1223
  ]`;
1226
1224
  default:
@@ -1228,9 +1226,9 @@ function getCircuitOptions(template) {
1228
1226
  {
1229
1227
  name: 'balanceProof',
1230
1228
  fn: balanceProof,
1231
- publicInputKeys: ['total'],
1232
- privateInputKeys: ['a', 'b'],
1233
- defaultInputs: { total: '50', a: '30', b: '20' },
1229
+ publicInputKeys: ['threshold'],
1230
+ privateInputKeys: ['balance'],
1231
+ defaultInputs: { threshold: '500', balance: '1000' },
1234
1232
  },
1235
1233
  {
1236
1234
  name: 'squareProof',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-izi-noir",
3
- "version": "0.2.18",
3
+ "version": "0.2.19",
4
4
  "description": "CLI to scaffold IZI-NOIR ZK projects",
5
5
  "type": "module",
6
6
  "bin": {