Elixium Core v0.6.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
Takes in a list of maps that match %{addr: addr, amount: amount} and creates a valid transaction
Creates a signature list based on unique addresses in the inputs. One signature is needed for each address
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
Take the correct amount of Utxo’s to send the alloted amount in a transaction
Link to this section Functions
calculate_fee(Elixium.Transaction) :: integer()
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.
Takes in a list of maps that match %{addr: addr, amount: amount} and creates a valid transaction.
create_sig_list(List, Map) :: List
Creates a signature list based on unique addresses in the inputs. One signature is needed for each address.
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
take_necessary_utxos(List, integer()) :: List | :not_enough_balance
Take the correct amount of Utxo’s to send the alloted amount in a transaction.
take_necessary_utxos(List, List, integer()) :: List | :not_enough_balance