Skip to content
LogoLogo

Merged mining for pools

Arrekta speaks the same merged-mining interface as Namecoin and Syscoin, so existing pool software can add it as an extra aux chain. Background: Merged mining.

JSON-RPC: POST /rpc

createauxblock(address)

Returns work paying the coinbase to address:

curl -s http://127.0.0.1:28332/rpc -H 'content-type: application/json' \
  -d '{"id": 1, "method": "createauxblock", "params": ["rarrk1p…"]}'
{
  "result": {
    "hash": "…",              // Arrekta block id, Bitcoin byte order (reversed)
    "chainid": 3335,          // 0x0D07
    "previousblockhash": "…",
    "coinbasevalue": 1000000000,
    "bits": "207fffff",
    "height": 102,
    "_target": "…"            // little-endian target, Bitcoin convention
  },
  "error": null,
  "id": 1
}

The node keeps the 64 most recent templates and drops templates whose parent is no longer the tip.

submitauxblock(hash, auxpow)

Submits the solution for a template returned by createauxblock. auxpow is the hex AuxPoW: the parent coinbase, its merkle branch, the aux-chain branch and the 80-byte Bitcoin header (§9.6).

{"id": 2, "method": "submitauxblock", "params": ["<hash>", "<auxpow hex>"]}

result is true when the block connected (or was stored on a side chain) and false otherwise.

getauxblock

Legacy form: without parameters it behaves like createauxblock with ARREKTA_MINER_ADDRESS (error if unset); with (hash, auxpow) it behaves like submitauxblock.

What the pool must commit

In the first input's scriptSig of the Bitcoin coinbase:

fa be 6d 6d ‖ reverse(aux merkle root) ‖ size u32 (= 2^m) ‖ nonce u32
  • the magic exactly once, immediately before the root;
  • the aux merkle tree has at most 30 levels; Arrekta's slot is rand = nonce·1103515245 + 12345; rand += 0x0D07; rand = rand·1103515245 + 12345; slot = rand mod 2^m;
  • the coinbase must not be exactly 64 bytes, and at most 32,768 bytes, non-witness serialization.

Rejections carry stable codes such as auxpow-missing-header, auxpow-wrong-index and high-hash.

Solo mining

  1. GET /v1/mining/template?address=… returns the header (header_hex), transactions (txs_hex), aux_hash and chain_id.
  2. Build a standalone AuxPoW: a coinbase with one null input whose scriptSig is fa be 6d 6d ‖ reverse(block id) ‖ 01000000 ‖ 00000000 ‖ extra_nonce, one empty output, and a parent header (version 0x20000000, zero prev, merkle = coinbase txid); iterate its nonce until it meets the target.
  3. POST /v1/mining/submit with header ‖ auxpow ‖ txs as hex.

See the Mining API. The admin shortcut POST /v1/admin/mine (devnets) is refused on mainnet with mainnet-mining-disabled; mainnet blocks come from pools or external miners.