Took code from here and modified it a bit to work with this code.
I don't think this will be its final form as I think we shouldn't be responsible for maintaining this code. IMO, best thing to do is to add the ordered merkle tree features here
And then import it as a library
This PR implements proper merkle proofing both onchain and offchain