public static Hash receiptsRoot(final List<TransactionReceipt> receipts) {
    final MerkleTrie<Bytes, Bytes> trie = trie();

    IntStream.range(0, receipts.size())
        .forEach(
            i ->
                trie.put(
                    indexKey(i),
                    RLP.encode(
                        rlpOutput ->
                            TransactionReceiptEncoder.writeTo(
                                receipts.get(i),
                                rlpOutput,
                                TransactionReceiptEncodingConfiguration.TRIE_ROOT))));

    return Hash.wrap(trie.getRootHash());
  }
Generates the receipt root for a list of receipts

@param receipts the receipts
@return the receipt root
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/BodyValidation.java