Elixium Core v0.2.9 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

Link to this section Functions

Link to this function calculate_fee(transaction) View Source
calculate_fee(Elixium.Transaction) :: Decimal
Link to this function calculate_hash(transaction) View Source
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.

Link to this function calculate_outputs(transaction) View Source
calculate_outputs(Elixium.Transaction) :: %{outputs: list(), fee: Decimal}
Link to this function generate_coinbase(amount, miner_address) View Source
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

Link to this function sum_inputs(inputs) View Source
sum_inputs(list()) :: Decimal