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.
ThegetValidityProof 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.
You can test this method via the OpenAPI example or custom examples below.
Proof limits per request are:
hashes: 1, 2, 3, 4, or 8
newAddressesWithTrees : 1, 2
The newAddresses param field is supported but deprecated. Please use newAddressesWithTreesinstead.
Common Use Cases
Token Transfers: Generate proofs required for transferring compressed tokens.
Account Operations: Create proofs needed for any compressed account modification.
Batch Processing: Generate proofs for multiple accounts in a single call.
State Tree Verification: Prove account inclusion in the current state tree.
Transaction Building: Obtain proof data needed for compressed transaction instructions.
Program Integration: Get validity proofs for custom program operations on compressed accounts.
Parameters
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.