How can i calculate merkle root of block?

+2 votes
Hello
i have some question about merkle root of block.
i had block information through rpc cmd 'getblock'

...
"merkleroot" : "457d067158bd97fe6120de13036a12c3558c1f8ca913144bcfe3f9e57dd9791c",
"tx" : [
    "8c73d60a27e13f06cc39d42dc27fe09e461b22d8b45ab737dcd02b400f829cf8"
],
...

i know that merkle root is calculated from txid. but i dont know how it calculated.
can u explain how merkle root calculated? is it different from bitcoin?
if possible, explain when the number of tx is odd or even.
regards.
asked Sep 16, 2019 by 0080khs

1 Answer

0 votes
It works in exactly the same way as for bitcoin, see for example this page:

https://bitcoindev.network/calculating-the-merkle-root-for-a-block/

Or you can use Google to find many more pages that describe how bitcoin calculates merkle roots.
answered Sep 17, 2019 by MultiChain
...