grandpa_proveFinality - Midnight

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

This method returns a GRANDPA justification proof for the specified block range, enabling light clients to independently verify finality. Provide the start of the range; the node returns the proof up to the most recent finalized block.

Parameters

Parameter
Type
Required
Description

blockNumber

integer

Yes

Block number from which to prove finality

Request Example

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "grandpa_proveFinality",
    "params": [
        981031
    ],
    "id": "getblock.io"
}'

Response Example

{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": "0x01a3e8\u2026"
}

Response Parameters

Field
Type
Description

result

string | null

Hex-encoded GRANDPA proof, or null if no proof is available for the given range

Use Cases

  • Building light clients that verify finality without trusting the RPC provider

  • Bridging Midnight state to other chains using GRANDPA proofs

  • Auditing finality assumptions in security-critical applications

Error Handling

Status Code
Error Message
Cause

403

Forbidden

Missing or invalid <ACCESS-TOKEN>

-32602

Invalid params

Request parameters are missing or malformed

429

Too Many Requests

Rate limit exceeded for your plan

SDK Integration

Last updated

Was this helpful?