Reconstruct the children of a Chia coin after they have been spent

A Chia coin spend can create several child coins. An indexer reconstructing lineage can miss historical children if it applies the default unspent-only filter.

Query the parent coin name

Set PARENT to the full hex coin ID. Include spent coins so children that were themselves spent later still appear. Record each child's parent, puzzle hash and integer amount from the returned coin record.

req=$(jq -cn --arg p "$PARENT" '{parent_ids:[$p],include_spent_coins:true}')
chia rpc full_node get_coin_records_by_parent_ids "$req" | jq '.coin_records[] | {coin, confirmed_block_index, spent_block_index}'

Trace branches independently

If a parent produced change and a payment, both children share the same parent ID. Their puzzle hashes and amounts can differ. Do not mark both as belonging to a recipient merely because they share ancestry. For a singleton continuation, validate the expected puzzle and protocol rules before following a candidate child.

docs.chia.net get_coin_records_by_parent_ids