Skip to main content
POST
/
v1
/
rpc
/
getBlockTemplate
Get block template
curl --request POST \
  --url https://api.kas.fyi/v1/rpc/getBlockTemplate \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "payAddress": "kaspa:qpzpfwcsqsxhxwup26r55fd0ghqlhyugz8cp6y3wxuddc02vcxtjg75pspnwz",
  "extraData": "Extra block data"
}'
{
  "block": {
    "header": {
      "version": 1,
      "parentsByLevel": [
        [
          "0x1234567890abcdef..."
        ],
        [
          "0x9876543210fedcba..."
        ]
      ],
      "hashMerkleRoot": "34e9538fd3225652553930657c3d767d5ccab0fcd545038a69c202e45929dcd6",
      "acceptedIdMerkleRoot": "34e9538fd3225652553930657c3d767d5ccab0fcd545038a69c202e45929dcd6",
      "utxoCommitment": "34e9538fd3225652553930657c3d767d5ccab0fcd545038a69c202e45929dcd6",
      "timestamp": "1638360000000",
      "bits": 393216,
      "nonce": "12345678901234567890",
      "daaScore": "1234567",
      "blueWork": "123456789012345",
      "blueScore": "1234567",
      "pruningPoint": "34e9538fd3225652553930657c3d767d5ccab0fcd545038a69c202e45929dcd6"
    },
    "transactions": [
      {
        "version": 0,
        "inputs": [
          {
            "previousOutpoint": {
              "transactionId": "fa99f98b8e9b0758100d181eccb35a4c053b8265eccb5a89aadd794e087d9820",
              "index": 1
            },
            "signatureScript": "4123c94e322fd98ce4ba8b2e33b47f2984a2f741ecfea6fb48eb90d209a46b9d58639888a1575a717cb243b006edd720a7153e9a7e63f4539958d0a44eea8bfa9f01",
            "sequence": 0,
            "sigOpCount": 1
          }
        ],
        "outputs": [
          {
            "value": "100000",
            "scriptPublicKey": {
              "version": 0,
              "script": "208b42bec57f9a538f740b067f947a5b29e04043218a37ff1fa7fb5ee850fd3fd3ac"
            }
          }
        ],
        "lockTime": 0,
        "subnetworkId": "0000000000000000000000000000000000000000",
        "gas": "0",
        "payload": ""
      }
    ]
  }
}

Cost

This endpoint costs 0.1 RU (Request Units) per call.

Authorizations

x-api-key
string
header
required

API key required for authentication. Get your API key at https://developer.kas.fyi

Body

application/json
payAddress
string
required

Pay address for the block template

Example:

"kaspa:qpzpfwcsqsxhxwup26r55fd0ghqlhyugz8cp6y3wxuddc02vcxtjg75pspnwz"

extraData
string

Optional extra data as string or byte array

Example:

"Extra block data"

Response

200 - application/json

Block template retrieved successfully

block
object
required

Raw block template for mining

⌘I