@solarity/zkit 0.2.6 → 0.3.0-rc.1

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 (79) hide show
  1. package/dist/core/CircuitZKit.d.ts +22 -21
  2. package/dist/core/CircuitZKit.d.ts.map +1 -1
  3. package/dist/core/CircuitZKit.js +28 -43
  4. package/dist/core/CircuitZKit.js.map +1 -1
  5. package/dist/core/protocols/AbstractImplementer.d.ts +15 -0
  6. package/dist/core/protocols/AbstractImplementer.d.ts.map +1 -0
  7. package/dist/core/protocols/AbstractImplementer.js +36 -0
  8. package/dist/core/protocols/AbstractImplementer.js.map +1 -0
  9. package/dist/core/protocols/Groth16Implementer.d.ts +10 -0
  10. package/dist/core/protocols/Groth16Implementer.d.ts.map +1 -0
  11. package/dist/core/protocols/Groth16Implementer.js +50 -0
  12. package/dist/core/protocols/Groth16Implementer.js.map +1 -0
  13. package/dist/core/protocols/PlonkImplementer.d.ts +10 -0
  14. package/dist/core/protocols/PlonkImplementer.d.ts.map +1 -0
  15. package/dist/core/protocols/PlonkImplementer.js +51 -0
  16. package/dist/core/protocols/PlonkImplementer.js.map +1 -0
  17. package/dist/core/protocols/index.d.ts +4 -0
  18. package/dist/core/protocols/index.d.ts.map +1 -0
  19. package/dist/core/protocols/index.js +10 -0
  20. package/dist/core/protocols/index.js.map +1 -0
  21. package/dist/core/templates/verifier_groth16.vy.ejs +3 -3
  22. package/dist/core/templates/verifier_plonk.sol.ejs +779 -0
  23. package/dist/core/templates/verifier_plonk.vy.ejs +650 -0
  24. package/dist/index.d.ts +4 -1
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +6 -1
  27. package/dist/index.js.map +1 -1
  28. package/dist/types/circuit-zkit.d.ts +0 -34
  29. package/dist/types/circuit-zkit.d.ts.map +1 -1
  30. package/dist/types/proof-utils.d.ts +7 -0
  31. package/dist/types/proof-utils.d.ts.map +1 -0
  32. package/dist/types/proof-utils.js +3 -0
  33. package/dist/types/proof-utils.js.map +1 -0
  34. package/dist/types/protocols/groth16.d.ts +28 -0
  35. package/dist/types/protocols/groth16.d.ts.map +1 -0
  36. package/dist/types/protocols/groth16.js +3 -0
  37. package/dist/types/protocols/groth16.js.map +1 -0
  38. package/dist/types/protocols/index.d.ts +31 -0
  39. package/dist/types/protocols/index.d.ts.map +1 -0
  40. package/dist/types/protocols/index.js +19 -0
  41. package/dist/types/protocols/index.js.map +1 -0
  42. package/dist/types/protocols/plonk.d.ts +26 -0
  43. package/dist/types/protocols/plonk.d.ts.map +1 -0
  44. package/dist/types/{types.js → protocols/plonk.js} +1 -1
  45. package/dist/types/protocols/plonk.js.map +1 -0
  46. package/package.json +1 -1
  47. package/src/core/CircuitZKit.ts +40 -63
  48. package/src/core/protocols/AbstractImplementer.ts +67 -0
  49. package/src/core/protocols/Groth16Implementer.ts +29 -0
  50. package/src/core/protocols/PlonkImplementer.ts +32 -0
  51. package/src/core/protocols/index.ts +3 -0
  52. package/src/core/templates/verifier_groth16.vy.ejs +3 -3
  53. package/src/core/templates/verifier_plonk.sol.ejs +779 -0
  54. package/src/core/templates/verifier_plonk.vy.ejs +650 -0
  55. package/src/index.ts +5 -1
  56. package/src/types/circuit-zkit.ts +0 -31
  57. package/src/types/proof-utils.ts +9 -0
  58. package/src/types/protocols/groth16.ts +21 -0
  59. package/src/types/protocols/index.ts +49 -0
  60. package/src/types/protocols/plonk.ts +28 -0
  61. package/dist/config/config.d.ts +0 -27
  62. package/dist/config/config.d.ts.map +0 -1
  63. package/dist/config/config.js +0 -19
  64. package/dist/config/config.js.map +0 -1
  65. package/dist/core/CircomZKit.d.ts +0 -39
  66. package/dist/core/CircomZKit.d.ts.map +0 -1
  67. package/dist/core/CircomZKit.js +0 -94
  68. package/dist/core/CircomZKit.js.map +0 -1
  69. package/dist/core/ManagerZKit.d.ts +0 -97
  70. package/dist/core/ManagerZKit.d.ts.map +0 -1
  71. package/dist/core/ManagerZKit.js +0 -222
  72. package/dist/core/ManagerZKit.js.map +0 -1
  73. package/dist/types/types.d.ts +0 -46
  74. package/dist/types/types.d.ts.map +0 -1
  75. package/dist/types/types.js.map +0 -1
  76. package/dist/utils/utils.d.ts +0 -18
  77. package/dist/utils/utils.d.ts.map +0 -1
  78. package/dist/utils/utils.js +0 -58
  79. package/dist/utils/utils.js.map +0 -1
