SelfProof
Class: SelfProof\<PublicInput, PublicOutput>
Type parameters
Name |
---|
PublicInput |
PublicOutput |
Hierarchy
Proof
\<PublicInput
,PublicOutput
>↳
SelfProof
Table of contents
Constructors
Properties
Methods
Constructors
constructor
• new SelfProof\<PublicInput
, PublicOutput
>(«destructured»
)
Type parameters
Name |
---|
PublicInput |
PublicOutput |
Parameters
Name | Type |
---|---|
«destructured» | Object |
› maxProofsVerified | 0 | 2 | 1 |
› proof | unknown |
› publicInput | PublicInput |
› publicOutput | PublicOutput |
Inherited from
Defined in
Properties
maxProofsVerified
• maxProofsVerified: 0
| 2
| 1
Inherited from
Defined in
proof
• proof: unknown
Inherited from
Defined in
publicInput
• publicInput: PublicInput
Inherited from
Defined in
publicOutput
• publicOutput: PublicOutput
Inherited from
Defined in
shouldVerify
• shouldVerify: Bool
Inherited from
Defined in
publicInputType
▪ Static
publicInputType: FlexibleProvablePure
\<any
>
Inherited from
Defined in
publicOutputType
▪ Static
publicOutputType: FlexibleProvablePure
\<any
>
Inherited from
Defined in
tag
▪ Static
tag: () => { name
: string
}
Type declaration
▸ (): Object
Returns
Object
Name | Type |
---|---|
name | string |
Inherited from
Defined in
Methods
toJSON
▸ toJSON(): JsonProof
Returns
Inherited from
Defined in
verify
▸ verify(): void
Returns
void
Inherited from
Defined in
verifyIf
▸ verifyIf(condition
): void
Parameters
Name | Type |
---|---|
condition | Bool |
Returns
void
Inherited from
Defined in
dummy
▸ Static
dummy\<Input
, OutPut
>(publicInput
, publicOutput
, maxProofsVerified
, domainLog2?
): 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
Name |
---|
Input |
OutPut |
Parameters
Name | Type | Default value |
---|---|---|
publicInput | Input | undefined |
publicOutput | OutPut | undefined |
maxProofsVerified | 0 | 2 | 1 | undefined |
domainLog2 | number | 14 |
Returns
Promise
\<Proof
\<Input
, OutPut
>>
Inherited from
Defined in
fromJSON
▸ Static
fromJSON\<S
>(this
, «destructured»
): Proof
\<InferProvable
\<S
["publicInputType"
]>, InferProvable
\<S
["publicOutputType"
]>>
Type parameters
Name | Type |
---|---|
S | extends Subclass \<typeof Proof > |
Parameters
Name | Type |
---|---|
this | S |
«destructured» | JsonProof |
Returns
Proof
\<InferProvable
\<S
["publicInputType"
]>, InferProvable
\<S
["publicOutputType"
]>>