EXPERIMENTAL_light_client_proof - NEAR Protocol

Returns an execution-outcome inclusion proof (for a transaction or receipt) against a given light-client head, so a light client can verify the outcome.

Method

EXPERIMENTAL_light_client_proof

Parameters

The params object carries:

ParameterExampleDescription
type"transaction"—
transaction_hash"B2d..."—
sender_id"example.near"—
light_client_head"9MzuZ..."—

Example

bashexport NEAR_RPC=https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/

curl -X POST "${NEAR_RPC}" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc": "2.0", "id": "getblock.io", "method": "EXPERIMENTAL_light_client_proof", "params": {"type": "transaction", "transaction_hash": "B2d...", "sender_id": "example.near", "light_client_head": "9MzuZ..."}}'

Response

json{
    "outcome_proof": {
        "id": "B2d...",
        "outcome": {
            "status": {
                "SuccessValue": ""
            }
        }
    },
    "outcome_root_proof": [],
    "block_header_lite": {
        "inner_lite": {
            "height": 152000000
        }
    },
    "block_proof": []
}

Response Fields

FieldTypeDescription
outcome_proofobjectThe Merkle proof of the transaction/receipt outcome
outcome_root_proofarrayProof linking the outcome to the block's outcome root
block_header_liteobjectThe compact header the proof is anchored to
block_proofarrayProof linking the block to the light-client head

Use Cases

  • Trustless verification: Prove a transaction executed, to a light client or bridge

Error Handling

ErrorMessageDescription
-32700 / Parse errorParse errorThe JSON request was malformed
-32601 / Method not foundMethod not foundThe method is unknown or disabled on this node version
HANDLER_ERRORRequested data not foundThe account, block, chunk, or transaction does not exist or is garbage-collected (use an archival node)
403 / RBAC: access deniedAccess deniedThe GetBlock access token is missing or incorrect