Skip to main content

pathfinder_getProof RPC Method

Returns merkle proofs for a contract's storage. This allows you to verify a contract's state for a specific Starknet block.

Updated on
Mar 18, 2024

pathfinder_getProof RPC Method

Parameters

block_id
string
REQUIRED
The hash of the requested block, the block number (height) of the requested block, or a block tag (latest or pending)
contract_address
string
REQUIRED
The address of the contract to read from
key
array
REQUIRED
The storage element addresses to gather proofs for

Returns

result
object
The result object which can be one of the following object:
state_commitment
string
(Optional) The commitment for the state of a Starknet block. Before Starknet v0.11.0 this was equivalent to storage commitment, which is the hash of the first node in the contract proof
class_commitment
string
(Optional) The root of the class commitment tree
contract_proof
object
The proof of the contract state hash. It contains one of the following object:
binary
object
The binary node object which contains the following fields:
left
string
The left child's hash
right
string
The right child's hash
edge
object
The edge object which contains the following fields:
child
string
The child's hash
path
object
The path object which contains the following fields:
value
string
The path of this edge node
len
integer
The bit length of this path
contract_data
object
(Optional) The contract data object which is only present if the contract exists
class_hash
string
The hash of the contract's class
nonce
string
The contract's nonce
root
string
The contract's storage state root hash
contract_state_hash_version
string
The state hash version used to calculate the state hash
storage_proofs
array
(Optional) It contains the requested storage proofs (in order of request). It contains one of the following object:
binary
object
The binary node object which contains the following fields:
left
string
The left child's hash
right
string
The right child's hash
edge
object
The edge object which contains the following fields:
child
string
The child's hash
path
object
The path object which contains the following fields:
value
string
The path of this edge node
len
integer
The bit length of this path
Request
1
curl --location 'https://docs-demo.strk-mainnet.quiknode.pro/rpc/pathfinder/v0.1' \
2
--header 'accept: application/json' \
3
--header 'content-type: application/json' \
4
--data '{
5
"jsonrpc": "2.0",
6
"id": 1,
7
"method": "pathfinder_getProof",
8
"params": [
9
"latest",
10
"0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
11
[
12
"0x0000000000000000000000000000000000000000000000000000000000000001"
13
]
14
]
15
}'
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free