@nori-zk/proof-conversion
Version:
Verifying zkVM proofs inside o1js circuits, to generate Mina compatible proof
333 lines (332 loc) • 15.4 kB
TypeScript
import { Field, Provable, UInt64 } from 'o1js';
import { NodeProofLeft } from '../structs.js';
declare const Bytes32_base: typeof import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes;
declare class Bytes32 extends Bytes32_base {
}
declare const BlobstreamInput_base: (new (value: {
trustedHeaderHash: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes;
targetHeaderHash: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes;
dataCommitment: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes;
trustedBlockHeight: UInt64;
targetBlockHeight: UInt64;
validatorBitmap: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes;
}) => {
trustedHeaderHash: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes;
targetHeaderHash: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes;
dataCommitment: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes;
trustedBlockHeight: UInt64;
targetBlockHeight: UInt64;
validatorBitmap: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes;
}) & {
_isStruct: true;
} & Omit<import("node_modules/o1js/dist/node/lib/provable/types/provable-intf.js").Provable<{
trustedHeaderHash: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes;
targetHeaderHash: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes;
dataCommitment: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes;
trustedBlockHeight: UInt64;
targetBlockHeight: UInt64;
validatorBitmap: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes;
}, {
trustedHeaderHash: {
bytes: {
value: bigint;
}[];
};
targetHeaderHash: {
bytes: {
value: bigint;
}[];
};
dataCommitment: {
bytes: {
value: bigint;
}[];
};
trustedBlockHeight: bigint;
targetBlockHeight: bigint;
validatorBitmap: {
bytes: {
value: bigint;
}[];
};
}>, "fromFields"> & {
fromFields: (fields: import("node_modules/o1js/dist/node/lib/provable/field.js").Field[]) => {
trustedHeaderHash: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes;
targetHeaderHash: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes;
dataCommitment: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes;
trustedBlockHeight: UInt64;
targetBlockHeight: UInt64;
validatorBitmap: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes;
};
} & {
fromValue: (value: {
trustedHeaderHash: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes | {
bytes: {
value: bigint;
}[];
};
targetHeaderHash: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes | {
bytes: {
value: bigint;
}[];
};
dataCommitment: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes | {
bytes: {
value: bigint;
}[];
};
trustedBlockHeight: number | bigint | UInt64;
targetBlockHeight: number | bigint | UInt64;
validatorBitmap: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes | {
bytes: {
value: bigint;
}[];
};
}) => {
trustedHeaderHash: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes;
targetHeaderHash: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes;
dataCommitment: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes;
trustedBlockHeight: UInt64;
targetBlockHeight: UInt64;
validatorBitmap: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes;
};
toInput: (x: {
trustedHeaderHash: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes;
targetHeaderHash: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes;
dataCommitment: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes;
trustedBlockHeight: UInt64;
targetBlockHeight: UInt64;
validatorBitmap: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes;
}) => {
fields?: Field[] | undefined;
packed?: [Field, number][] | undefined;
};
toJSON: (x: {
trustedHeaderHash: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes;
targetHeaderHash: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes;
dataCommitment: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes;
trustedBlockHeight: UInt64;
targetBlockHeight: UInt64;
validatorBitmap: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes;
}) => {
trustedHeaderHash: {
bytes: {
value: string;
}[];
};
targetHeaderHash: {
bytes: {
value: string;
}[];
};
dataCommitment: {
bytes: {
value: string;
}[];
};
trustedBlockHeight: string;
targetBlockHeight: string;
validatorBitmap: {
bytes: {
value: string;
}[];
};
};
fromJSON: (x: {
trustedHeaderHash: {
bytes: {
value: string;
}[];
};
targetHeaderHash: {
bytes: {
value: string;
}[];
};
dataCommitment: {
bytes: {
value: string;
}[];
};
trustedBlockHeight: string;
targetBlockHeight: string;
validatorBitmap: {
bytes: {
value: string;
}[];
};
}) => {
trustedHeaderHash: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes;
targetHeaderHash: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes;
dataCommitment: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes;
trustedBlockHeight: UInt64;
targetBlockHeight: UInt64;
validatorBitmap: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes;
};
empty: () => {
trustedHeaderHash: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes;
targetHeaderHash: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes;
dataCommitment: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes;
trustedBlockHeight: UInt64;
targetBlockHeight: UInt64;
validatorBitmap: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes;
};
};
declare class BlobstreamInput extends BlobstreamInput_base {
}
declare const blobstreamVerifier: {
name: string;
maxProofsVerified(): Promise<0 | 1 | 2>;
compile: (options?: {
cache?: import("o1js").Cache;
forceRecompile?: boolean;
proofsEnabled?: boolean;
withRuntimeTables?: boolean;
numChunks?: number;
lazyMode?: boolean;
}) => Promise<{
verificationKey: {
data: string;
hash: Field;
};
}>;
verify: (proof: import("o1js").Proof<BlobstreamInput, undefined>) => Promise<boolean>;
digest: () => Promise<string>;
analyzeMethods: () => Promise<{
compute: import("node_modules/o1js/dist/node/lib/provable/core/provable-context.js").ConstraintSystemSummary & {
proofs: import("node_modules/o1js/dist/node/lib/proof-system/proof.js").ProofClass[];
};
}>;
analyzeSingleMethod<K extends "compute">(methodName: K): Promise<import("node_modules/o1js/dist/node/lib/provable/core/provable-context.js").ConstraintSystemSummary & {
proofs: import("node_modules/o1js/dist/node/lib/proof-system/proof.js").ProofClass[];
}>;
publicInputType: typeof BlobstreamInput;
publicOutputType: import("o1js").ProvablePureExtended<undefined, undefined, null>;
privateInputTypes: {
compute: [typeof NodeProofLeft];
};
auxiliaryOutputTypes: {
compute: undefined;
};
rawMethods: {
compute: (publicInput: BlobstreamInput, args_0: NodeProofLeft) => Promise<void>;
};
Proof: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: import("node_modules/o1js/dist/node/bindings.js").Pickles.Proof;
publicInput: BlobstreamInput;
publicOutput: undefined;
maxProofsVerified: 0 | 1 | 2;
}): import("o1js").Proof<BlobstreamInput, undefined>;
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>>;
get 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/bindings.js").Base64ProofString, maxProofsVerified: 0 | 1 | 2): unknown;
_proofToBase64(proof: import("node_modules/o1js/dist/node/bindings.js").Pickles.Proof, maxProofsVerified: 0 | 1 | 2): string;
};
proofsEnabled: boolean;
setProofsEnabled(proofsEnabled: boolean): void;
} & {
compute: (publicInput: BlobstreamInput | {
trustedHeaderHash: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes | {
bytes: {
value: bigint;
}[];
};
targetHeaderHash: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes | {
bytes: {
value: bigint;
}[];
};
dataCommitment: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes | {
bytes: {
value: bigint;
}[];
};
trustedBlockHeight: number | bigint | UInt64;
targetBlockHeight: number | bigint | UInt64;
validatorBitmap: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes | {
bytes: {
value: bigint;
}[];
};
}, args_0: import("o1js").DynamicProof<any, any> | import("node_modules/o1js/dist/node/lib/proof-system/proof.js").ProofValue<any, any>) => Promise<{
proof: import("o1js").Proof<BlobstreamInput, undefined>;
auxiliaryOutput: undefined;
}>;
};
declare const BlobstreamProof: {
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
proof: unknown;
publicInput: BlobstreamInput;
publicOutput: undefined;
maxProofsVerified: 0 | 2 | 1;
}): import("o1js").Proof<BlobstreamInput, undefined>;
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<BlobstreamInput, undefined>, import("node_modules/o1js/dist/node/lib/proof-system/proof.js").ProofValue<{
trustedHeaderHash: {
bytes: {
value: bigint;
}[];
};
targetHeaderHash: {
bytes: {
value: bigint;
}[];
};
dataCommitment: {
bytes: {
value: bigint;
}[];
};
trustedBlockHeight: bigint;
targetBlockHeight: bigint;
validatorBitmap: {
bytes: {
value: bigint;
}[];
};
}, undefined>>;
};
export { blobstreamVerifier, BlobstreamProof, BlobstreamInput, Bytes32 };