Using Proof from 'gettxoutproof' with Bitcoin for SPV proofs

I’m trying to use a spv proof library to verify transactions in solidity and I’m getting errors about the length and format of the proof returned from gettouxtproof.

In the docs it says that the return value is “A string that is a serialized, hex-encoded data for the proof”. The error I’m getting ‘is not an even number of hashes’. I’m not sure if the returned string is the proof and I’m not formatting it properly: I’m using hex"[returned_proof] with solidity, or if the returned string is a “merkle block” that needs to be parsed and if so I’m not sure how to parse it.

If anyone has experience implementing spv proofs with quick node please let me know I’m pretty stuck! for reference this is the spv library I’m using.

1 Like