Skip to main content
{
  "openapi": "3.0.0",
  "info": {
    "title": "Kadena Chainweb Node API",
    "description": "API of [chainweb-node](https://github.com/kadena-io/chainweb-node)\n\nChainweb is a scalable Proof-Of-Work (PoW) consensus algorithm. It is an\nconservative extension of Bitcoin's Nakamoto consensus that extends\nBitcoin's single chain algorithm to multiple chains. This allows for\nunlimited transaction throughput by horizontally scaling the number of chains.\n\nFeedback and bug reports for the content of this site are welcome. Please\nopen an issue at [this github repository](https://github.com/kadena-io/chainweb-openapi/issues).\n",
    "version": "0.0",
    "x-logo": {
      "url": "https://i.imgur.com/bAZFAGF.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.\n",
      "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.\n",
      "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.\n",
      "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": "p2p_api",
      "x-displayName": "P2P API",
      "description": "The P2P API is used for inter-node communication in order to establish block\nchain consensus. Each chainweb-node serves these endpoints via HTTPS on a\nnetwork interface and port that is available directly on the public\ninternet.\n\nAdditionally, endpoints of the P2P API can be made available for other\nclients. For this purpose it is possible to expose the endpoints via reverse\nproxies, load balancers, or authentication frameworks, and similar web\ntechnologies.\n"
    },
    {
      "name": "service_api",
      "x-displayName": "Service API",
      "description": "The Service API includes endpoints that expose functionality of\nchainweb-node to clients other than chainweb-nodes, such as mining pools,\nDAPPs, web applications, exchanges, wallets, etc.\n\nThe endpoints of the service API are optional and can be enabled via\nrespective configuration settings. They are served on a separate port via\nplain HTTP. Node operators are free to expose those endpoints only locally,\nor via reverse proxies, load balancers, authentication frameworks, and\nsimilar web technologies.\n\nSome of the endpoints of the service API can require considerable resources\non the server side and administrators should be careful when exposing those\npublicly. Generally, endpoints of the service API are more vulnerable to DOS\nattacks.\n"
    },
    {
      "name": "cut",
      "x-displayName": "Cut Endpoints",
      "description": "A cut represents a distributed state of a chainweb. It references one\nblock header for each chain, such that those blocks are pairwise\nconcurrent.\n\nTwo blocks from two different chains are said to be concurrent if either\none of them is an adjacent parent (is a direct dependency) of the other or\nif the blocks do not depend at all on each other.\n"
    },
    {
      "name": "peer",
      "x-displayName": "Peer Endpoints",
      "description": "The P2P communication between chainweb-nodes is sharded into several independent\nP2P network. The `cut` network is exchanging consensus state. There is also one\nmempool P2P network for each chain.\n"
    },
    {
      "name": "mempool",
      "x-displayName": "Mempool P2P Endpoints",
      "description": "Mempool P2P endpoints for communication between mempools. Endusers are not\nsupposed to use these endpoints directly. Instead, the respective Pact\nendpoints should be used for submitting transactions into the network.\n"
    },
    {
      "name": "payload",
      "x-displayName": "Block Payload Endpoints",
      "description": "Raw literal Block Payloads in the form in which they are stored on the chain.\nBy default only the payload data is returned which is sufficient for validating\nthe blockchain Merkle Tree. It is also sufficient as input to Pact for\nexecuting the Pact transactions of the block and recomputing the outputs.\n\nIt is also possible to query the transaction outputs along with the payload data.\n"
    },
    {
      "name": "blockhash",
      "x-displayName": "Block Hashes Endpoints",
      "description": "These endpoints return block hashes from the chain database.\n\nGenerally, block hashes are returned in ascending order and include hashes\nfrom orphaned blocks.\n\nFor only querying blocks that are included in the winning branch of the\nchain the `branch` endpoint can be used, which returns blocks in descending\norder starting from the leafs of branches of the block chain.\n"
    },
    {
      "name": "header",
      "x-displayName": "Block Header Endpoints",
      "description": "These endpoints return block headers from the chain database.\n\nGenerally, block headers are returned in ascending order and include headers\nof orphaned blocks.\n\nFor only querying blocks that are included in the winning branch of the\nchain the `branch` endpoints can be used, which return blocks in descending\norder starting from the leafs of branches of the block chain.\n\nBlock headers are returned in three different formats specified in the `accept` header of the request:\n*   `application/json`, returns block headers in base64Url (without padding)\n    encoded binary.\n*   `application/json;blockheader-encoding=object`, returns block headers in\n    JSON encoding.\n*   `application/octet-stream`, when supported by the endpoint, returns block\n    headers as binary.\n"
    },
    {
      "name": "config",
      "x-displayName": "Config Endpoint"
    },
    {
      "name": "misc",
      "x-displayName": "Miscellaneous Endpoints"
    },
    {
      "name": "pact",
      "x-displayName": "Pact Endpoints",
      "description": "The [Pact](https://pactlang.org) endpoints are documented in the [Pact API\nSpecification](./pact.html).\n\nThe Pact endpoints for chain `{chainId}` use the route prefix\n`/chain/{chainId}/pact/` in addition to the base URL.\n\nFuther details can also be found in [this section of the Pact Language\nReference](https://pact-language.readthedocs.io/en/stable/pact-reference.html#endpoints).\n"
    },
    {
      "name": "rosetta",
      "x-displayName": "Rosetta Endpoints",
      "description": "Chainweb node includes an implementation of the\n[Rosetta API](https://www.rosetta-api.org). The API is disabled by default\nand can be enabled in the configuration file of a node.\n\nThe following endpoints are supported, which are documented\nin the [Rosetta Specification](https://www.rosetta-api.org/docs/welcome.html):\n\n*   `POST rosetta/account/balance`\n*   `POST rosetta/block/transaction`\n*   `POST rosetta/block`\n*   `POST rosetta/construction/metadata`\n*   `POST rosetta/construction/submit`\n*   `POST rosetta/mempool/transaction`\n*   `POST rosetta/mempool`\n*   `POST rosetta/network/list`\n*   `POST rosetta/network/options`\n*   `POST rosetta/network/status`\n"
    },
    {
      "name": "mining",
      "x-displayName": "Mining Endpoints",
      "description": "The Mining API of Chainweb node is disabled by default. It can be enabled\nand configured in the configuration file.\n\n\nThe mining API consists of the following endpoints that\nare described in detail on the\n[Chainweb mining wiki page](https://github.com/kadena-io/chainweb-node/wiki/Mining-API)\n\n*   `GET mining/work`\n*   `POST mining/solved`\n*   `GET mining/updates`\n"
    },
    {
      "name": "binaryHeader",
      "x-displayName": "Block Header Binary Encoding",
      "description": "## Binary Format For Chain Graphs of Degree Three\n\ndefined in `Chainweb.BlockHeader`\n\n| Size | Bytes   | Value       |\n| ---- | ------- | ----------- |\n| 8    | 0-7     | flags       |\n| 8    | 8-15    | time        |\n| 32   | 16-47   | parent      |\n| 110  | 48-157  | adjacents   |\n| 32   | 158-189 | target      |\n| 32   | 190-221 | payload     |\n| 4    | 222-225 | chain       |\n| 32   | 226-257 | weight      |\n| 8    | 258-265 | height      |\n| 4    | 266-269 | version     |\n| 8    | 270-277 | epoch start |\n| 8    | 278-285 | nonce       |\n| 32   | 286-317 | hash        |\n\ntotal: 318 bytes\n\nAdjacent Parents Record (length 3):\n\n| Bytes | Value     |\n| ----- | --------- |\n| 0-1   | length    |\n| 2-109 | adjacents |\n\ntotal: 110 bytes\n\nAdjacent Parent:\n\n| Bytes | Value |\n| ----- | ----- |\n| 0-3   | chain |\n| 4-35  | hash  |\n\ntotal: 36 bytes\n\n## Fields\n\n**POW related values**:\n\nArithmetic operations and comparisons on `parent`, `target`, `weight`, and `hash`\ninterpret the value as unsigned 256 bit integral numbers in little endian encoding.\nAll operations are performed using rational arithmetic of unlimited precision and the final result is rounded.\nPlease consult the code for details of how the result is rounded.\n\n**Time Stamps**:\n\n`time` and `epoch start` are a little endian twoth complement encoded integral numbers that count SI microseconds since POSIX epoch (leap seconds are ignored). These numbers are always positive (highest bit is 0).\n\n**Numbers**:\n\n* `height` is a little endian encoded unsigned integral 64 bit number.\n* `length` is a little endian encoded unsigned integral 16 bit number.\n\n**Version**:\n\n`version` identifies the chainweb version. It is a 32 bit value in little endian encoding.\nValues up to 0x0000FFFF are reserved for production versions (which includes `development` and testnets).\n\n| value      | version     |\n| ---------- | ----------- |\n| 0x00000005 | mainnet01   |\n| 0x00000001 | development |\n| 0x00000007 | testnet04   |\n\n**Other**:\n\n* `nonce` is any sequence of 8 bytes that is only compared for equality.\n* `chain` is any sequence of 4 bytes that identifies a chain and can be compared for equality.\n* `payload` is any sequence of 32 bytes that is a cryptographic hash of the payload associated with the block and can be compared for equality.\n* `flags` are eight bytes of value 0x0 that are reserved for future use.\n"
    },
    {
      "name": "binaryWorkHeader",
      "x-displayName": "Work Header Binary Encoding",
      "description": "The work bytes received from the `/miner/work` endpoint is slightly different than the above header format. These headers do not include the block hash, instead prefixing the header above (without hash) with chain id and hash target bytes.\n\nThe first 36 bytes are informational. Only the bytes from position 36 to the end are subject of the POW hash computation.\n\nThe final 8 bytes are the nonce. The creation time is encoded in bytes 44-52 (see above for details of the encoding). Miners are allowed,  but not required, to update the time to reflect the solve time for the block more closely.\nA larger value for the creation time increases the accuracy of difficulty adjustment which is in the interest of miners -- the high difficulty guarantees that the outcome of the race of winning blocks is determined by actual hash power. However, blocks that are predated (i.e. have a creation time that is in the future) are rejected during block header validation. Leaving the time unchanged is a valid choice.\n\nMiners must not change or make any assumptions about the content of the \"reserved\" bytes.\n\nDefined in `Chainweb.Miner.Core`\n\n| Size | Bytes   | Work Bytes | Value       |\n| ---- | ------- | -----------| ----------- |\n| 4    | 0-3     | NA         | chain       |\n| 32   | 4-35    | NA         | hash-target |\n|      |         |            |             |\n| 8    | 36-43   | 0-7        | reserved    |\n| 8    | 44-51   | 8-15       | **time**    |\n| 298  | 52-313  | 16-277     | reserved    |\n| 8    | 314-321 | 278-285    | **nonce**   |\n\ntotal: 322 bytes\n\n\nFor arithmetic comparisons the `hash-target` is interpreted as unsigned 256 bit integral number in little endian encoding.\n\n`time` is a little endian twoth complement encoded integral number that counts SI microseconds since POSIX epoch (leap seconds are ignored). The value is always positive (highest bit is 0).\n"
    },
    {
      "name": "cut_model",
      "x-displayName": "Cut Model",
      "description": "The `origin` property is required for use with the `PUT /cut` endpoint.\n<SchemaDefinition schemaRef=\"#/components/schemas/cut\" showReadOnly={true} showWriteOnly={true} />\n"
    },
    {
      "name": "payload_model",
      "x-displayName": "Payload Model",
      "description": "<SchemaDefinition schemaRef=\"#/components/schemas/payload\" showReadOnly={true} showWriteOnly={true} />\n"
    },
    {
      "name": "payloadWithOutputs_model",
      "x-displayName": "Payload With Outputs Model",
      "description": "<SchemaDefinition schemaRef=\"#/components/schemas/payloadWithOutputs\" showReadOnly={true} showWriteOnly={true} />\n"
    },
    {
      "name": "header_model",
      "x-displayName": "Block Header Model",
      "description": "<SchemaDefinition schemaRef=\"#/components/schemas/blockHeader\" showReadOnly={true} showWriteOnly={true} />\n"
    },
    {
      "name": "peer_model",
      "x-displayName": "Peer Info Model",
      "description": "<SchemaDefinition schemaRef=\"#/components/schemas/peer\" showReadOnly={true} showWriteOnly={true} />\n\n## Compute PeerInfo\n\nGenerally, it is easier to query the peer info of a peer using a GET query for a peer database.\nOtherwise the peer info can be computed as follows.\n\nFor peers that use domain names with valid CA signed SSL certificates the peer id is `null`.\n\nFor peers with self-signed certificates the peer id is the base64Url (without padding) encoded\nSHA256 fingerprint of the certificate. For a chainweb-node `NODE` it can be computed as follows:\n\n```sh\necho |\nopenssl s_client -showcerts -servername ${NODE} -connect ${NODE}:443 2>/dev/null |\nopenssl x509 -fingerprint -noout -sha256 |\nsed 's/://g' |\ntail -c 65 |\nxxd -r -p |\nbase64 |\ntr -d '=' |\ntr '/+' '_-'\n```\n"
    },
    {
      "name": "nodeInfo_model",
      "x-displayName": "Chainweb Node Info Model",
      "description": "<SchemaDefinition schemaRef=\"#/components/schemas/nodeInfo\" showReadOnly={true} showWriteOnly={true} />\n"
    },
    {
      "name": "page_model",
      "x-displayName": "Collection Page Model",
      "description": "<SchemaDefinition schemaRef=\"#/components/schemas/page\" showReadOnly={true} showWriteOnly={true} />\n"
    },
    {
      "name": "minerInfo_model",
      "x-displayName": "Miner Info Model",
      "description": "<SchemaDefinition schemaRef=\"#/components/schemas/minerInfo\" showReadOnly={true} showWriteOnly={true} />\n"
    },
    {
      "name": "miningUpdateEventStream_model",
      "x-displayName": "Mining Update Event Stream Model",
      "description": "A server-sent event sources that notifies miners when new mining work\nbecomes available. The stream is terminated by the server in regular\nintervals and it is up to the client to request a new stream.\n\nEach event consists of a single line: `event:New Cut`.\nEvents are separated by empty lines.\n\n<SchemaDefinition schemaRef=\"#/components/schemas/miningUpdateEventStream\" showReadOnly={true} showWriteOnly={true} />\n"
    },
    {
      "name": "commonResponseHeaders",
      "x-displayName": "Response Headers",
      "description": "\n## Server Timestamp\n\n`x-server-timestamp`: The time of the clock of the remote node\n\n<SchemaDefinition schemaRef=\"#/components/schemas/posixTimestamp\" showReadOnly={true} showWriteOnly={true} />\n\n## Chainweb Node Version\n\n`x-chainweb-node-version`: The version of the remote chainweb node\n\n<SchemaDefinition schemaRef=\"#/components/schemas/chainwebVersion\" showReadOnly={true} showWriteOnly={true} />\n\n## Client Peer Address\n\n`x-peer-addr`: Host and port of the client as observed by the remote node\n\n<SchemaDefinition schemaRef=\"#/components/schemas/hostAddress\" showReadOnly={true} showWriteOnly={true} />\n"
    }
  ],
  "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",
        "misc",
        "mining",
        "pact",
        "rosetta"
      ]
    },
    {
      "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"
      ]
    }
  ],
  "components": {
    "schemas": {
      "posixTimestamp": {
        "title": "POSIX Timestamp",
        "type": "integer",
        "description": "Seconds since POSIX epoch",
        "example": 1619108524,
        "minimum": 0
      },
      "posixTimestampMicro": {
        "title": "POSIX Timestamp in Microseconds",
        "type": "integer",
        "description": "Microseconds since POSIX epoch",
        "example": 1602382624629329,
        "minimum": 0
      },
      "chainwebVersion": {
        "title": "Chainweb Version",
        "description": "The version of the Chainweb network",
        "enum": [
          "test-singleton",
          "development",
          "mainnet01",
          "testnet04"
        ]
      },
      "chainId": {
        "title": "Chain ID",
        "description": "A Chainweb chain ID. In Kadena Chainweb chains are named by numbers\nstarting form 0. Valid values depend on the current graph at the\nrespective block height of the chainweb version.\n",
        "type": "integer",
        "minimum": 0,
        "example": 0
      },
      "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"
      },
      "signedTxText": {
        "title": "Signed Transaction Text",
        "type": "string",
        "description": "Text of a JSON encoded signed Pact transaction",
        "example": {
          "$ref": "#/components/examples/signedTxText"
        }
      },
      "requestKey": {
        "title": "Request Key",
        "type": "string",
        "description": "Base64Url-encoded, request key of a Pact transaction",
        "pattern": "^[a-zA-Z0-9_-]{43}$",
        "minLength": 43,
        "maxLength": 43,
        "example": "y3aWL72-3wAy7vL9wcegGXnstH0lHi-q-cfxkhD5JCw"
      },
      "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"
      },
      "blockHash": {
        "title": "Block Hash",
        "description": "Base64Url (without padding) encoded block hash",
        "example": "QxGCAz5AY1Y41nh1yWtgqhKhZ9pPiPRagFdIKNqBH7",
        "allOf": [
          {
            "$ref": "#/components/schemas/sha256Hash"
          }
        ]
      },
      "payloadHash": {
        "title": "Block Payload Hash",
        "description": "Base64Url (without padding) encoded block payload hash",
        "example": "GpaWbHkHrCjRhY8hKE0qZ1WsBBaG3Y_zkFLV2sYumQA",
        "allOf": [
          {
            "$ref": "#/components/schemas/sha256Hash"
          }
        ]
      },
      "blockHeight": {
        "title": "Block Height",
        "description": "The height of a block is the number of its predecessors in the block chain\n",
        "type": "integer",
        "minimum": 0,
        "example": 1000000
      },
      "blockWeight": {
        "title": "Block Weight",
        "description": "The POW weight of a block is the sum of the difficulties of the block\nand of all of its ancestors. The difficulty of a block is the maximum\ndifficulty divided by the target.\n\nIt represented as the base64Url (without padding) 256 bit little endian\nencoding of the numerical value.\n",
        "type": "string",
        "pattern": "^[a-zA-Z0-9_-]{43}$",
        "minLength": 43,
        "maxLength": 43,
        "example": "iil_D0t2MGqjAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
      },
      "target": {
        "title": "PoW Target",
        "description": "The PoW target of a block represented as the base64Url (without\npadding) 256 bit little endian encoding of the numerical value.\n",
        "type": "string",
        "pattern": "^[a-zA-Z0-9_-]{43}$",
        "minLength": 43,
        "maxLength": 43,
        "example": "2uMCnB4lWsErj9w1C1vAp1sHYd-sABf3kgcAAAAAAAA"
      },
      "nonce": {
        "title": "PoW Nonce",
        "description": "PoW nonce of the block. This is computed by the miner such that the\nblock hash is smaller than the target.\n",
        "type": "string",
        "pattern": "[0-9]+",
        "minLength": 1
      },
      "base64Header": {
        "title": "Base64Url Block Header",
        "description": "Base64Url (without padding) encoded binary block header",
        "type": "string",
        "pattern": "[a-zA-Z0-9_-]+",
        "example": {
          "value": {
            "$ref": "#/components/examples/base64HeaderPage/value/items/0"
          }
        }
      },
      "backupStatus": {
        "title": "Backup job status",
        "type": "string",
        "pattern": "backup-done|backup-in-progress|backup-failed"
      },
      "backupId": {
        "title": "Backup job identifier",
        "description": "Textual backup job identifier",
        "type": "string",
        "pattern": "[a-zA-Z0-9_-]+",
        "example": 1648665437000
      },
      "binaryHeader": {
        "title": "Binary Block Header",
        "description": "Binary representation of a block header",
        "type": "string",
        "minLength": 318,
        "maxLength": 318
      },
      "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\nrepresented as an associative array that maps the adjancent chain\nids to the respective block hash.\n",
            "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"
          }
        }
      },
      "payload": {
        "title": "Block Payload",
        "description": "Payload of a Block including the Merkle roots for transactions and\ntransaction outputs.\n",
        "required": [
          "transactions",
          "minerData",
          "transactionsHash",
          "outputsHash",
          "payloadHash"
        ],
        "example": {
          "value": {
            "$ref": "#/components/examples/payloads/value/1"
          }
        },
        "properties": {
          "transactions": {
            "type": "array",
            "description": "Array of base64Url (without padding) encoded JSON texts of signed Pact transactions",
            "items": {
              "type": "string",
              "pattern": "[a-zA-Z0-9_-]+",
              "description": "Base64Url (without padding) encoded JSON text of a signed Pact transaction"
            }
          },
          "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"
          }
        }
      },
      "payloadWithOutputs": {
        "title": "Block Payload With Outputs",
        "description": "Payload with outputs of a Block including the Merkle roots for\ntransactions and transaction outputs\n",
        "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.\nSigned Pact transactions and outputs are base64Url-encoded without padding.\n",
            "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"
          }
        }
      },
      "peer": {
        "title": "Peer",
        "description": "Peer info object",
        "required": [
          "id",
          "address"
        ],
        "example": {
          "$ref": "#/components/examples/peers/value/items/0"
        },
        "properties": {
          "id": {
            "description": "The base64Url (without padding) encoded SHA256 fingerprint of the\nSSL certificate of the node. This can be null only if the node uses\nan official CA signed certificate\n",
            "type": "string",
            "nullable": true,
            "pattern": "[a-zA-Z0-9_-]{43}"
          },
          "address": {
            "required": [
              "hostname",
              "port"
            ],
            "properties": {
              "hostname": {
                "description": "A domain name or IP address. This must be a domain name only if\nthe respective node is using a valid CA signed SSL certificate.\n",
                "type": "string",
                "oneOf": [
                  {
                    "format": "hostname"
                  },
                  {
                    "format": "ipv4"
                  },
                  {
                    "format": "ipv6"
                  }
                ]
              },
              "port": {
                "description": "Port number",
                "type": "integer",
                "minimum": 1,
                "maximum": 65535
              }
            }
          }
        }
      },
      "cut": {
        "title": "Cut",
        "description": "Cut datastruction of the chainweb API",
        "required": [
          "height",
          "weight",
          "hashes"
        ],
        "example": {
          "$ref": "#/components/examples/cut"
        },
        "properties": {
          "origin": {
            "$ref": "#/components/schemas/peer"
          },
          "height": {
            "description": "The cut height is the sum of the height of all blocks of the cut.\nUsage of this value should be avoided, because its semantics may\nchange in the future\n",
            "type": "integer",
            "minimum": 0
          },
          "weight": {
            "description": "The sum of the weights of all blocks in the cut",
            "type": "string",
            "pattern": "[a-zA-Z0-9_-]{43}"
          },
          "hashes": {
            "type": "object",
            "required": [
              "0",
              "1",
              "2",
              "3",
              "4",
              "5",
              "6",
              "7",
              "8",
              "9",
              "10"
            ],
            "description": "An object that maps chain Ids to their respective block hash and\nblock height\n",
            "additionalProperties": {
              "$ref": "#/components/schemas/hashWithBlockHeight"
            }
          },
          "instance": {
            "type": "string"
          },
          "id": {
            "type": "string"
          }
        }
      },
      "hashWithBlockHeight": {
        "title": "Hash with block height",
        "description": "A block hash and the height of that block",
        "required": [
          "hash",
          "height"
        ],
        "example": {
          "height": 1539924,
          "hash": "uP-pHW4QKrV9fN1mlDGwKuaiIDlJW7xYSj1nW53EHM4"
        },
        "type": "object",
        "properties": {
          "hash": {
            "type": "string",
            "pattern": "[a-zA-Z0-9_-]{43}"
          },
          "height": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "nodeInfo": {
        "title": "Chainweb Node Info",
        "description": "General information about a chainweb node",
        "required": [
          "nodeNumberOfChains",
          "nodeApiVersion",
          "nodeChains",
          "nodeVersion",
          "nodeGraphHistory"
        ],
        "example": {
          "$ref": "#/components/examples/info"
        },
        "properties": {
          "nodeNumberOfChains": {
            "type": "integer",
            "minimum": 10,
            "example": 20
          },
          "nodeApiVersion": {
            "type": "string",
            "example": "0.0"
          },
          "nodeChains": {
            "type": "array",
            "items": {
              "description": "Chain identifiers",
              "type": "string"
            },
            "minItems": 0,
            "example": [
              "0"
            ]
          },
          "nodeVersion": {
            "type": "string",
            "enum": [
              "test-singleton",
              "development",
              "mainnet01",
              "testnet04"
            ],
            "example": "mainnet01"
          },
          "nodeGraphHistory": {
            "description": "Array of all chain graphs indexed by the height of the first block with the repective\ngraph. Graphs are encoded as adjacency lists.\n",
            "type": "array",
            "uniqueItems": true,
            "minItems": 1,
            "items": {
              "description": "A pair consisting of the height of the first block of a chain graph and the adjacency list of the graph.",
              "type": "array",
              "minItems": 2,
              "maxItems": 2,
              "items": {
                "oneOf": [
                  {
                    "description": "height of the first block of the graph",
                    "type": "integer",
                    "minimum": 0
                  },
                  {
                    "description": "adjacency list encoding of the chain graph.",
                    "type": "array",
                    "items": {
                      "description": "A pair of the chain identifier and the list of chains adjacent to it.",
                      "minItems": 2,
                      "maxItems": 2,
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "description": "a chain identifier",
                            "type": "integer",
                            "minimum": 0
                          },
                          {
                            "description": "an adjacency list for that chain",
                            "type": "array",
                            "minItems": 0,
                            "items": {
                              "type": "integer",
                              "minimum": 0
                            }
                          }
                        ]
                      }
                    }
                  }
                ]
              }
            }
          }
        }
      },
      "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\nnever be larger than the number of requested items.\n",
            "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\nliterally as value for the `next` parameter in a follow-up request.\n",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "string"
              }
            ],
            "nullable": true,
            "pattern": "^(inclusive|exclusive):.*$"
          },
          "items": {
            "description": "The items in the page.\n"
          }
        }
      },
      "miningUpdateEventStream": {
        "title": "Mining Update Events",
        "description": "A stream of server-sent events. **This is not an JSON array**.\nEvents are separated by empty lines (`\\n\\n`). Each event\nconsists of a single line:\n\n  event:New Cut\n",
        "type": "array",
        "items": {
          "title": "New Cut Event",
          "description": "A `New Cut` event. **This is not an JSON object**.\nEach event consists of a single `event` propert.\n",
          "properties": {
            "event": {
              "type": "string",
              "enum": [
                "New Cut"
              ]
            }
          }
        },
        "example": "event:New Cut\n\nevent:New Cut\n\nevent:New Cut"
      },
      "minerInfo": {
        "title": "Miner Info",
        "properties": {
          "account": {
            "title": "Account Name",
            "description": "Miner account name. Usually this is the same as the public key.",
            "type": "string",
            "example": "f880a433d6e2a13a32b6169030f56245efdd8c1b8a5027e9ce98a88e886bef27"
          },
          "predicate": {
            "title": "Key Predicate",
            "enum": [
              "keys-all",
              "keys-any"
            ],
            "example": "keys-all",
            "description": "key predicate. For a single key this is usually `keys-all`."
          },
          "public-keys": {
            "type": "array",
            "items": {
              "title": "Miner Public Key",
              "type": "string",
              "example": "f880a433d6e2a13a32b6169030f56245efdd8c1b8a5027e9ce98a88e886bef27"
            }
          }
        },
        "example": {
          "account": "miner",
          "predicate": "keys-all",
          "public-keys": [
            "f880a433d6e2a13a32b6169030f56245efdd8c1b8a5027e9ce98a88e886bef27"
          ]
        }
      },
      "nodeConfig": {
        "title": "Node Configuration",
        "description": "The configuration of a node. Private information regarding certificates\n"
      }
    }
  }
}

Was this page helpful?

Receive important developer updates