How can i calculate merkle root of block?

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

"merkleroot" : "457d067158bd97fe6120de13036a12c3558c1f8ca913144bcfe3f9e57dd9791c",
"tx" : [

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.
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:

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