getshardblockproof - TON

Example code for the getshardblockproof JSON-RPC method. Сomplete guide on how to use getshardblockproof JSON-RPC in GetBlock.io Web3 documentation.

This method returns the Merkle proof for a shardchain block, anchored to the masterchain. Use it to verify a shard block independently of trusting the RPC provider.

Parameters

Parameter
Type
Required
Description

workchain

integer

Yes

Workchain ID of the shard block (0 for basechain)

shard

string

Yes

Shard ID as a 64-bit integer (string-encoded)

seqno

integer

Yes

Seqno of the shard block

from_seqno

integer

No

Masterchain seqno from which the proof is required. Defaults to the latest

Request Example

REST (GET):

curl --location --request GET 'https://go.getblock.io/<ACCESS-TOKEN>/getShardBlockProof?workchain=0&shard=8000000000000000&seqno=12345678' \
--header 'Content-Type: application/json'

JSON-RPC (POST):

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "getShardBlockProof",
    "params": {
        "workchain": 0,
        "shard": "8000000000000000",
        "seqno": 12345678
    },
    "id": "getblock.io"
}'

Response Example

Response Parameters

Field
Type
Description

result.from

object

Masterchain block from which the proof starts

result.mc_id

object

Masterchain block that anchors the shard block

result.links

array

Array of Merkle proof links from masterchain to the target shard block

Use Cases

  • Light client verification of shard blocks

  • Building trust-minimised cross-shard bridges

  • Independent verification of provider-returned shard data

Error Handling

Status Code
Error Message
Cause

403

Forbidden

Missing or invalid <ACCESS-TOKEN>

422

Validation Error

Request parameters are missing or malformed

429

Too Many Requests

Rate limit exceeded for your plan

504

Lite Server Timeout

Upstream TON liteserver timed out

SDK Integration

Last updated

Was this helpful?