Prioritizing Transactions on Your Own Block Templates with StratumV2

Optional, off by default. The practical payoff of building your own blocks.

Once you're building your own blocks (setup guide here), you also control which transactions your templates favor. The DMND Client exposes an API to do exactly that. Build the block, decide what gets bumped.

What it does

The client can expose an API that takes a raw transaction, submits it to your node, and asks it to prioritize that transaction in template selection (via Bitcoin Core's prioritisetransaction RPC). The fee boost is virtual. It shapes what your templates favor, spends nothing, and doesn't change the transaction on the network.

Turn it on

Enabled only when all five settings are configured. Miss one and the endpoints stay off:

SettingCLI flagconfig.tomlEnv varDescription
RPC URL--rpc-urlrpc_urlRPC_URLe.g. http://127.0.0.1:8332
RPC user--rpc-userrpc_userRPC_USERCore RPC username
RPC password--rpc-pwdrpc_pwdRPC_PWDCore RPC password
Fee delta--rpc-fee-deltarpc_fee_deltaRPC_FEE_DELTAVirtual boost in satoshis
API token--api-tx-tokenapi_tx_tokenAPI_TX_TOKENBearer token for the API

RPC_FEE_DELTA is in satoshis. 100000 (a 0.001 BTC virtual boost) is a reasonable start.

TOKEN=<DMND-token> RPC_URL=http://127.0.0.1:8332 \
RPC_USER=<user> RPC_PWD=<pwd> RPC_FEE_DELTA=100000 API_TX_TOKEN=<api-token> \
./dmnd-client -l info -d 250T --tp-address="127.0.0.1:8336"

Security: read first

  • Never expose the tx API publicly. Default port 3001; bind to localhost or a private gateway.
  • config.toml stores RPC creds in plaintext. Run chmod 600 config.toml.
  • Treat API_TX_TOKEN like a password.

Using it

Submit a raw transaction:

curl -X POST -H "Authorization: Bearer <api-token>" \
  "http://127.0.0.1:3001/api/tx/submit/<raw-transaction-hex>"

List prioritized transactions:

curl -H "Authorization: Bearer <api-token>" \
  "http://127.0.0.1:3001/api/tx/prioritized"

The response returns the count and, per tx, its txid, hex, and live fees. real is the base fee (fees.base), and modified is the boosted figure (fees.modified):

{ "success": true, "data": { "count": 1, "txs": [
  { "txid": "<txid>", "tx_hex": "<hex>",
    "tx_fee": { "real": 0.00001000, "modified": 0.00101000 } } ] } }

Port defaults to 3001 (--api-server-port / api_server_port / API_SERVER_PORT).

If it isn't working

Incomplete config means disabled by design. The client logs that prioritization isn't enabled and the endpoints return 503. The fix is always the same: all five settings must be set.

Why it matters

The setup guide reclaimed control of your block contents. This uses it. Prioritized inclusion becomes something you can offer, price, and recoup against, whether that's fee recovery or private inclusion. None of it exists on legacy infrastructure where the pool builds the block. It only works because the template is yours. That's the thesis DMND is built on.


Join our pool today at https://join.dmnd.work

Subscribe to DMND

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
jamie@example.com
Subscribe