how does merkle root building work for empty array?
This cannot happen. Every block contains at least a &quot;coinbase&quot; transaction that distributes the subsidy and fees to the block's miners.
Blocks without coinbase are invalid, even if the subsidy were 0.