nimue_pow

Trait PoWIOPattern

Source
pub trait PoWIOPattern {
    // Required method
    fn challenge_pow(self, label: &str) -> Self;
}
Expand description

[IOPattern] for proof-of-work challenges.

Required Methods§

Source

fn challenge_pow(self, label: &str) -> Self

Adds a PoWChallenge to the [IOPattern].

In order to squeeze a proof-of-work challenge, we extract a 32-byte challenge using the byte interface, and then we find a 16-byte nonce that satisfies the proof-of-work. The nonce a 64-bit integer encoded as an unsigned integer and written in big-endian and added to the protocol transcript as the nonce for the proof-of-work.

The number of bits used for the proof of work are not encoded within the [IOPattern]. It is up to the implementor to change the domain separator or the label in order to reflect changes in the proof in order to preserve simulation extractability.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<IOPattern> PoWIOPattern for IOPattern
where IOPattern: ByteIOPattern,