Kryvon / KRYVON DEVELOPER DOCSKRYVON DEVELOPER DOCS

Mining

Use the mining reference for the Kryvon node, with RPC parameters, response types and examples.

RPC reference

Module Miner

RPC Module Miner for miners.

A miner gets a template from KRYVON, optionally selects transactions, resolves the PoW puzzle, and submits the found new block.

Method get_block_template

  • get_block_template(bytes_limit, proposals_limit, max_version)
  • result: BlockTemplate

Returns block template for miners.

Miners can assemble the new block from the template. The RPC is designed to allow miners to remove transactions and adding new transactions to the block.

Params
  • bytes_limit - the max serialization size in bytes of the block. (Optional: the default is the consensus limit.)
  • proposals_limit - the max count of proposals. (Optional: the default is the consensus limit.)
  • max_version - the max block version. (Optional: the default is one configured in the current client version.)
Example

Request

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "get_block_template",
  "params": []
}

Response

{
  "jsonrpc": "2.0",
  "result": {
    "bytes_limit": "0x91c08",
    "cellbase": {
      "cycles": null,
      "data": {
        "cell_deps": [],
        "header_deps": [],
        "inputs": [
          {
            "previous_output": {
              "index": "0xffffffff",
              "tx_hash": "0x0000000000000000000000000000000000000000000000000000000000000000"
            },
            "since": "0x1"
          }
        ],
        "outputs": [],
        "outputs_data": [],
        "version": "0x0",
        "witnesses": [
          "0x700000000c00000061000000550000001000000030000000310000000ab222ccd15b0160e2113b036ffe7a0d4cbcb40ac2fe7454194f381a33bd0d650020000000fc6a14efa21dda983e863549c2c6015132147a1e30433db78e0226bfeb4f99080b000000302e3231302e3020282029"
        ]
      },
      "hash": "0xfa0072347417d8f9cd328ad52ed71f993abff8923ee19cd50fc56782c7aedc40"
    },
    "compact_target": "0x1e02cbd3",
    "current_time": "0x1a2319263fd",
    "cycles_limit": "0xd09dc300",
    "epoch": "0xf00001000000",
    "extension": "0xc628799f6f32e145af7c66206fb67efcaacfe2bff71978fd21884b5cf398681b",
    "number": "0x1",
    "parent_hash": "0xfc53392312b0f85d23f8bfd7bb33e9a105095acc89f6f579687bb124c2827334",
    "proposals": [],
    "transactions": [],
    "uncles": [],
    "uncles_count_limit": "0x2",
    "version": "0x0",
    "work_id": "0x0"
  },
  "id": 1
}

Method submit_block

  • submit_block(work_id, block)
    • work_id: string
    • block: Block
  • result: H256

Submit new block to the network.

Params
  • work_id - The same work ID returned from get_block_template.
  • block - The assembled block from the block template and which PoW puzzle has been resolved.
Example

Pass the work_id from get_block_template and the solved Kryvon block with its Eaglesong nonce. The bundled Kryvon miner handles block assembly and submission.