Elixium Core v0.1.3 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
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) :: %{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