@nori-zk/proof-conversion
Version:
Verifying zkVM proofs inside o1js circuits, to generate Mina compatible proof
336 lines (335 loc) • 8.34 kB
TypeScript
import { G1Affine, G2Affine } from '../ec/index.js';
import { Fp2, FrC } from '../towers/index.js';
import { Provable, Struct } from 'o1js';
import { G2Line } from '../lines/index.js';
import { GrothVk } from './vk.js';
export interface ProofData {
negA: G1Affine;
B: G2Affine;
C: G1Affine;
PI: G1Affine;
b_lines: G2Line[];
pis: FrC[];
}
type ProofClass = ReturnType<typeof Struct<{
negA: typeof G1Affine;
B: typeof G2Affine;
C: typeof G1Affine;
PI: typeof G1Affine;
b_lines: ReturnType<typeof Provable.Array>;
pis: ReturnType<typeof Provable.Array>;
}>> & {
parse(vk: GrothVk, path: string): ProofData;
};
export declare function detectInputCountFromProof(path: string): number;
export declare function parseProof(vk: GrothVk, path: string): ProofData;
declare const Proof: ProofClass | {
new (value: {
negA: G1Affine;
B: G2Affine;
C: G1Affine;
PI: G1Affine;
b_lines: G2Line[];
pis: import("o1js").CanonicalForeignField[];
}): {
negA: G1Affine;
B: G2Affine;
C: G1Affine;
PI: G1Affine;
b_lines: G2Line[];
pis: import("o1js").CanonicalForeignField[];
};
parse(vk: GrothVk, path: string): {
negA: G1Affine;
B: G2Affine;
C: G1Affine;
PI: G1Affine;
b_lines: G2Line[];
pis: import("o1js").CanonicalForeignField[];
};
_isStruct: true;
toFields: (value: {
negA: G1Affine;
B: G2Affine;
C: G1Affine;
PI: G1Affine;
b_lines: G2Line[];
pis: import("o1js").CanonicalForeignField[];
}) => import("node_modules/o1js/dist/node/lib/provable/field.js").Field[];
toAuxiliary: (value?: {
negA: G1Affine;
B: G2Affine;
C: G1Affine;
PI: G1Affine;
b_lines: G2Line[];
pis: import("o1js").CanonicalForeignField[];
} | undefined) => any[];
sizeInFields: () => number;
check: (value: {
negA: G1Affine;
B: G2Affine;
C: G1Affine;
PI: G1Affine;
b_lines: G2Line[];
pis: import("o1js").CanonicalForeignField[];
}) => void;
toValue: (x: {
negA: G1Affine;
B: G2Affine;
C: G1Affine;
PI: G1Affine;
b_lines: G2Line[];
pis: import("o1js").CanonicalForeignField[];
}) => {
negA: {
x: bigint;
y: bigint;
};
B: {
x: {
c0: bigint;
c1: bigint;
};
y: {
c0: bigint;
c1: bigint;
};
};
C: {
x: bigint;
y: bigint;
};
PI: {
x: bigint;
y: bigint;
};
b_lines: {
lambda: {
c0: bigint;
c1: bigint;
};
neg_mu: {
c0: bigint;
c1: bigint;
};
}[];
pis: bigint[];
};
fromValue: ((x: {
negA: G1Affine;
B: G2Affine;
C: G1Affine;
PI: G1Affine;
b_lines: G2Line[];
pis: import("o1js").CanonicalForeignField[];
} | {
negA: {
x: bigint;
y: bigint;
};
B: {
x: {
c0: bigint;
c1: bigint;
};
y: {
c0: bigint;
c1: bigint;
};
};
C: {
x: bigint;
y: bigint;
};
PI: {
x: bigint;
y: bigint;
};
b_lines: {
lambda: {
c0: bigint;
c1: bigint;
};
neg_mu: {
c0: bigint;
c1: bigint;
};
}[];
pis: bigint[];
}) => {
negA: G1Affine;
B: G2Affine;
C: G1Affine;
PI: G1Affine;
b_lines: G2Line[];
pis: import("o1js").CanonicalForeignField[];
}) & ((value: {
negA: G1Affine | {
x: bigint | import("o1js").AlmostForeignField;
y: bigint | import("o1js").AlmostForeignField;
};
B: G2Affine | {
x: Fp2 | {
c0: bigint | import("o1js").AlmostForeignField;
c1: bigint | import("o1js").AlmostForeignField;
};
y: 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;
};
b_lines: G2Line[] | {
lambda: {
c0: bigint;
c1: bigint;
};
neg_mu: {
c0: bigint;
c1: bigint;
};
}[];
pis: import("o1js").CanonicalForeignField[] | bigint[];
}) => {
negA: G1Affine;
B: G2Affine;
C: G1Affine;
PI: G1Affine;
b_lines: G2Line[];
pis: import("o1js").CanonicalForeignField[];
});
toCanonical?: ((x: {
negA: G1Affine;
B: G2Affine;
C: G1Affine;
PI: G1Affine;
b_lines: G2Line[];
pis: import("o1js").CanonicalForeignField[];
}) => {
negA: G1Affine;
B: G2Affine;
C: G1Affine;
PI: G1Affine;
b_lines: G2Line[];
pis: import("o1js").CanonicalForeignField[];
}) | undefined;
fromFields: (fields: import("node_modules/o1js/dist/node/lib/provable/field.js").Field[]) => {
negA: G1Affine;
B: G2Affine;
C: G1Affine;
PI: G1Affine;
b_lines: G2Line[];
pis: import("o1js").CanonicalForeignField[];
};
toInput: (x: {
negA: G1Affine;
B: G2Affine;
C: G1Affine;
PI: G1Affine;
b_lines: G2Line[];
pis: import("o1js").CanonicalForeignField[];
}) => {
fields?: import("o1js").Field[] | undefined;
packed?: [import("o1js").Field, number][] | undefined;
};
toJSON: (x: {
negA: G1Affine;
B: G2Affine;
C: G1Affine;
PI: G1Affine;
b_lines: G2Line[];
pis: import("o1js").CanonicalForeignField[];
}) => {
negA: {
x: string;
y: string;
};
B: {
x: {
c0: string;
c1: string;
};
y: {
c0: string;
c1: string;
};
};
C: {
x: string;
y: string;
};
PI: {
x: string;
y: string;
};
b_lines: {
lambda: {
c0: string;
c1: string;
};
neg_mu: {
c0: string;
c1: string;
};
}[];
pis: string[];
};
fromJSON: (x: {
negA: {
x: string;
y: string;
};
B: {
x: {
c0: string;
c1: string;
};
y: {
c0: string;
c1: string;
};
};
C: {
x: string;
y: string;
};
PI: {
x: string;
y: string;
};
b_lines: {
lambda: {
c0: string;
c1: string;
};
neg_mu: {
c0: string;
c1: string;
};
}[];
pis: string[];
}) => {
negA: G1Affine;
B: G2Affine;
C: G1Affine;
PI: G1Affine;
b_lines: G2Line[];
pis: import("o1js").CanonicalForeignField[];
};
empty: () => {
negA: G1Affine;
B: G2Affine;
C: G1Affine;
PI: G1Affine;
b_lines: G2Line[];
pis: import("o1js").CanonicalForeignField[];
};
};
export { Proof };