---
title: "Request block candidate"
method: POST
path: "/mining/candidateWithTxs"
tags: ["mining"]
---

# Request block candidate

`POST /mining/candidateWithTxs`

## Request body

- ErgoTransaction[] — List of ErgoTransaction objects
  - `id` string, base16 — Base16-encoded transaction id bytes
  - `inputs` ErgoTransactionInput[], required — Inputs, that will be spent by this transaction
    - `boxId` string, base16, required — Base16-encoded transaction box id bytes. Should be 32 bytes long
    - `spendingProof` SpendingProof, required — Spending proof for transaction input
      - `proofBytes` string, base16, required — Base16-encoded spending proofs
      - `extension` object, required — Variables to be put into context
  - `dataInputs` ErgoTransactionDataInput[], required — Read-only inputs, that are not going to be spent by transaction.
    - `boxId` string, base16, required — Base16-encoded transaction box id bytes. Should be 32 bytes long
  - `outputs` ErgoTransactionOutput[], required — Outputs of the transaction, i.e. box candidates to be created by this transaction.
    - `boxId` string, base16 — Base16-encoded transaction box id bytes. Should be 32 bytes long
    - `value` integer, required — Amount of Ergo token
    - `ergoTree` string, base16, required — Base16-encoded ergo tree bytes
    - `creationHeight` integer, required — Height the output was created at
    - `assets` Asset[] — Assets list in the transaction
      - `tokenId` string, base16, required — Base16-encoded 32 byte digest
      - `amount` integer, required — Amount of the token
    - `additionalRegisters` Registers, required — Ergo box registers
    - `transactionId` string, base16 — Base16-encoded transaction id bytes
    - `index` integer — Index in the transaction outputs
  - `size` integer — Size of ErgoTransaction in bytes

## Response `200`

External candidate

- WorkMessage — Block candidate related data for external miner to perform work
  - `msg` string, required — Base16-encoded block header bytes without PoW solution
  - `b` integer, required — Work target value
  - `pk` string, required — Base16-encoded miner public key
  - `proof` ProofOfUpcomingTransactions — Proof that a block corresponding to given header without PoW contains some transactions
    - `msgPreimage` string, required — Base16-encoded serialized header without Proof-of-Work
    - `txProofs` MerkleProof[], required — Merkle proofs of transactions included into blocks (not necessarily all the block transactions)
      - `leaf` string, required — Base16-encoded Merkle tree leaf bytes
      - `levels` array[], required
        - union[] — pairs of hash and side of hash
          - union
            - string — hash
            - integer — side of hash

## Other responses

- `default` — Error

---

[API](https://skmtc.dev/ergoplatform/apis/ergo-node-api.md) · [All operations](https://skmtc.dev/ergoplatform/apis/ergo-node-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/ergoplatform/ergo-node-api/revisions/a731602272c6/schema)
