Skip to content

Transaction Generator

Denis Shevchenko edited this page Sep 10, 2019 · 14 revisions

Generating a transaction is selecting inputs (UTxO), outputs, and amounts to transfer. (+ digitally signed)

The input selection is only valid on the set of unspent transaction outputs (UTxO). The transaction will create new UTxO that can be reused in future transactions. Some amount will be spent for the transaction costs and will reduce the available coins in the UTxO. (can we control tx costs? or set to zero?)

Prepare addresses

We receive (at least) 3 signing keys from CLI argument --sig-key. These keys will be used to create 3 addresses:

  1. genesisAddress - an address we send an initial (genesis) funds to. This is the very first transaction.
  2. sourceAddress - an address we use as a source for all further transactions.
  3. recepientAddress - an address we use as a recipient for all further transactions.

Genesis generation

Genesis UTxO is generated from genesis signing key, in extractGenesisFunds function. Currently it's 1.4 billion ADA. Then we prepare initial funds using prepareInitialFunds function: we perform the very first transaction to move all initial funds from genesisAddress to sourceAddress.

Creating additional UTxO entries

Since sourceAddress (after initial transaction) contains all genesis funds, we have one single UTxO entry with 1.4 billion ADA. Now we have to split this amount to required number of UTxO entries, i.e.:

1 UTxO entry (sourceAddress and amount X) -> N UTxO entries (sourceAddress and amount X/N).

So we perform N splitting transactions in createMoreFundCoins function.

input selection

describe input selection

transaction generation

describe transaction logic to create new UTxO

TPS control

describe how the TPS is controlled to a set level

configuration

describe configuration parameters

Clone this wiki locally