[][src]Struct grin_core::core::transaction::Transaction

pub struct Transaction {
    pub offset: BlindingFactor,
    // some fields omitted
}

A transaction

Fields

The kernel "offset" k2 excess is k1G after splitting the key k = k1 + k2

Methods

impl Transaction
[src]

Creates a new empty transaction (no inputs or outputs, zero fee).

Creates a new transaction initialized with the provided inputs, outputs, kernels

Creates a new transaction using this transaction as a template and with the specified offset.

Builds a new transaction with the provided inputs added. Existing inputs, if any, are kept intact. Sort order is maintained.

Builds a new transaction with the provided output added. Existing outputs, if any, are kept intact. Sort order is maintained.

Builds a new transaction with the provided output added. Existing outputs, if any, are kept intact. Sort order is maintained.

Get inputs

Get inputs mutable

Get outputs

Get outputs mutable

Get kernels

Get kernels mut

Total fee for a transaction is the sum of fees of all kernels.

Total overage across all kernels.

Lock height of a transaction is the max lock height of the kernels.

"Lightweight" validation that we can perform quickly during read/deserialization. Subset of full validation that skips expensive verification steps, specifically -

  • rangeproof verification (on the body)
  • kernel signature verification (on the body)
  • kernel sum verification

Validates all relevant parts of a fully built transaction. Checks the excess value against the signature as well as range proofs for each output.

Calculate transaction weight

Calculate transaction weight as a block

Calculate transaction weight from transaction details

Trait Implementations

impl Committed for Transaction
[src]

Gather the kernel excesses and sum them.

Gathers commitments and sum them.

Verify the sum of the kernel excesses equals the sum of the outputs, taking into account both the kernel_offset and overage. Read more

impl Writeable for Transaction
[src]

Implementation of Writeable for a fully blinded transaction, defines how to write the transaction as binary.

impl Readable for Transaction
[src]

Implementation of Readable for a transaction, defines how to read a full transaction from a binary stream.

impl PartialEq<Transaction> for Transaction
[src]

PartialEq

This method tests for !=.

impl Clone for Transaction
[src]

Performs copy-assignment from source. Read more

impl Into<TransactionBody> for Transaction
[src]

impl Default for Transaction
[src]

impl Debug for Transaction
[src]

impl Serialize for Transaction
[src]

impl<'de> Deserialize<'de> for Transaction
[src]

Auto Trait Implementations

impl Send for Transaction

impl Sync for Transaction

Blanket Implementations

impl<W> Hashed for W where
    W: Writeable
[src]

impl<H> ShortIdentifiable for H where
    H: Hashed
[src]

Generate a short_id via the following -

  • extract k0/k1 from block_hash hashed with the nonce (first two u64 values) * initialize a siphasher24 with k0/k1
    • self.hash() passing in the siphasher24 instance
    • drop the 2 most significant bytes (to return a 6 byte short_id)

impl<T> PMMRIndexHashable for T where
    T: Writeable
[src]

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> DebugAny for T where
    T: Any + Debug

impl<T> CloneAny for T where
    T: Clone + Any

impl<T> UnsafeAny for T where
    T: Any

impl<T> Erased for T

impl<T> Same for T

Should always be Self