pub enum CoinbasePuzzle<N>where
N: Network,{
Prover(Arc<CoinbaseProvingKey<N>>),
Verifier(Arc<VerifierKey<<N as Environment>::PairingCurve>>),
}Variants§
Prover(Arc<CoinbaseProvingKey<N>>)
The prover contains the coinbase puzzle proving key.
Verifier(Arc<VerifierKey<<N as Environment>::PairingCurve>>)
The verifier contains the coinbase puzzle verifying key.
Implementations§
Source§impl<N> CoinbasePuzzle<N>where
N: Network,
impl<N> CoinbasePuzzle<N>where
N: Network,
Sourcepub fn load() -> Result<CoinbasePuzzle<N>, Error>
pub fn load() -> Result<CoinbasePuzzle<N>, Error>
Load the coinbase puzzle proving and verifying keys.
pub fn trim( srs: &UniversalParams<<N as Environment>::PairingCurve>, config: PuzzleConfig, ) -> Result<CoinbasePuzzle<N>, Error>
Sourcepub fn prove(
&self,
epoch_challenge: &EpochChallenge<N>,
address: Address<N>,
nonce: u64,
minimum_proof_target: Option<u64>,
) -> Result<ProverSolution<N>, Error>
pub fn prove( &self, epoch_challenge: &EpochChallenge<N>, address: Address<N>, nonce: u64, minimum_proof_target: Option<u64>, ) -> Result<ProverSolution<N>, Error>
Returns a prover solution to the coinbase puzzle.
Sourcepub fn check_solutions(
&self,
solutions: &CoinbaseSolution<N>,
epoch_challenge: &EpochChallenge<N>,
proof_target: u64,
) -> Result<(), Error>
pub fn check_solutions( &self, solutions: &CoinbaseSolution<N>, epoch_challenge: &EpochChallenge<N>, proof_target: u64, ) -> Result<(), Error>
Returns true if the solutions are valid.
Sourcepub fn coinbase_proving_key(&self) -> Result<&CoinbaseProvingKey<N>, Error>
pub fn coinbase_proving_key(&self) -> Result<&CoinbaseProvingKey<N>, Error>
Returns the coinbase proving key.
Sourcepub fn coinbase_verifying_key(
&self,
) -> &VerifierKey<<N as Environment>::PairingCurve>
pub fn coinbase_verifying_key( &self, ) -> &VerifierKey<<N as Environment>::PairingCurve>
Returns the coinbase verifying key.
Trait Implementations§
Source§impl<N> Clone for CoinbasePuzzle<N>
impl<N> Clone for CoinbasePuzzle<N>
Source§fn clone(&self) -> CoinbasePuzzle<N>
fn clone(&self) -> CoinbasePuzzle<N>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<N> Freeze for CoinbasePuzzle<N>
impl<N> RefUnwindSafe for CoinbasePuzzle<N>where
<<N as Environment>::PairingCurve as PairingEngine>::G1Affine: RefUnwindSafe,
<<N as Environment>::PairingCurve as PairingEngine>::G2Affine: RefUnwindSafe,
<<<N as Environment>::PairingCurve as PairingEngine>::G2Affine as PairingCurve>::Prepared: RefUnwindSafe,
<N as Environment>::Field: RefUnwindSafe,
impl<N> Send for CoinbasePuzzle<N>
impl<N> Sync for CoinbasePuzzle<N>
impl<N> Unpin for CoinbasePuzzle<N>
impl<N> UnwindSafe for CoinbasePuzzle<N>where
<<N as Environment>::PairingCurve as PairingEngine>::G1Affine: RefUnwindSafe,
<<N as Environment>::PairingCurve as PairingEngine>::G2Affine: RefUnwindSafe,
<<<N as Environment>::PairingCurve as PairingEngine>::G2Affine as PairingCurve>::Prepared: RefUnwindSafe,
<N as Environment>::Field: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more