pub enum CoinbasePuzzle<N: Network> {
Prover(Arc<CoinbaseProvingKey<N>>),
Verifier(Arc<CoinbaseVerifyingKey<N>>),
}
Variants§
Prover(Arc<CoinbaseProvingKey<N>>)
The prover contains the coinbase puzzle proving key.
Verifier(Arc<CoinbaseVerifyingKey<N>>)
The verifier contains the coinbase puzzle verifying key.
Implementations§
source§impl<N: Network> CoinbasePuzzle<N>
impl<N: Network> CoinbasePuzzle<N>
pub fn trim(srs: &SRS<N::PairingCurve>, config: PuzzleConfig) -> Result<Self>
sourcepub fn prove(
&self,
epoch_challenge: &EpochChallenge<N>,
address: Address<N>,
nonce: u64,
minimum_proof_target: Option<u64>
) -> Result<ProverSolution<N>>
pub fn prove( &self, epoch_challenge: &EpochChallenge<N>, address: Address<N>, nonce: u64, minimum_proof_target: Option<u64> ) -> Result<ProverSolution<N>>
Returns a prover solution to the coinbase puzzle.
sourcepub fn check_solutions(
&self,
solutions: &CoinbaseSolution<N>,
epoch_challenge: &EpochChallenge<N>,
proof_target: u64
) -> Result<()>
pub fn check_solutions( &self, solutions: &CoinbaseSolution<N>, epoch_challenge: &EpochChallenge<N>, proof_target: u64 ) -> Result<()>
Returns true
if the solutions are valid.
sourcepub fn coinbase_proving_key(&self) -> Result<&CoinbaseProvingKey<N>>
pub fn coinbase_proving_key(&self) -> Result<&CoinbaseProvingKey<N>>
Returns the coinbase proving key.
sourcepub fn coinbase_verifying_key(&self) -> &CoinbaseVerifyingKey<N>
pub fn coinbase_verifying_key(&self) -> &CoinbaseVerifyingKey<N>
Returns the coinbase verifying key.
Trait Implementations§
source§impl<N: Clone + Network> Clone for CoinbasePuzzle<N>
impl<N: Clone + Network> Clone for CoinbasePuzzle<N>
source§fn clone(&self) -> CoinbasePuzzle<N>
fn clone(&self) -> CoinbasePuzzle<N>
Returns a copy 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> RefUnwindSafe for CoinbasePuzzle<N>where
<N as Environment>::Field: RefUnwindSafe,
<<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,
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>::Field: RefUnwindSafe,
<<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,
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