Attribute Kaspa coinbase outputs to merge-set rewards

A coinbase transaction can distribute rewards to scripts associated with blocks in its merge set. Crediting every output to the miner of the containing block misstates pool revenue.

Follow the reward construction

For a simplified example, use integer amounts in a common unit. An eligible blue block with subsidy 40 and fees 2 contributes 42 to its miner's script. Eligible red rewards are accumulated and a nonzero total goes to the current miner's script. Check eligibility first because the implementation excludes certain non-DAA merge-set blocks.

eligible blue B: subsidy 40 + fees 2 → B's miner script
eligible red R: subsidy 40 + fees 1 → red reward accumulator

Reconcile at script and output level

Preserve each output's index, value and destination script, even when a pool controls several destinations. The payload's subsidy field alone cannot reconstruct the entire payout vector. Fee data and merge-set reward eligibility are necessary to explain a difference between payload subsidy and summed outputs.

Sources