Skip to main content

Proof

Extends

Type parameters

Input

Output

Constructors

new Proof()

new Proof<Input, Output>(__namedParameters: {
"maxProofsVerified": 0 | 1 | 2;
"proof": unknown;
"publicInput": Input;
"publicOutput": Output;
}): Proof<Input, Output>

Parameters

__namedParameters

__namedParameters.maxProofsVerified: 0 | 1 | 2

__namedParameters.proof: unknown

__namedParameters.publicInput: Input

__namedParameters.publicOutput: Output

Returns

Proof\<Input, Output>

Inherited from

ProofBase.constructor

Source

lib/proof-system/proof.ts:49

Properties

maxProofsVerified

maxProofsVerified: 0 | 1 | 2;

Inherited from

ProofBase.maxProofsVerified

Source

lib/proof-system/proof.ts:36


proof

proof: unknown;

Inherited from

ProofBase.proof

Source

lib/proof-system/proof.ts:35


publicInput

publicInput: Input;

Inherited from

ProofBase.publicInput

Source

lib/proof-system/proof.ts:33


publicOutput

publicOutput: Output;

Inherited from

ProofBase.publicOutput

Source

lib/proof-system/proof.ts:34


shouldVerify

shouldVerify: Bool;

Inherited from

ProofBase.shouldVerify

Source

lib/proof-system/proof.ts:37


publicInputType

static publicInputType: FlexibleProvablePure<any>;

Inherited from

ProofBase.publicInputType

Source

lib/proof-system/proof.ts:25


publicOutputType

static publicOutputType: FlexibleProvablePure<any>;

Inherited from

ProofBase.publicOutputType

Source

lib/proof-system/proof.ts:26


tag()

static tag: () => {
"name": string;
};

Returns

{
"name": string;
}
name
name: string;

Inherited from

ProofBase.tag

Source

lib/proof-system/proof.ts:27

Accessors

provable

get static provable(): ProvableProof<Proof<any, any>, any, any>

Returns

ProvableProof\<Proof\<any, any>, any, any>

Source

lib/proof-system/proof.ts:165

Methods

publicFields()

publicFields(): {
"input": Field[];
"output": Field[];
}

Returns

{
"input": Field[];
"output": Field[];
}
input
input: Field[];
output
output: Field[];

Inherited from

ProofBase.publicFields

Source

lib/proof-system/proof.ts:92


toJSON()

toJSON(): JsonProof

Returns

JsonProof

Inherited from

ProofBase.toJSON

Source

lib/proof-system/proof.ts:39


verify()

verify(): void

Returns

void

Source

lib/proof-system/proof.ts:98


verifyIf()

verifyIf(condition: Bool): void

Parameters

condition: Bool

Returns

void

Source

lib/proof-system/proof.ts:101


dummy()

static dummy<Input, OutPut>(
publicInput: Input,
publicOutput: OutPut,
maxProofsVerified: 0 | 1 | 2,
domainLog2: number): Promise<Proof<Input, OutPut>>

Dummy proof. This can be useful for ZkPrograms that handle the base case in the same method as the inductive case, using a pattern like this:

method(proof: SelfProof<I, O>, isRecursive: Bool) {
proof.verifyIf(isRecursive);
// ...
}

To use such a method in the base case, you need a dummy proof:

let dummy = await MyProof.dummy(publicInput, publicOutput, 1);
await myProgram.myMethod(dummy, Bool(false));

Note: The types of publicInput and publicOutput, as well as the maxProofsVerified parameter, must match your ZkProgram. maxProofsVerified is the maximum number of proofs that any of your methods take as arguments.

Type parameters

Input

OutPut

Parameters

publicInput: Input

publicOutput: OutPut

maxProofsVerified: 0 | 1 | 2

domainLog2: number= 14

Returns

Promise\<Proof\<Input, OutPut>>

Source

lib/proof-system/proof.ts:150


fromJSON()

static fromJSON<S>(this: S, __namedParameters: JsonProof): Promise<Proof<InferProvable<S["publicInputType"]>, InferProvable<S["publicOutputType"]>>>

Type parameters

S extends Subclass\<typeof Proof>

Parameters

this: S

__namedParameters: JsonProof

Returns

Promise\<Proof\<InferProvable\<S["publicInputType"]>, InferProvable\<S["publicOutputType"]>>>

Source

lib/proof-system/proof.ts:105


publicFields()

static publicFields(value: ProofBase<any, any>): {
"input": Field[];
"output": Field[];
}

Parameters

value: ProofBase\<any, any>

Returns

{
"input": Field[];
"output": Field[];
}
input
input: Field[];
output
output: Field[];

Inherited from

ProofBase.publicFields

Source

lib/proof-system/proof.ts:84