public static Hash transactionsRoot(final List<Transaction> transactions) {
    final MerkleTrie<Bytes, Bytes> trie = trie();

    IntStream.range(0, transactions.size())
        .forEach(
            i ->
                trie.put(
                    indexKey(i),
                    TransactionEncoder.encodeOpaqueBytes(
                        transactions.get(i), EncodingContext.BLOCK_BODY)));

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

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