getbestblockhash | Bitcoin

The getbestblockhash method returns the hash of the best block in the most-work fully-validated chain. The best block is the tip of the blockchain, representing the most recent block that has been validated and added to the chain.

👍

Get you own node endpoint today

Start for free and get your app to production levels immediately. No credit card required.

You can sign up with your GitHub, X, Google, or Microsoft account.

Parameters

  • none

Response

  • result — a hex-encoded string representing the hash of the best block in the longest blockchain.
  • error — an object containing an error message if an error occurred, otherwise null.
  • id — an integer representing the ID of the request, used to match requests with responses.

Use case

The getbestblockhash method is useful for applications that need to know the current state of the blockchain. For example, a wallet application may use this method to determine the latest block to scan for transactions relevant to the wallet's addresses.

Try the getbestblockhash RPC method yourself

Language
Click Try It! to start a request and see the response here!