[−][src]Struct wagyu_zcash::transaction::ZcashTransactionParameters
Represents the Zcash transaction parameters
Fields
header: u32
The header of the transaction (Overwintered flag and transaction version) (04000080 for Sapling)
version_group_id: u32
The version group ID (0x892F2085 for Sapling)
transparent_inputs: Vec<ZcashTransparentInput<N>>
The inputs for a transparent transaction, encoded as in Bitcoin.
transparent_outputs: Vec<ZcashTransparentOutput>
The outputs for a transparent transaction, encoded as in Bitcoin,
lock_time: u32
The Unix epoch time (UTC) or block height, encoded as in Bitcoin. (4 bytes)
expiry_height: u32
The block height in the range {1 .. 499999999} after which the transaction will expire, or 0 to disable expiry (ZIP-203).
shielded_inputs: Vec<SaplingSpend<N>>
The inputs for a shielded transaction, encoded as a sequence of Zcash spend descriptions.
shielded_outputs: Vec<SaplingOutput<N>>
The outputs for a shielded transaction, encoded as a sequence of Zcash output descriptions.
value_balance: ZcashAmount
The balancing value is the net value of spend transfers minus output transfers in a transaction (in zatoshi, represented as a signed integer).
A positive balancing value takes value from the Sapling value pool, and adds it to the transparent value pool.
A negative balancing value does the reverse.
binding_signature: Option<Vec<u8>>
The binding signature enforces the consistency of the balancing value with the value commitments in spend descriptions and output descriptions.
Namely, it enforces:
-
That the value spent by spend transfers minus that produced by output transfers, is consistent with the balancing value field of the transaction.
-
That the signer knew the randomness used for the spend and output value commitments, in order to prevent output descriptions from being replayed by an adversary in a different transaction.
anchor: Option<Fr>
The root of the Sapling note commitment tree at some block height in the past.
Methods
impl<N: ZcashNetwork> ZcashTransactionParameters<N>
[src]
pub fn new(
version: &str,
lock_time: u32,
expiry_height: u32
) -> Result<Self, TransactionError>
[src]
version: &str,
lock_time: u32,
expiry_height: u32
) -> Result<Self, TransactionError>
Returns the Zcash transaction parameters
pub fn add_transparent_input(
&self,
transaction_id: Vec<u8>,
index: u32,
address: Option<ZcashAddress<N>>,
amount: Option<ZcashAmount>,
redeem_script: Option<Vec<u8>>,
script_pub_key: Option<Vec<u8>>,
sequence: Option<Vec<u8>>,
sighash_code: SignatureHash
) -> Result<Self, TransactionError>
[src]
&self,
transaction_id: Vec<u8>,
index: u32,
address: Option<ZcashAddress<N>>,
amount: Option<ZcashAmount>,
redeem_script: Option<Vec<u8>>,
script_pub_key: Option<Vec<u8>>,
sequence: Option<Vec<u8>>,
sighash_code: SignatureHash
) -> Result<Self, TransactionError>
Returns the transaction parameters with the given transparent input appended.
pub fn add_transparent_output(
&self,
address: &ZcashAddress<N>,
amount: ZcashAmount
) -> Result<Self, TransactionError>
[src]
&self,
address: &ZcashAddress<N>,
amount: ZcashAmount
) -> Result<Self, TransactionError>
Returns the transaction parameters with the given transparent output appended.
pub fn add_sapling_input(
&self,
extended_private_key: &ZcashExtendedPrivateKey<N>,
cmu: &[u8; 32],
epk: &[u8; 32],
enc_ciphertext: &str,
input_anchor: Fr,
witness: MerklePath<Node>
) -> Result<Self, TransactionError>
[src]
&self,
extended_private_key: &ZcashExtendedPrivateKey<N>,
cmu: &[u8; 32],
epk: &[u8; 32],
enc_ciphertext: &str,
input_anchor: Fr,
witness: MerklePath<Node>
) -> Result<Self, TransactionError>
Add a sapling shielded spend to the transaction
pub fn add_sapling_output(
&self,
ovk: Option<SaplingOutgoingViewingKey>,
address: &ZcashAddress<N>,
amount: ZcashAmount
) -> Result<Self, TransactionError>
[src]
&self,
ovk: Option<SaplingOutgoingViewingKey>,
address: &ZcashAddress<N>,
amount: ZcashAmount
) -> Result<Self, TransactionError>
Add a sapling shielded output to the transaction
pub fn read<R: Read>(reader: R) -> Result<Self, TransactionError>
[src]
Read and output the Zcash transaction parameters
Trait Implementations
impl<N: Clone + ZcashNetwork> Clone for ZcashTransactionParameters<N>
[src]
fn clone(&self) -> ZcashTransactionParameters<N>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<N: Debug + ZcashNetwork> Debug for ZcashTransactionParameters<N>
[src]
Auto Trait Implementations
impl<N> RefUnwindSafe for ZcashTransactionParameters<N> where
N: RefUnwindSafe,
N: RefUnwindSafe,
impl<N> Send for ZcashTransactionParameters<N>
impl<N> Sync for ZcashTransactionParameters<N>
impl<N> Unpin for ZcashTransactionParameters<N> where
N: Unpin,
N: Unpin,
impl<N> UnwindSafe for ZcashTransactionParameters<N> where
N: UnwindSafe,
N: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,