@proto-kit/protocolDocs


Documentation / @proto-kit/protocol / DynamicBlockProof

Class: DynamicBlockProof

Extends

Constructors

new DynamicBlockProof()

new DynamicBlockProof(__namedParameters): DynamicBlockProof

Parameters

__namedParameters

__namedParameters.maxProofsVerified: 0 | 1 | 2

__namedParameters.proof: unknown

__namedParameters.publicInput: BlockProverPublicInput

__namedParameters.publicOutput: BlockProverPublicOutput

Returns

DynamicBlockProof

Inherited from

`DynamicProof< BlockProverPublicInput, BlockProverPublicOutput

.constructor`

Defined in

node_modules/o1js/dist/node/lib/proof-system/proof.d.ts:40

Properties

maxProofsVerified

maxProofsVerified: 0 | 1 | 2

Inherited from

DynamicProof.maxProofsVerified

Defined in

node_modules/o1js/dist/node/lib/proof-system/proof.d.ts:22


proof

proof: unknown

Inherited from

DynamicProof.proof

Defined in

node_modules/o1js/dist/node/lib/proof-system/proof.d.ts:21


publicInput

publicInput: BlockProverPublicInput

Inherited from

DynamicProof.publicInput

Defined in

node_modules/o1js/dist/node/lib/proof-system/proof.d.ts:19


publicOutput

publicOutput: BlockProverPublicOutput

Inherited from

DynamicProof.publicOutput

Defined in

node_modules/o1js/dist/node/lib/proof-system/proof.d.ts:20


shouldVerify

shouldVerify: Bool

Inherited from

DynamicProof.shouldVerify

Defined in

node_modules/o1js/dist/node/lib/proof-system/proof.d.ts:23


usedVerificationKey?

optional usedVerificationKey: VerificationKey

Inherited from

DynamicProof.usedVerificationKey

Defined in

node_modules/o1js/dist/node/lib/proof-system/proof.d.ts:151


featureFlags

static featureFlags: object = FeatureFlags.allMaybe

As the name indicates, feature flags are features of the proof system.

If we want to side load proofs and verification keys, we first have to tell Pickles what shape of proofs it should expect.

For example, if we want to side load proofs that use foreign field arithmetic custom gates, we have to make Pickles aware of that by defining these custom gates.

Note: Only proofs that use the exact same composition of custom gates which were expected by Pickles can be verified using side loading. If you want to verify any proof, no matter what custom gates it uses, you can use FeatureFlags.allMaybe. Please note that this might incur a significant overhead.

You can also toggle specific feature flags manually by specifying them here. Alternatively, you can use FeatureFlags.fromZkProgram to compute the set of feature flags that are compatible with a given program.

foreignFieldAdd

foreignFieldAdd: undefined

foreignFieldMul

foreignFieldMul: undefined

lookup

lookup: undefined

rangeCheck0

rangeCheck0: undefined

rangeCheck1

rangeCheck1: undefined

rot

rot: undefined

runtimeTables

runtimeTables: undefined

xor

xor: undefined

Overrides

DynamicProof.featureFlags

Defined in

packages/protocol/src/settlement/contracts/settlement/SettlementBase.ts:54


maxProofsVerified

static maxProofsVerified: 2

Overrides

DynamicProof.maxProofsVerified

Defined in

packages/protocol/src/settlement/contracts/settlement/SettlementBase.ts:52


publicInputType

static publicInputType: typeof BlockProverPublicInput = BlockProverPublicInput

Overrides

DynamicProof.publicInputType

Defined in

packages/protocol/src/settlement/contracts/settlement/SettlementBase.ts:48


publicOutputType

static publicOutputType: typeof BlockProverPublicOutput = BlockProverPublicOutput

Overrides

DynamicProof.publicOutputType

Defined in

packages/protocol/src/settlement/contracts/settlement/SettlementBase.ts:50

Accessors

provable

Get Signature

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

Returns

ProvableProof<DynamicProof<any, any>, any, any>

Inherited from

DynamicProof.provable

Defined in

node_modules/o1js/dist/node/lib/proof-system/proof.d.ts:182

Methods

declare()

declare(): boolean

To verify a recursive proof inside a ZkProgram method, it has to be “declared” as part of the method. This is done by calling declare() on the proof.

Note: declare() is a low-level method that most users will not have to call directly. For proofs that are inputs to the ZkProgram, it is done automatically.

You can think of declaring a proof as a similar step as witnessing a variable, which introduces that variable to the circuit. Declaring a proof will tell Pickles to add the additional constraints for recursive proof verification.

Similar to Provable.witness(), declare() is a no-op when run outside ZkProgram compilation or proving. It returns false in that case, and true if the proof was actually declared.

