getfinalizedblockhash - Bitcoin
Example code for the getfinalizedblockhash JSON-RPC method. Complete guide on how to use getfinalizedblockhash JSON-RPC in GetBlock Web3 documentation.
This method returns the hash of the finalized block. A finalized block is a block that has been deeply confirmed and is considered irreversible.
Parameters
None
Request
curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "getfinalizedblockhash",
"params": [],
"id": "getblock.io"
}'import axios from 'axios';
const data = JSON.stringify({
"jsonrpc": "2.0",
"method": "getfinalizedblockhash",
"params": [],
"id": "getblock.io"
});
const config = {
method: 'post',
url: 'https://go.getblock.io/<ACCESS-TOKEN>/',
headers: {
'Content-Type': 'application/json'
},
data: data
};
axios(config)
.then(response => console.log(JSON.stringify(response.data)))
.catch(error => console.log(error));Response
{
"jsonrpc": "2.0",
"id": "getblock.io",
"result": "000000000000000000043a9302e08c16ea186950f42a5498320ddd1bd7ab3420"
}Response Parameters
result
string
The hash of the finalized block as a hex string.
Use Case
The getfinalizedblockhash method is essential for:
Determining transaction finality
Building confirmation tracking systems
Implementing safe payment thresholds
Exchange deposit confirmation logic
High-value transaction verification
Building merchant payment systems
Error Handling
403
Forbidden
Missing or invalid ACCESS-TOKEN.
-1
No finalized block
No block has been finalized yet.
Integration With Web3
The getfinalizedblockhash method helps developers:
Build payment confirmation systems
Implement finality guarantees
Create safe deposit tracking
Support high-value transaction workflows
Build exchange integration systems
Last updated
Was this helpful?