Skip to main content

hash_value

Function hash_value 

Source
pub fn hash_value(value: &Value) -> Result<String>
Expand description

The canonical hash of any JSON value: the blake3 of its canonical form.

This is the crate’s only definition of “the hash”. prove reports both of its hashes through it, and hash_candles and hash_report are it applied to the two shapes a caller outside the prover needs. Anything that recomputes a hash independently – a zkVM guest, a language binding – has to agree with this function, or the proof it produces says nothing.

§Errors

Propagates a canonicalization failure. Canonicalizing a Value is total, so the variant exists for signature uniformity with the rest of the API.