UNPKG

@nori-zk/proof-conversion

Version:

Verifying zkVM proofs inside o1js circuits, to generate Mina compatible proof

333 lines (332 loc) 17.8 kB
import { Field, Provable } from 'o1js'; import { Accumulator } from './data.js'; import { Fp12 } from '../../towers/index.js'; import { G1Affine } from '../../ec/index.js'; declare const zkp13: { name: string; maxProofsVerified(): Promise<0 | 1 | 2>; compile: (options?: { cache?: import("o1js").Cache; forceRecompile?: boolean; proofsEnabled?: boolean; }) => Promise<{ verificationKey: { data: string; hash: Field; }; }>; verify: (proof: import("o1js").Proof<import("node_modules/o1js/dist/node/lib/provable/field.js").Field, import("node_modules/o1js/dist/node/lib/provable/field.js").Field>) => Promise<boolean>; digest: () => Promise<string>; analyzeMethods: () => Promise<{ compute: { proofs: import("node_modules/o1js/dist/node/lib/proof-system/proof.js").ProofClass[]; rows: number; digest: string; gates: import("node_modules/o1js/dist/node/snarky.js").Gate[]; publicInputSize: number; print(): void; summary(): Partial<Record<import("node_modules/o1js/dist/node/snarky.js").GateType | "Total rows", number>>; }; }>; publicInputType: typeof import("node_modules/o1js/dist/node/lib/provable/field.js").Field & ((x: string | number | bigint | import("node_modules/o1js/dist/node/lib/provable/core/fieldvar.js").FieldConst | import("node_modules/o1js/dist/node/lib/provable/core/fieldvar.js").FieldVar | import("node_modules/o1js/dist/node/lib/provable/field.js").Field) => import("node_modules/o1js/dist/node/lib/provable/field.js").Field); publicOutputType: typeof import("node_modules/o1js/dist/node/lib/provable/field.js").Field & ((x: string | number | bigint | import("node_modules/o1js/dist/node/lib/provable/core/fieldvar.js").FieldConst | import("node_modules/o1js/dist/node/lib/provable/core/fieldvar.js").FieldVar | import("node_modules/o1js/dist/node/lib/provable/field.js").Field) => import("node_modules/o1js/dist/node/lib/provable/field.js").Field); privateInputTypes: { compute: [typeof Accumulator, import("node_modules/o1js/dist/node/bindings/lib/generic.js").GenericProvableExtendedPure<import("node_modules/o1js/dist/node/lib/provable/field.js").Field[], bigint[], string[], import("node_modules/o1js/dist/node/lib/provable/field.js").Field>, import("node_modules/o1js/dist/node/bindings/lib/generic.js").GenericProvableExtendedPure<Fp12[], { c0: { c0: { c0: bigint; c1: bigint; }; c1: { c0: bigint; c1: bigint; }; c2: { c0: bigint; c1: bigint; }; }; c1: { c0: { c0: bigint; c1: bigint; }; c1: { c0: bigint; c1: bigint; }; c2: { c0: bigint; c1: bigint; }; }; }[], { c0: { c0: { c0: string; c1: string; }; c1: { c0: string; c1: string; }; c2: { c0: string; c1: string; }; }; c1: { c0: { c0: string; c1: string; }; c1: { c0: string; c1: string; }; c2: { c0: string; c1: string; }; }; }[], import("node_modules/o1js/dist/node/lib/provable/field.js").Field>]; }; auxiliaryOutputTypes: { compute: undefined; }; rawMethods: { compute: (publicInput: import("node_modules/o1js/dist/node/lib/provable/field.js").Field, args_0: Accumulator, args_1: import("node_modules/o1js/dist/node/lib/provable/field.js").Field[], args_2: Fp12[]) => Promise<{ publicOutput: import("node_modules/o1js/dist/node/lib/provable/field.js").Field; }>; }; Proof: { new ({ proof, publicInput, publicOutput, maxProofsVerified, }: { proof: import("node_modules/o1js/dist/node/snarky.js").Pickles.Proof; publicInput: import("node_modules/o1js/dist/node/lib/provable/field.js").Field; publicOutput: import("node_modules/o1js/dist/node/lib/provable/field.js").Field; maxProofsVerified: 0 | 1 | 2; }): import("o1js").Proof<import("node_modules/o1js/dist/node/lib/provable/field.js").Field, import("node_modules/o1js/dist/node/lib/provable/field.js").Field>; fromJSON<S extends import("node_modules/o1js/dist/node/lib/util/types.js").Subclass<typeof import("o1js").Proof>>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>; dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 1 | 2, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>; readonly provable: { toFields: (value: import("o1js").Proof<any, any>) => import("node_modules/o1js/dist/node/lib/provable/field.js").Field[]; toAuxiliary: (value?: import("o1js").Proof<any, any> | undefined) => any[]; fromFields: (fields: import("node_modules/o1js/dist/node/lib/provable/field.js").Field[], aux: any[]) => import("o1js").Proof<any, any>; sizeInFields(): number; check: (value: import("o1js").Proof<any, any>) => void; toValue: (x: import("o1js").Proof<any, any>) => import("node_modules/o1js/dist/node/lib/proof-system/proof.js").ProofValue<any, any>; fromValue: (x: import("node_modules/o1js/dist/node/lib/proof-system/proof.js").ProofValue<any, any> | import("o1js").Proof<any, any>) => import("o1js").Proof<any, any>; toCanonical?: ((x: import("o1js").Proof<any, any>) => import("o1js").Proof<any, any>) | undefined; }; publicInputType: import("o1js").FlexibleProvable<any>; publicOutputType: import("o1js").FlexibleProvable<any>; tag: () => { name: string; }; publicFields(value: import("o1js").ProofBase): { input: import("node_modules/o1js/dist/node/lib/provable/field.js").Field[]; output: import("node_modules/o1js/dist/node/lib/provable/field.js").Field[]; }; _proofFromBase64(proofString: import("node_modules/o1js/dist/node/snarky.js").Base64ProofString, maxProofsVerified: 0 | 1 | 2): unknown; _proofToBase64(proof: import("node_modules/o1js/dist/node/snarky.js").Pickles.Proof, maxProofsVerified: 0 | 1 | 2): string; }; proofsEnabled: boolean; setProofsEnabled(proofsEnabled: boolean): void; } & { compute: (publicInput: string | number | bigint | import("node_modules/o1js/dist/node/lib/provable/field.js").Field, args_0: Accumulator | { proof: import("./data.js").RecursionProof | { negA: G1Affine | { x: bigint | import("o1js").AlmostForeignField; y: bigint | import("o1js").AlmostForeignField; }; B: import("../../ec/g2.js").G2Affine | { x: import("../../towers/fp2.js").Fp2 | { c0: bigint | import("o1js").AlmostForeignField; c1: bigint | import("o1js").AlmostForeignField; }; y: import("../../towers/fp2.js").Fp2 | { c0: bigint | import("o1js").AlmostForeignField; c1: bigint | import("o1js").AlmostForeignField; }; }; C: G1Affine | { x: bigint | import("o1js").AlmostForeignField; y: bigint | import("o1js").AlmostForeignField; }; PI: G1Affine | { x: bigint | import("o1js").AlmostForeignField; y: bigint | import("o1js").AlmostForeignField; }; c: Fp12 | { c0: import("../../towers/fp6.js").Fp6 | { c0: import("../../towers/fp2.js").Fp2 | { c0: bigint | import("o1js").AlmostForeignField; c1: bigint | import("o1js").AlmostForeignField; }; c1: import("../../towers/fp2.js").Fp2 | { c0: bigint | import("o1js").AlmostForeignField; c1: bigint | import("o1js").AlmostForeignField; }; c2: import("../../towers/fp2.js").Fp2 | { c0: bigint | import("o1js").AlmostForeignField; c1: bigint | import("o1js").AlmostForeignField; }; }; c1: import("../../towers/fp6.js").Fp6 | { c0: import("../../towers/fp2.js").Fp2 | { c0: bigint | import("o1js").AlmostForeignField; c1: bigint | import("o1js").AlmostForeignField; }; c1: import("../../towers/fp2.js").Fp2 | { c0: bigint | import("o1js").AlmostForeignField; c1: bigint | import("o1js").AlmostForeignField; }; c2: import("../../towers/fp2.js").Fp2 | { c0: bigint | import("o1js").AlmostForeignField; c1: bigint | import("o1js").AlmostForeignField; }; }; }; c_inv: Fp12 | { c0: import("../../towers/fp6.js").Fp6 | { c0: import("../../towers/fp2.js").Fp2 | { c0: bigint | import("o1js").AlmostForeignField; c1: bigint | import("o1js").AlmostForeignField; }; c1: import("../../towers/fp2.js").Fp2 | { c0: bigint | import("o1js").AlmostForeignField; c1: bigint | import("o1js").AlmostForeignField; }; c2: import("../../towers/fp2.js").Fp2 | { c0: bigint | import("o1js").AlmostForeignField; c1: bigint | import("o1js").AlmostForeignField; }; }; c1: import("../../towers/fp6.js").Fp6 | { c0: import("../../towers/fp2.js").Fp2 | { c0: bigint | import("o1js").AlmostForeignField; c1: bigint | import("o1js").AlmostForeignField; }; c1: import("../../towers/fp2.js").Fp2 | { c0: bigint | import("o1js").AlmostForeignField; c1: bigint | import("o1js").AlmostForeignField; }; c2: import("../../towers/fp2.js").Fp2 | { c0: bigint | import("o1js").AlmostForeignField; c1: bigint | import("o1js").AlmostForeignField; }; }; }; shift_power: string | number | bigint | import("node_modules/o1js/dist/node/lib/provable/field.js").Field; }; state: import("./data.js").State | { T: import("../../ec/g2.js").G2Affine | { x: import("../../towers/fp2.js").Fp2 | { c0: bigint | import("o1js").AlmostForeignField; c1: bigint | import("o1js").AlmostForeignField; }; y: import("../../towers/fp2.js").Fp2 | { c0: bigint | import("o1js").AlmostForeignField; c1: bigint | import("o1js").AlmostForeignField; }; }; f: Fp12 | { c0: import("../../towers/fp6.js").Fp6 | { c0: import("../../towers/fp2.js").Fp2 | { c0: bigint | import("o1js").AlmostForeignField; c1: bigint | import("o1js").AlmostForeignField; }; c1: import("../../towers/fp2.js").Fp2 | { c0: bigint | import("o1js").AlmostForeignField; c1: bigint | import("o1js").AlmostForeignField; }; c2: import("../../towers/fp2.js").Fp2 | { c0: bigint | import("o1js").AlmostForeignField; c1: bigint | import("o1js").AlmostForeignField; }; }; c1: import("../../towers/fp6.js").Fp6 | { c0: import("../../towers/fp2.js").Fp2 | { c0: bigint | import("o1js").AlmostForeignField; c1: bigint | import("o1js").AlmostForeignField; }; c1: import("../../towers/fp2.js").Fp2 | { c0: bigint | import("o1js").AlmostForeignField; c1: bigint | import("o1js").AlmostForeignField; }; c2: import("../../towers/fp2.js").Fp2 | { c0: bigint | import("o1js").AlmostForeignField; c1: bigint | import("o1js").AlmostForeignField; }; }; }; g_digest: string | number | bigint | import("node_modules/o1js/dist/node/lib/provable/field.js").Field; }; }, args_1: import("node_modules/o1js/dist/node/lib/provable/field.js").Field[] | bigint[], args_2: Fp12[] | { c0: { c0: { c0: bigint; c1: bigint; }; c1: { c0: bigint; c1: bigint; }; c2: { c0: bigint; c1: bigint; }; }; c1: { c0: { c0: bigint; c1: bigint; }; c1: { c0: bigint; c1: bigint; }; c2: { c0: bigint; c1: bigint; }; }; }[]) => Promise<{ proof: import("o1js").Proof<import("node_modules/o1js/dist/node/lib/provable/field.js").Field, import("node_modules/o1js/dist/node/lib/provable/field.js").Field>; auxiliaryOutput: undefined; }>; }; declare const ZKP13Proof: { new ({ proof, publicInput, publicOutput, maxProofsVerified, }: { proof: unknown; publicInput: import("node_modules/o1js/dist/node/lib/provable/field.js").Field; publicOutput: import("node_modules/o1js/dist/node/lib/provable/field.js").Field; maxProofsVerified: 0 | 2 | 1; }): import("o1js").Proof<import("node_modules/o1js/dist/node/lib/provable/field.js").Field, import("node_modules/o1js/dist/node/lib/provable/field.js").Field>; fromJSON<S extends import("node_modules/o1js/dist/node/lib/util/types.js").Subclass<typeof import("o1js").Proof>>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>; dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>; readonly provable: { toFields: (value: import("o1js").Proof<any, any>) => import("node_modules/o1js/dist/node/lib/provable/field.js").Field[]; toAuxiliary: (value?: import("o1js").Proof<any, any> | undefined) => any[]; fromFields: (fields: import("node_modules/o1js/dist/node/lib/provable/field.js").Field[], aux: any[]) => import("o1js").Proof<any, any>; sizeInFields(): number; check: (value: import("o1js").Proof<any, any>) => void; toValue: (x: import("o1js").Proof<any, any>) => import("node_modules/o1js/dist/node/lib/proof-system/proof.js").ProofValue<any, any>; fromValue: (x: import("o1js").Proof<any, any> | import("node_modules/o1js/dist/node/lib/proof-system/proof.js").ProofValue<any, any>) => import("o1js").Proof<any, any>; toCanonical?: ((x: import("o1js").Proof<any, any>) => import("o1js").Proof<any, any>) | undefined; }; publicInputType: import("o1js").FlexibleProvable<any>; publicOutputType: import("o1js").FlexibleProvable<any>; tag: () => { name: string; }; publicFields(value: import("o1js").ProofBase<any, any>): { input: import("node_modules/o1js/dist/node/lib/provable/field.js").Field[]; output: import("node_modules/o1js/dist/node/lib/provable/field.js").Field[]; }; _proofFromBase64(proofString: string, maxProofsVerified: 0 | 2 | 1): unknown; _proofToBase64(proof: unknown, maxProofsVerified: 0 | 2 | 1): string; } & { provable: Provable<import("o1js").Proof<import("node_modules/o1js/dist/node/lib/provable/field.js").Field, import("node_modules/o1js/dist/node/lib/provable/field.js").Field>, import("node_modules/o1js/dist/node/lib/proof-system/proof.js").ProofValue<bigint, bigint>>; }; export { ZKP13Proof, zkp13 };