getLatestBlockhash

POSTFees & BlockhashOperator+

Returns a recent blockhash and the last block height it remains valid through.

Try itSends a real request from your browser to the selected region.
POST
/

getLatestBlockhash returns a blockhash for a transaction's recentBlockhash field, and the lastValidBlockHeight at which it expires. Every transaction must reference a recent blockhash so the network can detect and drop duplicates and stale transactions.

A blockhash is valid for about 150 blocks, roughly a minute; transaction-building flows typically fetch one immediately before signing rather than caching it.

Plans & rate limitsOperator and above
FreeNot included
Operator50/s
Blade Runner200/s
Nexus500/s

Parameters

params is a JSON array, with values in this order: config.

1configobject

Optional configuration.

Show propertiesProperties
commitmentstringdefault: "finalized"

Bank state to read the blockhash from. processed gives the newest possible blockhash but carries the highest risk of referencing a block that gets skipped.

Allowed values:finalizedconfirmedprocessed
minContextSlotinteger

Minimum slot the node must have processed before answering.

Result

resultobject

The blockhash and its expiry height, wrapped with context.

Show propertiesProperties
contextobjectrequired
Show propertiesProperties
slotinteger
apiVersionstring
valueobjectrequired
Show propertiesProperties
blockhashstringrequired

Base-58 encoded blockhash.

lastValidBlockHeightintegerrequired

Last block height at which this blockhash will be accepted for fee calculation and transaction validity.

Notes

  • A transaction's lastValidBlockHeight, compared against the current getBlockHeight, indicates whether it is still safe to (re)broadcast.
  • Not available on the Free plan.