Struct sn_dbc::DbcContent[][src]

pub struct DbcContent {
    pub parents: BTreeSet<Hash>,
    pub amount_secrets_cipher: Ciphertext,
    pub commitment: CompressedRistretto,
    pub range_proof_bytes: Vec<u8>,
    pub owner: BlindedOwner,
}

Fields

parents: BTreeSet<Hash>amount_secrets_cipher: Ciphertextcommitment: CompressedRistrettorange_proof_bytes: Vec<u8>owner: BlindedOwner

Implementations

Represents the content of a DBC.

Decrypt AmountSecrets using a SecretKey

Decrypt AmountSecrets using a SecretKeySet

Decrypt AmountSecrets using threshold+1 SecretKeyShares

Decrypt AmountSecrets using threshold+1 DecryptionShares

This fn should be used when keys (SecretKeyShare) are distributed across multiple parties. In which case each party will need to call SecretKeyShare::decrypt_share() or decrypt_share_no_verify() to generate a DecryptionShare and one party will need to obtain/aggregate all the shares together somehow.

Verifies range proof, ie that the committed amount is a non-negative u64.

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

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

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

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

Performs the conversion.

Performs the conversion.

Should always be Self

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.