Output List Initialization

From Open Transactions
Revision as of 14:27, 22 October 2014 by Justusranvier (talk | contribs) (Created page with "<div style="float: right"><include iframe src="https://www.lucidchart.com/documents/embeddedchart/56b10d7d-bbd4-4590-8200-c837c5ad953c" width="450" height="800" frameborder="0...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Initial Conditions

The startwithdrawal API call has been received by the wallet, and all the arguments have been checked for errors.


  1. Pass the inputstart, inputstop, and dustthreshold parameters to the input selection algorithm to obtain an ordered list of eligible inputs.
  2. Perform a first pass check to determine if the requested outputs exceed the size of the eligible inputs. Note that this check is only definitive in the case where the output sum is greater than the input sum. At this stage of the algorithm, the input sum exceeding the output sum does not prove that all outputs will be successfully created.
    1. Take the sum of both lists.
    2. If the sum of the outputs exceeds the sum of the inputs, remove outputs in descending size order until this is no longer true. Note this may result in the output list being an empty set.
      1. Removed outputs are given a status of "partial-" at this stage. This status will be updated at the end of the procedure to include the series number which must be made hot to satisfy the outBailment.
  3. If the output list is non-empty, sort it by SHA256(server id, transaction number) where the server id and transaction number come from the outBailmentID.
    1. Express the server id and transaction number as strings, and concatenate them prior to hashing
  4. Move both the input lists and outputs lists into separate stacks by pushing them in reverse list order. The first input and first output should be on the top of their respective stacks.