> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# getbestblockhash | Bitcoin

> The getbestblockhash method returns the hash of the best block in the most-work fully-validated chain. Chainstack Bitcoin reference.

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.

<Check>
  **Get your own node endpoint today**

  [Start for free](https://console.chainstack.com/) and get your app to production levels immediately. No credit card required.

  You can sign up with your GitHub, X, Google, or Microsoft account.
</Check>

## 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.


## OpenAPI

````yaml /openapi/bitcoin_node_api/getbestblockhash.json POST /788f110831fe13808302bd79796d55e8
openapi: 3.0.0
info:
  title: getbestblockhash example
  version: 1.0.0
  description: >-
    This is an API example for getbestblockhash, a method to retrieve the hash
    of the best (tip) block in the  most-work fully-validated chain.
servers:
  - url: https://nd-202-842-353.p2pify.com
security: []
paths:
  /788f110831fe13808302bd79796d55e8:
    post:
      tags:
        - Blockchain Operations
      summary: getbestblockhash
      operationId: getBestBlockHash
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                jsonrpc:
                  type: string
                  default: '1.0'
                method:
                  type: string
                  default: getbestblockhash
                id:
                  type: integer
                  default: 1
      responses:
        '200':
          description: The hash of the best (tip) block
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                  error:
                    type: object
                  id:
                    type: integer

````