Kadena block API

These endpoints return whole blocks, headers and payloads, from the chain database. Generally, blocks are returned in ascending order and include orphaned blocks. For only querying blocks that are included in the winning branch of the chain the `branch` endpoints can be used, which return blocks in descending order starting from the leafs of branches of the block chain. Blocks are returned in only one format, with block headers and payloads in JSON encoding.

OpenAPI Specification

kadena-block-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Kadena Chainweb Node block API
  description: 'API of [chainweb-node](https://github.com/kadena-io/chainweb-node)


    Chainweb is a scalable Proof-Of-Work (PoW) consensus algorithm. It is an

    conservative extension of Bitcoin''s Nakamoto consensus that extends

    Bitcoin''s single chain algorithm to multiple chains. This allows for

    unlimited transaction throughput by horizontally scaling the number of chains.


    Feedback and bug reports for the content of this site are welcome. Please

    open an issue at [this github repository](https://github.com/kadena-io/chainweb-openapi/issues).

    '
  version: '0.0'
  x-logo:
    url: https://cdn.sanity.io/images/agrhq0bu/production/73f06e78e066f86e21cb84f82292494fe04b9be8-1438x472.png
    alttext: Kadena Chainweb Logo
servers:
- url: https://api.chainweb.com/chainweb/{apiVersion}/mainnet01
  description: 'Chainweb mainnet service API. It also serves some endpoints of the P2P API.

    '
  variables:
    apiVersion:
      default: '0.0'
- url: https://api.testnet.chainweb.com/chainweb/{apiVersion}/testnet04
  description: 'Chainweb testnet service API. It also serves some endpoints of the P2P API.

    '
  variables:
    apiVersion:
      default: '0.0'
- url: '{schema}://{domain}:{port}/chainweb/{apiVersion}/{chainwebVersion}'
  description: 'An generic chainweb-node. It may serve only a subset of the endpoints.

    '
  variables:
    schema:
      default: http
      enum:
      - http
      - https
    domain:
      default: api.chainweb.com
    port:
      default: '1848'
    chainwebVersion:
      default: mainnet01
      enum:
      - test-singleton
      - development
      - mainnet01
      - testnet04
    apiVersion:
      default: '0.0'
- url: https://{location}.chainweb.com/chainweb/{apiVersion}/mainnet01
  description: Chainweb mainnet P2P bootstrap node. Only P2P API endpoints are served.
  variables:
    location:
      default: us-e1
      enum:
      - us-e1
      - us-e2
      - us-e3
      - us-w1
      - us-w2
      - us-w3
      - fr1
      - fr2
      - fr3
      - jp1
      - jp2
      - jp3
    apiVersion:
      default: '0.0'
- url: https://{location}.testnet.chainweb.com/chainweb/{apiVersion}/testnet04
  description: Chainweb testnet P2P bootstrap node. Only P2P API endpoints are served.
  variables:
    location:
      default: us-e1
      enum:
      - us1
      - us2
      - eu1
      - eu2
      - ap1
      - ap2
    apiVersion:
      default: '0.0'
tags:
- name: block
  x-displayName: Block Endpoints
  description: 'These endpoints return whole blocks, headers and payloads, from the chain

    database.


    Generally, blocks are returned in ascending order and include orphaned

    blocks.


    For only querying blocks that are included in the winning branch of the

    chain the `branch` endpoints can be used, which return blocks in descending

    order starting from the leafs of branches of the block chain.


    Blocks are returned in only one format, with block headers and payloads in

    JSON encoding.

    '
paths:
  /chain/{chain}/block:
    get:
      summary: Get Block
      description: 'A page of a collection of blocks in **ascending** order that satisfies

        query parameters. Any block from the chain database is returned. **This

        includes orphaned blocks.**

        '
      tags:
      - block
      parameters:
      - $ref: '#/components/parameters/chain'
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/next'
      - $ref: '#/components/parameters/minheight'
      - $ref: '#/components/parameters/maxheight'
      responses:
        '200':
          description: The requested blocks
          headers:
            x-peer-addr:
              $ref: '#/components/headers/x-peer-addr'
            x-server-timestamp:
              $ref: '#/components/headers/x-server-timestamp'
            x-chainweb-node-version:
              $ref: '#/components/headers/x-chainweb-node-version'
          content:
            application/json:
              schema:
                allOf:
                - properties:
                    items:
                      description: Array of JSON encoded blocks
                      items:
                        $ref: '#/components/schemas/block'
                - $ref: '#/components/schemas/page'
              example:
                $ref: '#/components/examples/blockPage'
        '404':
          description: 'The `next` or `maxheight` parameter indicated a nonexistent block height.

            '
          headers:
            x-peer-addr:
              $ref: '#/components/headers/x-peer-addr'
            x-server-timestamp:
              $ref: '#/components/headers/x-server-timestamp'
            x-chainweb-node-version:
              $ref: '#/components/headers/x-chainweb-node-version'
          content:
            application/json:
              schema:
                properties:
                  reason:
                    type: string
                  key:
                    $ref: '#/components/schemas/blockHash'
  /chain/{chain}/block/branch:
    post:
      summary: Get Block Branches
      description: 'A page of blocks from branches of the block chain in **descending**

        order.


        Blocks are returned that are ancestors of the block in the set of upper

        bounds and are not ancestors of any block in the set of lower bounds.

        '
      tags:
      - block
      parameters:
      - $ref: '#/components/parameters/chain'
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/next'
      - $ref: '#/components/parameters/minheight'
      - $ref: '#/components/parameters/maxheight'
      requestBody:
        description: Upper and lower bounds of the queried branches
        content:
          application/json:
            schema:
              properties:
                lower:
                  description: 'No blocks are returned that are predecessors of any block with

                    an hash from this array.

                    '
                  type: array
                  items:
                    $ref: '#/components/schemas/blockHash'
                upper:
                  description: 'Returned block headers are predecessors of a block with an

                    hash from this array. This includes blocks with hashes from

                    this array.

                    '
                  type: array
                  items:
                    $ref: '#/components/schemas/blockHash'
            examples:
              singletonLimited:
                value:
                  lower:
                  - RClyuyZAacwvPpmLXKbTwrIRXWeUSjiNhJVP2esH8KM
                  upper:
                  - QxGCAz5AY1Y41nh1yWtgqhKhZ9pPiPRagFdIKNqBH74
                summary: Ancestors of block that are not ancestors of another block
              singleton:
                value:
                  lower: []
                  upper:
                  - QxGCAz5AY1Y41nh1yWtgqhKhZ9pPiPRagFdIKNqBH74
                summary: Ancestors of one block
              empty:
                value:
                  lower: []
                  upper: []
                summary: Empty branch
              empty2:
                value:
                  lower:
                  - QxGCAz5AY1Y41nh1yWtgqhKhZ9pPiPRagFdIKNqBH74
                  upper:
                  - QxGCAz5AY1Y41nh1yWtgqhKhZ9pPiPRagFdIKNqBH74
                summary: Another example that returns an empty page
      responses:
        '200':
          description: The blocks that were found
          headers:
            x-peer-addr:
              $ref: '#/components/headers/x-peer-addr'
            x-server-timestamp:
              $ref: '#/components/headers/x-server-timestamp'
            x-chainweb-node-version:
              $ref: '#/components/headers/x-chainweb-node-version'
          content:
            application/json:
              schema:
                allOf:
                - properties:
                    items:
                      description: Array of JSON encoded blocks
                      items:
                        $ref: '#/components/schemas/block'
                - $ref: '#/components/schemas/page'
              example:
                $ref: '#/components/examples/blockPage'
        '400':
          headers:
            x-peer-addr:
              $ref: '#/components/headers/x-peer-addr'
            x-server-timestamp:
              $ref: '#/components/headers/x-server-timestamp'
            x-chainweb-node-version:
              $ref: '#/components/headers/x-chainweb-node-version'
          description: The branch bounds were exceeded.
        '406':
          headers:
            x-peer-addr:
              $ref: '#/components/headers/x-peer-addr'
            x-server-timestamp:
              $ref: '#/components/headers/x-server-timestamp'
            x-chainweb-node-version:
              $ref: '#/components/headers/x-chainweb-node-version'
          description: The value of the `Accept` header is not supported.
        '404':
          headers:
            x-peer-addr:
              $ref: '#/components/headers/x-peer-addr'
            x-server-timestamp:
              $ref: '#/components/headers/x-server-timestamp'
            x-chainweb-node-version:
              $ref: '#/components/headers/x-chainweb-node-version'
          description: A block indicated by a required parameter was not found.
          content:
            application/json:
              schema:
                properties:
                  reason:
                    type: string
                  key:
                    $ref: '#/components/schemas/blockHash'
components:
  examples:
    blockPage:
      value:
        next: inclusive:o1S4NNFhKWg8T1HEkmDvsTH9Ut9l3_qHRpp00yRKZIk
        items:
        - blockHeader:
            creationTime: 1602382624629329
            parent: HaXABq1PKSKlhncJk0_Mt75_lL7NS3wI627QfXZ_85k
            height: 1000000
            hash: k0an0qEORusqQg9ZjKrxa-0Bo0-hQVYLXqWi5LHxg3k
            chainId: 0
            weight: NQn4BGftuWAeAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
            featureFlags: 0
            epochStart: 1602381443331834
            adjacents:
              '15': MItdqgHZxf7j6l0oE8X-G9-VyMbnQmZrtSniuRe_EJ8
              '5': Mpic85rur2MYf3zli8s8bHxTFjriFoMPTr6ZPs8sjxM
              '10': VBKuhU_hQmuvKlx88A5o-FH0rzNo59NsdxmOGNBQ-yc
            payloadHash: GpaWbHkHrCjRhY8hKE0qZ1WsBBaG3Y_zkFLV2sYumQA
            chainwebVersion: mainnet01
            target: QrcsbEm-3WjyCGAGlzIEhLEN3ZMWORoyYy8AAAAAAAA
            nonce: '13095611958898437'
          payloadWithOutputs:
            transactions: []
            minerData: eyJhY2NvdW50IjoiYTFiMzE0MGNiN2NjODk1YzBlMDkxNzAyZWQwNTU3OWZiZTA1YzZlNjc0NWY4MmNlNjAzNzQ2YjQwMGM4MTU0OCIsInByZWRpY2F0ZSI6ImtleXMtYWxsIiwicHVibGljLWtleXMiOlsiYTFiMzE0MGNiN2NjODk1YzBlMDkxNzAyZWQwNTU3OWZiZTA1YzZlNjc0NWY4MmNlNjAzNzQ2YjQwMGM4MTU0OCJdfQ
            transactionsHash: nT0j4xw2woMkdXXaopdurXIn24OG-jNMqQzUGfxV_MA
            outputsHash: 4pXRrZ2K0_V0iGAxQCKrKdLjQTBZHBOQS7P-47kdnhY
            payloadHash: GpaWbHkHrCjRhY8hKE0qZ1WsBBaG3Y_zkFLV2sYumQA
            coinbase: eyJnYXMiOjAsInJlc3VsdCI6eyJzdGF0dXMiOiJzdWNjZXNzIiwiZGF0YSI6IldyaXRlIHN1Y2NlZWRlZCJ9LCJyZXFLZXkiOiJJa2hoV0VGQ2NURlFTMU5MYkdodVkwcHJNRjlOZERjMVgyeE1OMDVUTTNkSk5qSTNVV1pZV2w4NE5Xc2kiLCJsb2dzIjoiZ3Noak1kWFJrVGxKYmIxalZkQWJ6SVVDcGpQb1JBQ2pEbExzRzBXNkJEMCIsIm1ldGFEYXRhIjpudWxsLCJjb250aW51YXRpb24iOm51bGwsInR4SWQiOjEyNzIzNTB9
        - blockHeader:
            creationTime: 1602382678045236
            parent: k0an0qEORusqQg9ZjKrxa-0Bo0-hQVYLXqWi5LHxg3k
            height: 1000001
            hash: vhVa6Deh10RXLRf3L-MSQTYqaL-_IY_mi-v58MjP9R8
            chainId: 0
            weight: bOkHN2JUv2AeAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
            featureFlags: 0
            epochStart: 1602381443331834
            adjacents:
              '15': Kv0sz_rTANjoiJwMrdZFCJNFwdH0U_M5ouwMr3BXBfo
              '5': ALcxv1ZiwwQ_QX9eOBZMbzIop6n7XtveS1FqOFwyvGM
              '10': C76ElC60qXSJQCHePpzzJxsCYvvrqvmkoHPyZnex-4Q
            payloadHash: smUiDW9jfD_0vrdt4-fXKT_lqC90RsgEGObdp3FznFY
            chainwebVersion: mainnet01
            target: QrcsbEm-3WjyCGAGlzIEhLEN3ZMWORoyYy8AAAAAAAA
            nonce: '110239794631051275'
          payloadWithOutputs:
            transactions:
            - - eyJoYXNoIjoibFRqWW9taEFDSEUxemphRFlvbnV6VGJmdEV1THp2SExNTUE5dzI0SFY5SSIsInNpZ3MiOlt7InNpZyI6IjE3ZDhkYmRmYjUyZWUyMmMyMTA5MGNjYzBkYzY0MzhmYjFjZjlmZWVmNmVjNGY1YWQwMTA3MzViNjllYjA4MjQ2MGU3ZTExYmI4NTBjM2FkN2M4MjAyNzFiMzViNmFiMDcyOTExNGExOGE2YWUwMmFiYWJmZGM0Yzc1ZWZiZjA0In1dLCJjbWQiOiJ7XCJuZXR3b3JrSWRcIjpcIm1haW5uZXQwMVwiLFwicGF5bG9hZFwiOntcImV4ZWNcIjp7XCJkYXRhXCI6e30sXCJjb2RlXCI6XCIoY29pbi50cmFuc2ZlciBcXFwiNjUyYTg4MzFhNWFkMjQzOTYxNWM4NzQ2NzliNjAwN2EwMzUzOTg1Mjk3YzhmN2MzNDhmMzhhYzYxODZiNzBmN1xcXCIgXFxcIjlhMjEyYjZiZDM5ZmZlOWMzZTIxNTk5ZDMyOWEzYTg0YzkwN2NkNGJlMWYzYjUyYWE0ZmU3NmEzNjk1Yzk1ODFcXFwiIDEwLjEzKVwifX0sXCJzaWduZXJzXCI6W3tcInB1YktleVwiOlwiNjUyYTg4MzFhNWFkMjQzOTYxNWM4NzQ2NzliNjAwN2EwMzUzOTg1Mjk3YzhmN2MzNDhmMzhhYzYxODZiNzBmN1wiLFwiY2xpc3RcIjpbe1wiYXJnc1wiOltdLFwibmFtZVwiOlwiY29pbi5HQVNcIn0se1wiYXJnc1wiOltcIjY1MmE4ODMxYTVhZDI0Mzk2MTVjODc0Njc5YjYwMDdhMDM1Mzk4NTI5N2M4ZjdjMzQ4ZjM4YWM2MTg2YjcwZjdcIixcIjlhMjEyYjZiZDM5ZmZlOWMzZTIxNTk5ZDMyOWEzYTg0YzkwN2NkNGJlMWYzYjUyYWE0ZmU3NmEzNjk1Yzk1ODFcIiwxMC4xM10sXCJuYW1lXCI6XCJjb2luLlRSQU5TRkVSXCJ9XX1dLFwibWV0YVwiOntcImNyZWF0aW9uVGltZVwiOjE2MDIzODI1NTgsXCJ0dGxcIjoyODgwMCxcImdhc0xpbWl0XCI6NjAwLFwiY2hhaW5JZFwiOlwiMFwiLFwiZ2FzUHJpY2VcIjoxLjBlLTUsXCJzZW5kZXJcIjpcIjY1MmE4ODMxYTVhZDI0Mzk2MTVjODc0Njc5YjYwMDdhMDM1Mzk4NTI5N2M4ZjdjMzQ4ZjM4YWM2MTg2YjcwZjdcIn0sXCJub25jZVwiOlwiXFxcIjIwMjAtMTAtMTFUMDI6MTc6MDMuNTM3WlxcXCJcIn0ifQ
              - eyJnYXMiOjU3MiwicmVzdWx0Ijp7InN0YXR1cyI6InN1Y2Nlc3MiLCJkYXRhIjoiV3JpdGUgc3VjY2VlZGVkIn0sInJlcUtleSI6ImxUallvbWhBQ0hFMXpqYURZb251elRiZnRFdUx6dkhMTU1BOXcyNEhWOUkiLCJsb2dzIjoicERxbDlQazJBSHAwanEyVzRWQmZPWmpWWEhTTHRqMklBWGZ0TlRBZXBFVSIsIm1ldGFEYXRhIjpudWxsLCJjb250aW51YXRpb24iOm51bGwsInR4SWQiOjEyNzIzNTN9
            minerData: eyJhY2NvdW50IjoiYTFiMzE0MGNiN2NjODk1YzBlMDkxNzAyZWQwNTU3OWZiZTA1YzZlNjc0NWY4MmNlNjAzNzQ2YjQwMGM4MTU0OCIsInByZWRpY2F0ZSI6ImtleXMtYWxsIiwicHVibGljLWtleXMiOlsiYTFiMzE0MGNiN2NjODk1YzBlMDkxNzAyZWQwNTU3OWZiZTA1YzZlNjc0NWY4MmNlNjAzNzQ2YjQwMGM4MTU0OCJdfQ
            transactionsHash: Fzhmc04Cub7YcLd2ybMKBok8TpBQ6-W_msAV8gFzuhM
            outputsHash: VsGmieWzCV3nwDHFtdKrGd61mycmtv_vJ9mI0VZrONI
            payloadHash: smUiDW9jfD_0vrdt4-fXKT_lqC90RsgEGObdp3FznFY
            coinbase: eyJnYXMiOjAsInJlc3VsdCI6eyJzdGF0dXMiOiJzdWNjZXNzIiwiZGF0YSI6IldyaXRlIHN1Y2NlZWRlZCJ9LCJyZXFLZXkiOiJJbXN3WVc0d2NVVlBVblZ6Y1ZGbk9WcHFTM0o0WVMwd1FtOHdMV2hSVmxsTVdIRlhhVFZNU0hobk0yc2kiLCJsb2dzIjoicDkzUW00LVdGYnpFb0R6Y0FoSEFWZTd6N21kaFQ0UG9yMVJ0S2QydWR1YyIsIm1ldGFEYXRhIjpudWxsLCJjb250aW51YXRpb24iOm51bGwsInR4SWQiOjEyNzIzNTF9
        limit: 2
    emptyPayload:
      value:
        transactions: []
        minerData: eyJhY2NvdW50IjoiYTFiMzE0MGNiN2NjODk1YzBlMDkxNzAyZWQwNTU3OWZiZTA1YzZlNjc0NWY4MmNlNjAzNzQ2YjQwMGM4MTU0OCIsInByZWRpY2F0ZSI6ImtleXMtYWxsIiwicHVibGljLWtleXMiOlsiYTFiMzE0MGNiN2NjODk1YzBlMDkxNzAyZWQwNTU3OWZiZTA1YzZlNjc0NWY4MmNlNjAzNzQ2YjQwMGM4MTU0OCJdfQ
        transactionsHash: nT0j4xw2woMkdXXaopdurXIn24OG-jNMqQzUGfxV_MA
        outputsHash: 4pXRrZ2K0_V0iGAxQCKrKdLjQTBZHBOQS7P-47kdnhY
        payloadHash: GpaWbHkHrCjRhY8hKE0qZ1WsBBaG3Y_zkFLV2sYumQA
        coinbase: eyJnYXMiOjAsInJlc3VsdCI6eyJzdGF0dXMiOiJzdWNjZXNzIiwiZGF0YSI6IldyaXRlIHN1Y2NlZWRlZCJ9LCJyZXFLZXkiOiJJa2hoV0VGQ2NURlFTMU5MYkdodVkwcHJNRjlOZERjMVgyeE1OMDVUTTNkSk5qSTNVV1pZV2w4NE5Xc2kiLCJsb2dzIjoiZ3Noak1kWFJrVGxKYmIxalZkQWJ6SVVDcGpQb1JBQ2pEbExzRzBXNkJEMCIsIm1ldGFEYXRhIjpudWxsLCJjb250aW51YXRpb24iOm51bGwsInR4SWQiOjEyNzIzNTB9
    blockHeaderPage:
      value:
        next: inclusive:o1S4NNFhKWg8T1HEkmDvsTH9Ut9l3_qHRpp00yRKZIk
        items:
        - creationTime: 1602382624629329
          parent: HaXABq1PKSKlhncJk0_Mt75_lL7NS3wI627QfXZ_85k
          height: 1000000
          hash: k0an0qEORusqQg9ZjKrxa-0Bo0-hQVYLXqWi5LHxg3k
          chainId: 0
          weight: NQn4BGftuWAeAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
          featureFlags: 0
          epochStart: 1602381443331834
          adjacents:
            '15': MItdqgHZxf7j6l0oE8X-G9-VyMbnQmZrtSniuRe_EJ8
            '5': Mpic85rur2MYf3zli8s8bHxTFjriFoMPTr6ZPs8sjxM
            '10': VBKuhU_hQmuvKlx88A5o-FH0rzNo59NsdxmOGNBQ-yc
          payloadHash: GpaWbHkHrCjRhY8hKE0qZ1WsBBaG3Y_zkFLV2sYumQA
          chainwebVersion: mainnet01
          target: QrcsbEm-3WjyCGAGlzIEhLEN3ZMWORoyYy8AAAAAAAA
          nonce: '13095611958898437'
        - creationTime: 1602382678045236
          parent: k0an0qEORusqQg9ZjKrxa-0Bo0-hQVYLXqWi5LHxg3k
          height: 1000001
          hash: vhVa6Deh10RXLRf3L-MSQTYqaL-_IY_mi-v58MjP9R8
          chainId: 0
          weight: bOkHN2JUv2AeAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
          featureFlags: 0
          epochStart: 1602381443331834
          adjacents:
            '15': Kv0sz_rTANjoiJwMrdZFCJNFwdH0U_M5ouwMr3BXBfo
            '5': ALcxv1ZiwwQ_QX9eOBZMbzIop6n7XtveS1FqOFwyvGM
            '10': C76ElC60qXSJQCHePpzzJxsCYvvrqvmkoHPyZnex-4Q
          payloadHash: smUiDW9jfD_0vrdt4-fXKT_lqC90RsgEGObdp3FznFY
          chainwebVersion: mainnet01
          target: QrcsbEm-3WjyCGAGlzIEhLEN3ZMWORoyYy8AAAAAAAA
          nonce: '110239794631051275'
        limit: 2
    base64HeaderPage:
      value:
        next: inclusive:o1S4NNFhKWg8T1HEkmDvsTH9Ut9l3_qHRpp00yRKZIk
        items:
        - AAAAAAAAAABRoiLHW7EFAB2lwAatTykipYZ3CZNPzLe-f5S-zUt8COtu0H12f_OZAwAFAAAAMpic85rur2MYf3zli8s8bHxTFjriFoMPTr6ZPs8sjxMKAAAAVBKuhU_hQmuvKlx88A5o-FH0rzNo59NsdxmOGNBQ-ycPAAAAMItdqgHZxf7j6l0oE8X-G9-VyMbnQmZrtSniuRe_EJ9CtyxsSb7daPIIYAaXMgSEsQ3dkxY5GjJjLwAAAAAAABqWlmx5B6wo0YWPIShNKmdVrAQWht2P85BS1drGLpkAAAAAADUJ-ARn7blgHgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEIPAAAAAAAFAAAA-na5gFuxBQAFL-3CY4YuAJNGp9KhDkbrKkIPWYyq8WvtAaNPoUFWC16louSx8YN5
        - AAAAAAAAAAA0slHKW7EFAJNGp9KhDkbrKkIPWYyq8WvtAaNPoUFWC16louSx8YN5AwAFAAAAALcxv1ZiwwQ_QX9eOBZMbzIop6n7XtveS1FqOFwyvGMKAAAAC76ElC60qXSJQCHePpzzJxsCYvvrqvmkoHPyZnex-4QPAAAAKv0sz_rTANjoiJwMrdZFCJNFwdH0U_M5ouwMr3BXBfpCtyxsSb7daPIIYAaXMgSEsQ3dkxY5GjJjLwAAAAAAALJlIg1vY3w_9L63bePn1yk_5agvdEbIBBjm3adxc5xWAAAAAGzpBzdiVL9gHgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQUIPAAAAAAAFAAAA-na5gFuxBQALiBhXgqaHAb4VWug3oddEVy0X9y_jEkE2Kmi_vyGP5ovr-fDIz_Uf
        limit: 2
  parameters:
    minheight:
      name: minheight
      in: query
      description: Minimum block height of the returned headers
      required: false
      schema:
        type: integer
        minimum: 0
      example: 500000
    next:
      name: next
      in: query
      description: 'The cursor for the next page. This value can be found as value of the

        `next` property of the previous page.

        '
      required: false
      schema:
        type: string
    limit:
      name: limit
      in: query
      description: 'Maximum number of records that may be returned. The actual number may be

        lower.

        '
      required: false
      schema:
        type: integer
        minimum: 0
    chain:
      name: chain
      in: path
      description: the id of the chain to which the request is sent
      required: true
      schema:
        type: integer
        minimum: 0
        example: 0
    maxheight:
      name: maxheight
      in: query
      description: Maximum block height of the returned headers
      required: false
      schema:
        type: integer
        minimum: 0
      example: 500000
  headers:
    x-server-timestamp:
      description: The time of the clock of the remote node
      schema:
        $ref: '#/components/schemas/posixTimestamp'
      example: 1618597601
    x-peer-addr:
      description: Host and port of the client as observed by the remote node
      schema:
        $ref: '#/components/schemas/hostAddress'
      example: 10.36.1.3:42988
    x-chainweb-node-version:
      description: The version of the remote chainweb node
      schema:
        type: string
      example: '2.6'
  schemas:
    blockHash:
      title: Block Hash
      description: Base64Url (without padding) encoded block hash
      example: QxGCAz5AY1Y41nh1yWtgqhKhZ9pPiPRagFdIKNqBH7
      allOf:
      - $ref: '#/components/schemas/sha256Hash'
    posixTimestampMicro:
      title: POSIX Timestamp in Microseconds
      type: integer
      description: Microseconds since POSIX epoch
      example: 1602382624629329
      minimum: 0
    blockHeight:
      title: Block Height
      description: 'The height of a block is the number of its predecessors in the block chain

        '
      type: integer
      minimum: 0
      example: 1000000
    payloadWithOutputs:
      title: Block Payload With Outputs
      description: 'Payload with outputs of a Block including the Merkle roots for

        transactions and transaction outputs

        '
      required:
      - transactions
      - minerData
      - transactionsHash
      - outputsHash
      - payloadHash
      - coinbase
      example:
        $ref: '#/components/examples/emptyPayload'
      properties:
        transactions:
          type: array
          description: 'Array of pairs of transactions and their outputs.

            Signed Pact transactions and outputs are base64Url-encoded without padding.

            '
          items:
            type: array
            minItems: 2
            maxItems: 2
            items:
              anyOf:
              - type: string
                pattern: '[a-zA-Z0-9_-]+'
                description: Base64Url (without padding) encoded JSON text of a signed Pact transaction
              - type: string
                pattern: '[a-zA-Z0-9_-]+'
                description: Base64Url (without padding) encoded JSON text of a transaction output
        minerData:
          type: string
          pattern: '[a-zA-Z0-9_-]+'
          description: Base64Url (without padding) encoded JSON text of the miner data of the payload
        transactionsHash:
          $ref: '#/components/schemas/sha256Hash'
        outputsHash:
          $ref: '#/components/schemas/sha256Hash'
        payloadHash:
          $ref: '#/components/schemas/payloadHash'
        coinbase:
          type: string
          pattern: '[a-zA-Z0-9_-]+'
          description: Base64Url (without padding) encoded JSON text of coinbase output of the block
    blockWeight:
      title: Block Weight
      description: 'The POW weight of a block is the sum of the difficulties of the block

        and of all of its ancestors. The difficulty of a block is the maximum

        difficulty divided by the target.


        It represented as the base64Url (without padding) 256 bit little endian

        encoding of the numerical value.

        '
      type: string
      pattern: ^[a-zA-Z0-9_-]{43}$
      minLength: 43
      maxLength: 43
      example: iil_D0t2MGqjAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    payloadHash:
      title: Block Payload Hash
      description: Base64Url (without padding) encoded block payload hash
      example: GpaWbHkHrCjRhY8hKE0qZ1WsBBaG3Y_zkFLV2sYumQA
      allOf:
      - $ref: '#/components/schemas/sha256Hash'
    block:
      title: Full block
      description: 'A block header and payload

        '
      required:
      - header
      - payloadWithOutputs
      example:
        $ref: '#/components/examples/blockPage/value/items/0'
      properties:
        header:
          $ref: '#/components/schemas/blockHeader'
        payloadWithOutputs:
          $ref: '#/components/schemas/payloadWithOutputs'
    hostAddress:
      title: Host Address
      description: Host address containing IPv4 and port
      type: string
      pattern: ^\d{4}.\d{4}.\d{4}.\d{4}:\d+$
      example: 10.36.1.3:42988
    blockHeader:
      title: Block Header
      description: JSON Encoded Block Header
      required:
      - creationTime
      - parent
      - height
      - hash
      - chainId
      - weight
      - featureFlags
      - epochStart
      - adjacents
      - payloadHash
      - chainwebVersion
      - target
      - nonce
      example:
        value:
          $ref: '#/components/examples/blockHeaderPage/value/items/0'
      properties:
        creationTime:
          $ref: '#/components/schemas/posixTimestampMicro'
        parent:
          $ref: '#/components/schemas/blockHash'
        height:
          $ref: '#/components/schemas/blockHeight'
        hash:
          $ref: '#/components/schemas/blockHash'
        chainId:
          $ref: '#/components/schemas/chainId'
        weight:
          $ref: '#/components/schemas/blockWeight'
        featureFlags:
          type: integer
          description: A reserved value that must be 0.
        epochStart:
          $ref: '#/components/schemas/posixTimestampMicro'
        adjacents:
          description: 'The block hashes of the adjacent parents of the block. This is

            represented as an associative array that maps the adjancent chain

            ids to the respective block hash.

            '
          type: object
          additionalProperties:
            $ref: '#/components/schemas/blockHash'
        payloadHash:
          $ref: '#/components/schemas/payloadHash'
        chainwebVersion:
          $ref: '#/components/schemas/chainwebVersion'
        target:
          $ref: '#/components/schemas/target'
        nonce:
          $ref: '#/components/schemas/nonce'
    page:
      title: Page
      description: Page of a collection of items
      required:
      - next
      - limit
      - items
      example:
        $ref: '#/components/examples/base64HeaderPage'
      properties:
        limit:
          description: 'The number of items in the page. This number can be smaller but

            never be larger than the number of requested items.

            '
          type: integer
          minimum: 0
          items:
            description: Items of the returned collection
            type: array
        next:
          description: 'A cursor that can be used to query the next page. It should be used

            literally as value for the `next` parameter in a follow-up request.

            '
          oneOf:
          - type: 'null'
          - type: string
          nullable: true
          pattern: ^(inclusive|exclusive):.*$
        items:
          description: 'The items in the page.

            '
    chainwebVersion:
      title: Chainweb Version
      description: The version of the Chainweb network
      enum:
      - test-singleton
      - development
      - mainnet01
      - testnet04
    nonce:
      title: PoW Nonce
      description: 'PoW nonce of the block. This is computed by the miner such that the

        block hash is smaller than the target.

        '
      type: string
      pattern: '[0-9]+'
      minLength: 1
    sha256Hash:
      title: SHA256 Hash
      type: string
      description: Base64Url (without padding) encoded SHA256 hash
      pattern: ^[a-zA-Z0-9_-]{43}$
      minLength: 43
      maxLength: 43
      example: y3aWL72-3wAy7vL9wcegGXnstH0lHi-q-cfxkhD5JCw
    target:
      title: PoW Target
      description: 'The PoW target of a block represented as the base64Url (without

        padding) 256 bit little endian encoding of the numerical value.

        '
      type: string
      pattern: ^[a-zA-Z0-9_-]{43}$
      minLength: 43
      maxLength: 43
      example: 2uMCnB4lWsErj9w1C1vAp1sHYd-sABf3kgcAAAAAAAA
    chainId:
      title: Chain ID
      description: 'A Chainweb chain ID. In Kadena Chainweb chains are named by numbers

        starting form 0. Valid values depend on the current graph at the

        respective block height of the chainweb version.

        '
      type: integer
      minimum: 0
      example: 0
    posixTimestamp:
      title: POSIX Timestamp
      type: integer
      description: Seconds since POSIX epoch
      example: 1619108524
      minimum: 0
x-tagGroups:
- name: chainweb_p2p
  x-displayName: Chainweb P2P API
  tags:
  - p2p_api
  - cut
  - blockhash
  - header
  - payload
  - mempool
  - peer
  - config
- name: chainweb_service
  x-displayName: Chainweb Service API
  tags:
  - service_api
  - block
  - misc
  - mining
  - pact
- name: Common HTTP Headers
  tags:
  - commonResponseHeaders
- name: Data Models
  tags:
  - cut_model
  - header_model
  - payload_model
  - payloadWithOutputs_model
  - peer_model
  - nodeInfo_model
  - page_model
  - minerInfo_model
  - miningUpdateEventStream_model
- name: Binary Encodings
  tags:
  - binaryHeader
  - binaryWorkHeader