pub trait GrindingVerifierChannel {
// Required method
fn verify_grind(&mut self, bits: usize) -> Result<(), Error>;
}Expand description
A verifier channel that can check a proof of work its prover paid into the transcript.
Grinding acts on the Fiat-Shamir state rather than on anything committed. So it is a trait of its own, asked for alongside the channel bound a protocol already needs. A channel with no way to express a proof of work is then rejected at the type level.
§Contract
A difficulty of zero is not a grind: it leaves the proof tape and the challenger untouched. So a protocol configured to grind nothing writes exactly the transcript it wrote before. That rule lives here rather than at the call sites, where the two sides could drift apart. A grind is sound only when prover and verifier apply it at the same point in the transcript.
Required Methods§
Sourcefn verify_grind(&mut self, bits: usize) -> Result<(), Error>
fn verify_grind(&mut self, bits: usize) -> Result<(), Error>
Checks the proof of work of bits difficulty standing at this point in the transcript.
§Errors
Returns Error::InsufficientWork when the nonce the prover sent does not meet bits.
Returns a deserialization error when the proof carries no nonce here.
§Preconditions
bitsis at mostMAX_GRINDING_BITS.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".