Skip to main content

Guesser

Trait Guesser 

Source
pub trait Guesser {
    // Required method
    fn guess(
        &self,
        bundle: &ProgramBundle,
        input: &ProgramInput,
        difficulty: u64,
        max_attempts: u64,
    ) -> Result<GuessResult, String>;
}
Expand description

Search for a nonce that satisfies a difficulty target.

Warriors implement this to find a nonce such that hash(message ++ nonce) < target. Used for proof-of-work mining and computational puzzles.

Required Methods§

Source

fn guess( &self, bundle: &ProgramBundle, input: &ProgramInput, difficulty: u64, max_attempts: u64, ) -> Result<GuessResult, String>

Search for a valid nonce. Returns the nonce, digest, and number of attempts if found within max_attempts.

Implementors§