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.
- package/dist/index.js +15 -17
- 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.
|
|
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
|
|
399
|
-
* This
|
|
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
|
|
401
|
+
* Example: Prove balance=1000 >= threshold=500
|
|
403
402
|
*
|
|
404
|
-
* @param
|
|
405
|
-
* @param
|
|
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
|
-
[
|
|
410
|
-
[
|
|
407
|
+
[threshold]: [number],
|
|
408
|
+
[balance]: [number]
|
|
411
409
|
): void {
|
|
412
|
-
assert(
|
|
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: ['
|
|
1222
|
-
privateInputKeys: ['
|
|
1223
|
-
defaultInputs: {
|
|
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: ['
|
|
1232
|
-
privateInputKeys: ['
|
|
1233
|
-
defaultInputs: {
|
|
1229
|
+
publicInputKeys: ['threshold'],
|
|
1230
|
+
privateInputKeys: ['balance'],
|
|
1231
|
+
defaultInputs: { threshold: '500', balance: '1000' },
|
|
1234
1232
|
},
|
|
1235
1233
|
{
|
|
1236
1234
|
name: 'squareProof',
|