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

# getblocktemplate | Bitcoin

> The getblocktemplate method is used by miners to request a block template for mining new blocks. Use it on Bitcoin via Chainstack.

The `getblocktemplate` method is used by miners to request a block template for mining new blocks. It can be customized with various parameters to specify the desired mining capabilities and rules.

<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

* `mode` (optional): Specifies the mode of operation. Can be 'template' for a block template or 'proposal' for submitting a block proposal. This field is required if parameters are specified.
* `capabilities` (optional): A list of strings specifying the capabilities the miner supports. This can include 'coinbasetxn', 'workid', 'coinbase/append', etc.
* `rules` (optional): A list of strings specifying the rules the miner will support. For example, 'segwit' indicates support for Segregated Witness.

## Response

* `result` — an object containing the block template or proposal for mining.
* `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 `getblocktemplate` method is crucial for miners who need to get information about the current state of the network to mine new blocks. It allows miners to get a template for creating a new block to be added to the blockchain.


## OpenAPI

````yaml /openapi/bitcoin_node_api/getblocktemplate.json POST /788f110831fe13808302bd79796d55e8
openapi: 3.0.0
info:
  title: getblocktemplate example
  version: 1.0.0
  description: >-
    This is an API example for getblocktemplate, a method to get a block
    template or proposal for use in  mining.
servers:
  - url: https://nd-202-842-353.p2pify.com
security: []
paths:
  /788f110831fe13808302bd79796d55e8:
    post:
      tags:
        - Blockchain Operations
      summary: getblocktemplate
      operationId: getBlockTemplate
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                jsonrpc:
                  type: string
                  default: '1.0'
                method:
                  type: string
                  default: getblocktemplate
                params:
                  type: array
                  items:
                    type: object
                    properties:
                      mode:
                        type: string
                        description: >-
                          This must be set to 'template', 'proposal', or left
                          unset.
                        enum:
                          - template
                          - proposal
                      capabilities:
                        type: array
                        items:
                          type: string
                        description: List of capabilities
                        example:
                          - coinbasetxn
                          - workid
                          - coinbase/append
                      rules:
                        type: array
                        items:
                          type: string
                        description: A list of strings
                        example:
                          - segwit
                    required:
                      - mode
                  example:
                    - mode: template
                      capabilities:
                        - coinbasetxn
                        - workid
                        - coinbase/append
                      rules:
                        - segwit
                  default:
                    - mode: template
                      capabilities:
                        - coinbasetxn
                        - workid
                        - coinbase/append
                      rules:
                        - segwit
                id:
                  type: integer
                  default: 1
      responses:
        '200':
          description: A block template or proposal for mining.
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    description: The block template or proposal.
                  error:
                    type: object
                  id:
                    type: integer

````