Skip to main content

ZkProgram

function ZkProgram<Config, Methods, MethodSignatures, PrivateInputs, AuxiliaryOutputs>(config: Config & {
"methods": { [I in string | number | symbol]: Methods[I] };
"name": string;
"overrideWrapDomain": 0 | 2 | 1;
}): {
"analyzeMethods": () => Promise<{ [I in keyof Config["methods"]]: UnwrapPromise<ReturnType<typeof analyzeMethod>> }>;
"auxiliaryOutputTypes": AuxiliaryOutputs;
"compile": (options?: {
"cache": Cache;
"forceRecompile": boolean;
"proofsEnabled": boolean;
}) => Promise<{
"verificationKey": {
"data": string;
"hash": Field;
};
}>;
"digest": () => Promise<string>;
"name": string;
"privateInputTypes": PrivateInputs;
"proofsEnabled": boolean;
"publicInputType": ProvableOrUndefined<Get<Config, "publicInput">>;
"publicOutputType": ProvableOrVoid<Get<Config, "publicOutput">>;
"rawMethods": { [I in keyof Config["methods"]]: Methods[I]["method"] };
"verify": (proof: Proof<InferProvableOrUndefined<Get<Config, "publicInput">>, InferProvableOrVoid<Get<Config, "publicOutput">>>) => Promise<boolean>;
"setProofsEnabled": void;
} & { [I in keyof Config["methods"]]: Prover<InferProvableOrUndefined<Get<Config, "publicInput">>, InferProvableOrVoid<Get<Config, "publicOutput">>, PrivateInputs[I], InferProvableOrUndefined<AuxiliaryOutputs[I]>> }

Type parameters

Config extends { "methods": {}; "publicInput": ProvableTypePure; "publicOutput": ProvableTypePure; }

Methods extends { [I in string | number | symbol]: Method\<InferProvableOrUndefined\<Get\<Config, "publicInput">>, InferProvableOrVoid\<Get\<Config, "publicOutput">>, Config["methods"][I]> }

MethodSignatures extends {} = Config["methods"]

PrivateInputs extends { [I in string | number | symbol]: MethodSignatures[I]["privateInputs"] } = { [I in string | number | symbol]: MethodSignatures[I]["privateInputs"] }

AuxiliaryOutputs extends { [I in string | number | symbol]: Get\<MethodSignatures[I], "auxiliaryOutput"> } = { [I in string | number | symbol]: Get\<MethodSignatures[I], "auxiliaryOutput"> }

Parameters

config: Config & { "methods": { [I in string | number | symbol]: Methods[I] }; "name": string; "overrideWrapDomain": 0 | 2 | 1; }

Returns

{ "analyzeMethods": () => Promise\<{ [I in keyof Config["methods"]]: UnwrapPromise<ReturnType<typeof analyzeMethod>> }>; "auxiliaryOutputTypes": AuxiliaryOutputs; "compile": (options?: { "cache": Cache; "forceRecompile": boolean; "proofsEnabled": boolean; }) => Promise\<{ "verificationKey": { "data": string; "hash": Field; }; }>; "digest": () => Promise\<string>; "name": string; "privateInputTypes": PrivateInputs; "proofsEnabled": boolean; "publicInputType": ProvableOrUndefined\<Get\<Config, "publicInput">>; "publicOutputType": ProvableOrVoid\<Get\<Config, "publicOutput">>; "rawMethods": { [I in keyof Config["methods"]]: Methods[I]["method"] }; "verify": (proof: Proof\<InferProvableOrUndefined\<Get\<Config, "publicInput">>, InferProvableOrVoid\<Get\<Config, "publicOutput">>>) => Promise\<boolean>; "setProofsEnabled": void; } & { [I in keyof Config["methods"]]: Prover<InferProvableOrUndefined<Get<Config, "publicInput">>, InferProvableOrVoid<Get<Config, "publicOutput">>, PrivateInputs[I], InferProvableOrUndefined<AuxiliaryOutputs[I]>> }

Source

lib/proof-system/zkprogram.ts:174