Retrieve a single ZK Proof used by the compression program to verify that the given accounts are valid and the new addresses can be created. RPC method guide with use cases, tips and examples.
getValidityProof RPC method generates zero-knowledge proofs to verify that the given accounts are valid or the new addresses can be created. This proof is required for any operation on compressed accounts (transfer, approve, decompress, etc.) for on-chain verification of compressed state.
hashes: 1, 2, 3, 4, or 8newAddressesWithTrees : 1, 2newAddresses param field is supported but deprecated. Please use newAddressesWithTreesinstead.hashes (BN254[], required): Array of BN254 objects representing compressed account hashes to generate proofs for.newAddresses (BN254[], optional): Array of BN254 objects representing new addresses to include in the proof for address tree verification.compressedProof (ValidityProof | null): The compressed validity proof object for zero-knowledge verificationroots (BN[]): Array of merkle tree roots used in proof generationrootIndices (number[]): Array of indices of the roots in the state treeleafIndices (number[]): Array of indices of the leaves being provenleaves (BN[]): Array of leaf values in the merkle treetreeInfos (TreeInfo[]): Array of information about the state trees usedproveByIndices (boolean[]): Array indicating whether to prove by indices for each elementproof.compressedProof and proof.rootIndices when building transactionsDependencies & Setup
An ID to identify the request.
test-account The version of the JSON-RPC protocol.
2.0 The name of the method to invoke.
getCompressedAccountBalance Request for compressed account data
{
"address": null,
"hash": "11111111111111111111111111111111"
}