Struct snarkvm_dpc::testnet1::transaction::transaction::Transaction [−][src]
pub struct Transaction<C: Testnet1Components> { pub network: Network, pub ledger_digest: MerkleTreeDigest<C::MerkleParameters>, pub old_serial_numbers: Vec<<C::AccountSignature as SignatureScheme>::PublicKey>, pub new_commitments: Vec<<C::RecordCommitment as CommitmentScheme>::Output>, pub program_commitment: <C::ProgramVerificationKeyCommitment as CommitmentScheme>::Output, pub local_data_root: <C::LocalDataCRH as CRH>::Output, pub value_balance: AleoAmount, pub signatures: Vec<<C::AccountSignature as SignatureScheme>::Signature>, pub encrypted_records: Vec<EncryptedRecord<C>>, pub transaction_proof: <C::OuterSNARK as SNARK>::Proof, pub memorandum: [u8; 32], pub inner_circuit_id: <C::InnerCircuitIDCRH as CRH>::Output, }
Fields
network: Network
The network this transaction is included in
ledger_digest: MerkleTreeDigest<C::MerkleParameters>
The root of the ledger commitment Merkle tree
old_serial_numbers: Vec<<C::AccountSignature as SignatureScheme>::PublicKey>
The serial numbers of the records being spend
new_commitments: Vec<<C::RecordCommitment as CommitmentScheme>::Output>
The commitment of the new records
program_commitment: <C::ProgramVerificationKeyCommitment as CommitmentScheme>::Output
The commitment to the old record death and new record birth programs
local_data_root: <C::LocalDataCRH as CRH>::Output
The root of the local data merkle tree
value_balance: AleoAmount
A transaction value balance is the difference between input and output record balances. This value effectively becomes the transaction fee for the miner. Only coinbase transactions can have a negative value balance representing tokens being minted.
signatures: Vec<<C::AccountSignature as SignatureScheme>::Signature>
Randomized signatures that allow for authorized delegation of transaction generation
encrypted_records: Vec<EncryptedRecord<C>>
Encrypted record and selector bits of the new records generated by the transaction
transaction_proof: <C::OuterSNARK as SNARK>::Proof
Zero-knowledge proof attesting to the valididty of the transaction
memorandum: [u8; 32]
Public data associated with the transaction that must be unique among all transactions
inner_circuit_id: <C::InnerCircuitIDCRH as CRH>::Output
The ID of the inner SNARK being used
Implementations
pub fn new(
old_serial_numbers: Vec<<Self as TransactionScheme>::SerialNumber>,
new_commitments: Vec<<Self as TransactionScheme>::Commitment>,
memorandum: <Self as TransactionScheme>::Memorandum,
ledger_digest: MerkleTreeDigest<C::MerkleParameters>,
inner_circuit_id: <C::InnerCircuitIDCRH as CRH>::Output,
transaction_proof: <C::OuterSNARK as SNARK>::Proof,
program_commitment: <C::ProgramVerificationKeyCommitment as CommitmentScheme>::Output,
local_data_root: <C::LocalDataCRH as CRH>::Output,
value_balance: AleoAmount,
network: Network,
signatures: Vec<<C::AccountSignature as SignatureScheme>::Signature>,
encrypted_records: Vec<EncryptedRecord<C>>
) -> Self
Trait Implementations
impl<C: Testnet1Components> PartialEq<Transaction<C>> for Transaction<C> where
C: Testnet1Components,
impl<C: Testnet1Components> PartialEq<Transaction<C>> for Transaction<C> where
C: Testnet1Components,
Transaction id = Hash of (serial numbers || commitments || memo)
type Commitment = <C::RecordCommitment as CommitmentScheme>::Output
type Digest = MerkleTreeDigest<C::MerkleParameters>
type EncryptedRecord = EncryptedRecord<C>
type InnerCircuitID = <C::InnerCircuitIDCRH as CRH>::Output
type LocalDataRoot = <C::LocalDataCRH as CRH>::Output
type Memorandum = [u8; 32]
type ProgramCommitment = <C::ProgramVerificationKeyCommitment as CommitmentScheme>::Output
type SerialNumber = <C::AccountSignature as SignatureScheme>::PublicKey
type Signature = <C::AccountSignature as SignatureScheme>::Signature
type ValueBalance = AleoAmount
Returns the network_id in the transaction.
Returns the ledger digest.
Returns the inner circuit ID.
Returns the old serial numbers.
Returns the new commitments.
Returns the memorandum.
Returns the program commitment in the transaction.
Returns the local data root in the transaction.
Returns the value balance in the transaction.
Returns the signatures.
Returns the encrypted records
Auto Trait Implementations
impl<C> RefUnwindSafe for Transaction<C> where
<<<C as Testnet1Components>::MerkleParameters as MerkleParameters>::H as CRH>::Output: RefUnwindSafe,
<<C as DPCComponents>::InnerCircuitIDCRH as CRH>::Output: RefUnwindSafe,
<<C as DPCComponents>::LocalDataCRH as CRH>::Output: RefUnwindSafe,
<<C as DPCComponents>::ProgramVerificationKeyCommitment as CommitmentScheme>::Output: RefUnwindSafe,
<<C as DPCComponents>::RecordCommitment as CommitmentScheme>::Output: RefUnwindSafe,
<<C as Testnet1Components>::OuterSNARK as SNARK>::Proof: RefUnwindSafe,
<<C as DPCComponents>::AccountSignature as SignatureScheme>::PublicKey: RefUnwindSafe,
<<C as DPCComponents>::AccountSignature as SignatureScheme>::Signature: RefUnwindSafe,
<<C as DPCComponents>::AccountEncryption as EncryptionScheme>::Text: RefUnwindSafe,
impl<C> Send for Transaction<C> where
<<C as Testnet1Components>::OuterSNARK as SNARK>::Proof: Send,
<<C as DPCComponents>::AccountEncryption as EncryptionScheme>::Text: Send,
impl<C> Sync for Transaction<C> where
<<C as Testnet1Components>::OuterSNARK as SNARK>::Proof: Sync,
<<C as DPCComponents>::AccountEncryption as EncryptionScheme>::Text: Sync,
impl<C> Unpin for Transaction<C> where
<<<C as Testnet1Components>::MerkleParameters as MerkleParameters>::H as CRH>::Output: Unpin,
<<C as DPCComponents>::InnerCircuitIDCRH as CRH>::Output: Unpin,
<<C as DPCComponents>::LocalDataCRH as CRH>::Output: Unpin,
<<C as DPCComponents>::ProgramVerificationKeyCommitment as CommitmentScheme>::Output: Unpin,
<<C as DPCComponents>::RecordCommitment as CommitmentScheme>::Output: Unpin,
<<C as Testnet1Components>::OuterSNARK as SNARK>::Proof: Unpin,
<<C as DPCComponents>::AccountSignature as SignatureScheme>::PublicKey: Unpin,
<<C as DPCComponents>::AccountSignature as SignatureScheme>::Signature: Unpin,
<<C as DPCComponents>::AccountEncryption as EncryptionScheme>::Text: Unpin,
impl<C> UnwindSafe for Transaction<C> where
<<<C as Testnet1Components>::MerkleParameters as MerkleParameters>::H as CRH>::Output: UnwindSafe,
<<C as DPCComponents>::InnerCircuitIDCRH as CRH>::Output: UnwindSafe,
<<C as DPCComponents>::LocalDataCRH as CRH>::Output: UnwindSafe,
<<C as DPCComponents>::ProgramVerificationKeyCommitment as CommitmentScheme>::Output: UnwindSafe,
<<C as DPCComponents>::RecordCommitment as CommitmentScheme>::Output: UnwindSafe,
<<C as Testnet1Components>::OuterSNARK as SNARK>::Proof: UnwindSafe,
<<C as DPCComponents>::AccountSignature as SignatureScheme>::PublicKey: UnwindSafe,
<<C as DPCComponents>::AccountSignature as SignatureScheme>::Signature: UnwindSafe,
<<C as DPCComponents>::AccountEncryption as EncryptionScheme>::Text: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
fn fmt_binary(self) -> FmtBinary<Self> where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self> where
Self: Binary,
Causes self
to use its Binary
implementation when Debug
-formatted.
fn fmt_display(self) -> FmtDisplay<Self> where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self> where
Self: Display,
Causes self
to use its Display
implementation when
Debug
-formatted. Read more
fn fmt_lower_exp(self) -> FmtLowerExp<Self> where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self> where
Self: LowerExp,
Causes self
to use its LowerExp
implementation when
Debug
-formatted. Read more
fn fmt_lower_hex(self) -> FmtLowerHex<Self> where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self> where
Self: LowerHex,
Causes self
to use its LowerHex
implementation when
Debug
-formatted. Read more
Causes self
to use its Octal
implementation when Debug
-formatted.
fn fmt_pointer(self) -> FmtPointer<Self> where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self> where
Self: Pointer,
Causes self
to use its Pointer
implementation when
Debug
-formatted. Read more
fn fmt_upper_exp(self) -> FmtUpperExp<Self> where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self> where
Self: UpperExp,
Causes self
to use its UpperExp
implementation when
Debug
-formatted. Read more
fn fmt_upper_hex(self) -> FmtUpperHex<Self> where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self> where
Self: UpperHex,
Causes self
to use its UpperHex
implementation when
Debug
-formatted. Read more
impl<T> Pipe for T where
T: ?Sized,
impl<T> Pipe for T where
T: ?Sized,
Pipes by value. This is generally the method you want to use. Read more
Borrows self
and passes that borrow into the pipe function. Read more
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R where
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R where
R: 'a,
Mutably borrows self
and passes that borrow into the pipe function. Read more
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R where
Self: Borrow<B>,
R: 'a,
B: 'a + ?Sized,
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R where
Self: Borrow<B>,
R: 'a,
B: 'a + ?Sized,
Borrows self
, then passes self.borrow()
into the pipe function. Read more
fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R where
Self: BorrowMut<B>,
R: 'a,
B: 'a + ?Sized,
fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R where
Self: BorrowMut<B>,
R: 'a,
B: 'a + ?Sized,
Mutably borrows self
, then passes self.borrow_mut()
into the pipe
function. Read more
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R where
Self: AsRef<U>,
R: 'a,
U: 'a + ?Sized,
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R where
Self: AsRef<U>,
R: 'a,
U: 'a + ?Sized,
Borrows self
, then passes self.as_ref()
into the pipe function.
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R where
Self: AsMut<U>,
R: 'a,
U: 'a + ?Sized,
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R where
Self: AsMut<U>,
R: 'a,
U: 'a + ?Sized,
Mutably borrows self
, then passes self.as_mut()
into the pipe
function. Read more
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Deref<Target = T>,
R: 'a,
T: 'a + ?Sized,
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Deref<Target = T>,
R: 'a,
T: 'a + ?Sized,
Borrows self
, then passes self.deref()
into the pipe function.
type Output = T
type Output = T
Should always be Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
Immutable access to the Borrow<B>
of a value. Read more
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
Mutable access to the BorrowMut<B>
of a value. Read more
Immutable access to the AsRef<R>
view of a value. Read more
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
Mutable access to the AsMut<R>
view of a value. Read more
Immutable access to the Deref::Target
of a value. Read more
Mutable access to the Deref::Target
of a value. Read more
Calls .tap()
only in debug builds, and is erased in release builds.
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls .tap_mut()
only in debug builds, and is erased in release
builds. Read more
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
Calls .tap_borrow()
only in debug builds, and is erased in release
builds. Read more
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
Calls .tap_borrow_mut()
only in debug builds, and is erased in release
builds. Read more
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized,
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized,
Calls .tap_ref()
only in debug builds, and is erased in release
builds. Read more
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
Calls .tap_ref_mut()
only in debug builds, and is erased in release
builds. Read more
pub fn vzip(self) -> V