Loading documentation…
Fetch a recent Solana blockhash and its last valid block height for signing transactions.
getLatestBlockhash returns a recent blockhash to reference when signing a transaction, plus the
last block height at which that blockhash is still valid. Every transaction needs a fresh blockhash;
a stale one is the most common cause of a dropped transaction.
curl -s https://rpc.rpcedge.com \
-H 'content-type: application/json' \
-H 'x-api-key: YOUR_UUID_KEY' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getLatestBlockhash",
"params": [{ "commitment": "processed" }]
}'| Position | Name | Type | Notes |
|---|---|---|---|
0 | config | object | Optional. commitment and minContextSlot. |
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"context": { "slot": 429641447 },
"value": {
"blockhash": "EkSnNWid2cvwEVnVx9aBqawnmiCNiDgp3gUdkDPTKN1N",
"lastValidBlockHeight": 429641900
}
}
}| Field | Meaning |
|---|---|
blockhash | Base-58 blockhash to set on your transaction message. |
lastValidBlockHeight | The transaction is only valid while the chain's block height is ≤ this. After that, re-sign with a fresh blockhash. |