@@ -0,0 +1,21 @@
1
+ import { NumericString, PublicSignals } from "../proof-utils";
2
+
3
+ export interface Groth16Proof {
4
+ pi_a: [NumericString, NumericString];
5
+ pi_b: [[NumericString, NumericString], [NumericString, NumericString]];
6
+ pi_c: [NumericString, NumericString];
7
+ protocol: string;
8
+ curve: string;
9
+ }
10
+
11
+ export interface Groth16ProofStruct {
12
+ proof: Groth16Proof;
13
+ publicSignals: PublicSignals;
14
+ }
15
+
16
+ export type Groth16Calldata = [
17
+ [NumericString, NumericString],
18
+ [[NumericString, NumericString], [NumericString, NumericString]],
19
+ [NumericString, NumericString],
20
+ PublicSignals,
21
+ ];
@@ -0,0 +1,49 @@
1
+ import { Groth16ProofStruct, Groth16Calldata } from "./groth16";
2
+ import { PlonkProofStruct, PlonkCalldata } from "./plonk";
3
+
4
+ import { Signals } from "../proof-utils";
5
+ import { VerifierLanguageType } from "../circuit-zkit";
6
+
7
+ export * from "./groth16";
8
+ export * from "./plonk";
9
+
10
+ export interface IProtocolImplementer<T extends ProvingSystemType> {
11
+ createVerifier(
12
+ circuitName: string,
13
+ vKeyFilePath: string,
14
+ verifierFilePath: string,
15
+ languageExtension: VerifierLanguageType,
16
+ ): Promise<void>;
17
+
18
+ generateProof(inputs: Signals, zKeyFilePath: string, wasmFilePath: string): Promise<ProofStructByProtocol<T>>;
19
+
20
+ verifyProof(proof: ProofStructByProtocol<T>, vKeyFilePath: string): Promise<boolean>;
21
+
22
+ generateCalldata(proof: ProofStructByProtocol<T>): Promise<CalldataByProtocol<T>>;
23
+
24
+ getProvingSystemType(): ProvingSystemType;
25
+
26
+ getTemplate(fileExtension: VerifierLanguageType): string;
27
+
28
+ getVerifierName(circuitName: string): string;
29
+
30
+ getZKeyFileName(circuitName: string): string;
31
+
32
+ getVKeyFileName(circuitName: string): string;
33
+ }
34
+
35
+ export interface ProvingSystemStructMap {
36
+ groth16: {
37
+ proofStruct: Groth16ProofStruct;
38
+ calldata: Groth16Calldata;
39
+ };
40
+ plonk: {
41
+ proofStruct: PlonkProofStruct;
42
+ calldata: PlonkCalldata;
43
+ };
44
+ }
45
+
46
+ export type ProvingSystemType = keyof ProvingSystemStructMap;
47
+
48
+ export type ProofStructByProtocol<T extends ProvingSystemType> = ProvingSystemStructMap[T]["proofStruct"];
49
+ export type CalldataByProtocol<T extends ProvingSystemType> = ProvingSystemStructMap[T]["calldata"];
@@ -0,0 +1,28 @@
1
+ import { NumericString, PublicSignals } from "../proof-utils";
2
+
3
+ export interface PlonkProof {
4
+ A: [NumericString, NumericString];
5
+ B: [NumericString, NumericString];
6
+ C: [NumericString, NumericString];
7
+ Z: [NumericString, NumericString];
8
+ T1: [NumericString, NumericString];
9
+ T2: [NumericString, NumericString];
10
+ T3: [NumericString, NumericString];
11
+ Wxi: [NumericString, NumericString];
12
+ Wxiw: [NumericString, NumericString];
13
+ eval_a: NumericString;
14
+ eval_b: NumericString;
15
+ eval_c: NumericString;
16
+ eval_s1: NumericString;
17
+ eval_s2: NumericString;
18
+ eval_zw: NumericString;
19
+ protocol: string;
20
+ curve: string;
21
+ }
22
+
23
+ export interface PlonkProofStruct {
24
+ proof: PlonkProof;
25
+ publicSignals: PublicSignals;
26
+ }
27
+
28
+ export type PlonkCalldata = [NumericString[], PublicSignals];
@@ -1,27 +0,0 @@
1
- import { TemplateType } from "../types/types";
2
- declare const Context: any;
3
- export type ManagerZKitConfig = {
4
- circuitsDir: string;
5
- artifactsDir: string;
6
- verifiersDir: string;
7
- ptauDir: string;
8
- allowDownload: boolean;
9
- };
10
- export declare const defaultManagerOptions: Partial<ManagerZKitConfig>;
11
- export type CompileOptions = {
12
- sym: boolean;
13
- json: boolean;
14
- c: boolean;
15
- quiet: boolean;
16
- setup: TemplateType;
17
- contributions: number;
18
- };
19
- export declare const defaultCompileOptions: CompileOptions;
20
- export type ManagerZKitPrivateConfig = ManagerZKitConfig & {
21
- compiler: typeof Context;
22
- templates: {
23
- groth16: string;
24
- };
25
- };
26
- export {};
27
- //# sourceMappingURL=config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,QAAA,MAAQ,OAAO,KAAuC,CAAC;AAEvD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,OAAO,CAAC,iBAAiB,CAK5D,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,EAAE,OAAO,CAAC;IACb,IAAI,EAAE,OAAO,CAAC;IACd,CAAC,EAAE,OAAO,CAAC;IACX,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,YAAY,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,cAOnC,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,iBAAiB,GAAG;IACzD,QAAQ,EAAE,OAAO,OAAO,CAAC;IACzB,SAAS,EAAE;QACT,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH,CAAC"}
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultCompileOptions = exports.defaultManagerOptions = void 0;
4
- const { Context } = require("@distributedlab/circom2");
5
- exports.defaultManagerOptions = {
6
- circuitsDir: "circuits",
7
- artifactsDir: "zkit-artifacts",
8
- verifiersDir: "contracts/verifiers",
9
- allowDownload: true,
10
- };
11
- exports.defaultCompileOptions = {
12
- sym: false,
13
- json: false,
14
- c: false,
15
- quiet: false,
16
- setup: "groth16",
17
- contributions: 5,
18
- };
19
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config/config.ts"],"names":[],"mappings":";;;AAEA,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;AAU1C,QAAA,qBAAqB,GAA+B;IAC/D,WAAW,EAAE,UAAU;IACvB,YAAY,EAAE,gBAAgB;IAC9B,YAAY,EAAE,qBAAqB;IACnC,aAAa,EAAE,IAAI;CACpB,CAAC;AAWW,QAAA,qBAAqB,GAAmB;IACnD,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,KAAK;IACX,CAAC,EAAE,KAAK;IACR,KAAK,EAAE,KAAK;IACZ,KAAK,EAAE,SAAS;IAChB,aAAa,EAAE,CAAC;CACjB,CAAC"}
@@ -1,39 +0,0 @@
1
- import { CircuitZKit } from "./CircuitZKit";
2
- import { CircuitInfo } from "../types/types";
3
- import { ManagerZKitConfig } from "../config/config";
4
- /**
5
- * `CircomZKit` acts as a factory for `CircuitZKit` instances.
6
- */
7
- export declare class CircomZKit {
8
- private readonly _manager;
9
- /**
10
- * Creates a new `CircomZKit` instance.
11
- *
12
- * @param {Partial<ManagerZKitConfig>} [options=defaultManagerOptions] - The configuration options to use.
13
- */
14
- constructor(options?: Partial<ManagerZKitConfig>);
15
- /**
16
- * Returns a `CircuitZKit` instance for the specified circuit.
17
- *
18
- * @dev If the circuit id is not unique, the path to the circuit file must be provided.
19
- *
20
- * @param {string} circuit - The path to the circuit file or the circuit id (filename without extension).
21
- * @returns {CircomZKit} The `CircuitZKit` instance.
22
- */
23
- getCircuit(circuit: string): CircuitZKit;
24
- /**
25
- * Returns an array of all circuits available in the circuits directory.
26
- *
27
- * @dev If a circuit id is not unique, the id will be set to `null`.
28
- *
29
- * @returns {CircuitInfo[]} An array of circuit information objects.
30
- */
31
- getCircuits(): CircuitInfo[];
32
- /**
33
- * Returns an array of all circuits paths available in the circuits directory.
34
- *
35
- * @returns {string[]} An array of circuit paths.
36
- */
37
- private _getAllCircuits;
38
- }
39
- //# sourceMappingURL=CircomZKit.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CircomZKit.d.ts","sourceRoot":"","sources":["../../src/core/CircomZKit.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAyB,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE5E;;GAEG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAc;IAEvC;;;;OAIG;gBACS,OAAO,GAAE,OAAO,CAAC,iBAAiB,CAAyB;IAIvE;;;;;;;OAOG;IACI,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW;IA2B/C;;;;;;OAMG;IACI,WAAW,IAAI,WAAW,EAAE;IAyBnC;;;;OAIG;IACH,OAAO,CAAC,eAAe;CAaxB"}
@@ -1,94 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.CircomZKit = void 0;
7
- const os_1 = __importDefault(require("os"));
8
- const path_1 = __importDefault(require("path"));
9
- const CircuitZKit_1 = require("./CircuitZKit");
10
- const ManagerZKit_1 = require("./ManagerZKit");
11
- const utils_1 = require("../utils/utils");
12
- const config_1 = require("../config/config");
13
- /**
14
- * `CircomZKit` acts as a factory for `CircuitZKit` instances.
15
- */
16
- class CircomZKit {
17
- _manager;
18
- /**
19
- * Creates a new `CircomZKit` instance.
20
- *
21
- * @param {Partial<ManagerZKitConfig>} [options=defaultManagerOptions] - The configuration options to use.
22
- */
23
- constructor(options = config_1.defaultManagerOptions) {
24
- this._manager = new ManagerZKit_1.ManagerZKit({ ...config_1.defaultManagerOptions, ...options });
25
- }
26
- /**
27
- * Returns a `CircuitZKit` instance for the specified circuit.
28
- *
29
- * @dev If the circuit id is not unique, the path to the circuit file must be provided.
30
- *
31
- * @param {string} circuit - The path to the circuit file or the circuit id (filename without extension).
32
- * @returns {CircomZKit} The `CircuitZKit` instance.
33
- */
34
- getCircuit(circuit) {
35
- const circuits = this._getAllCircuits();
36
- const candidates = circuits.filter((file) => {
37
- if (circuit.endsWith(".circom")) {
38
- return file == path_1.default.normalize(circuit);
39
- }
40
- return path_1.default.basename(file) == `${circuit}.circom`;
41
- });
42
- if (candidates.length == 0) {
43
- throw Error(`No circuits with name \"${circuit}\" found`);
44
- }
45
- if (candidates.length > 1) {
46
- throw Error(`Found multiple entries for the circuit "${circuit}".
47
-
48
- \rConsider replacing \"${circuit}\" with one of the valid paths:
49
- \r${candidates.map((candidate) => `"${candidate}"`).join(os_1.default.EOL)}`);
50
- }
51
- return new CircuitZKit_1.CircuitZKit(path_1.default.join(this._manager.getCircuitsDir(), candidates[0]), this._manager);
52
- }
53
- /**
54
- * Returns an array of all circuits available in the circuits directory.
55
- *
56
- * @dev If a circuit id is not unique, the id will be set to `null`.
57
- *
58
- * @returns {CircuitInfo[]} An array of circuit information objects.
59
- */
60
- getCircuits() {
61
- const circuits = this._getAllCircuits();
62
- let circuitsCount = {};
63
- for (const circuit of circuits) {
64
- const circuitId = path_1.default.parse(circuit).name;
65
- circuitsCount[circuitId] = (circuitsCount[circuitId] || 0) + 1;
66
- }
67
- let result = [];
68
- for (const circuit of circuits) {
69
- const circuitId = path_1.default.parse(circuit).name;
70
- result.push({
71
- path: circuit,
72
- id: circuitsCount[circuitId] > 1 ? null : circuitId,
73
- });
74
- }
75
- return result;
76
- }
77
- /**
78
- * Returns an array of all circuits paths available in the circuits directory.
79
- *
80
- * @returns {string[]} An array of circuit paths.
81
- */
82
- _getAllCircuits() {
83
- const circuitsDir = this._manager.getCircuitsDir();
84
- let circuits = [];
85
- (0, utils_1.readDirRecursively)(circuitsDir, (_dir, file) => {
86
- if (path_1.default.extname(file) == ".circom") {
87
- circuits.push(path_1.default.relative(circuitsDir, file));
88
- }
89
- });
90
- return circuits;
91
- }
92
- }
93
- exports.CircomZKit = CircomZKit;
94
- //# sourceMappingURL=CircomZKit.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CircomZKit.js","sourceRoot":"","sources":["../../src/core/CircomZKit.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AAExB,+CAA4C;AAC5C,+CAA4C;AAE5C,0CAAoD;AACpD,6CAA4E;AAE5E;;GAEG;AACH,MAAa,UAAU;IACJ,QAAQ,CAAc;IAEvC;;;;OAIG;IACH,YAAY,UAAsC,8BAAqB;QACrE,IAAI,CAAC,QAAQ,GAAG,IAAI,yBAAW,CAAC,EAAE,GAAG,8BAAqB,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED;;;;;;;OAOG;IACI,UAAU,CAAC,OAAe;QAC/B,MAAM,QAAQ,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QAExC,MAAM,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE;YAC1C,IAAI,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;gBAChC,OAAO,IAAI,IAAI,cAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;YACzC,CAAC;YAED,OAAO,cAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,GAAG,OAAO,SAAS,CAAC;QACpD,CAAC,CAAC,CAAC;QAEH,IAAI,UAAU,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;YAC3B,MAAM,KAAK,CAAC,2BAA2B,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IAED;;;;OAIG;IACK,eAAe;QACrB,MAAM,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,cAAc,EAAE,CAAC;QAEnD,IAAI,QAAQ,GAAG,EAAc,CAAC;QAE9B,IAAA,0BAAkB,EAAC,WAAW,EAAE,CAAC,IAAY,EAAE,IAAY,EAAE,EAAE;YAC7D,IAAI,cAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,SAAS,EAAE,CAAC;gBACpC,QAAQ,CAAC,IAAI,CAAC,cAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC;YAClD,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AAjGD,gCAiGC"}
@@ -1,97 +0,0 @@
1
- import { ManagerZKitConfig } from "../config/config";
2
- import { TemplateType } from "../types/types";
3
- /**
4
- * `ManagerZKit` provides configuration options and utility methods used by the `CircomZKit` and `CircuitZKit` classes.
5
- */
6
- export declare class ManagerZKit {
7
- private _config;
8
- /**
9
- * Creates a new `ManagerZKit` instance.
10
- *
11
- * @param {Partial<ManagerZKitConfig>} [config=defaultManagerOptions] - The configuration options to use.
12
- */
13
- constructor(config?: Partial<ManagerZKitConfig>);
14
- /**
15
- * Fetches the `ptau` file.
16
- *
17
- * @dev If `ptau` file is not found, this method will try to download it. Use `allowDownload=false` to disable this behavior.
18
- *
19
- * @param {number} minConstraints - The minimum number of constraints the `ptau` file must support.
20
- * @returns {Promise<string>} The path to the `ptau` file.
21
- */
22
- fetchPtauFile(minConstraints: number): Promise<string>;
23
- /**
24
- * Returns the path to the artifacts' directory.
25
- *
26
- * @returns {string} The path to the artifacts' directory.
27
- */
28
- getArtifactsDir(): string;
29
- /**
30
- * Returns the path to the circuits' directory.
31
- *
32
- * @returns {string} The path to the circuits' directory.
33
- */
34
- getCircuitsDir(): string;
35
- /**
36
- * Returns the path to the verifiers' directory.
37
- *
38
- * @returns {string} The path to the verifiers' directory.
39
- */
40
- getVerifiersDir(): string;
41
- /**
42
- * Returns the path to the `ptau` directory.
43
- *
44
- * @dev The default `ptau` directory is located at `${HOME}/.zkit/.ptau`.
45
- *
46
- * @returns {string} The path to the `ptau` directory.
47
- */
48
- getPtauDir(): string;
49
- /**
50
- * Returns a temporary directory path.
51
- *
52
- * @dev Temporary files are stored in the OS's temporary directory.
53
- *
54
- * @returns {string} A temporary directory path.
55
- */
56
- getTempDir(): string;
57
- /**
58
- * Returns the circom compiler's wasm binary.
59
- *
60
- * @returns {string} The circom compiler's wasm binary.
61
- */
62
- getCompiler(): string;
63
- /**
64
- * Returns the Solidity verifier template for the specified proving system.
65
- *
66
- * @param {TemplateType} templateType - The template type.
67
- * @returns {string} The Solidity verifier template.
68
- */
69
- getTemplate(templateType: TemplateType): string;
70
- /**
71
- * Returns whether the download of the `ptau` file is allowed.
72
- *
73
- * @returns {boolean} Whether the download of the `ptau` file is allowed.
74
- */
75
- getAllowDownload(): boolean;
76
- /**
77
- * Downloads the `ptau` file. The download is allowed only if the user confirms it.
78
- *
79
- * @param {PtauInfo} ptauInfo - The `ptau` file and download url.
80
- */
81
- private _downloadPtau;
82
- /**
83
- * Searches for the `ptau` file that supports the specified number of constraints.
84
- *
85
- * @param {number} ptauId - The `ptau` file id.
86
- * @returns {PtauInfo} The `ptau` file path and download url if the file doesn't exist.
87
- */
88
- private _searchPtau;
89
- /**
90
- * Prompts the user to allow the download of the `ptau` file.
91
- *
92
- * @param {PtauInfo} ptauInfo - The `ptau` file and download url.
93
- * @returns {Promise<boolean>} Whether the download is allowed.
94
- */
95
- private _askForDownloadAllowance;
96
- }
97
- //# sourceMappingURL=ManagerZKit.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ManagerZKit.d.ts","sourceRoot":"","sources":["../../src/core/ManagerZKit.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,iBAAiB,EAAmD,MAAM,kBAAkB,CAAC;AACtG,OAAO,EAAY,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGxD;;GAEG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,OAAO,CAA2B;IAE1C;;;;OAIG;gBACS,MAAM,GAAE,OAAO,CAAC,iBAAiB,CAAyB;IAsBtE;;;;;;;OAOG;IACU,aAAa,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAkBnE;;;;OAIG;IACI,eAAe,IAAI,MAAM;IAIhC;;;;OAIG;IACI,cAAc,IAAI,MAAM;IAI/B;;;;OAIG;IACI,eAAe,IAAI,MAAM;IAIhC;;;;;;OAMG;IACI,UAAU,IAAI,MAAM;IAI3B;;;;;;OAMG;IACI,UAAU,IAAI,MAAM;IAI3B;;;;OAIG;IACI,WAAW,IAAI,MAAM;IAI5B;;;;;OAKG;IACI,WAAW,CAAC,YAAY,EAAE,YAAY,GAAG,MAAM;IAStD;;;;OAIG;IACI,gBAAgB,IAAI,OAAO;IAIlC;;;;OAIG;YACW,aAAa;IAc3B;;;;;OAKG;IACH,OAAO,CAAC,WAAW;IA+BnB;;;;;OAKG;IACH,OAAO,CAAC,wBAAwB;CAgBjC"}
@@ -1,222 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.ManagerZKit = void 0;
30
- const fs_1 = __importDefault(require("fs"));
31
- const os_1 = __importDefault(require("os"));
32
- const path_1 = __importDefault(require("path"));
33
- const process_1 = __importDefault(require("process"));
34
- const readline = __importStar(require("readline"));
35
- const uuid_1 = require("uuid");
36
- const config_1 = require("../config/config");
37
- const utils_1 = require("../utils/utils");
38
- /**
39
- * `ManagerZKit` provides configuration options and utility methods used by the `CircomZKit` and `CircuitZKit` classes.
40
- */
41
- class ManagerZKit {
42
- _config;
43
- /**
44
- * Creates a new `ManagerZKit` instance.
45
- *
46
- * @param {Partial<ManagerZKitConfig>} [config=defaultManagerOptions] - The configuration options to use.
47
- */
48
- constructor(config = config_1.defaultManagerOptions) {
49
- const overriddenConfig = { ...config_1.defaultManagerOptions, ...config };
50
- overriddenConfig.circuitsDir = path_1.default.join(process_1.default.cwd(), overriddenConfig.circuitsDir);
51
- overriddenConfig.artifactsDir = path_1.default.join(process_1.default.cwd(), overriddenConfig.artifactsDir);
52
- overriddenConfig.verifiersDir = path_1.default.join(process_1.default.cwd(), overriddenConfig.verifiersDir);
53
- if (overriddenConfig.ptauDir) {
54
- overriddenConfig.ptauDir = path_1.default.join(process_1.default.cwd(), overriddenConfig.ptauDir);
55
- }
56
- else {
57
- overriddenConfig.ptauDir = path_1.default.join(os_1.default.homedir(), ".zkit", ".ptau");
58
- }
59
- this._config = {
60
- ...overriddenConfig,
61
- compiler: fs_1.default.readFileSync(require.resolve("@distributedlab/circom2/circom.wasm")),
62
- templates: {
63
- groth16: fs_1.default.readFileSync(path_1.default.join(__dirname, "templates", "verifier_groth16.sol.ejs"), "utf8"),
64
- },
65
- };
66
- }
67
- /**
68
- * Fetches the `ptau` file.
69
- *
70
- * @dev If `ptau` file is not found, this method will try to download it. Use `allowDownload=false` to disable this behavior.
71
- *
72
- * @param {number} minConstraints - The minimum number of constraints the `ptau` file must support.
73
- * @returns {Promise<string>} The path to the `ptau` file.
74
- */
75
- async fetchPtauFile(minConstraints) {
76
- const ptauId = Math.max(Math.ceil(Math.log2(minConstraints)), 8);
77
- if (ptauId > 20) {
78
- throw new Error('Circuit has too many constraints. The maximum number of constraints is 2^20. Consider passing "ptauDir=PATH_TO_LOCAL_DIR".');
79
- }
80
- const ptauInfo = this._searchPtau(ptauId);
81
- if (ptauInfo.url) {
82
- await this._downloadPtau(ptauInfo);
83
- }
84
- return ptauInfo.file;
85
- }
86
- /**
87
- * Returns the path to the artifacts' directory.
88
- *
89
- * @returns {string} The path to the artifacts' directory.
90
- */
91
- getArtifactsDir() {
92
- return this._config.artifactsDir;
93
- }
94
- /**
95
- * Returns the path to the circuits' directory.
96
- *
97
- * @returns {string} The path to the circuits' directory.
98
- */
99
- getCircuitsDir() {
100
- return this._config.circuitsDir;
101
- }
102
- /**
103
- * Returns the path to the verifiers' directory.
104
- *
105
- * @returns {string} The path to the verifiers' directory.
106
- */
107
- getVerifiersDir() {
108
- return this._config.verifiersDir;
109
- }
110
- /**
111
- * Returns the path to the `ptau` directory.
112
- *
113
- * @dev The default `ptau` directory is located at `${HOME}/.zkit/.ptau`.
114
- *
115
- * @returns {string} The path to the `ptau` directory.
116
- */
117
- getPtauDir() {
118
- return this._config.ptauDir;
119
- }
120
- /**
121
- * Returns a temporary directory path.
122
- *
123
- * @dev Temporary files are stored in the OS's temporary directory.
124
- *
125
- * @returns {string} A temporary directory path.
126
- */
127
- getTempDir() {
128
- return path_1.default.join(os_1.default.tmpdir(), ".zkit", (0, uuid_1.v4)());
129
- }
130
- /**
131
- * Returns the circom compiler's wasm binary.
132
- *
133
- * @returns {string} The circom compiler's wasm binary.
134
- */
135
- getCompiler() {
136
- return this._config.compiler;
137
- }
138
- /**
139
- * Returns the Solidity verifier template for the specified proving system.
140
- *
141
- * @param {TemplateType} templateType - The template type.
142
- * @returns {string} The Solidity verifier template.
143
- */
144
- getTemplate(templateType) {
145
- switch (templateType) {
146
- case "groth16":
147
- return this._config.templates.groth16;
148
- default:
149
- throw new Error(`Ambiguous template type: ${templateType}.`);
150
- }
151
- }
152
- /**
153
- * Returns whether the download of the `ptau` file is allowed.
154
- *
155
- * @returns {boolean} Whether the download of the `ptau` file is allowed.
156
- */
157
- getAllowDownload() {
158
- return this._config.allowDownload;
159
- }
160
- /**
161
- * Downloads the `ptau` file. The download is allowed only if the user confirms it.
162
- *
163
- * @param {PtauInfo} ptauInfo - The `ptau` file and download url.
164
- */
165
- async _downloadPtau(ptauInfo) {
166
- if (!this.getAllowDownload() && !(await this._askForDownloadAllowance(ptauInfo))) {
167
- throw new Error('Download is cancelled. Allow download or consider passing "ptauDir=PATH_TO_LOCAL_DIR" to the existing ptau files');
168
- }
169
- fs_1.default.mkdirSync(this.getPtauDir(), { recursive: true });
170
- if (!(await (0, utils_1.downloadFile)(ptauInfo.file, ptauInfo.url))) {
171
- throw new Error("Something went wrong while downloading the ptau file.");
172
- }
173
- }
174
- /**
175
- * Searches for the `ptau` file that supports the specified number of constraints.
176
- *
177
- * @param {number} ptauId - The `ptau` file id.
178
- * @returns {PtauInfo} The `ptau` file path and download url if the file doesn't exist.
179
- */
180
- _searchPtau(ptauId) {
181
- let entries = [];
182
- if (fs_1.default.existsSync(this.getPtauDir())) {
183
- entries = fs_1.default.readdirSync(this.getPtauDir(), { withFileTypes: true });
184
- }
185
- const entry = entries.find((entry) => {
186
- if (!entry.isFile()) {
187
- return false;
188
- }
189
- const match = entry.name.match(/^powers-of-tau-(\d+)\.ptau$/);
190
- if (!match) {
191
- return false;
192
- }
193
- const entryPtauId = parseInt(match[1]);
194
- return ptauId <= entryPtauId;
195
- });
196
- const file = path_1.default.join(this.getPtauDir(), entry ? entry.name : `powers-of-tau-${ptauId}.ptau`);
197
- const url = entry
198
- ? null
199
- : `https://hermez.s3-eu-west-1.amazonaws.com/powersOfTau28_hez_final_${ptauId.toString().padStart(2, "0")}.ptau`;
200
- return { file, url };
201
- }
202
- /**
203
- * Prompts the user to allow the download of the `ptau` file.
204
- *
205
- * @param {PtauInfo} ptauInfo - The `ptau` file and download url.
206
- * @returns {Promise<boolean>} Whether the download is allowed.
207
- */
208
- _askForDownloadAllowance(ptauInfo) {
209
- return new Promise((resolve) => {
210
- const readLine = readline.createInterface({
211
- input: process_1.default.stdin,
212
- output: process_1.default.stdout,
213
- });
214
- readLine.question(`No ptau found. Press [Y] to download it from "${ptauInfo.url}" to ${ptauInfo.file}: `, (response) => {
215
- readLine.close();
216
- resolve(response.toUpperCase() == "Y");
217
- });
218
- });
219
- }
220
- }
221
- exports.ManagerZKit = ManagerZKit;
222
- //# sourceMappingURL=ManagerZKit.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ManagerZKit.js","sourceRoot":"","sources":["../../src/core/ManagerZKit.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAAoB;AACpB,4CAAoB;AACpB,gDAAwB;AACxB,sDAA8B;AAC9B,mDAAqC;AACrC,+BAAkC;AAElC,6CAAsG;AAEtG,0CAA8C;AAE9C;;GAEG;AACH,MAAa,WAAW;IACd,OAAO,CAA2B;IAE1C;;;;OAIG;IACH,YAAY,SAAqC,8BAAqB;QACpE,MAAM,gBAAgB,GAAG,EAAE,GAAG,8BAAqB,EAAE,GAAG,MAAM,EAAuB,CAAC;QAEtF,gBAAgB,CAAC,WAAW,GAAG,cAAI,CAAC,IAAI,CAAC,iBAAO,CAAC,GAAG,EAAE,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAC;QACtF,gBAAgB,CAAC,YAAY,GAAG,cAAI,CAAC,IAAI,CAAC,iBAAO,CAAC,GAAG,EAAE,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;QACxF,gBAAgB,CAAC,YA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