I've been struggling the past couple of days to deserialize a merkleblock message. I'm writing a go app that uses the bitcoin rpc client to call gettxoutproof, but only need the merkle proof (array of required tx hashes needed to hash merkle root) of given transaction (want to verify the transaction in an ethereum smart contract).
So I've looked at how the serialization is defined in merkleblock.h which looks pretty straight forward. The problem i'm having is figuring out how CDataStream serializes the CMerkleBlock object, and finding the transaction hashes in the hex string.
Example: This is the block im looking at: Testnet Block
it only contains one tx: 8148740e33df53073f55089f195c327f40e2a9c374dcc05643c60671243cc4a8
When I run the gettxoutproof command I get the following output:
0000002024ea1b7676f6ae9f2a3b639ec43e15c509a661d33d123deb3d00000000000000a8c43c247106c64356c0dc74c3a9e2407f325c199f08553f0753df330e744881f4d6715affff001d00cecafd0100000001a8c43c247106c64356c0dc74c3a9e2407f325c199f08553f0753df330e7448810101
Initially I expected to find the tx hash somewhere in that hex string, since its the only tx in the block and has to be included, but its no where to be found. Since the docs say that gettxoutproof returns a serialized, hex encoded string I thought maybe the tx hash has been hex encoded, but it isn't. I've tried figuring this out with other blocks, that for example contain 2 transactions but have had no luck. I've looked at how CDataStream serializes the data but fail to understand it.
Would be very happy if someone could help me out!