Elixium Core v0.3.15 Elixium.Transaction View Source
Contains all the functions that pertain to creating valid transactions
Link to this section Summary
Functions
Each transaction consists of multiple inputs and outputs. Inputs to any particular transaction are just outputs from other transactions. This is called the UTXO model. In order to efficiently represent the UTXOs within the transaction, we can calculate the merkle root of the inputs of the transaction
In order for a block to be considered valid, it must have a coinbase as the FIRST transaction in the block. This coinbase has a single output, designated to the address of the miner, and the output amount is the block reward plus any transaction fees from within the transaction
Takes in a transaction received from a peer which may have malicious or extra attributes attached. Removes all extra parameters which are not defined explicitly by the transaction struct
Returns the data that a signer of the transaction needs to sign
Link to this section Functions
calculate_fee(Elixium.Transaction) :: Decimal
calculate_hash(Elixium.Transaction) :: String.t()
Each transaction consists of multiple inputs and outputs. Inputs to any particular transaction are just outputs from other transactions. This is called the UTXO model. In order to efficiently represent the UTXOs within the transaction, we can calculate the merkle root of the inputs of the transaction.
calculate_outputs(Elixium.Transaction, Map) :: %{outputs: list(), fee: Decimal}
generate_coinbase(Decimal, String.t()) :: Elixium.Transaction
In order for a block to be considered valid, it must have a coinbase as the FIRST transaction in the block. This coinbase has a single output, designated to the address of the miner, and the output amount is the block reward plus any transaction fees from within the transaction
sanitize(Elixium.Transaction) :: Elixium.Transaction
Takes in a transaction received from a peer which may have malicious or extra attributes attached. Removes all extra parameters which are not defined explicitly by the transaction struct.
signing_digest(Elixium.Transaction) :: binary()
Returns the data that a signer of the transaction needs to sign