Skip to main content

Get Verification Key

The verificationKey method allows you to retrieve important verification keys associated with specific contracts in the database. These keys include details like the Merkle tree height, key hashes, and raw encoded data. They are essential for verifying zero-knowledge proofs and understanding the cryptographic configuration of the system.

Method Signature

await zkdb.db(databaseName: string).verificationKey(): Promise<VerificationKey | null>;

Syntax

import { ZkDatabase } from 'zkdb';

const zkdb = await ZkDatabase.connect({
userName: "chiro-user",
privateKey: "EKFTciRxyxshZjimay9sktsn7v5PvmC5zPq7q4JnitHUytxUVnFP",
environment: "node",
// This URL is for test environment
url: "https://api.zkdatabase.org/graphql",
});

await zkdb.auth.signIn();


console.log(await zkdb.db("zkdb_test").verificationKey());

await zkdb.auth.signOut();

Returns

  • A promise that resolves to a VerificationKey or null if no verification keys are available.
{
data: 'AQHwbVNVDjA...m0fMy4=',
hash: Field { value: [ 0, [Array] ] }
}