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

Return the Bid as a set of “hasheable” parameters which is directly digestible by the Poseidon sponge hash fn.

Calculate the one-way BlsScalar representation of the Bid

Generate a new Bid from a Message, the hashed secret(m) and a StealthAddress.

Returns the message field of the Bid.

Returns the raw cipher data from the PoseidonCipher located inside of the Message field of the Bid.

Returns the nonce 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.

Returns the pos field of the Bid.

Sets a new value for the position 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).

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

Immutably borrows from an owned value. Read more

Write the value as bytes to a Sink

Read the value from bytes in a Source

Returns the number of bytes needed to encode this value

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Performs the conversion.

Returns the associated StealthAddress

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

The type returned in the event of a conversion error.

Deserialize a [&[u8; N]] into Self, it might be fail.

Serialize Self into a [[u8; N]].

The size of

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Deserialize a slice of u8 into Self

Deserialize the type reading the bytes from a reader. The bytes read are removed from the reader. Read more

Encode Self into a buffer

Performs the conversion.

Performs the conversion.

Return a reference to the key of the leaf type

Parse a string slice as bytes hex representation and returns `

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.