Struct dusk_blindbid::Bid [−][src]
pub struct Bid { /* fields omitted */ }
Expand description
The Bid structure contains all of the logic and information needed to be
able to participate in the Dusk consensus lottery through the bidding
process. It allows the user to generate a random Bid with which will be able
to generate a Score
and participate in leader election
process for this consensus round iteration. In particular, a Bid provides
these core functionalities among others.
- Generation of a Prover ID.
- Generation of a Score.
It is always initialized randomly, and any trick to cheat on it’s initialization/construction will resume in a failure in the BindBidProof verification.
The Bid is also designed to be stored within a PoseidonTree. Although it’s not responsability of this crate to provide such implementation. To make that happen, make sure to implement PoseidonLeaf trait for it or a wrapper structure.
Implementations
Generate a new Bid from a Message
, the hashed secret(m) and a
StealthAddress
.
Returns the raw cipher data from the PoseidonCipher
located inside
of the Message
field of the Bid.
Returns the hashed_secret
field of the Bid.
Returns the commitment
field of the Bid.
Returns the eligibility
field of the Bid.
Sets a new value for the eligibility of the Bid.
Returns the expiration
field of the Bid.
Returns a mutable ref pointing to the pos
field of the
Bid.
Performs the sponge_hash techniqe using poseidon to compute the one-time prover_id that corresponds to a Bid in an specific point of the consensus which is determinated by:
- consensus_round_seed (sigma^s)
- latest_consensus_round (k^t)
- latest_consensus_step (k^s)
One-time prover-id is stated to be
H(bid.secret_k, sigma^s, k^t, k^s)
.
pub fn decrypt_data(
&self,
secret: &JubJubScalar,
psk: &PublicSpendKey
) -> Result<(JubJubScalar, JubJubScalar), BlindBidError>
pub fn decrypt_data(
&self,
secret: &JubJubScalar,
psk: &PublicSpendKey
) -> Result<(JubJubScalar, JubJubScalar), BlindBidError>
Provided the secret, decripts the data stored inside the cipher returning a tuple that contains the value at stake in the bid and the blinder data which are the two values used to generate the bid commitment.
Trait Implementations
Returns the associated StealthAddress
Auto Trait Implementations
impl RefUnwindSafe for Bid
impl UnwindSafe for Bid
Blanket Implementations
Mutably borrows from an owned value. Read more
Encode Self
into a buffer
fn from_hex_str(s: &str) -> Result<Self, Self::Error> where
Self::Error: BadLength,
Self::Error: InvalidChar,
fn from_hex_str(s: &str) -> Result<Self, Self::Error> where
Self::Error: BadLength,
Self::Error: InvalidChar,
Parse a string slice as bytes hex representation and returns `