Returns

boolean

Inherited from

DynamicProof.declare

Defined in

node_modules/o1js/dist/node/lib/proof-system/proof.d.ts:38


publicFields()

publicFields(): object

Returns

object

input

input: Field[]

output

output: Field[]

Inherited from

DynamicProof.publicFields

Defined in

node_modules/o1js/dist/node/lib/proof-system/proof.d.ts:51


toJSON()

toJSON(): JsonProof

Returns

JsonProof

Inherited from

DynamicProof.toJSON

Defined in

node_modules/o1js/dist/node/lib/proof-system/proof.d.ts:39


verify()

verify(vk): void

Sets the shouldVerify flag to true The downstream effect of this is that the proof will be verified when the circuit is run

Parameters

vk: VerificationKey

The verification key this proof will be verified against

Returns

void

Note

This method is meant to be called in a circuit. Executing it outside of a circuit will have no effect.

Note

The vk parameter will have its auxiliary data checked in the circuit, so the hash must match the data, or else the proof will fail

Inherited from

DynamicProof.verify

Defined in

node_modules/o1js/dist/node/lib/proof-system/proof.d.ts:161


verifyIf()

verifyIf(vk, condition): void

Sets the shouldVerify flag to the given condition param If set to Bool(true), the proof will be verified when the circuit is run If set to Bool(false), the proof will not be verified when the circuit is run

Parameters

vk: VerificationKey

The verification key this proof will be verified against

condition: Bool

The condition to set the shouldVerify flag to

Returns

void

Note

This method is meant to be called in a circuit. Executing it outside of a circuit will have no effect.

Note

The vk parameter will have its auxiliary data checked in the circuit, so the hash must match the data, or else the proof will fail

Inherited from

DynamicProof.verifyIf

Defined in

node_modules/o1js/dist/node/lib/proof-system/proof.d.ts:173


_proofFromBase64()

static _proofFromBase64(proofString, maxProofsVerified): unknown

Parameters

proofString: string

maxProofsVerified: 0 | 1 | 2

Returns

unknown

Inherited from

DynamicProof._proofFromBase64

Defined in

node_modules/o1js/dist/node/lib/proof-system/proof.d.ts:55


_proofToBase64()

static _proofToBase64(proof, maxProofsVerified): string

Parameters

proof: unknown

maxProofsVerified: 0 | 1 | 2

Returns

string

Inherited from

DynamicProof._proofToBase64

Defined in

node_modules/o1js/dist/node/lib/proof-system/proof.d.ts:56


dummy()

static dummy<S>(this, publicInput, publicOutput, maxProofsVerified, domainLog2?): Promise<InstanceType<S>>

Type Parameters

S extends Subclass<typeof DynamicProof>

Parameters

this: S

publicInput: InferProvable<S["publicInputType"]>

publicOutput: InferProvable<S["publicOutputType"]>

maxProofsVerified: 0 | 1 | 2

domainLog2?: number

Returns

Promise<InstanceType<S>>

Inherited from

DynamicProof.dummy

Defined in

node_modules/o1js/dist/node/lib/proof-system/proof.d.ts:175


fromJSON()

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

Type Parameters

S extends Subclass<typeof DynamicProof>

Parameters

this: S

__namedParameters: JsonProof

Returns

Promise<DynamicProof<InferProvable<S["publicInputType"]>, InferProvable<S["publicOutputType"]>>>

Inherited from

DynamicProof.fromJSON

Defined in

node_modules/o1js/dist/node/lib/proof-system/proof.d.ts:174


fromProof()

static fromProof<S>(this, proof): InstanceType<S>

Converts a Proof into a DynamicProof carrying over all relevant data. This method can be used to convert a Proof computed by a ZkProgram into a DynamicProof that is accepted in a circuit that accepts DynamicProofs

Type Parameters

S extends Subclass<typeof DynamicProof>

Parameters

this: S

proof: Proof<InferProvable<S["publicInputType"]>, InferProvable<S["publicOutputType"]>>

Returns

InstanceType<S>

Inherited from

DynamicProof.fromProof

Defined in

node_modules/o1js/dist/node/lib/proof-system/proof.d.ts:181


publicFields()

static publicFields(value): object

Parameters

value: ProofBase<any, any>

Returns

object

input

input: Field[]

output

output: Field[]

Inherited from

DynamicProof.publicFields

Defined in

node_modules/o1js/dist/node/lib/proof-system/proof.d.ts:47


tag()

static tag(): object

Returns

object

name

name: string

Inherited from

DynamicProof.tag

Defined in

node_modules/o1js/dist/node/lib/proof-system/proof.d.ts:148