Skip to Content
MiningAuxPoW Integration

AuxPoW Integration

Status: Built, not yet activated on mainnet. Active on testnet from block 1000 and regtest from genesis.

Tidecoin AuxPoW integration is a protocol flow: get a Tidecoin candidate, commit its hash in the parent coinbase, build the parent merkle root, mine a parent scrypt header, serialize the AuxPoW proof, and submit it to Tidecoin.

This page describes the protocol contract. It does not document any specific pool codebase.

Candidate Creation

Create a candidate with an explicit Tidecoin payout address:

tidecoin-cli createauxblock "<tidecoin-payout-address>"

The result includes:

FieldUse
hashTidecoin aux block hash to commit in the parent coinbase.
chainidMust be 8 for Tidecoin.
previousblockhashTidecoin parent tip used by the candidate.
coinbasevalueTidecoin block subsidy and fees for the candidate.
bitsTidecoin target in compact form.
heightTidecoin candidate height.
_targetDeprecated full target representation.

If the Tidecoin tip changes, refresh the candidate. Tidecoin rejects stale candidate hashes that are no longer known to the AuxPoW RPC cache.

Parent Coinbase Commitment

Tidecoin searches the parent coinbase input script for the merged-mining marker:

fa be 6d 6d

The marker must appear exactly once and immediately before the aux-chain merkle root.

For a single auxiliary chain, the commitment blob is:

fabe6d6d || tide_aux_hash_display_order || 01000000 || 00000000
FieldSizeMeaning
fabe6d6d4 bytesMerged-mining marker.
tide_aux_hash_display_order32 bytesTidecoin candidate hash in the order returned by RPC.
010000004 bytesAux chain merkle tree size, little-endian 1.
000000004 bytesAux chain merkle nonce, little-endian 0.

For multiple auxiliary chains, replace the direct Tidecoin hash with the aux-chain merkle root, set size = 1 << chain_merkle_branch_height, choose a nonce, and set Tidecoin’s chain index to CAuxPow::getExpectedIndex(nonce, 8, height).

Parent Coinbase Shape

A real parent coinbase must remain valid for the parent chain. A typical Stratum split is:

coinbase = coinbase1 || extranonce1 || extranonce2 || coinbase2

The parent coinbase script usually contains:

  1. parent-chain BIP34 height push;
  2. optional compatibility fields such as timestamp;
  3. miner-controlled extranonce bytes;
  4. a push containing the merged-mining commitment blob.

The merged-mining marker and root only need to be present in the script byte stream where Tidecoin can find them. They do not need to be a standalone output.

Parent Merkle Root

After miners fill extranonce and nonce fields:

  1. Reconstruct the full parent coinbase transaction.
  2. Compute the coinbase transaction hash.
  3. Combine it with the parent template transaction merkle branch.
  4. Put the resulting merkle root into the parent 80-byte header.
  5. Mine the parent header with scrypt.

The coinbase merkle branch submitted in AuxPoW must prove the coinbase transaction at index 0 into the parent header’s merkle root. Use the same hash byte order that the parent header uses for its merkle root field.

AuxPoW Serialization

Tidecoin’s CAuxPow serialization order is:

parent coinbase transaction hashBlock coinbase merkle branch vector nIndex chain merkle branch vector nChainIndex parent block header

For the common single-chain case:

FieldValue
parent coinbase transactionThe real parent coinbase containing the Tidecoin commitment.
hashBlockLegacy MerkleTx field. Tidecoin does not use it for AuxPoW validity.
coinbase merkle branchBranch from parent coinbase txid to parent header merkle root.
nIndex0, because the parent coinbase is transaction index 0.
chain merkle branchEmpty.
nChainIndex0.
parent block headerThe mined 80-byte scrypt parent header.

Submit with:

tidecoin-cli submitauxblock "<tide_aux_hash>" "<serialized_auxpow_hex>"

Validation Checks

Tidecoin verifies:

  • AuxPoW is active at the candidate height.
  • The block version has the AuxPoW flag.
  • The block version encodes chain ID 8.
  • The parent chain ID is not Tidecoin’s chain ID under strict checks.
  • The parent coinbase contains exactly one merged-mining marker.
  • The marker is immediately before the aux-chain merkle root.
  • The coinbase merkle branch reaches the parent header merkle root.
  • The chain merkle tree size and nonce match nChainIndex.
  • The parent scrypt proof satisfies Tidecoin’s target.

Reorg and Refresh Rules

  • Refresh Tidecoin candidates when the Tidecoin tip changes.
  • Refresh parent jobs when the parent tip, parent transactions, parent time, or parent payout script changes.
  • Treat transport errors during submitauxblock as ambiguous until reconciled from the chain.
  • Do not pay miners solely because a share was submitted; pay according to the pool’s confirmed or maturity-adjusted accounting policy.

Source Cross-Checks

TopicSource
Tidecoin AuxPoW validation../tidecoin/src/auxpow.cpp
Tidecoin AuxPoW serialization../tidecoin/src/auxpow.h
AuxPoW RPC cache and submission../tidecoin/src/rpc/auxpow_miner.cpp
Functional-test minimal AuxPoW../tidecoin/test/functional/test_framework/auxpow.py
Pool protocol reference example../../pool/liquidpool/crates/mm_auxpow_tide/src/lib.rs
Parent coinbase split example../../pool/liquidpool/crates/mm_engine_bells_tide/src/bells_coinbase.rs

See also: Protocol / AuxPoW, Mining Pool Operator Guide, RPC Reference.

Last updated on