Skip to main content

Module transaction

Module transaction 

Source
Expand description

Transactions and transaction-related structures.

Re-exportsยง

pub use crate::sapling::FieldNotPresent;

Modulesยง

arbitrary
Arbitrary data generation for transaction proptests
auth_digest ๐Ÿ”’
Authorizing digests for Zcash transactions.
compat ๐Ÿ”’
Conversions between Zebra and zcash_primitives transaction types.
hash ๐Ÿ”’
Transaction identifiers for Zcash.
joinsplit ๐Ÿ”’
lock_time ๐Ÿ”’
Transaction LockTime.
memo ๐Ÿ”’
serialize ๐Ÿ”’
Contains impls of ZcashSerialize, ZcashDeserialize for all of the transaction types, so that all of the serialization logic is in one place.
sighash ๐Ÿ”’
Signature hashes for Zcash transactions
unmined ๐Ÿ”’
Unmined Zcash transaction identifiers and transactions.
zip317
An implementation of the [ZIP-317] fee calculations for UnminedTxs:

Structsยง

AuthDigest
An authorizing data commitment hash as specified in ZIP-244.
Hash
A transaction ID, which uniquely identifies mined v5 transactions, and all v1-v4 transactions.
HashType
The different SigHash types, as defined in https://zips.z.cash/zip-0143
JoinSplitData
A bundle of JoinSplit descriptions and signature data.
Memo
A 512-byte (plaintext) memo associated with a note, as described in protocol specification ยง5.5.
RecordingReader ๐Ÿ”’
An io::Read wrapper that records every byte consumed, for post-parse validation.
SerializedTransaction
A serialized transaction.
SigHash
A Signature Hash (or SIGHASH) as specified in https://zips.z.cash/protocol/protocol.pdf#sighash
SigHasher
A SigHasher context which stores precomputed data that is reused between sighash computations for the same transaction.
Transaction
A Zcash transaction, wrapping zcash_primitives::transaction::Transaction.
UnminedTx
An unmined transaction, and its pre-calculated unique identifying ID.
VerifiedUnminedTx
A verified unmined transaction, and the corresponding transaction fee.
WtxId
A witnessed transaction ID, which uniquely identifies unmined v5 transactions.

Enumsยง

LockTime
A Bitcoin-style locktime, representing either a block height or an epoch time.
TxVersion
The set of defined transaction format versions.
UnminedTxId
A unique identifier for an unmined transaction, regardless of version.

Constantsยง

MEMPOOL_TRANSACTION_COST_THRESHOLD
The minimum cost value for a transaction in the mempool.
MIN_TRANSPARENT_TX_SIZE
All txs must have at least one input, a 4 byte locktime, and at least one output.
MIN_TRANSPARENT_TX_V4_SIZE
The minimum transaction size for v4 transactions.
MIN_TRANSPARENT_TX_V5_SIZE
The minimum transaction size for v5 transactions.
SPROUT_CIPHERTEXT_SIZE
The size of one Sprout note ciphertext.

Functionsยง

deserialize_and_check ๐Ÿ”’
Parses a transaction and runs the parse-time consensus checks that zcash_primitives does not enforce. Both deserialization impls go through this function, so a transaction cannot reach a Transaction value without passing the checks.
sprout_joinsplit_key_proof_and_ciphertexts
Returns the ephemeralKey, proof, and encCiphertexts of a Sprout JoinSplit description.
v4_empty_sapling_value_balance ๐Ÿ”’
Reads the valueBalanceSapling field of a V4 transaction that has no Sapling spends or outputs, from the bytes that were consumed while parsing it.