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

# krnx_getBlockTemplate

> Pool mining template



## OpenAPI

````yaml specs/krnx_getBlockTemplate.json POST /
openapi: 3.1.0
info:
  description: >-
    Generated from internal/krnxapi/krnx_mining_rpc.go by tools/rpcdocgen. Do
    not edit by hand.
  title: KRNX JSON-RPC
  version: 1.0.0
servers:
  - url: https://rpc.kronex.network
security: []
paths:
  /:
    post:
      summary: krnx_getBlockTemplate
      description: >-
        Returns a mining template for a pool to build parent-chain work from.


        `coinbase` is not a parent-chain payout address: it is the KRNX
        beneficiary of the workshare rewards. The parent-chain payout is already
        fixed inside the signed aux template. Set `extras: ["operator"]` only on
        the gateway that also submits the parent block.
      operationId: krnx_getBlockTemplate
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Request'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Response'
          description: JSON-RPC response
components:
  schemas:
    Request:
      properties:
        id:
          example: 1
          type: integer
        jsonrpc:
          enum:
            - '2.0'
          example: '2.0'
          type: string
        method:
          enum:
            - krnx_getBlockTemplate
          example: krnx_getBlockTemplate
          type: string
        params:
          description: 'Positional parameters: 1. `req` (object, required).'
          example:
            - coinbase: '0x299f5F0Ae73248455543Da5A8E14195Bc9CA1D22'
              extradata: pool-01
              extranonce1: '01020304'
              extranonce2: '0000000000000000'
              mode: template
              rules:
                - sha256d
          maxItems: 1
          minItems: 1
          type: array
      required:
        - jsonrpc
        - method
        - params
        - id
      type: object
    Response:
      properties:
        error:
          description: Present instead of `result` when the call fails.
          properties:
            code:
              example: -32602
              type: integer
            message:
              type: string
          type: object
        id:
          example: 1
          type: integer
        jsonrpc:
          example: '2.0'
          type: string
        result:
          $ref: '#/components/schemas/KRNXGetBlockTemplateResponse'
      type: object
    KRNXGetBlockTemplateResponse:
      properties:
        algorithm:
          type: string
        auxMerkleBranch:
          description: >-
            AuxMerkleBranch and AuxMerkleIndex are the KRNX leaf's proof in the
            merged-mining aux merkle tree.
          items:
            type: string
          type: array
        auxMerkleIndex:
          description: 0x-prefixed hex quantity.
          pattern: ^0x[0-9a-fA-F]+$
          type: string
        beneficiary:
          example: '0x0000000000000000000000000000000000000000'
          pattern: ^0x[0-9a-fA-F]{40}$
          type: string
        bits:
          type: string
        blockcommitments:
          description: >-
            BlockCommitments is the ZEC-only hashBlockCommitments the parent
            header must carry.
          type: string
        coinb1:
          type: string
        coinb2:
          type: string
        coinbaseAuxExtraBytesLength:
          type: integer
        coinbaseTx:
          description: >-
            CoinbaseTx is the fully assembled parent coinbase, set for ZEC
            because its v5/v6 envelope is not something a pool can splice from
            coinb1/coinb2 without reimplementing the transaction format.
          type: string
        curtime:
          type: integer
        difficulty:
          type: string
        dogeAuxHash:
          type: string
        dogeAuxMerkleBranch:
          description: >-
            DogeAuxMerkleBranch/DogeAuxMerkleIndex are the DOGE leaf's proof in
            the same aux merkle tree, present only when the node has fresh
            coordinator-pushed DOGE work.
          items:
            type: string
          type: array
        dogeAuxMerkleIndex:
          description: 0x-prefixed hex quantity.
          pattern: ^0x[0-9a-fA-F]+$
          type: string
        dogeBits:
          type: string
        extranonce1Length:
          type: integer
        extranonce2Length:
          type: integer
        height:
          type: integer
        krnxBlockHash:
          example: '0x0000000000000000000000000000000000000000000000000000000000000000'
          pattern: ^0x[0-9a-fA-F]{64}$
          type: string
        krnxBlockNumber:
          description: 0x-prefixed hex quantity.
          pattern: ^0x[0-9a-fA-F]+$
          type: string
        merklebranch:
          items:
            type: string
          type: array
        merkleroot:
          type: string
        mintime:
          type: integer
        noncerange:
          type: string
        operator:
          allOf:
            - $ref: '#/components/schemas/KRNXTemplateOperatorExtras'
          description: Operator is present only when the request asked for it.
        parentChain:
          type: string
        powId:
          type: integer
        previousblockhash:
          type: string
        target:
          type: string
        version:
          type: integer
        workTemplate:
          description: 0x-prefixed hex byte string.
          pattern: ^0x([0-9a-fA-F]{2})*$
          type: string
        workid:
          example: '0x0000000000000000000000000000000000000000000000000000000000000000'
          pattern: ^0x[0-9a-fA-F]{64}$
          type: string
      required:
        - algorithm
        - beneficiary
        - bits
        - coinb1
        - coinb2
        - coinbaseAuxExtraBytesLength
        - curtime
        - difficulty
        - extranonce1Length
        - extranonce2Length
        - height
        - krnxBlockHash
        - krnxBlockNumber
        - merklebranch
        - merkleroot
        - mintime
        - noncerange
        - parentChain
        - powId
        - previousblockhash
        - target
        - version
        - workTemplate
        - workid
      type: object
    KRNXTemplateOperatorExtras:
      description: >-
        KRNXTemplateOperatorExtras is the part of the template that only the
        operator running the parent-chain node needs, returned solely when the
        request asks for it.
      properties:
        parentSource:
          description: >-
            ParentSource names which kind of AuxTemplate this work was built
            from.
          type: string
        parentTarget:
          type: string
        signedTemplateHash:
          example: '0x0000000000000000000000000000000000000000000000000000000000000000'
          pattern: ^0x[0-9a-fA-F]{64}$
          type: string
      required:
        - parentTarget
        - signedTemplateHash
      type: object

````