pub trait Transaction:
Clone
+ ReadWrite
+ Digestible {
const SIZE_LIMIT: Option<usize> = _;
const BLOCK_SIZE_LIMIT: Option<usize> = _;
// Required methods
fn kind(&self) -> TransactionKind;
fn verify(&self) -> Result<(), TransactionError>;
// Provided methods
fn signature_challenge(
&self,
genesis: [u8; 32],
) -> Option<<Ristretto as Ciphersuite>::F> { ... }
fn hash(&self) -> [u8; 32] { ... }
}Expand description
A Tributary transaction.
The implementation of Digestible MUST be binding to the entire transaction except its
signature (if signed).
Provided Associated Constants§
Sourceconst SIZE_LIMIT: Option<usize> = _
const SIZE_LIMIT: Option<usize> = _
The size limit for a transaction.
The Tributary will enforce no individual transaction exceeds this size.
Transactions MUST be able to be included within a block’s size limit.
The default size limit is 2 MiB.
Sourceconst BLOCK_SIZE_LIMIT: Option<usize> = _
const BLOCK_SIZE_LIMIT: Option<usize> = _
The size limit for a block.
The Tributary will enforce no individual block exceeds this size.
This MUST be greater than the size of an empty block.
The default size limt is 4 MiB.
Required Methods§
Sourcefn kind(&self) -> TransactionKind
fn kind(&self) -> TransactionKind
The type of transaction this is.
Sourcefn verify(&self) -> Result<(), TransactionError>
fn verify(&self) -> Result<(), TransactionError>
Verify this transaction’s content.
This MUST be a context-free validation over the data within this transaction alone. This function is only required to apply application-specific verification rules, where the Tributary will always apply its rules and any rules regarding the current context.
Provided Methods§
Sourcefn signature_challenge(
&self,
genesis: [u8; 32],
) -> Option<<Ristretto as Ciphersuite>::F>
fn signature_challenge( &self, genesis: [u8; 32], ) -> Option<<Ristretto as Ciphersuite>::F>
Obtain the challenge for this transaction’s signature.
This MUST return Some(_) when TransactionKind::Signed { .. } and None otherwise.
The provided implementation uses BLAKE2b-512, with a personalization of “tributary tx sig”,
for its hash function. It scopes to a specific Tributary via its genesis before digesting the
transaction and the present signature’s nonce (its first 32 bytes).
Sourcefn hash(&self) -> [u8; 32]
fn hash(&self) -> [u8; 32]
Hash this transaction.
The provided implementation uses BLAKE2b-256, with a personalization of “tributary tx”, for
its hash function. The implementation MUST be binding to the entire value’s Digestible
content.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".