Struct sn_dbc::DbcContent [−][src]
pub struct DbcContent {
pub parents: BTreeSet<SpendKey>,
pub amount_secrets_cipher: Ciphertext,
pub commitment: CompressedRistretto,
pub range_proof_bytes: Vec<u8>,
pub owner: PublicKey,
}Fields
parents: BTreeSet<SpendKey>amount_secrets_cipher: Ciphertextcommitment: CompressedRistrettorange_proof_bytes: Vec<u8>owner: PublicKeyImplementations
Represents the content of a DBC.
pub fn new(
parents: BTreeSet<SpendKey>,
amount: Amount,
owner: PublicKey,
blinding_factor: Scalar
) -> Result<Self, Error>
Verifies range proof, ie that the committed amount is a non-negative u64.
pub fn confirm_amount_matches_commitment(
&self,
public_key_set: &PublicKeySet,
decryption_shares: &BTreeMap<usize, DecryptionShare>
) -> Result<bool, Error>
pub fn confirm_amount_matches_commitment(
&self,
public_key_set: &PublicKeySet,
decryption_shares: &BTreeMap<usize, DecryptionShare>
) -> Result<bool, Error>
Checks if the secret (encrypted) amount matches the amount commitment. returns true if they match, false if not, or an error if decryption fails.
Checks if the provided AmountSecrets matches the amount commitment. note that both the amount and blinding_factor must be correct.
Calculates the blinding factor for the next output, typically used inside a loop.
is_last: must be true if this is the last output, else false. inputs_bf_sum: sum of blinding factors for all transaction inputs. outputs_bf_sum: sum of blinding factors for preceding transaction outputs.
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
Auto Trait Implementations
impl RefUnwindSafe for DbcContent
impl Send for DbcContent
impl Sync for DbcContent
impl Unpin for DbcContent
impl UnwindSafe for DbcContent
Blanket Implementations
Mutably borrows from an owned value. Read more