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

verify_transaction_and_witness_proof - Nervos

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

Verifies a transaction-and-witness proof and returns the transaction hashes it witnesses.

Parameters

Parameter
Type
Required
Description

tx_proof

TransactionAndWitnessProof

Yes

Proof object returned by get_transaction_and_witness_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_and_witness_proof",
    "params": [
        {
            "block_hash": "0x02530b25ad0ff677acc365cb73de3e8cc09c7ddd58272e879252e199d08df83b",
            "transactions_proof": {
                "indices": [
                    "0x0"
                ],
                "lemmas": [
                    "0x4a3e8d3f1c4b9a2e5d8b7c4f9a3e6b1d5c8a2f4e7b1d6c9a3e5b8d2f4a6c8e0b"
                ]
            },
            "witnesses_proof": {
                "indices": [
                    "0x0"
                ],
                "lemmas": [
                    "0x8a7e3d3f1c4b9a2e5d8b7c4f9a3e6b1d5c8a2f4e7b1d6c9a3e5b8d2f4a6c8e0b"
                ]
            }
        }
    ],
    "id": "getblock.io"
}'

Response Example

Response Parameters

Field
Type
Description

result

array of H256

Transaction hashes whose inclusion (and witnesses) the proof verifies

Use Cases

  • Strong-form light client verification

  • Cross-chain proof relayers

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

SDK Integration

Was this helpful?