For the complete documentation index, see llms.txt. This page is also available as Markdown.

verify_transaction_proof - Nervos

Example code for the verify_transaction_proof JSON-RPC method. Complete guide on how to use verify_transaction_proof JSON-RPC in GetBlock Web3 documentation.

Verifies a Merkle proof returned by get_transaction_proof and returns the transaction hashes that the proof witnesses.

Parameters

Parameter
Type
Required
Description

tx_proof

TransactionProof

Yes

Proof object returned by get_transaction_proof

Request Example

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "verify_transaction_proof",
    "params": [
        {
            "block_hash": "0x02530b25ad0ff677acc365cb73de3e8cc09c7ddd58272e879252e199d08df83b",
            "witnesses_root": "0x6a7e8d3f1c4b9a2e5d8b7c4f9a3e6b1d5c8a2f4e7b1d6c9a3e5b8d2f4a6c8e0b",
            "proof": {
                "indices": [
                    "0x0"
                ],
                "lemmas": [
                    "0x4a3e8d3f1c4b9a2e5d8b7c4f9a3e6b1d5c8a2f4e7b1d6c9a3e5b8d2f4a6c8e0b"
                ]
            }
        }
    ],
    "id": "getblock.io"
}'

Response Example

Response Parameters

Field
Type
Description

result

array of H256

Transaction hashes whose inclusion the proof verifies

Use Cases

  • Light client proof verification

  • Bridge relayer code that needs to verify CKB proofs on-chain

Error Handling

Status Code
Error Message
Cause

403

Forbidden

Missing or invalid <ACCESS-TOKEN>

-32602

Invalid params

Request parameters are missing or malformed

-32601

Method not found

Method does not exist or is not enabled on this node

-32603

Internal error

Server-side error while processing the request

429

Too Many Requests

Rate limit exceeded for your plan

-32602

Invalid proof

Proof is malformed or doesn't verify against the block

SDK Integration

Was this helpful?