Skip to main content

VerificationKeyUpgradeAuthority

VerificationKeyUpgradeAuthority is a smart contract that provides a secure mechanism for upgrading the verification keys of other contracts without requiring redeployment. It manages a list of validators who can vote on upgrade proposals, ensuring that only authorized upgrades are applied.

Key Features:

  • Verification Key Management: Allows for secure upgrades of verification keys for other contracts.
  • Validators Governance: Maintains a list of authorized validators who can vote on upgrade proposals.
  • Secure Voting Mechanism: Implements Zero-Knowledge proofs to validate votes from validators without revealing sensitive information.
  • Upgrade Database Management: Keeps track of upgrade proposals and their validity periods.
  • Event Emissions: Emits events when validators list or upgrade database is updated.

Hierarchy

  • SmartContract
    • VerificationKeyUpgradeAuthority

Implements

Index

Constructors

externalconstructor

Properties

events

events: { updateDatabase: typeof UpgradeDatabaseState; validatorsList: typeof ValidatorsListEvent } = ...

The events emitted by the VerificationKeyUpgradeAuthority contract.


Type declaration

upgradeDatabasePacked

upgradeDatabasePacked: State<UpgradeDatabaseStatePacked> = ...

Packed state containing the upgrade database information.

validators

validators: State<Field> = ...

The hash representing the current state of the validators list.

verificationKeyHash

verificationKeyHash: State<Field> = ...

The hash of the verification key.

Methods

checkValidatorsDecision

  • checkValidatorsDecision(proof: ValidatorsVotingProof, vk: VerificationKey, decisionType: Field): Promise<void>
  • Checks the validators' decision by verifying the provided proof.


    Parameters

    • proof: ValidatorsVotingProof

      The proof to verify.

    • vk: VerificationKey

      The verification key to validate the proof.

    • decisionType: Field

      The type of decision being validated.

    Returns Promise<void>

deploy

  • deploy(): Promise<void>
  • Deploys the contract and sets the initial state.


    Returns Promise<void>

initialize

  • Initializes the contract with validators and sets the verification key hash.


    Parameters

    • validators: ValidatorsState

      The initial validators state.

    • storage: Storage

      Off-chain storage information, e.g., IPFS hash.

    • verificationKeyHash: Field

      The hash of the verification key.

    Returns Promise<void>

setValidatorsList

  • Sets the validators list and emits an event.


    Parameters

    • validators: ValidatorsState

      The validators state to set.

    • storage: Storage

      The storage associated with the validators list.

    Returns Promise<void>

updateDatabase

  • Updates the upgrade database after validator consensus.


    Parameters

    • proof: ValidatorsVotingProof

      The proof of validators voting.

    • vk: VerificationKey

      The verification key to validate the proof.

    Returns Promise<void>

updateValidatorsList

  • Updates the validators list based on validator votes.


    Parameters

    • validators: ValidatorsState

      The new validators state.

    • storage: Storage

      The storage associated with the validators list.

    • proof: ValidatorsVotingProof

      The proof of validators voting.

    • vk: VerificationKey

      The verification key to validate the proof.

    Returns Promise<void>

publicverifyUpgradeData

  • Verifies the upgrade data provided by another contract.


    Parameters

    Returns Promise<UpgradeAuthorityAnswer>

    • The answer indicating verification result.