3

How do you save the "base58-decoded IPFS multihash" returned by Oraclize (in the proof parameter)?

function __callback(bytes32 myid, string result, bytes proof)

Can you safely convert proof to bytes32, and save that in the contract?

From the documentation:

If instead oraclize_setProof(proofType_TLSNotary | proofStorage_IPFS) is used, then Oraclize will return only the base58-decoded IPFS multihash as the proof argument. To obtain the IPFS multihash, the bytes must be encoded to base58.

1 Answer 1

0

I presume you're talking about just storing the proof bytes in the contract? You can simply store it as bytes type as it is sent. Although, there is probably not much use in storing it in the contract, unless you're looking for other contracts to make use of it, such as coupling it with: https://github.com/MrChico/verifyIPFS

However, if you wish for the end-user to be able to check the IPFS multihash themselves, by downloading and then running it through the Oraclize proof-verification-tool, the best way to do this is to just emit an event of it, and then in your front-end/UI base58 encode the proof parameter, and it should result in the multihash that can be used to download it from IPFS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.