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

# getnetworkhashps | Bitcoin

The `getnetworkhashps` method estimates the total hashing power of the network based on the last n blocks. It can provide insights into the current or historical network difficulty and security.

<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

* `n` (optional): The number of blocks to calculate the average hash rate over. The default is 120 blocks.
* `height` (optional): The block height at which to calculate the hash rate. The default is -1, which calculates the hash rate at the current height.

## Response

* `result` — a number representing the estimated hashes per second for the network based on the specified number of blocks.
* `error` — an object containing an error message if an error occurred, otherwise `null`.
* `id` — an integer representing the ID of the request.

## Use case

The `getnetworkhashps` method is useful for understanding the overall security and difficulty of the blockchain network. It helps users and analysts gauge the amount of computational power dedicated to mining and maintaining the network.


## OpenAPI

````yaml /openapi/bitcoin_node_api/getnetworkhashps.json POST /788f110831fe13808302bd79796d55e8
openapi: 3.0.0
info:
  title: getnetworkhashps example
  version: 1.0.0
  description: >-
    This is an API example for getnetworkhashps, a method to get the estimated
    current or historical network  hashes per second based on the last n blocks.
servers:
  - url: https://nd-202-842-353.p2pify.com
security: []
paths:
  /788f110831fe13808302bd79796d55e8:
    post:
      tags:
        - Blockchain Operations
      summary: getnetworkhashps
      operationId: getNetworkHashPs
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                jsonrpc:
                  type: string
                  default: '1.0'
                method:
                  type: string
                  default: getnetworkhashps
                params:
                  type: array
                  items:
                    oneOf:
                      - type: integer
                        description: >-
                          The number of blocks to calculate the average hash
                          rate over. Default is 120.
                      - type: integer
                        description: >-
                          The block height at which to calculate the hash rate.
                          Default is -1, meaning the  current height.
                  default:
                    - 120
                    - -1
                id:
                  type: integer
                  default: 1
      responses:
        '200':
          description: The estimated network hashes per second.
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: number
                    description: >-
                      The estimated number of hashes per second based on the
                      last n blocks.
                  error:
                    type: object
                  id:
                    type: integer

````