Mining
Notes on Kaspa mining - kHeavyHash, how coinbase rewards work in a blockDAG, and mining in practice.Kaspa is pure proof-of-work: mining is the only issuance and the only way blocks are created. What differs from blockchain PoW is what happens to parallel blocks - and how rewards are paid.
kHeavyHash
Kaspa’s PoW function. To mine, a miner varies the nonce until the block header’s kHeavyHash is numerically at or below the target. The pipeline (from rusty-kaspa consensus/pow and crypto/hashes):
- Pre-PoW hash - the header hashed with nonce and timestamp zeroed, so the matrix (step 3) is fixed per template while the nonce spins.
- cSHAKE256, domain
ProofOfWorkHash, over pre-PoW hash + timestamp + nonce. - Matrix step - a deterministic 64×64 matrix of 4-bit values (generated from the pre-PoW hash via xoshiro256++, regenerated until full rank) is multiplied against the hash split into 64 nibbles; the result is XORed back into the hash.
- cSHAKE256 again, domain
HeavyHash, producing the final value compared to target.
All keccak-family hashing. The matrix multiplication is the “heavy” part - it was designed with optical/compute-in-memory mining hardware in mind, though in practice it is mined by conventional ASICs.
Rewards in a blockDAG
In a blockchain, a block’s coinbase pays its own miner. Kaspa inverts this: a block’s coinbase pays the miners of the blocks it merges (its mergeset), and a block’s own reward arrives later, in the coinbase of the chain block that merges it. From the coinbase logic in consensus/src/processes/coinbase.rs:
- Each blue merged block gets an output paying its subsidy plus its fees to the address the merged block declared in its own coinbase payload.
- Red blocks do not keep their rewards: the subsidies and fees of merged reds are pooled into a single output paid to the merging block’s own miner.
Consequences:
- Honest parallel blocks (blue) are all paid - there is no orphan risk from the high block rate, so solo mining pays out proportionally even at small hashrate.
- Poorly connected or adversarial blocks (red) forfeit their reward to whoever merges them.
Coinbase outputs mature after 1,000 blocks (~100 seconds) before they can be spent. Per-block subsidy amounts come from the emission schedule.
Mining in practice
- Hardware: mainnet is mined by kHeavyHash ASICs (available since ~2023). CPU/GPU mining is only relevant on testnet.
- Pools speak stratum. kaspad itself does not; a stratum bridge sits between pool software/miners and the node. rusty-kaspa added an in-repo
stratum-bridgebinary (beta, January 2026); third-party bridges predate it. - Solo/custom: the node RPC exposes
getBlockTemplate(pass a payout address, solve, thensubmitBlock). See RPC Calls. - Block rate is held at 10 BPS by the difficulty adjustment algorithm regardless of total hashrate.
See Also: Difficulty Adjustment, Emission & Supply, GHOSTDAG Ordering