Skip to main content

GrindingProverChannel

Trait GrindingProverChannel 

Source
pub trait GrindingProverChannel {
    // Required method
    fn grind(&mut self, bits: usize) -> u64;
}
Expand description

A prover channel that can pay a proof of work into the transcript.

The mirror of GrindingVerifierChannel. It is a trait of its own for the same reason: grinding acts on the Fiat-Shamir state alone.

§Contract

A difficulty of zero is not a grind, and must leave tape and challenger untouched. The verifier’s trait documents why that rule belongs to the channel rather than the call sites.

Required Methods§

Source

fn grind(&mut self, bits: usize) -> u64

Searches for a nonce meeting bits of difficulty and writes it, returning the nonce.

The expected cost is 2^bits challenger trials, paid in wall clock.

§Preconditions

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T, Challenger_, F, H: ParallelHashSuite, A: Allocator> GrindingProverChannel for ProverMerkleTranscriptChannel<T, Challenger_, F, H, A>
where T: BorrowMut<ProverTranscript<Challenger_>>, Challenger_: Challenger + Clone,