<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://opentransactions.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Larshesel</id>
	<title>Open Transactions - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://opentransactions.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Larshesel"/>
	<link rel="alternate" type="text/html" href="http://opentransactions.org/wiki/Special:Contributions/Larshesel"/>
	<updated>2026-05-19T09:14:52Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.32.2</generator>
	<entry>
		<id>http://opentransactions.org/wiki/index.php?title=Talk:Keyset_(voting_pools)&amp;diff=3112</id>
		<title>Talk:Keyset (voting pools)</title>
		<link rel="alternate" type="text/html" href="http://opentransactions.org/wiki/index.php?title=Talk:Keyset_(voting_pools)&amp;diff=3112"/>
		<updated>2014-11-06T09:15:29Z</updated>

		<summary type="html">&lt;p&gt;Larshesel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I understand what an xpub is (an extended public key) but it might not be clear for the first time reader, maybe we should write that. Do we have a good reference on extended keys? I guess this might be the best: https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#Extended_keys&lt;br /&gt;
&lt;br /&gt;
[[User:Larshesel|Larshesel]] ([[User talk:Larshesel|talk]]) 08:36, 6 November 2014 (UTC):&lt;br /&gt;
&lt;br /&gt;
I might just fail to remember. Does the auditors make the decision that a series should become active? Is the wallet supposed to know if a series is active or not? Since I don't see a way that the wallet is explicitly told, I assume the wallet is not to know this. That assumption is also reinforced by the fact that getdepositscript tells the wallet from which series it should create an address.&lt;br /&gt;
&lt;br /&gt;
On the other hand, currently we have some assumptions in the code that we know which series is the active one (for instance, we're saving a bit saying if the series is active or not) and are starting to build further on this assumption, so it would be good to get clarified what the initial design idea was.&lt;br /&gt;
&lt;br /&gt;
I can't tell right now if there are things in the wallet that actually *need* to know if a series is active or not. But if it did, it could enforce certain things, like not allowing getdepositscript to create deposit addresses for an inactive series, or eliminating the series id from the getdepositscript call entirely.&lt;br /&gt;
&lt;br /&gt;
Update: [[User:Larshesel|Larshesel]] ([[User talk:Larshesel|talk]]) 09:15, 6 November 2014 (UTC):&lt;br /&gt;
&lt;br /&gt;
Never mind - this is clearly spelled out elsewhere. The charter output defines the active series, and we can check if a series is active by looking for the charteroutput at the specified address. In that way we can provide relevant error messages etc.&lt;/div&gt;</summary>
		<author><name>Larshesel</name></author>
		
	</entry>
	<entry>
		<id>http://opentransactions.org/wiki/index.php?title=Talk:Keyset_(voting_pools)&amp;diff=3111</id>
		<title>Talk:Keyset (voting pools)</title>
		<link rel="alternate" type="text/html" href="http://opentransactions.org/wiki/index.php?title=Talk:Keyset_(voting_pools)&amp;diff=3111"/>
		<updated>2014-11-06T08:36:02Z</updated>

		<summary type="html">&lt;p&gt;Larshesel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I understand what an xpub is (an extended public key) but it might not be clear for the first time reader, maybe we should write that. Do we have a good reference on extended keys? I guess this might be the best: https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#Extended_keys&lt;br /&gt;
&lt;br /&gt;
[[User:Larshesel|Larshesel]] ([[User talk:Larshesel|talk]]) 08:36, 6 November 2014 (UTC):&lt;br /&gt;
&lt;br /&gt;
I might just fail to remember. Does the auditors make the decision that a series should become active? Is the wallet supposed to know if a series is active or not? Since I don't see a way that the wallet is explicitly told, I assume the wallet is not to know this. That assumption is also reinforced by the fact that getdepositscript tells the wallet from which series it should create an address.&lt;br /&gt;
&lt;br /&gt;
On the other hand, currently we have some assumptions in the code that we know which series is the active one (for instance, we're saving a bit saying if the series is active or not) and are starting to build further on this assumption, so it would be good to get clarified what the initial design idea was.&lt;br /&gt;
&lt;br /&gt;
I can't tell right now if there are things in the wallet that actually *need* to know if a series is active or not. But if it did, it could enforce certain things, like not allowing getdepositscript to create deposit addresses for an inactive series, or eliminating the series id from the getdepositscript call entirely.&lt;/div&gt;</summary>
		<author><name>Larshesel</name></author>
		
	</entry>
	<entry>
		<id>http://opentransactions.org/wiki/index.php?title=Talk:Asset_contract_(voting_pools)&amp;diff=3079</id>
		<title>Talk:Asset contract (voting pools)</title>
		<link rel="alternate" type="text/html" href="http://opentransactions.org/wiki/index.php?title=Talk:Asset_contract_(voting_pools)&amp;diff=3079"/>
		<updated>2014-10-16T08:01:51Z</updated>

		<summary type="html">&lt;p&gt;Larshesel: Questions about the charter output&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[User:Larshesel|Larshesel]] ([[User talk:Larshesel|talk]]) 08:01, 16 October 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
From this page: &lt;br /&gt;
&lt;br /&gt;
    Additionally, the charter output must be located in the first change output for the current series. &lt;br /&gt;
&lt;br /&gt;
From http://opentransactions.org/wiki/index.php/Startwithdrawal:&lt;br /&gt;
&lt;br /&gt;
    The charter output for the pool is not located at the 0th change address for the given series, or the next series.&lt;br /&gt;
&lt;br /&gt;
That seems to be contradictory. Where is the charter output located?&lt;br /&gt;
&lt;br /&gt;
Further - what is the charter output life-cycle? In which series is it living?&lt;/div&gt;</summary>
		<author><name>Larshesel</name></author>
		
	</entry>
	<entry>
		<id>http://opentransactions.org/wiki/index.php?title=Transaction_Construction_Algorithm_(voting_pools)&amp;diff=3039</id>
		<title>Transaction Construction Algorithm (voting pools)</title>
		<link rel="alternate" type="text/html" href="http://opentransactions.org/wiki/index.php?title=Transaction_Construction_Algorithm_(voting_pools)&amp;diff=3039"/>
		<updated>2014-10-03T09:38:13Z</updated>

		<summary type="html">&lt;p&gt;Larshesel: Fix typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
In order to avoid an expensive and error-prone consensus process, it is mandatory for wallets to be able to construct withdrawal transactions in a deterministic manner, assuming they are given the withdrawal requests in a deterministic order. Once this is accomplished, then it only becomes necessary for wallets to share signatures among themselves because they know they all signed the exact same bitcoin transaction.&lt;br /&gt;
&lt;br /&gt;
==Procedure==&lt;br /&gt;
&lt;br /&gt;
===Overview===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right&amp;quot;&amp;gt;&amp;lt;include iframe src=&amp;quot;https://www.lucidchart.com/documents/embeddedchart/eb960c32-71d4-4cfc-8f49-63a82b343608/0&amp;quot; width=&amp;quot;300&amp;quot; height=&amp;quot;1004&amp;quot; frameborder=&amp;quot;0&amp;quot; scrolling=&amp;quot;yes&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
The [[startwithdrawal]] API call has been received by the wallet, and all the arguments have been checked for errors.&lt;br /&gt;
&lt;br /&gt;
====Sequence====&lt;br /&gt;
&lt;br /&gt;
The basic flow of the procedure is:&lt;br /&gt;
&lt;br /&gt;
# Gather accounting information from the API call arguments&lt;br /&gt;
# Validate and sort the output list&lt;br /&gt;
# Start a new transactions&lt;br /&gt;
# Add outputs to the transaction until either all outputs are added or all inputs are used.&lt;br /&gt;
# Make sure all generated transactions are ready for signing.&lt;br /&gt;
# Create a list of all signatures which the wallet is capable of generating.&lt;br /&gt;
# Create a status list containing the deposition of every output the caller specified.&lt;br /&gt;
# Return the status list and signature list to the caller.&lt;br /&gt;
&lt;br /&gt;
Each step in this chart is more fully described below.&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Preparation===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right&amp;quot;&amp;gt;&amp;lt;include iframe src=&amp;quot;https://www.lucidchart.com/documents/embeddedchart/0dd5f7d6-8511-4440-a535-32ad8508d146&amp;quot; width=&amp;quot;150&amp;quot; height=&amp;quot;502&amp;quot; frameborder=&amp;quot;0&amp;quot; scrolling=&amp;quot;yes&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
The [[startwithdrawal]] API call has been received by the wallet, and all the arguments have been checked for errors.&lt;br /&gt;
&lt;br /&gt;
====Sequence====&lt;br /&gt;
&lt;br /&gt;
# The algorithm must keep track of the next change address to be used. The initial value is supplied as the &amp;lt;code&amp;gt;[[Startwithdrawal#Arguments|changestart]]&amp;lt;/code&amp;gt; argument. Any time a change output is allocated, the index value of the [[address identifier]] is incremented, and if a change output is remove from a transaction the index value is decremented. The final value will be returned to the caller as the &amp;lt;code&amp;gt;[[Withdrawal status|nextchangestart]]&amp;lt;/code&amp;gt; value in the [[Withdrawal status| withdrawal status list]].&lt;br /&gt;
# Prepare an empty list for holding transactions as they are constructed and before they are signed.&lt;br /&gt;
# Prepare an empty array to hold the transaction signatures which will be returned to the caller as the &amp;lt;code&amp;gt;[[siglist| signatures]]&amp;lt;/code&amp;gt; value.&lt;br /&gt;
# Prepare an &amp;lt;code&amp;gt;withdrawal status&amp;lt;/code&amp;gt; object.&lt;br /&gt;
## &amp;lt;code&amp;gt;roundID&amp;lt;/code&amp;gt;: copied from &amp;lt;code&amp;gt;roundID&amp;lt;/code&amp;gt; argument&lt;br /&gt;
## &amp;lt;code&amp;gt;nextinputstart&amp;lt;/code&amp;gt;: nil&lt;br /&gt;
## &amp;lt;code&amp;gt;nextchangestart&amp;lt;/code&amp;gt;: nil&lt;br /&gt;
## &amp;lt;code&amp;gt;fees&amp;lt;/code&amp;gt;: 0&lt;br /&gt;
## &amp;lt;code&amp;gt;outputs&amp;lt;/code&amp;gt;: should contain an entry for every output passed:&lt;br /&gt;
### &amp;lt;code&amp;gt;outBailmentID&amp;lt;/code&amp;gt;: copied from &amp;lt;code&amp;gt;outBailmentID&amp;lt;/code&amp;gt; entry in &amp;lt;code&amp;gt;outputs&amp;lt;/code&amp;gt; argument&lt;br /&gt;
### &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt;: empty string&lt;br /&gt;
### &amp;lt;code&amp;gt;transactions&amp;lt;/code&amp;gt;: nil&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Output List Initialization===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right&amp;quot;&amp;gt;&amp;lt;include iframe src=&amp;quot;https://www.lucidchart.com/documents/embeddedchart/56b10d7d-bbd4-4590-8200-c837c5ad953c&amp;quot; width=&amp;quot;450&amp;quot; height=&amp;quot;800&amp;quot; frameborder=&amp;quot;0&amp;quot; scrolling=&amp;quot;yes&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
The [[startwithdrawal]] API call has been received by the wallet, and all the arguments have been checked for errors.&lt;br /&gt;
&lt;br /&gt;
====Sequence====&lt;br /&gt;
&lt;br /&gt;
# Pass the &amp;lt;code&amp;gt;inputstart&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;inputstop&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;dustthreshold&amp;lt;/code&amp;gt; parameters to the [[Input Selection Algorithm (voting pools)|input selection algorithm]] to obtain an ordered list of eligible inputs.&lt;br /&gt;
# 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.&lt;br /&gt;
## Take the sum of both lists.&lt;br /&gt;
## 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.&lt;br /&gt;
# If the output list is non-empty, sort it by &amp;lt;code&amp;gt;outBailmentID&amp;lt;/code&amp;gt;&lt;br /&gt;
# 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.&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Initialize New Transaction===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right&amp;quot;&amp;gt;&amp;lt;include iframe src=&amp;quot;https://www.lucidchart.com/documents/embeddedchart/506ed019-070c-44d6-b5e4-994169ab0704&amp;quot; width=&amp;quot;150&amp;quot; height=&amp;quot;450&amp;quot; frameborder=&amp;quot;0&amp;quot; scrolling=&amp;quot;yes&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
* There are no pending transactions in the process of being constructed, either because this is the first transaction of the algorithm or because a previous pending transaction has been moved to the finished transaction list.&lt;br /&gt;
&lt;br /&gt;
====Sequence====&lt;br /&gt;
&lt;br /&gt;
# Create a minimal transaction skeleton with a header and one change output.&lt;br /&gt;
## The change output will be the last output of the transaction, but the number of other outputs in this transaction is not yet known.&lt;br /&gt;
## The change output must be included in the skeleton for transaction size calculations.&lt;br /&gt;
## The position index for the change output is nil.&lt;br /&gt;
## The first non-change output for the transaction will be placed at position index 0.&lt;br /&gt;
&lt;br /&gt;
After creating the transaction skeleton, and after any action which alters it, the new transaction size (bytes) and minimum required transaction fee must be recalculated.&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Add Next Output===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right&amp;quot;&amp;gt;&amp;lt;include iframe src=&amp;quot;https://www.lucidchart.com/documents/embeddedchart/3e9b2758-338e-40f7-8fe2-e036fda68157&amp;quot; width=&amp;quot;600&amp;quot; height=&amp;quot;800&amp;quot; frameborder=&amp;quot;0&amp;quot; scrolling=&amp;quot;yes&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
The output stack contains at least one output.&lt;br /&gt;
&lt;br /&gt;
There is a transaction in progress which is ready to accept new outputs. This transaction is either empty or it contains 1 or more outputs.&lt;br /&gt;
&lt;br /&gt;
If the transaction already contains outputs, then it also contains sufficient inputs to cover those outputs and any required transaction fees without exceeding size limits. This is because it must have already successfully passed through this procedure before.&lt;br /&gt;
&lt;br /&gt;
====Sequence====&lt;br /&gt;
&lt;br /&gt;
# Locate the entry for this output in the [[Withdrawal status|withdrawal status]] object by finding the corresponding outBailmentID.&lt;br /&gt;
# Validate the output address.&lt;br /&gt;
## If it is invalid, update &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt; entry for this output to &amp;quot;invalid&amp;quot; and exit from this procedure.&lt;br /&gt;
## If it is valid, add it to the transaction.&lt;br /&gt;
### Add a new entry to the &amp;lt;code&amp;gt;transaction&amp;lt;/code&amp;gt; array for this output:&lt;br /&gt;
###* &amp;lt;code&amp;gt;ntxid&amp;lt;/code&amp;gt;: nil&lt;br /&gt;
###* &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;: next unused&lt;br /&gt;
###* &amp;lt;code&amp;gt;amount&amp;lt;/code&amp;gt;: copied from [[Outputs (Voting Pool Wallet API)|outputs]] list.&lt;br /&gt;
# Check that the transaction does not exceed size limits. If it does, follow the [[Transaction Construction Algorithm (voting pools)#Oversize Transaction|Oversize Transaction]] procedure.&lt;br /&gt;
# Compare the sum of the inputs to the sum of the outputs and required transaction fee to determine if more inputs are required.&lt;br /&gt;
## If no more inputs are required, then update the &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt; for this output to &amp;quot;success&amp;quot;.&lt;br /&gt;
# If more inputs are required, then check to see if any more are available.&lt;br /&gt;
## According to the initial conditions, the input stack can not be empty on the first run through this loop.&lt;br /&gt;
## If the input stack is empty at this point, then the output has added at least one input beyond what was needed to satisfy the prior output (if there was a prior output)&lt;br /&gt;
## If the input stack is empty, then the output can only be partially fulfilled. Follow the [[Transaction Construction Algorithm (voting pools)#Split Output|Split Output]] procedure.&lt;br /&gt;
# Add the next input from the stack, and continue the loop at step 2.&lt;br /&gt;
&lt;br /&gt;
The loop will continue until either:&lt;br /&gt;
&lt;br /&gt;
* The transaction contains sufficient input value to satisfy the output plus transaction fees&lt;br /&gt;
* The transaction exceeds size limits&lt;br /&gt;
* There is not enough input value, but no more inputs are available&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Finalize Transaction===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right&amp;quot;&amp;gt;&amp;lt;include iframe src=&amp;quot;https://www.lucidchart.com/documents/embeddedchart/79c726f4-9d4e-4a3c-bd20-6556099d24ab&amp;quot; width=&amp;quot;300&amp;quot; height=&amp;quot;1004&amp;quot; frameborder=&amp;quot;0&amp;quot; scrolling=&amp;quot;yes&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
* An unfinished transaction is ready for processing.&lt;br /&gt;
** The transaction may or may not have have a useful (non-change) output&lt;br /&gt;
** The transaction is valid&lt;br /&gt;
*** Not too big&lt;br /&gt;
*** Inputs are sufficient to cover outputs and required fees&lt;br /&gt;
** A change output may exist in the transaction&lt;br /&gt;
*** If a change output exists, it has a nil position and a nil value.&lt;br /&gt;
&lt;br /&gt;
====Sequence====&lt;br /&gt;
&lt;br /&gt;
# If the transaction only contains a change output and no inputs, then it may be discarded.&lt;br /&gt;
# The change amount is calculated by: Σ(txin) - ( Σ(txout) + fees )&lt;br /&gt;
## If the change amount is greater than zero:&lt;br /&gt;
### Set the value of the output&lt;br /&gt;
### Set the position of the output to the next unused value after the last non-change output.&lt;br /&gt;
## If the change amount is zero, then the change output is removed from the transaction.&lt;br /&gt;
# Calculate an [[ntxid]] for the transaction for tracking purposes.&lt;br /&gt;
# Loop through every (non-change) output in the transaction and update the [[withdrawal status]] object for the corresponding output.&lt;br /&gt;
## The withdrawal status object contain an entry for every output in the transaction, where each entry has an &amp;lt;code&amp;gt;transactions&amp;lt;/code&amp;gt; object containing a nil &amp;lt;code&amp;gt;ntxid&amp;lt;/code&amp;gt;, an &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt; matching the output position index, and a matching &amp;lt;code&amp;gt;amount&amp;lt;/code&amp;gt;.&lt;br /&gt;
## Update the &amp;lt;code&amp;gt;ntxid&amp;lt;/code&amp;gt; value from nil to the ntxid for the transaction.&lt;br /&gt;
# Add the fees from this transaction to the &amp;lt;code&amp;gt;fees&amp;lt;/code&amp;gt; property of the withdrawal status object.&lt;br /&gt;
# Move the transaction to the finished transaction list.&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Update Signatures===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right&amp;quot;&amp;gt;&amp;lt;include iframe src=&amp;quot;https://www.lucidchart.com/documents/embeddedchart/97025b62-3720-4810-ae85-5ae678031aed&amp;quot; width=&amp;quot;600&amp;quot; height=&amp;quot;1100&amp;quot; frameborder=&amp;quot;0&amp;quot; scrolling=&amp;quot;yes&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
* The finished transaction list contains zero or more finalized transactions &lt;br /&gt;
* The transactions are valid in all respects except for missing signatures&lt;br /&gt;
&lt;br /&gt;
====Sequence====&lt;br /&gt;
&lt;br /&gt;
* If the finished transaction list is empty, the rest of the procedure can be skipped.&lt;br /&gt;
* Loop through each transaction.&lt;br /&gt;
** Within each transaction, loop through every input.&lt;br /&gt;
*** Within each input, loop through every pubkey in the [[redeem script]].&lt;br /&gt;
**** If the wallet possesses the private key corresponding to the pubkey, create the appropriate signature.&lt;br /&gt;
***** Add the signature to the transaction.&lt;br /&gt;
***** Add the signature to the [[siglist|signature list]] in the appropriate position.&lt;br /&gt;
* Move all transactions in the finished transaction list to the pending transaction database, where they will wait for additional signatures from other voting pool members.&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Update Status===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right&amp;quot;&amp;gt;&amp;lt;include iframe src=&amp;quot;https://www.lucidchart.com/documents/embeddedchart/b4dcbb56-3b87-4f56-b249-dfd4276c7cc4&amp;quot; width=&amp;quot;300&amp;quot; height=&amp;quot;800&amp;quot; frameborder=&amp;quot;0&amp;quot; scrolling=&amp;quot;yes&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
* Every outBailmentID in the [[Outputs (Voting Pool Wallet API)|output]] list provided has a non-nil &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt; value in the [[withdrawal status]] object.&lt;br /&gt;
&lt;br /&gt;
====Sequence====&lt;br /&gt;
&lt;br /&gt;
# Update the status for any split outBailments which exist:&lt;br /&gt;
## Split outBailments have more than one item in their &amp;lt;code&amp;gt;transactions&amp;lt;/code&amp;gt; array and have an existing &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt; value of &amp;quot;success&amp;quot;.&lt;br /&gt;
## Change the &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt; for all split outBailments from &amp;quot;success&amp;quot; to &amp;quot;split&amp;quot;.&lt;br /&gt;
# Update the status for any partial outBailments which exist:&lt;br /&gt;
## Partial outBailments have existing &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt; value of &amp;quot;partial-&amp;quot;.&lt;br /&gt;
## Calculate the total missing value needed to satisfy the partial outputs.&lt;br /&gt;
## The missing value of an outBailment is the originally-requested size of the outBailment minus the sum of all outputs created to satisfy it (if any exist).&lt;br /&gt;
### Obtain a list of eligible inputs from the next un-thawed series and calculate their total value.&lt;br /&gt;
### If the eligible value of the next un-thawed series is greater than the total missing value, then the next un-thawed series is the target series.&lt;br /&gt;
#### If not, repeat the above process while keeping a running total of eligible value until a target series is located.&lt;br /&gt;
### Append the number of the target series to the &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt; value for every partial series.&lt;br /&gt;
# Update the &amp;lt;code&amp;gt;nextinputstart&amp;lt;/code&amp;gt; value.&lt;br /&gt;
## If the input stack is empty, &amp;lt;code&amp;gt;nextinputstart&amp;lt;/code&amp;gt; is the first [[address identifier]] for the next un-thawed series.&lt;br /&gt;
## If the input stack is not empty, &amp;lt;code&amp;gt;nextinputstart&amp;lt;/code&amp;gt; is the [[address identifier]] for the next input in the stack.&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Oversize Transaction===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right&amp;quot;&amp;gt;&amp;lt;include iframe src=&amp;quot;https://www.lucidchart.com/documents/embeddedchart/4abd7b4f-1079-48d7-af9d-d892433cd65a&amp;quot; width=&amp;quot;300&amp;quot; height=&amp;quot;400&amp;quot; frameborder=&amp;quot;0&amp;quot; scrolling=&amp;quot;yes&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An oversize transaction may occur while attempting to add inputs to satisfy an output which has been added to a transaction as part of the [[#Add Next Output|Add Next Output]] step.&lt;br /&gt;
&lt;br /&gt;
Even with the worst case of high &amp;lt;code&amp;gt;m&amp;lt;/code&amp;gt; and/or &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; values, inputs will never be large enough that a transaction can be oversized while attempting to add the first input to a transaction.&lt;br /&gt;
&lt;br /&gt;
Oversize transactions will have one change output, at least one non-change output, and many inputs.&lt;br /&gt;
&lt;br /&gt;
If an oversize has two or more non-change outputs, then Add Next Output was successful for the previous output. In this case, the transaction was valid before attempting to add the current output, so the current output should be removed from the current transaction and moved to the next one.&lt;br /&gt;
&lt;br /&gt;
Otherwise, the transaction has become too large while adding its first non-change output. This can happen due to a series of small inputs, or a large output, or a combination of the two. In this case the [[outBailment]] can not be satisfied with a single transaction and must be split across multiple transactions.&lt;br /&gt;
&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
* The Add Next Output procedure has created a transaction that exceeds size limits, in one of the following circumstances:&lt;br /&gt;
** Immediately upon adding an output to the transaction&lt;br /&gt;
*** The transaction contains other outputs which were added successfully. All inputs currently in the transaction are required to satisfy the previous output(s) before the output that failed.&lt;br /&gt;
** After adding the first input to the transaction to satisfy an output&lt;br /&gt;
*** The transaction contains other outputs which were added successfully. All inputs currently in the transaction are required to satisfy the previous output(s) before the output that failed.&lt;br /&gt;
** After having added at least one input to the transaction to satisfy an output without causing an oversize condition.&lt;br /&gt;
*** At least one of the inputs in this transaction are only required to satisfy the current output, not any previous outputs (if any exist).&lt;br /&gt;
&lt;br /&gt;
====Procedure====&lt;br /&gt;
&lt;br /&gt;
# Count the number of non-change outputs in the transaction.&lt;br /&gt;
# If the number exceeds one, follow the [[#Rollback Last Output|Rollback Last Output]] procedure.&lt;br /&gt;
# If the number is one, follow the [[#Split Output|Split Output]] procedure.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Rollback Last Output===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right&amp;quot;&amp;gt;&amp;lt;include iframe src=&amp;quot;https://www.lucidchart.com/documents/embeddedchart/81fbb6f6-b150-4a06-915e-7633b05da9af&amp;quot; width=&amp;quot;300&amp;quot; height=&amp;quot;600&amp;quot; frameborder=&amp;quot;0&amp;quot; scrolling=&amp;quot;yes&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This procedure is used if a transaction has exceeded the size limit, and can be brought back under the limit by removing the most-recently added output and the inputs needed to support it from the transaction &lt;br /&gt;
&lt;br /&gt;
The removed inputs and outputs will be added to the beginning of a new transaction.&lt;br /&gt;
&lt;br /&gt;
This procedure will remove one more input than is required to bring the transaction below size limits, and then add exactly one more. This will always result in a valid transaction because the only way to reach this procedure is by having successfully completed at least one [[#Add Next Output|Add Next Output]] cycle for the current transaction prior to adding an output or input that pushes the transaction over the size limit.&lt;br /&gt;
&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
* An oversize transaction contains one or more outputs and their supporting inputs which do not exceed transaction size limits, and one output which does not.&lt;br /&gt;
* The number of inputs which are solely dedicated to satisfying the most recently-added output (not required for previous outputs) may be zero or more.&lt;br /&gt;
&lt;br /&gt;
====Sequence====&lt;br /&gt;
&lt;br /&gt;
# Remove the most-recently added output from the transaction and return it to the output stack.&lt;br /&gt;
#* This will cause the output to be the first one added to the next transaction.&lt;br /&gt;
# Remove the most-recently added input from the transaction and return it to the input stack.&lt;br /&gt;
# If the sum of input values exceeds the sum of output values by an amount greater than the required transaction fee:&lt;br /&gt;
#* Continue removing inputs one at a time until the sum of the input values falls below the needed output + transaction fee value.&lt;br /&gt;
# Add the next input from the stack to the transaction.&lt;br /&gt;
# Perform the [[#Finalize Transaction|Finalize Transaction]] procedure.&lt;br /&gt;
# [[#Initialize Transaction|Initialize]] a new transaction.&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Split Output===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right&amp;quot;&amp;gt;&amp;lt;include iframe src=&amp;quot;https://www.lucidchart.com/documents/embeddedchart/c72ce59c-65c0-4a90-943a-c669bac5a737&amp;quot; width=&amp;quot;300&amp;quot; height=&amp;quot;1004&amp;quot; frameborder=&amp;quot;0&amp;quot; scrolling=&amp;quot;yes&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This procedure is used when, either due to a large output or small inputs, the inputs required to satisfy a single output can not fit within transaction size limits.&lt;br /&gt;
&lt;br /&gt;
The outBailment will be split across two or more transactions.&lt;br /&gt;
&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
* The transaction being constructed contains one change output, one non-change output, and many inputs.&lt;br /&gt;
* The transaction did not exceed any size limits until the most recent input was added.&lt;br /&gt;
&lt;br /&gt;
====Sequence====&lt;br /&gt;
&lt;br /&gt;
# Remove the change output from the transaction.&lt;br /&gt;
# Decrement the value of the &amp;lt;code&amp;gt;nextchangestart&amp;lt;/code&amp;gt; property of the [[withdrawal status]] object.&lt;br /&gt;
# Determine if the transaction still exceeds size limits.&lt;br /&gt;
## If yes, then remove the most-recently added input.&lt;br /&gt;
# Update the value of the output in the transaction to be the sum of the inputs minus the required transaction fee.&lt;br /&gt;
# Make a copy of the [[Outputs (Voting Pool Wallet API)|outputs]] object corresponding to this outBailmentID.&lt;br /&gt;
# Update the &amp;lt;code&amp;gt;amount&amp;lt;/code&amp;gt; field of the copied output by subtracting the value determined in step 4.&lt;br /&gt;
# Push this new output to the output stack.&lt;br /&gt;
# Update the &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt; field for this outBailmentID in the [[withdrawal status]] object to &amp;quot;partial-&amp;quot;.&lt;br /&gt;
# Perform the [[#Finalize Transaction|Finalize Transaction]] Procedure.&lt;br /&gt;
# [[#Initialize Transaction|Initialize]] a new transaction.&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Insufficient Inputs===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right&amp;quot;&amp;gt;&amp;lt;include iframe src=&amp;quot;https://www.lucidchart.com/documents/embeddedchart/9b471e6e-0a62-408a-ad0e-a5d7c491aa43&amp;quot; width=&amp;quot;150&amp;quot; height=&amp;quot;500&amp;quot; frameborder=&amp;quot;0&amp;quot; scrolling=&amp;quot;yes&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This procedure is followed when the [[#Output List Initialization|Output List Initialization]] step estimated that that the input list was sufficient to fulfill the valid outputs but, due to change and/or transaction fees, one or more outputs can not be fulfilled.&lt;br /&gt;
&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
* [[#Add Next Output|Add Next Output]] has been completed successfully at least once.&lt;br /&gt;
* An empty transaction skeleton has been created.&lt;br /&gt;
* At least one output remains in the stack, but the input stack is empty.&lt;br /&gt;
&lt;br /&gt;
====Sequence====&lt;br /&gt;
&lt;br /&gt;
* Pop all outputs from the output stack and update their &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt; property in the [[withdrawal status]] list to &amp;quot;partial-&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
No further action is necessary. After completing this procedure the algorithm moves on to the [[#Finalize Transaction|Finalize Transaction]] procedure which will discard the empty transaction skeleton which would have otherwise contained the outputs which were processed in this procedure.&lt;br /&gt;
&lt;br /&gt;
[[Category:Voting Pool Technical Specifications]]&lt;/div&gt;</summary>
		<author><name>Larshesel</name></author>
		
	</entry>
	<entry>
		<id>http://opentransactions.org/wiki/index.php?title=Talk:Transaction_Construction_Algorithm_(voting_pools)&amp;diff=3038</id>
		<title>Talk:Transaction Construction Algorithm (voting pools)</title>
		<link rel="alternate" type="text/html" href="http://opentransactions.org/wiki/index.php?title=Talk:Transaction_Construction_Algorithm_(voting_pools)&amp;diff=3038"/>
		<updated>2014-10-03T09:33:04Z</updated>

		<summary type="html">&lt;p&gt;Larshesel: Elaborate ntxid question&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[User:Larshesel|Larshesel]] ([[User talk:Larshesel|talk]]) 14:57, 26 September 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
In the preparation step it is mentioned that we create a withdrawal status object which is referenced throughout the algorithm.&lt;br /&gt;
&lt;br /&gt;
We add the roundID to this object, but it does not seem to be used anywhere. Is it needed at all?&lt;br /&gt;
&lt;br /&gt;
[[User:Justusranvier|Justusranvier]] ([[User talk:Justusranvier|talk]]) 15:41, 26 September 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
It's needed to match up withdrawalstatus objects with siglist objects.&lt;br /&gt;
&lt;br /&gt;
[[User:Larshesel|Larshesel]] ([[User talk:Larshesel|talk]]) 08:58, 29 September 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
In the output list initialization procedure we may return an empty output list if the smallest output is bigger than the sum of the inputs. What should happen if we return an empty output list? The next step (transaction initialization) seems to assume that it is not empty.&lt;br /&gt;
&lt;br /&gt;
As there are no longer any ouputs we cannot make a transaction. I don't seem to find any error code that reflects this situation.&lt;br /&gt;
&lt;br /&gt;
[[User:Justusranvier|Justusranvier]] ([[User talk:Justusranvier|talk]]) 12:49, 29 September 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
Transaction Initialization does not depend on the size of the output list. If the transaction skeleton ends up not being used, then Finalize Transaction will discard it (first step).&lt;br /&gt;
&lt;br /&gt;
Easiest way to see what happens is to just follow the steps with an empty output list and you'll find all the checks that handle it.&lt;br /&gt;
&lt;br /&gt;
[[User:Larshesel|Larshesel]] ([[User talk:Larshesel|talk]]) 08:32, 3 October 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
In the 'Output List Initialization' I don't think it's specified how to keep track of the outputs that are removed if sum(inputs) &amp;lt; sum(outputs). I would assume that we need to mark the output status in the withdrawal status object so the caller can take appropriate action?&lt;br /&gt;
&lt;br /&gt;
[[User:Larshesel|Larshesel]] ([[User talk:Larshesel|talk]]) 09:23, 3 October 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
In the 'Finalize Transaction' we create a ntxid which is used for tracking purposes. What kind of tracking purposes is that? I see it is used later to update the outbailment status to split if the outbailment has more than one ntxid.&lt;br /&gt;
&lt;br /&gt;
What is ntxid an abbreviation for? Does it have other roles?&lt;/div&gt;</summary>
		<author><name>Larshesel</name></author>
		
	</entry>
	<entry>
		<id>http://opentransactions.org/wiki/index.php?title=Transaction_Construction_Algorithm_(voting_pools)&amp;diff=3037</id>
		<title>Transaction Construction Algorithm (voting pools)</title>
		<link rel="alternate" type="text/html" href="http://opentransactions.org/wiki/index.php?title=Transaction_Construction_Algorithm_(voting_pools)&amp;diff=3037"/>
		<updated>2014-10-03T09:24:37Z</updated>

		<summary type="html">&lt;p&gt;Larshesel: fix typing error&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
In order to avoid an expensive and error-prone consensus process, it is mandatory for wallets to be able to construct withdrawal transactions in a deterministic manner, assuming they are given the withdrawal requests in a deterministic order. Once this is accomplished, then it only becomes necessary for wallets to share signatures among themselves because they know they all signed the exact same bitcoin transaction.&lt;br /&gt;
&lt;br /&gt;
==Procedure==&lt;br /&gt;
&lt;br /&gt;
===Overview===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right&amp;quot;&amp;gt;&amp;lt;include iframe src=&amp;quot;https://www.lucidchart.com/documents/embeddedchart/eb960c32-71d4-4cfc-8f49-63a82b343608/0&amp;quot; width=&amp;quot;300&amp;quot; height=&amp;quot;1004&amp;quot; frameborder=&amp;quot;0&amp;quot; scrolling=&amp;quot;yes&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
The [[startwithdrawal]] API call has been received by the wallet, and all the arguments have been checked for errors.&lt;br /&gt;
&lt;br /&gt;
====Sequence====&lt;br /&gt;
&lt;br /&gt;
The basic flow of the procedure is:&lt;br /&gt;
&lt;br /&gt;
# Gather accounting information from the API call arguments&lt;br /&gt;
# Validate and sort the output list&lt;br /&gt;
# Start a new transactions&lt;br /&gt;
# Add outputs to the transaction until either all outputs are added or all inputs are used.&lt;br /&gt;
# Make sure all generated transactions are ready for signing.&lt;br /&gt;
# Create a list of all signatures which the wallet is capable of generating.&lt;br /&gt;
# Create a status list containing the deposition of every output the caller specified.&lt;br /&gt;
# Return the status list and signature list to the caller.&lt;br /&gt;
&lt;br /&gt;
Each step in this chart is more fully described below.&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Preparation===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right&amp;quot;&amp;gt;&amp;lt;include iframe src=&amp;quot;https://www.lucidchart.com/documents/embeddedchart/0dd5f7d6-8511-4440-a535-32ad8508d146&amp;quot; width=&amp;quot;150&amp;quot; height=&amp;quot;502&amp;quot; frameborder=&amp;quot;0&amp;quot; scrolling=&amp;quot;yes&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
The [[startwithdrawal]] API call has been received by the wallet, and all the arguments have been checked for errors.&lt;br /&gt;
&lt;br /&gt;
====Sequence====&lt;br /&gt;
&lt;br /&gt;
# The algorithm must keep track of the next change address to be used. The initial value is supplied as the &amp;lt;code&amp;gt;[[Startwithdrawal#Arguments|changestart]]&amp;lt;/code&amp;gt; argument. Any time a change output is allocated, the index value of the [[address identifier]] is incremented, and if a change output is remove from a transaction the index value is decremented. The final value will be returned to the caller as the &amp;lt;code&amp;gt;[[Withdrawal status|nextchangestart]]&amp;lt;/code&amp;gt; value in the [[Withdrawal status| withdrawal status list]].&lt;br /&gt;
# Prepare an empty list for holding transactions as they are constructed and before they are signed.&lt;br /&gt;
# Prepare an empty array to hold the transaction signatures which will be returned to the caller as the &amp;lt;code&amp;gt;[[siglist| signatures]]&amp;lt;/code&amp;gt; value.&lt;br /&gt;
# Prepare an &amp;lt;code&amp;gt;withdrawal status&amp;lt;/code&amp;gt; object.&lt;br /&gt;
## &amp;lt;code&amp;gt;roundID&amp;lt;/code&amp;gt;: copied from &amp;lt;code&amp;gt;roundID&amp;lt;/code&amp;gt; argument&lt;br /&gt;
## &amp;lt;code&amp;gt;nextinputstart&amp;lt;/code&amp;gt;: nil&lt;br /&gt;
## &amp;lt;code&amp;gt;nextchangestart&amp;lt;/code&amp;gt;: nil&lt;br /&gt;
## &amp;lt;code&amp;gt;fees&amp;lt;/code&amp;gt;: 0&lt;br /&gt;
## &amp;lt;code&amp;gt;outputs&amp;lt;/code&amp;gt;: should contain an entry for every output passed:&lt;br /&gt;
### &amp;lt;code&amp;gt;outBailmentID&amp;lt;/code&amp;gt;: copied from &amp;lt;code&amp;gt;outBailmentID&amp;lt;/code&amp;gt; entry in &amp;lt;code&amp;gt;outputs&amp;lt;/code&amp;gt; argument&lt;br /&gt;
### &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt;: empty string&lt;br /&gt;
### &amp;lt;code&amp;gt;transactions&amp;lt;/code&amp;gt;: nil&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Output List Initialization===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right&amp;quot;&amp;gt;&amp;lt;include iframe src=&amp;quot;https://www.lucidchart.com/documents/embeddedchart/56b10d7d-bbd4-4590-8200-c837c5ad953c&amp;quot; width=&amp;quot;450&amp;quot; height=&amp;quot;800&amp;quot; frameborder=&amp;quot;0&amp;quot; scrolling=&amp;quot;yes&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
The [[startwithdrawal]] API call has been received by the wallet, and all the arguments have been checked for errors.&lt;br /&gt;
&lt;br /&gt;
====Sequence====&lt;br /&gt;
&lt;br /&gt;
# Pass the &amp;lt;code&amp;gt;inputstart&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;inputstop&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;dustthreshold&amp;lt;/code&amp;gt; parameters to the [[Input Selection Algorithm (voting pools)|input selection algorithm]] to obtain an ordered list of eligible inputs.&lt;br /&gt;
# 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.&lt;br /&gt;
## Take the sum of both lists.&lt;br /&gt;
## 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.&lt;br /&gt;
# If the output list is non-empty, sort it by &amp;lt;code&amp;gt;outBailmentID&amp;lt;/code&amp;gt;&lt;br /&gt;
# 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.&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Initialize New Transaction===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right&amp;quot;&amp;gt;&amp;lt;include iframe src=&amp;quot;https://www.lucidchart.com/documents/embeddedchart/506ed019-070c-44d6-b5e4-994169ab0704&amp;quot; width=&amp;quot;150&amp;quot; height=&amp;quot;450&amp;quot; frameborder=&amp;quot;0&amp;quot; scrolling=&amp;quot;yes&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
* There are no pending transactions in the process of being constructed, either because this is the first transaction of the algorithm or because a previous pending transaction has been moved to the finished transaction list.&lt;br /&gt;
&lt;br /&gt;
====Sequence====&lt;br /&gt;
&lt;br /&gt;
# Create a minimal transaction skeleton with a header and one change output.&lt;br /&gt;
## The change output will be the last output of the transaction, but the number of other outputs in this transaction is not yet known.&lt;br /&gt;
## The change output must be included in the skeleton for transaction size calculations.&lt;br /&gt;
## The position index for the change output is nil.&lt;br /&gt;
## The first non-change output for the transaction will be placed at position index 0.&lt;br /&gt;
&lt;br /&gt;
After creating the transaction skeleton, and after any action which alters it, the new transaction size (bytes) and minimum required transaction fee must be recalculated.&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Add Next Output===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right&amp;quot;&amp;gt;&amp;lt;include iframe src=&amp;quot;https://www.lucidchart.com/documents/embeddedchart/3e9b2758-338e-40f7-8fe2-e036fda68157&amp;quot; width=&amp;quot;600&amp;quot; height=&amp;quot;800&amp;quot; frameborder=&amp;quot;0&amp;quot; scrolling=&amp;quot;yes&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
The output stack contains at least one output.&lt;br /&gt;
&lt;br /&gt;
There is a transaction in progress which is ready to accept new outputs. This transaction is either empty or it contains 1 or more outputs.&lt;br /&gt;
&lt;br /&gt;
If the transaction already contains outputs, then it also contains sufficient inputs to cover those outputs and any required transaction fees without exceeding size limits. This is because it must have already successfully passed through this procedure before.&lt;br /&gt;
&lt;br /&gt;
====Sequence====&lt;br /&gt;
&lt;br /&gt;
# Locate the entry for this output in the [[Withdrawal status|withdrawal status]] object by finding the corresponding outBailmentID.&lt;br /&gt;
# Validate the output address.&lt;br /&gt;
## If it is invalid, update &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt; entry for this output to &amp;quot;invalid&amp;quot; and exit from this procedure.&lt;br /&gt;
## If it is valid, add it to the transaction.&lt;br /&gt;
### Add a new entry to the &amp;lt;code&amp;gt;transaction&amp;lt;/code&amp;gt; array for this output:&lt;br /&gt;
###* &amp;lt;code&amp;gt;nxid&amp;lt;/code&amp;gt;: nil&lt;br /&gt;
###* &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;: next unused&lt;br /&gt;
###* &amp;lt;code&amp;gt;amount&amp;lt;/code&amp;gt;: copied from [[Outputs (Voting Pool Wallet API)|outputs]] list.&lt;br /&gt;
# Check that the transaction does not exceed size limits. If it does, follow the [[Transaction Construction Algorithm (voting pools)#Oversize Transaction|Oversize Transaction]] procedure.&lt;br /&gt;
# Compare the sum of the inputs to the sum of the outputs and required transaction fee to determine if more inputs are required.&lt;br /&gt;
## If no more inputs are required, then update the &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt; for this output to &amp;quot;success&amp;quot;.&lt;br /&gt;
# If more inputs are required, then check to see if any more are available.&lt;br /&gt;
## According to the initial conditions, the input stack can not be empty on the first run through this loop.&lt;br /&gt;
## If the input stack is empty at this point, then the output has added at least one input beyond what was needed to satisfy the prior output (if there was a prior output)&lt;br /&gt;
## If the input stack is empty, then the output can only be partially fulfilled. Follow the [[Transaction Construction Algorithm (voting pools)#Split Output|Split Output]] procedure.&lt;br /&gt;
# Add the next input from the stack, and continue the loop at step 2.&lt;br /&gt;
&lt;br /&gt;
The loop will continue until either:&lt;br /&gt;
&lt;br /&gt;
* The transaction contains sufficient input value to satisfy the output plus transaction fees&lt;br /&gt;
* The transaction exceeds size limits&lt;br /&gt;
* There is not enough input value, but no more inputs are available&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Finalize Transaction===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right&amp;quot;&amp;gt;&amp;lt;include iframe src=&amp;quot;https://www.lucidchart.com/documents/embeddedchart/79c726f4-9d4e-4a3c-bd20-6556099d24ab&amp;quot; width=&amp;quot;300&amp;quot; height=&amp;quot;1004&amp;quot; frameborder=&amp;quot;0&amp;quot; scrolling=&amp;quot;yes&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
* An unfinished transaction is ready for processing.&lt;br /&gt;
** The transaction may or may not have have a useful (non-change) output&lt;br /&gt;
** The transaction is valid&lt;br /&gt;
*** Not too big&lt;br /&gt;
*** Inputs are sufficient to cover outputs and required fees&lt;br /&gt;
** A change output may exist in the transaction&lt;br /&gt;
*** If a change output exists, it has a nil position and a nil value.&lt;br /&gt;
&lt;br /&gt;
====Sequence====&lt;br /&gt;
&lt;br /&gt;
# If the transaction only contains a change output and no inputs, then it may be discarded.&lt;br /&gt;
# The change amount is calculated by: Σ(txin) - ( Σ(txout) + fees )&lt;br /&gt;
## If the change amount is greater than zero:&lt;br /&gt;
### Set the value of the output&lt;br /&gt;
### Set the position of the output to the next unused value after the last non-change output.&lt;br /&gt;
## If the change amount is zero, then the change output is removed from the transaction.&lt;br /&gt;
# Calculate an [[ntxid]] for the transaction for tracking purposes.&lt;br /&gt;
# Loop through every (non-change) output in the transaction and update the [[withdrawal status]] object for the corresponding output.&lt;br /&gt;
## The withdrawal status object contain an entry for every output in the transaction, where each entry has an &amp;lt;code&amp;gt;transactions&amp;lt;/code&amp;gt; object containing a nil &amp;lt;code&amp;gt;ntxid&amp;lt;/code&amp;gt;, an &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt; matching the output position index, and a matching &amp;lt;code&amp;gt;amount&amp;lt;/code&amp;gt;.&lt;br /&gt;
## Update the &amp;lt;code&amp;gt;ntxid&amp;lt;/code&amp;gt; value from nil to the ntxid for the transaction.&lt;br /&gt;
# Add the fees from this transaction to the &amp;lt;code&amp;gt;fees&amp;lt;/code&amp;gt; property of the withdrawal status object.&lt;br /&gt;
# Move the transaction to the finished transaction list.&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Update Signatures===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right&amp;quot;&amp;gt;&amp;lt;include iframe src=&amp;quot;https://www.lucidchart.com/documents/embeddedchart/97025b62-3720-4810-ae85-5ae678031aed&amp;quot; width=&amp;quot;600&amp;quot; height=&amp;quot;1100&amp;quot; frameborder=&amp;quot;0&amp;quot; scrolling=&amp;quot;yes&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
* The finished transaction list contains zero or more finalized transactions &lt;br /&gt;
* The transactions are valid in all respects except for missing signatures&lt;br /&gt;
&lt;br /&gt;
====Sequence====&lt;br /&gt;
&lt;br /&gt;
* If the finished transaction list is empty, the rest of the procedure can be skipped.&lt;br /&gt;
* Loop through each transaction.&lt;br /&gt;
** Within each transaction, loop through every input.&lt;br /&gt;
*** Within each input, loop through every pubkey in the [[redeem script]].&lt;br /&gt;
**** If the wallet possesses the private key corresponding to the pubkey, create the appropriate signature.&lt;br /&gt;
***** Add the signature to the transaction.&lt;br /&gt;
***** Add the signature to the [[siglist|signature list]] in the appropriate position.&lt;br /&gt;
* Move all transactions in the finished transaction list to the pending transaction database, where they will wait for additional signatures from other voting pool members.&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Update Status===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right&amp;quot;&amp;gt;&amp;lt;include iframe src=&amp;quot;https://www.lucidchart.com/documents/embeddedchart/b4dcbb56-3b87-4f56-b249-dfd4276c7cc4&amp;quot; width=&amp;quot;300&amp;quot; height=&amp;quot;800&amp;quot; frameborder=&amp;quot;0&amp;quot; scrolling=&amp;quot;yes&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
* Every outBailmentID in the [[Outputs (Voting Pool Wallet API)|output]] list provided has a non-nil &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt; value in the [[withdrawal status]] object.&lt;br /&gt;
&lt;br /&gt;
====Sequence====&lt;br /&gt;
&lt;br /&gt;
# Update the status for any split outBailments which exist:&lt;br /&gt;
## Split outBailments have more than one item in their &amp;lt;code&amp;gt;transactions&amp;lt;/code&amp;gt; array and have an existing &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt; value of &amp;quot;success&amp;quot;.&lt;br /&gt;
## Change the &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt; for all split outBailments from &amp;quot;success&amp;quot; to &amp;quot;split&amp;quot;.&lt;br /&gt;
# Update the status for any partial outBailments which exist:&lt;br /&gt;
## Partial outBailments have existing &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt; value of &amp;quot;partial-&amp;quot;.&lt;br /&gt;
## Calculate the total missing value needed to satisfy the partial outputs.&lt;br /&gt;
## The missing value of an outBailment is the originally-requested size of the outBailment minus the sum of all outputs created to satisfy it (if any exist).&lt;br /&gt;
### Obtain a list of eligible inputs from the next un-thawed series and calculate their total value.&lt;br /&gt;
### If the eligible value of the next un-thawed series is greater than the total missing value, then the next un-thawed series is the target series.&lt;br /&gt;
#### If not, repeat the above process while keeping a running total of eligible value until a target series is located.&lt;br /&gt;
### Append the number of the target series to the &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt; value for every partial series.&lt;br /&gt;
# Update the &amp;lt;code&amp;gt;nextinputstart&amp;lt;/code&amp;gt; value.&lt;br /&gt;
## If the input stack is empty, &amp;lt;code&amp;gt;nextinputstart&amp;lt;/code&amp;gt; is the first [[address identifier]] for the next un-thawed series.&lt;br /&gt;
## If the input stack is not empty, &amp;lt;code&amp;gt;nextinputstart&amp;lt;/code&amp;gt; is the [[address identifier]] for the next input in the stack.&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Oversize Transaction===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right&amp;quot;&amp;gt;&amp;lt;include iframe src=&amp;quot;https://www.lucidchart.com/documents/embeddedchart/4abd7b4f-1079-48d7-af9d-d892433cd65a&amp;quot; width=&amp;quot;300&amp;quot; height=&amp;quot;400&amp;quot; frameborder=&amp;quot;0&amp;quot; scrolling=&amp;quot;yes&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An oversize transaction may occur while attempting to add inputs to satisfy an output which has been added to a transaction as part of the [[#Add Next Output|Add Next Output]] step.&lt;br /&gt;
&lt;br /&gt;
Even with the worst case of high &amp;lt;code&amp;gt;m&amp;lt;/code&amp;gt; and/or &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; values, inputs will never be large enough that a transaction can be oversized while attempting to add the first input to a transaction.&lt;br /&gt;
&lt;br /&gt;
Oversize transactions will have one change output, at least one non-change output, and many inputs.&lt;br /&gt;
&lt;br /&gt;
If an oversize has two or more non-change outputs, then Add Next Output was successful for the previous output. In this case, the transaction was valid before attempting to add the current output, so the current output should be removed from the current transaction and moved to the next one.&lt;br /&gt;
&lt;br /&gt;
Otherwise, the transaction has become too large while adding its first non-change output. This can happen due to a series of small inputs, or a large output, or a combination of the two. In this case the [[outBailment]] can not be satisfied with a single transaction and must be split across multiple transactions.&lt;br /&gt;
&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
* The Add Next Output procedure has created a transaction that exceeds size limits, in one of the following circumstances:&lt;br /&gt;
** Immediately upon adding an output to the transaction&lt;br /&gt;
*** The transaction contains other outputs which were added successfully. All inputs currently in the transaction are required to satisfy the previous output(s) before the output that failed.&lt;br /&gt;
** After adding the first input to the transaction to satisfy an output&lt;br /&gt;
*** The transaction contains other outputs which were added successfully. All inputs currently in the transaction are required to satisfy the previous output(s) before the output that failed.&lt;br /&gt;
** After having added at least one input to the transaction to satisfy an output without causing an oversize condition.&lt;br /&gt;
*** At least one of the inputs in this transaction are only required to satisfy the current output, not any previous outputs (if any exist).&lt;br /&gt;
&lt;br /&gt;
====Procedure====&lt;br /&gt;
&lt;br /&gt;
# Count the number of non-change outputs in the transaction.&lt;br /&gt;
# If the number exceeds one, follow the [[#Rollback Last Output|Rollback Last Output]] procedure.&lt;br /&gt;
# If the number is one, follow the [[#Split Output|Split Output]] procedure.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Rollback Last Output===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right&amp;quot;&amp;gt;&amp;lt;include iframe src=&amp;quot;https://www.lucidchart.com/documents/embeddedchart/81fbb6f6-b150-4a06-915e-7633b05da9af&amp;quot; width=&amp;quot;300&amp;quot; height=&amp;quot;600&amp;quot; frameborder=&amp;quot;0&amp;quot; scrolling=&amp;quot;yes&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This procedure is used if a transaction has exceeded the size limit, and can be brought back under the limit by removing the most-recently added output and the inputs needed to support it from the transaction &lt;br /&gt;
&lt;br /&gt;
The removed inputs and outputs will be added to the beginning of a new transaction.&lt;br /&gt;
&lt;br /&gt;
This procedure will remove one more input than is required to bring the transaction below size limits, and then add exactly one more. This will always result in a valid transaction because the only way to reach this procedure is by having successfully completed at least one [[#Add Next Output|Add Next Output]] cycle for the current transaction prior to adding an output or input that pushes the transaction over the size limit.&lt;br /&gt;
&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
* An oversize transaction contains one or more outputs and their supporting inputs which do not exceed transaction size limits, and one output which does not.&lt;br /&gt;
* The number of inputs which are solely dedicated to satisfying the most recently-added output (not required for previous outputs) may be zero or more.&lt;br /&gt;
&lt;br /&gt;
====Sequence====&lt;br /&gt;
&lt;br /&gt;
# Remove the most-recently added output from the transaction and return it to the output stack.&lt;br /&gt;
#* This will cause the output to be the first one added to the next transaction.&lt;br /&gt;
# Remove the most-recently added input from the transaction and return it to the input stack.&lt;br /&gt;
# If the sum of input values exceeds the sum of output values by an amount greater than the required transaction fee:&lt;br /&gt;
#* Continue removing inputs one at a time until the sum of the input values falls below the needed output + transaction fee value.&lt;br /&gt;
# Add the next input from the stack to the transaction.&lt;br /&gt;
# Perform the [[#Finalize Transaction|Finalize Transaction]] procedure.&lt;br /&gt;
# [[#Initialize Transaction|Initialize]] a new transaction.&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Split Output===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right&amp;quot;&amp;gt;&amp;lt;include iframe src=&amp;quot;https://www.lucidchart.com/documents/embeddedchart/c72ce59c-65c0-4a90-943a-c669bac5a737&amp;quot; width=&amp;quot;300&amp;quot; height=&amp;quot;1004&amp;quot; frameborder=&amp;quot;0&amp;quot; scrolling=&amp;quot;yes&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This procedure is used when, either due to a large output or small inputs, the inputs required to satisfy a single output can not fit within transaction size limits.&lt;br /&gt;
&lt;br /&gt;
The outBailment will be split across two or more transactions.&lt;br /&gt;
&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
* The transaction being constructed contains one change output, one non-change output, and many inputs.&lt;br /&gt;
* The transaction did not exceed any size limits until the most recent input was added.&lt;br /&gt;
&lt;br /&gt;
====Sequence====&lt;br /&gt;
&lt;br /&gt;
# Remove the change output from the transaction.&lt;br /&gt;
# Decrement the value of the &amp;lt;code&amp;gt;nextchangestart&amp;lt;/code&amp;gt; property of the [[withdrawal status]] object.&lt;br /&gt;
# Determine if the transaction still exceeds size limits.&lt;br /&gt;
## If yes, then remove the most-recently added input.&lt;br /&gt;
# Update the value of the output in the transaction to be the sum of the inputs minus the required transaction fee.&lt;br /&gt;
# Make a copy of the [[Outputs (Voting Pool Wallet API)|outputs]] object corresponding to this outBailmentID.&lt;br /&gt;
# Update the &amp;lt;code&amp;gt;amount&amp;lt;/code&amp;gt; field of the copied output by subtracting the value determined in step 4.&lt;br /&gt;
# Push this new output to the output stack.&lt;br /&gt;
# Update the &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt; field for this outBailmentID in the [[withdrawal status]] object to &amp;quot;partial-&amp;quot;.&lt;br /&gt;
# Perform the [[#Finalize Transaction|Finalize Transaction]] Procedure.&lt;br /&gt;
# [[#Initialize Transaction|Initialize]] a new transaction.&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Insufficient Inputs===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right&amp;quot;&amp;gt;&amp;lt;include iframe src=&amp;quot;https://www.lucidchart.com/documents/embeddedchart/9b471e6e-0a62-408a-ad0e-a5d7c491aa43&amp;quot; width=&amp;quot;150&amp;quot; height=&amp;quot;500&amp;quot; frameborder=&amp;quot;0&amp;quot; scrolling=&amp;quot;yes&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This procedure is followed when the [[#Output List Initialization|Output List Initialization]] step estimated that that the input list was sufficient to fulfill the valid outputs but, due to change and/or transaction fees, one or more outputs can not be fulfilled.&lt;br /&gt;
&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
* [[#Add Next Output|Add Next Output]] has been completed successfully at least once.&lt;br /&gt;
* An empty transaction skeleton has been created.&lt;br /&gt;
* At least one output remains in the stack, but the input stack is empty.&lt;br /&gt;
&lt;br /&gt;
====Sequence====&lt;br /&gt;
&lt;br /&gt;
* Pop all outputs from the output stack and update their &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt; property in the [[withdrawal status]] list to &amp;quot;partial-&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
No further action is necessary. After completing this procedure the algorithm moves on to the [[#Finalize Transaction|Finalize Transaction]] procedure which will discard the empty transaction skeleton which would have otherwise contained the outputs which were processed in this procedure.&lt;br /&gt;
&lt;br /&gt;
[[Category:Voting Pool Technical Specifications]]&lt;/div&gt;</summary>
		<author><name>Larshesel</name></author>
		
	</entry>
	<entry>
		<id>http://opentransactions.org/wiki/index.php?title=Talk:Transaction_Construction_Algorithm_(voting_pools)&amp;diff=3036</id>
		<title>Talk:Transaction Construction Algorithm (voting pools)</title>
		<link rel="alternate" type="text/html" href="http://opentransactions.org/wiki/index.php?title=Talk:Transaction_Construction_Algorithm_(voting_pools)&amp;diff=3036"/>
		<updated>2014-10-03T09:23:51Z</updated>

		<summary type="html">&lt;p&gt;Larshesel: what is the purpose of ntxid?&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[User:Larshesel|Larshesel]] ([[User talk:Larshesel|talk]]) 14:57, 26 September 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
In the preparation step it is mentioned that we create a withdrawal status object which is referenced throughout the algorithm.&lt;br /&gt;
&lt;br /&gt;
We add the roundID to this object, but it does not seem to be used anywhere. Is it needed at all?&lt;br /&gt;
&lt;br /&gt;
[[User:Justusranvier|Justusranvier]] ([[User talk:Justusranvier|talk]]) 15:41, 26 September 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
It's needed to match up withdrawalstatus objects with siglist objects.&lt;br /&gt;
&lt;br /&gt;
[[User:Larshesel|Larshesel]] ([[User talk:Larshesel|talk]]) 08:58, 29 September 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
In the output list initialization procedure we may return an empty output list if the smallest output is bigger than the sum of the inputs. What should happen if we return an empty output list? The next step (transaction initialization) seems to assume that it is not empty.&lt;br /&gt;
&lt;br /&gt;
As there are no longer any ouputs we cannot make a transaction. I don't seem to find any error code that reflects this situation.&lt;br /&gt;
&lt;br /&gt;
[[User:Justusranvier|Justusranvier]] ([[User talk:Justusranvier|talk]]) 12:49, 29 September 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
Transaction Initialization does not depend on the size of the output list. If the transaction skeleton ends up not being used, then Finalize Transaction will discard it (first step).&lt;br /&gt;
&lt;br /&gt;
Easiest way to see what happens is to just follow the steps with an empty output list and you'll find all the checks that handle it.&lt;br /&gt;
&lt;br /&gt;
[[User:Larshesel|Larshesel]] ([[User talk:Larshesel|talk]]) 08:32, 3 October 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
In the 'Output List Initialization' I don't think it's specified how to keep track of the outputs that are removed if sum(inputs) &amp;lt; sum(outputs). I would assume that we need to mark the output status in the withdrawal status object so the caller can take appropriate action?&lt;br /&gt;
&lt;br /&gt;
[[User:Larshesel|Larshesel]] ([[User talk:Larshesel|talk]]) 09:23, 3 October 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
In the 'Finalize Transaction' we create a ntxid which is used for tracking purposes. What kind of tracking purposes is that?&lt;/div&gt;</summary>
		<author><name>Larshesel</name></author>
		
	</entry>
	<entry>
		<id>http://opentransactions.org/wiki/index.php?title=Talk:Transaction_Construction_Algorithm_(voting_pools)&amp;diff=3034</id>
		<title>Talk:Transaction Construction Algorithm (voting pools)</title>
		<link rel="alternate" type="text/html" href="http://opentransactions.org/wiki/index.php?title=Talk:Transaction_Construction_Algorithm_(voting_pools)&amp;diff=3034"/>
		<updated>2014-10-03T08:32:42Z</updated>

		<summary type="html">&lt;p&gt;Larshesel: Output list initialization - what to do with removed outputs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[User:Larshesel|Larshesel]] ([[User talk:Larshesel|talk]]) 14:57, 26 September 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
In the preparation step it is mentioned that we create a withdrawal status object which is referenced throughout the algorithm.&lt;br /&gt;
&lt;br /&gt;
We add the roundID to this object, but it does not seem to be used anywhere. Is it needed at all?&lt;br /&gt;
&lt;br /&gt;
[[User:Justusranvier|Justusranvier]] ([[User talk:Justusranvier|talk]]) 15:41, 26 September 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
It's needed to match up withdrawalstatus objects with siglist objects.&lt;br /&gt;
&lt;br /&gt;
[[User:Larshesel|Larshesel]] ([[User talk:Larshesel|talk]]) 08:58, 29 September 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
In the output list initialization procedure we may return an empty output list if the smallest output is bigger than the sum of the inputs. What should happen if we return an empty output list? The next step (transaction initialization) seems to assume that it is not empty.&lt;br /&gt;
&lt;br /&gt;
As there are no longer any ouputs we cannot make a transaction. I don't seem to find any error code that reflects this situation.&lt;br /&gt;
&lt;br /&gt;
[[User:Justusranvier|Justusranvier]] ([[User talk:Justusranvier|talk]]) 12:49, 29 September 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
Transaction Initialization does not depend on the size of the output list. If the transaction skeleton ends up not being used, then Finalize Transaction will discard it (first step).&lt;br /&gt;
&lt;br /&gt;
Easiest way to see what happens is to just follow the steps with an empty output list and you'll find all the checks that handle it.&lt;br /&gt;
&lt;br /&gt;
[[User:Larshesel|Larshesel]] ([[User talk:Larshesel|talk]]) 08:32, 3 October 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
In the 'Output List Initialization' I don't think it's specified how to keep track of the outputs that are removed if sum(inputs) &amp;lt; sum(outputs). I would assume that we need to mark the output status in the withdrawal status object so the caller can take appropriate action?&lt;/div&gt;</summary>
		<author><name>Larshesel</name></author>
		
	</entry>
	<entry>
		<id>http://opentransactions.org/wiki/index.php?title=Input_Selection_Algorithm_(voting_pools)&amp;diff=3008</id>
		<title>Input Selection Algorithm (voting pools)</title>
		<link rel="alternate" type="text/html" href="http://opentransactions.org/wiki/index.php?title=Input_Selection_Algorithm_(voting_pools)&amp;diff=3008"/>
		<updated>2014-10-02T08:22:51Z</updated>

		<summary type="html">&lt;p&gt;Larshesel: /* Input Ordering */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
In order to avoid an expensive and error-prone consensus process, it is mandatory for wallets to be able to construct withdrawal transactions in a deterministic manner, assuming they are given the withdrawal requests in a deterministic order. Once this is accomplished, then it only becomes necessary for wallets to share signatures among themselves because they know they all signed the exact same bitcoin transaction.&lt;br /&gt;
&lt;br /&gt;
One requirement to achieving this determinism is that the inputs used by the transaction construction algorithm are selected in a deterministic order.&lt;br /&gt;
&lt;br /&gt;
==Procedure==&lt;br /&gt;
&lt;br /&gt;
The input selection algorithm generates an ordered list of eligible inputs for a withdrawal transaction. It is called from [[startwithdrawal]] with a set of three parameters:&lt;br /&gt;
&lt;br /&gt;
# The first [[Wallet_(blockchain)#Address_Identification|address identifier]] to be considered.&lt;br /&gt;
# The last series from which to select inputs.&lt;br /&gt;
# The minimum allowed input size.&lt;br /&gt;
&lt;br /&gt;
The algorithm returns all inputs associated with the inclusive range given by inputstart and inputstop which are considered eligable, in a specific order.&lt;br /&gt;
&lt;br /&gt;
===Eligibility criteria===&lt;br /&gt;
&lt;br /&gt;
An unspent output is considered eligible if it meets the following criteria:&lt;br /&gt;
&lt;br /&gt;
* Its size is larger than dustthreshold&lt;br /&gt;
* The transaction in which it was created has more than 100 confirmations&lt;br /&gt;
&lt;br /&gt;
The first criteria ensures the input will add more value to the transaction than the cost spend it in terms of fees.&lt;br /&gt;
&lt;br /&gt;
The second ensures determinism. &lt;br /&gt;
&lt;br /&gt;
Withdrawals are processed from the oldest deposits, in FIFO order and reuse of deposit addresses is not encouraged. However, it's not possible to prevent anyone from sending duplicate or unsolicited deposits to an address. The [[Duplicate Deposit]] procedure sweeps unsolicited deposits to their correct location, however at any given time it's not possible to ensure all nodes have performed this procedure at the exact same moment.&lt;br /&gt;
&lt;br /&gt;
If the recommended values of weekly key rotation and 95% cold storage are followed, then the inputs being selected should have about 20000 confirmations (two orders of magnitude higher than the limit.)&lt;br /&gt;
&lt;br /&gt;
By rejecting all inputs with less than 100 confirmations, the pool effectively has a 16 hour window in which to detect duplicate deposits and perform the duplicate deposit procedure before there is a risk of non-deterministic transaction construction.&lt;br /&gt;
&lt;br /&gt;
===Input Ordering===&lt;br /&gt;
&lt;br /&gt;
When searching for addresses with eligible utxos to be used as inputs, the various parameters of the address identifier are incremented in the following order:&lt;br /&gt;
&lt;br /&gt;
# branch (0 to n+1)&lt;br /&gt;
# index (0 to highest used for series)&lt;br /&gt;
# series (oldest to newest)&lt;br /&gt;
&lt;br /&gt;
The returned inputs are sorted and returned in the same order: increasing by branch, index and series. If an address references more than one eligible inputs, they are all selected and are sorted by txid, then by output index.&lt;br /&gt;
&lt;br /&gt;
If an address contains no eligible inputs, it is skipped.&lt;br /&gt;
&lt;br /&gt;
==Determinism==&lt;br /&gt;
&lt;br /&gt;
In order for transaction signing to be successful, every wallet must create the exact same transactions, under all conditions. To achieve this, each wallet must create the transaction from the exact same set of inputs.&lt;br /&gt;
&lt;br /&gt;
An individual wallet knows which series it has thawed, but it does not know what the rest of the wallets in the pool have thawed. The caller of the [[startwithdrawal]] API call is responsible for coordinating with other pool members to determine which series have been thawed by at least &amp;lt;code&amp;gt;m&amp;lt;/code&amp;gt; members of the pool, and then passing this series identifier explicitly.&lt;br /&gt;
&lt;br /&gt;
The input selection algorithm must honor the provided &amp;lt;code&amp;gt;inputstart&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;inputstop&amp;lt;/code&amp;gt; regardless of the state of a series (cold or thawed).&lt;br /&gt;
&lt;br /&gt;
If this algorithm provides inputs from a series which this wallet has not yet thawed (but &amp;lt;code&amp;gt;m&amp;lt;/code&amp;gt;-of-&amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; members of the pool have), then the transaction construction algorithm will use those inputs but will not be able to sign them. This is not a problem for the withdrawal because the pool does have enough signatures to make the affected transactions valid.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;include iframe src=&amp;quot;http://opentransactions.org/wiki/images/thumb/b/b0/Voting_Pools_Series_Table.png/800px-Voting_Pools_Series_Table.png&amp;quot; width=&amp;quot;800&amp;quot; height=&amp;quot;450&amp;quot; frameborder=&amp;quot;0&amp;quot; scrolling=&amp;quot;no&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Voting Pool Technical Specifications]]&lt;/div&gt;</summary>
		<author><name>Larshesel</name></author>
		
	</entry>
	<entry>
		<id>http://opentransactions.org/wiki/index.php?title=Talk:Input_Selection_Algorithm_(voting_pools)&amp;diff=3005</id>
		<title>Talk:Input Selection Algorithm (voting pools)</title>
		<link rel="alternate" type="text/html" href="http://opentransactions.org/wiki/index.php?title=Talk:Input_Selection_Algorithm_(voting_pools)&amp;diff=3005"/>
		<updated>2014-10-01T10:21:55Z</updated>

		<summary type="html">&lt;p&gt;Larshesel: Addendum to bonus question&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[User:Larshesel|Larshesel]] ([[User talk:Larshesel|talk]]) 09:08, 1 October 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
I don't understand the part about moving from address to address in the 'Input Ordering' section. I suppose it is meant to specify an ordering?&lt;br /&gt;
&lt;br /&gt;
So the entire ordering would be by branch/index/series/txid/outputidx. For the addresses with only one output the last two parts of the ordering scheme are not necessary.&lt;br /&gt;
&lt;br /&gt;
[[User:Larshesel|Larshesel]] ([[User talk:Larshesel|talk]]) 09:38, 1 October 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
Bonus quesion&lt;br /&gt;
&lt;br /&gt;
I would expect that when I am searching for eligible inputs, the (voting pool), series and branch are fixed and I only ever change the index number. Is that the case?&lt;br /&gt;
&lt;br /&gt;
[[User:Larshesel|Larshesel]] ([[User talk:Larshesel|talk]]) 10:21, 1 October 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
I think I've started to use this wiki as my rubber duck :-) It at least appears that asking questions here helps me understand.&lt;br /&gt;
&lt;br /&gt;
The bonus question - I somehow had a notion that the series and branch should be fixed. But we want to use any eligible output we can get our hands on. Therefore it makes sense to look for any eligible input in the *hot* series - all branches and all indexes.&lt;br /&gt;
&lt;br /&gt;
But if the moving from address to address part of the 'Input Ordering' sections is supposed to describe how we search the space of eligible inputs, then the 3rd item does not make sense as there is only one series to select addresses from - the hot one, since the other series cannot be used for spending as the private keys are not online yet.&lt;br /&gt;
&lt;br /&gt;
Could we split 'how we search' and 'how the output should be ordered' into two distinct sections? The second can refer to the first, if it's the same ordering, but then it's explicit.&lt;/div&gt;</summary>
		<author><name>Larshesel</name></author>
		
	</entry>
	<entry>
		<id>http://opentransactions.org/wiki/index.php?title=Talk:Input_Selection_Algorithm_(voting_pools)&amp;diff=3004</id>
		<title>Talk:Input Selection Algorithm (voting pools)</title>
		<link rel="alternate" type="text/html" href="http://opentransactions.org/wiki/index.php?title=Talk:Input_Selection_Algorithm_(voting_pools)&amp;diff=3004"/>
		<updated>2014-10-01T09:38:31Z</updated>

		<summary type="html">&lt;p&gt;Larshesel: How to search for inputs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[User:Larshesel|Larshesel]] ([[User talk:Larshesel|talk]]) 09:08, 1 October 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
I don't understand the part about moving from address to address in the 'Input Ordering' section. I suppose it is meant to specify an ordering?&lt;br /&gt;
&lt;br /&gt;
So the entire ordering would be by branch/index/series/txid/outputidx. For the addresses with only one output the last two parts of the ordering scheme are not necessary.&lt;br /&gt;
&lt;br /&gt;
[[User:Larshesel|Larshesel]] ([[User talk:Larshesel|talk]]) 09:38, 1 October 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
Bonus quesion&lt;br /&gt;
&lt;br /&gt;
I would expect that when I am searching for eligible inputs, the (voting pool), series and branch are fixed and I only ever change the index number. Is that the case?&lt;/div&gt;</summary>
		<author><name>Larshesel</name></author>
		
	</entry>
	<entry>
		<id>http://opentransactions.org/wiki/index.php?title=Talk:Input_Selection_Algorithm_(voting_pools)&amp;diff=3003</id>
		<title>Talk:Input Selection Algorithm (voting pools)</title>
		<link rel="alternate" type="text/html" href="http://opentransactions.org/wiki/index.php?title=Talk:Input_Selection_Algorithm_(voting_pools)&amp;diff=3003"/>
		<updated>2014-10-01T09:08:59Z</updated>

		<summary type="html">&lt;p&gt;Larshesel: Question about input ordering&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[User:Larshesel|Larshesel]] ([[User talk:Larshesel|talk]]) 09:08, 1 October 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
I don't understand the part about moving from address to address in the 'Input Ordering' section. I suppose it is meant to specify an ordering?&lt;br /&gt;
&lt;br /&gt;
So the entire ordering would be by branch/index/series/txid/outputidx. For the addresses with only one output the last two parts of the ordering scheme are not necessary.&lt;/div&gt;</summary>
		<author><name>Larshesel</name></author>
		
	</entry>
	<entry>
		<id>http://opentransactions.org/wiki/index.php?title=Transaction_Construction_Algorithm_(voting_pools)&amp;diff=3002</id>
		<title>Transaction Construction Algorithm (voting pools)</title>
		<link rel="alternate" type="text/html" href="http://opentransactions.org/wiki/index.php?title=Transaction_Construction_Algorithm_(voting_pools)&amp;diff=3002"/>
		<updated>2014-10-01T06:53:16Z</updated>

		<summary type="html">&lt;p&gt;Larshesel: /* Initial Conditions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
In order to avoid an expensive and error-prone consensus process, it is mandatory for wallets to be able to construct withdrawal transactions in a deterministic manner, assuming they are given the withdrawal requests in a deterministic order. Once this is accomplished, then it only becomes necessary for wallets to share signatures among themselves because they know they all signed the exact same bitcoin transaction.&lt;br /&gt;
&lt;br /&gt;
==Procedure==&lt;br /&gt;
&lt;br /&gt;
===Overview===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right&amp;quot;&amp;gt;&amp;lt;include iframe src=&amp;quot;https://www.lucidchart.com/documents/embeddedchart/eb960c32-71d4-4cfc-8f49-63a82b343608/0&amp;quot; width=&amp;quot;300&amp;quot; height=&amp;quot;1004&amp;quot; frameborder=&amp;quot;0&amp;quot; scrolling=&amp;quot;yes&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
The [[startwithdrawal]] API call has been received by the wallet, and all the arguments have been checked for errors.&lt;br /&gt;
&lt;br /&gt;
====Sequence====&lt;br /&gt;
&lt;br /&gt;
The basic flow of the procedure is:&lt;br /&gt;
&lt;br /&gt;
# Gather accounting information from the API call arguments&lt;br /&gt;
# Validate and sort the output list&lt;br /&gt;
# Start a new transactions&lt;br /&gt;
# Add outputs to the transaction until either all outputs are added or all inputs are used.&lt;br /&gt;
# Make sure all generated transactions are ready for signing.&lt;br /&gt;
# Create a list of all signatures which the wallet is capable of generating.&lt;br /&gt;
# Create a status list containing the deposition of every output the caller specified.&lt;br /&gt;
# Return the status list and signature list to the caller.&lt;br /&gt;
&lt;br /&gt;
Each step in this chart is more fully described below.&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Preparation===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right&amp;quot;&amp;gt;&amp;lt;include iframe src=&amp;quot;https://www.lucidchart.com/documents/embeddedchart/0dd5f7d6-8511-4440-a535-32ad8508d146&amp;quot; width=&amp;quot;150&amp;quot; height=&amp;quot;502&amp;quot; frameborder=&amp;quot;0&amp;quot; scrolling=&amp;quot;yes&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
The [[startwithdrawal]] API call has been received by the wallet, and all the arguments have been checked for errors.&lt;br /&gt;
&lt;br /&gt;
====Sequence====&lt;br /&gt;
&lt;br /&gt;
# The algorithm must keep track of the next change address to be used. The initial value is supplied as the &amp;lt;code&amp;gt;[[Startwithdrawal#Arguments|changestart]]&amp;lt;/code&amp;gt; argument. Any time a change output is allocated, the index value of the [[address identifier]] is incremented, and if a change output is remove from a transaction the index value is decremented. The final value will be returned to the caller as the &amp;lt;code&amp;gt;[[Withdrawal status|nextchangestart]]&amp;lt;/code&amp;gt; value in the [[Withdrawal status| withdrawal status list]].&lt;br /&gt;
# Prepare an empty list for holding transactions as they are constructed and before they are signed.&lt;br /&gt;
# Prepare an empty array to hold the transaction signatures which will be returned to the caller as the &amp;lt;code&amp;gt;[[siglist| signatures]]&amp;lt;/code&amp;gt; value.&lt;br /&gt;
# Prepare an &amp;lt;code&amp;gt;withdrawal status&amp;lt;/code&amp;gt; object.&lt;br /&gt;
## &amp;lt;code&amp;gt;roundID&amp;lt;/code&amp;gt;: copied from &amp;lt;code&amp;gt;roundID&amp;lt;/code&amp;gt; argument&lt;br /&gt;
## &amp;lt;code&amp;gt;nextinputstart&amp;lt;/code&amp;gt;: nil&lt;br /&gt;
## &amp;lt;code&amp;gt;nextchangestart&amp;lt;/code&amp;gt;: nil&lt;br /&gt;
## &amp;lt;code&amp;gt;fees&amp;lt;/code&amp;gt;: 0&lt;br /&gt;
## &amp;lt;code&amp;gt;outputs&amp;lt;/code&amp;gt;: should contain an entry for every output passed:&lt;br /&gt;
### &amp;lt;code&amp;gt;outBailmentID&amp;lt;/code&amp;gt;: copied from &amp;lt;code&amp;gt;outBailmentID&amp;lt;/code&amp;gt; entry in &amp;lt;code&amp;gt;outputs&amp;lt;/code&amp;gt; argument&lt;br /&gt;
### &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt;: empty string&lt;br /&gt;
### &amp;lt;code&amp;gt;transactions&amp;lt;/code&amp;gt;: nil&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Output List Initialization===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right&amp;quot;&amp;gt;&amp;lt;include iframe src=&amp;quot;https://www.lucidchart.com/documents/embeddedchart/56b10d7d-bbd4-4590-8200-c837c5ad953c&amp;quot; width=&amp;quot;450&amp;quot; height=&amp;quot;800&amp;quot; frameborder=&amp;quot;0&amp;quot; scrolling=&amp;quot;yes&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
The [[startwithdrawal]] API call has been received by the wallet, and all the arguments have been checked for errors.&lt;br /&gt;
&lt;br /&gt;
====Sequence====&lt;br /&gt;
&lt;br /&gt;
# Pass the &amp;lt;code&amp;gt;inputstart&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;inputstop&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;dustthreshold&amp;lt;/code&amp;gt; parameters to the [[Input Selection Algorithm (voting pools)|input selection algorithm]] to obtain an ordered list of eligible inputs.&lt;br /&gt;
# 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.&lt;br /&gt;
## Take the sum of both lists.&lt;br /&gt;
## 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.&lt;br /&gt;
# If the output list is non-empty, sort it by &amp;lt;code&amp;gt;outBailmentID&amp;lt;/code&amp;gt;&lt;br /&gt;
# 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.&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Initialize New Transaction===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right&amp;quot;&amp;gt;&amp;lt;include iframe src=&amp;quot;https://www.lucidchart.com/documents/embeddedchart/506ed019-070c-44d6-b5e4-994169ab0704&amp;quot; width=&amp;quot;150&amp;quot; height=&amp;quot;450&amp;quot; frameborder=&amp;quot;0&amp;quot; scrolling=&amp;quot;yes&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
* There are no pending transactions in the process of being constructed, either because this is the first transaction of the algorithm or because a previous pending transaction has been moved to the finished transaction list.&lt;br /&gt;
&lt;br /&gt;
====Sequence====&lt;br /&gt;
&lt;br /&gt;
# Create a minimal transaction skeleton with a header and one change output.&lt;br /&gt;
## The change output will be the last output of the transaction, but the number of other outputs in this transaction is not yet known.&lt;br /&gt;
## The change output must be included in the skeleton for transaction size calculations.&lt;br /&gt;
## The position index for the change output is nil.&lt;br /&gt;
## The first non-change output for the transaction will be placed at position index 0.&lt;br /&gt;
&lt;br /&gt;
After creating the transaction skeleton, and after any action which alters it, the new transaction size (bytes) and minimum required transaction fee must be recalculated.&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Add Next Output===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right&amp;quot;&amp;gt;&amp;lt;include iframe src=&amp;quot;https://www.lucidchart.com/documents/embeddedchart/3e9b2758-338e-40f7-8fe2-e036fda68157&amp;quot; width=&amp;quot;600&amp;quot; height=&amp;quot;800&amp;quot; frameborder=&amp;quot;0&amp;quot; scrolling=&amp;quot;yes&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
The output stack contains at least one output.&lt;br /&gt;
&lt;br /&gt;
There is a transaction in progress which is ready to accept new outputs. This transaction is either empty or it contains 1 or more outputs.&lt;br /&gt;
&lt;br /&gt;
If the transaction already contains outputs, then it also contains sufficient inputs to cover those outputs and any required transaction fees without exceeding size limits. This is because it must have already successfully passed through this procedure before.&lt;br /&gt;
&lt;br /&gt;
====Sequence====&lt;br /&gt;
&lt;br /&gt;
# Locate the entry for this output in the [[Withdrawal status|withdrawal status]] object by finding the corresponding outBailmentID.&lt;br /&gt;
# Validate the output address.&lt;br /&gt;
## If it is invalid, update &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt; entry for this output to &amp;quot;invalid&amp;quot; and exit from this procedure.&lt;br /&gt;
## If it is valid, add it to the transaction.&lt;br /&gt;
### Add a new entry to the &amp;lt;code&amp;gt;transaction&amp;lt;/code&amp;gt; array for this output:&lt;br /&gt;
###* &amp;lt;code&amp;gt;nxid&amp;lt;/code&amp;gt;: nil&lt;br /&gt;
###* &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;: next unused&lt;br /&gt;
###* &amp;lt;code&amp;gt;amount&amp;lt;/code&amp;gt;: copied from [[Outputs (Voting Pool Wallet API)|outputs]] list.&lt;br /&gt;
# Check that the transaction does not exceed size limits. If it does, follow the [[Transaction Construction Algorithm (voting pools)#Oversize Transaction|Oversize Transaction]] procedure.&lt;br /&gt;
# Compare the sum of the inputs to the sum of the inputs and required transaction fee to determine if more inputs are required.&lt;br /&gt;
## If no more inputs are required, then update the &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt; for this output to &amp;quot;success&amp;quot;.&lt;br /&gt;
# If more inputs are required, then check to see if any more are available.&lt;br /&gt;
## According to the initial conditions, the input stack can not be empty on the first run through this loop.&lt;br /&gt;
## If the input stack is empty at this point, then the output has added at least one input beyond what was needed to satisfy the prior output (if there was a prior output)&lt;br /&gt;
## If the input stack is empty, then the output can only be partially fulfilled. Follow the [[Transaction Construction Algorithm (voting pools)#Split Output|Split Output]] procedure.&lt;br /&gt;
# Add the next input from the stack, and continue the loop at step 2.&lt;br /&gt;
&lt;br /&gt;
The loop will continue until either:&lt;br /&gt;
&lt;br /&gt;
* The transaction contains sufficient input value to satisfy the output plus transaction fees&lt;br /&gt;
* The transaction exceeds size limits&lt;br /&gt;
* There is not enough input value, but no more inputs are available&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Finalize Transaction===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right&amp;quot;&amp;gt;&amp;lt;include iframe src=&amp;quot;https://www.lucidchart.com/documents/embeddedchart/79c726f4-9d4e-4a3c-bd20-6556099d24ab&amp;quot; width=&amp;quot;300&amp;quot; height=&amp;quot;1004&amp;quot; frameborder=&amp;quot;0&amp;quot; scrolling=&amp;quot;yes&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
* An unfinished transaction is ready for processing.&lt;br /&gt;
** The transaction may or may not have have a useful (non-change) output&lt;br /&gt;
** The transaction is valid&lt;br /&gt;
*** Not too big&lt;br /&gt;
*** Inputs are sufficient to cover outputs and required fees&lt;br /&gt;
** A change output may exist in the transaction&lt;br /&gt;
*** If a change output exists, it has a nil position and a nil value.&lt;br /&gt;
&lt;br /&gt;
====Sequence====&lt;br /&gt;
&lt;br /&gt;
# If the transaction only contains a change output and no inputs, then it may be discarded.&lt;br /&gt;
# The change amount is calculated by: Σ(txin) - ( Σ(txout) + fees )&lt;br /&gt;
## If the change amount is greater than zero:&lt;br /&gt;
### Set the value of the output&lt;br /&gt;
### Set the position of the output to the next unused value after the last non-change output.&lt;br /&gt;
## If the change amount is zero, then the change output is removed from the transaction.&lt;br /&gt;
# Calculate an [[ntxid]] for the transaction for tracking purposes.&lt;br /&gt;
# Loop through every (non-change) output in the transaction and update the [[withdrawal status]] object for the corresponding output.&lt;br /&gt;
## The withdrawal status object contain an entry for every output in the transaction, where each entry has an &amp;lt;code&amp;gt;transactions&amp;lt;/code&amp;gt; object containing a nil &amp;lt;code&amp;gt;ntxid&amp;lt;/code&amp;gt;, an &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt; matching the output position index, and a matching &amp;lt;code&amp;gt;amount&amp;lt;/code&amp;gt;.&lt;br /&gt;
## Update the &amp;lt;code&amp;gt;nxid&amp;lt;/code&amp;gt; value from nil to the ntxid for the transaction.&lt;br /&gt;
# Add the fees from this transaction to the &amp;lt;code&amp;gt;fees&amp;lt;/code&amp;gt; property of the withdrawal status object.&lt;br /&gt;
# Move the transaction to the finished transaction list.&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
===Update Signatures===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right&amp;quot;&amp;gt;&amp;lt;include iframe src=&amp;quot;https://www.lucidchart.com/documents/embeddedchart/97025b62-3720-4810-ae85-5ae678031aed&amp;quot; width=&amp;quot;600&amp;quot; height=&amp;quot;1100&amp;quot; frameborder=&amp;quot;0&amp;quot; scrolling=&amp;quot;yes&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
* The finished transaction list contains zero or more finalized transactions &lt;br /&gt;
* The transactions are valid in all respects except for missing signatures&lt;br /&gt;
&lt;br /&gt;
====Sequence====&lt;br /&gt;
&lt;br /&gt;
* If the finished transaction list is empty, the rest of the procedure can be skipped.&lt;br /&gt;
* Loop through each transaction.&lt;br /&gt;
** Within each transaction, loop through every input.&lt;br /&gt;
*** Within each input, loop through every pubkey in the [[redeem script]].&lt;br /&gt;
**** If the wallet has possesses the private key corresponding to the pubkey, create the appropriate signature.&lt;br /&gt;
***** Add the signature to the transaction.&lt;br /&gt;
***** Add the signature to the [[siglist|signature list]] in the appropriate position.&lt;br /&gt;
* Move all transactions in the finished transaction list to the pending transaction database, where they will wait for additional signatures from other voting pool members.&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Update Status===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right&amp;quot;&amp;gt;&amp;lt;include iframe src=&amp;quot;https://www.lucidchart.com/documents/embeddedchart/b4dcbb56-3b87-4f56-b249-dfd4276c7cc4&amp;quot; width=&amp;quot;300&amp;quot; height=&amp;quot;800&amp;quot; frameborder=&amp;quot;0&amp;quot; scrolling=&amp;quot;yes&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
* Every outBailmentID in the [[Outputs (Voting Pool Wallet API)|output]] list provided has a non-nil &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt; value in the [[withdrawal status]] object.&lt;br /&gt;
&lt;br /&gt;
====Sequence====&lt;br /&gt;
&lt;br /&gt;
# Update the status for any split outBailments which exist:&lt;br /&gt;
## Split outBailments have more than one item in their &amp;lt;code&amp;gt;transactions&amp;lt;/code&amp;gt; array and have an existing &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt; value of &amp;quot;success&amp;quot;.&lt;br /&gt;
## Change the &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt; for all split outBailments from &amp;quot;success&amp;quot; to &amp;quot;split&amp;quot;.&lt;br /&gt;
# Update the status for any partial outBailments which exist:&lt;br /&gt;
## Partial outBailments have existing &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt; value of &amp;quot;partial-&amp;quot;.&lt;br /&gt;
## Calculate the total missing value needed to satisfy the partial outputs.&lt;br /&gt;
## The missing value of an outBailment is the originally-requested size of the outBailment minus the sum of all outputs created to satisfy it (if any exist).&lt;br /&gt;
### Obtain a list of eligible inputs from the next un-thawed series and calculate their total value.&lt;br /&gt;
### If the eligible value of the next un-thawed series is greater than the total missing value, then the next un-thawed series is the target series.&lt;br /&gt;
#### If not, repeat the above process while keeping a running total of eligible value until a target series is located.&lt;br /&gt;
### Append the number of the target series to the &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt; value for every partial series.&lt;br /&gt;
# Update the &amp;lt;code&amp;gt;nextinputstart&amp;lt;/code&amp;gt; value.&lt;br /&gt;
## If the input stack is empty, &amp;lt;code&amp;gt;nextinputstart&amp;lt;/code&amp;gt; is the first [[address identifier]] for the next un-thawed series.&lt;br /&gt;
## If the input stack is not empty, &amp;lt;code&amp;gt;nextinputstart&amp;lt;/code&amp;gt; is the [[address identifier]] for the next input in the stack.&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Oversize Transaction===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right&amp;quot;&amp;gt;&amp;lt;include iframe src=&amp;quot;https://www.lucidchart.com/documents/embeddedchart/4abd7b4f-1079-48d7-af9d-d892433cd65a&amp;quot; width=&amp;quot;300&amp;quot; height=&amp;quot;400&amp;quot; frameborder=&amp;quot;0&amp;quot; scrolling=&amp;quot;yes&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An oversize transaction may occur while attempting to add inputs to satisfy an output which has been added to a transaction as part of the [[#Add Next Output|Add Next Output]] step.&lt;br /&gt;
&lt;br /&gt;
Even with the worst case of high &amp;lt;code&amp;gt;m&amp;lt;/code&amp;gt; and/or &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; values, inputs will never be large enough that a transaction can be oversized while attempting to add the first input to a transaction.&lt;br /&gt;
&lt;br /&gt;
Oversize transactions will have one change output, at least one non-change output, and many inputs.&lt;br /&gt;
&lt;br /&gt;
If an oversize has two or more non-change outputs, then Add Next Output was successful for the previous output. In this case, the transaction was valid before attempting to add the current output, so the current output should be removed from the current transaction and moved to the next one.&lt;br /&gt;
&lt;br /&gt;
Otherwise, the transaction has become too large while adding its first non-change output. This can happen due to a series of small inputs, or a large output, or a combination of the two. In this case the [[outBailment]] can not be satisfied with a single transaction and must be split across multiple transactions.&lt;br /&gt;
&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
* The Add Next Output procedure has created a transaction that exceeds size limits, in one of the following circumstances:&lt;br /&gt;
** Immediately upon adding an output to the transaction&lt;br /&gt;
*** The transaction contains other outputs which were added successfully. All inputs currently in the transaction are required to satisfy the previous output(s) before the output that failed.&lt;br /&gt;
** After adding the first input to the transaction to satisfy an output&lt;br /&gt;
*** The transaction contains other outputs which were added successfully. All inputs currently in the transaction are required to satisfy the previous output(s) before the output that failed.&lt;br /&gt;
** After having added at least one input to the transaction to satisfy an output without causing an oversize condition.&lt;br /&gt;
*** At least one of the inputs in this transaction are only required to satisfy the current output, not any previous outputs (if any exist).&lt;br /&gt;
&lt;br /&gt;
====Procedure====&lt;br /&gt;
&lt;br /&gt;
# Count the number of non-change outputs in the transaction.&lt;br /&gt;
# If the number exceeds one, follow the [[#Rollback Last Output|Rollback Last Output]] procedure.&lt;br /&gt;
# If the number is one, follow the [[#Split Output|Split Output]] procedure.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Rollback Last Output===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right&amp;quot;&amp;gt;&amp;lt;include iframe src=&amp;quot;https://www.lucidchart.com/documents/embeddedchart/81fbb6f6-b150-4a06-915e-7633b05da9af&amp;quot; width=&amp;quot;300&amp;quot; height=&amp;quot;600&amp;quot; frameborder=&amp;quot;0&amp;quot; scrolling=&amp;quot;yes&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This procedure is used if a transaction has exceeded the size limit, and can be brought back under the limit by removing the most-recently added output and the inputs needed to support it from the transaction &lt;br /&gt;
&lt;br /&gt;
The removed inputs and outputs will be added to the beginning of a new transaction.&lt;br /&gt;
&lt;br /&gt;
This procedure will remove one more input than is required to bring the transaction below size limits, and then add exactly one more. This will always result in a valid transaction because the only way to reach this procedure is by having successfully completed at least one [[#Add Next Output|Add Next Output]] cycle for the current transaction prior to adding an output or input that pushes the transaction over the size limit.&lt;br /&gt;
&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
* An oversize transaction contains one or more outputs and their supporting inputs which do not exceed transaction size limits, and one output which does not.&lt;br /&gt;
* The number of inputs which are solely dedicated to satisfying the most recently-added output (not required for previous outputs) may be zero or more.&lt;br /&gt;
&lt;br /&gt;
====Sequence====&lt;br /&gt;
&lt;br /&gt;
# Remove the most-recently added output from the transaction and return it to the output stack.&lt;br /&gt;
#* This will cause the output to be the first one added to the next transaction.&lt;br /&gt;
# Remove the most-recently added input from the transaction and return it to the input stack.&lt;br /&gt;
# If the sum of input values exceeds the sum of output values by an amount greater than the required transaction fee:&lt;br /&gt;
#* Continue removing inputs one at a time until the sum of the input values falls below the needed output + transaction fee value.&lt;br /&gt;
# Add the next input from the stack to the transaction.&lt;br /&gt;
# Perform the [[#Finalize Transaction|Finalize Transaction]] procedure.&lt;br /&gt;
# [[#Initialize Transaction|Initialize]] a new transaction.&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Split Output===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right&amp;quot;&amp;gt;&amp;lt;include iframe src=&amp;quot;https://www.lucidchart.com/documents/embeddedchart/c72ce59c-65c0-4a90-943a-c669bac5a737&amp;quot; width=&amp;quot;300&amp;quot; height=&amp;quot;1004&amp;quot; frameborder=&amp;quot;0&amp;quot; scrolling=&amp;quot;yes&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This procedure is used when, either due to a large output or small inputs, the inputs required to satisfy a single output can not fit within transaction size limits.&lt;br /&gt;
&lt;br /&gt;
The outBailment will be split across two or more transactions.&lt;br /&gt;
&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
* The transaction being constructed contains one change output, one non-change output, and many inputs.&lt;br /&gt;
* The transaction did not exceed any size limits until the most recent input was added.&lt;br /&gt;
&lt;br /&gt;
====Sequence====&lt;br /&gt;
&lt;br /&gt;
# Remove the change output from the transaction.&lt;br /&gt;
# Decrement the value of the &amp;lt;code&amp;gt;nextchangestart&amp;lt;/code&amp;gt; property of the [[withdrawal status]] object.&lt;br /&gt;
# Determine if the transaction still exceeds size limits.&lt;br /&gt;
## If yes, then remove the most-recently added input.&lt;br /&gt;
# Update the value of the output in the transaction to be the sum of the inputs minus the required transaction fee.&lt;br /&gt;
# Make a copy of the [[Outputs (Voting Pool Wallet API)|outputs]] object corresponding to this outBailmentID.&lt;br /&gt;
# Update the &amp;lt;code&amp;gt;amount&amp;lt;/code&amp;gt; field of the copied output by subtracting the value determined in step 4.&lt;br /&gt;
# Push this new output to the output stack.&lt;br /&gt;
# Update the &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt; field for this outBailmentID in the [[withdrawal status]] object to &amp;quot;partial-&amp;quot;.&lt;br /&gt;
# Perform the [[#Finalize Transaction|Finalize Transaction]] Procedure.&lt;br /&gt;
# [[#Initialize Transaction|Initialize]] a new transaction.&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Insufficient Inputs===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right&amp;quot;&amp;gt;&amp;lt;include iframe src=&amp;quot;https://www.lucidchart.com/documents/embeddedchart/9b471e6e-0a62-408a-ad0e-a5d7c491aa43&amp;quot; width=&amp;quot;150&amp;quot; height=&amp;quot;500&amp;quot; frameborder=&amp;quot;0&amp;quot; scrolling=&amp;quot;yes&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This procedure is followed when the [[#Output List Initialization|Output List Initialization]] step estimated that that the input list was sufficient to fulfill the valid outputs but, due to change and/or transaction fees, one or more outputs can not be fulfilled.&lt;br /&gt;
&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
* [[#Add Next Output|Add Next Output]] has been completed successfully at least once.&lt;br /&gt;
* An empty transaction skeleton has been created.&lt;br /&gt;
* At least one output remains in the stack, but the input stack is empty.&lt;br /&gt;
&lt;br /&gt;
====Sequence====&lt;br /&gt;
&lt;br /&gt;
* Pop all outputs from the output stack and update their &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt; property in the [[withdrawal status]] list to &amp;quot;partial-&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
No further action is necessary. After completing this procedure the algorithm moves on to the [[#Finalize Transaction|Finalize Transaction]] procedure which will discard the empty transaction skeleton which would have otherwise contained the outputs which were processed in this procedure.&lt;br /&gt;
&lt;br /&gt;
[[Category:Voting Pool Technical Specifications]]&lt;/div&gt;</summary>
		<author><name>Larshesel</name></author>
		
	</entry>
	<entry>
		<id>http://opentransactions.org/wiki/index.php?title=Talk:Transaction_Construction_Algorithm_(voting_pools)&amp;diff=2998</id>
		<title>Talk:Transaction Construction Algorithm (voting pools)</title>
		<link rel="alternate" type="text/html" href="http://opentransactions.org/wiki/index.php?title=Talk:Transaction_Construction_Algorithm_(voting_pools)&amp;diff=2998"/>
		<updated>2014-09-29T08:58:03Z</updated>

		<summary type="html">&lt;p&gt;Larshesel: What happens if the output list initialization procedure returns an empty output list&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[User:Larshesel|Larshesel]] ([[User talk:Larshesel|talk]]) 14:57, 26 September 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
In the preparation step it is mentioned that we create a withdrawal status object which is referenced throughout the algorithm.&lt;br /&gt;
&lt;br /&gt;
We add the roundID to this object, but it does not seem to be used anywhere. Is it needed at all?&lt;br /&gt;
&lt;br /&gt;
[[User:Justusranvier|Justusranvier]] ([[User talk:Justusranvier|talk]]) 15:41, 26 September 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
It's needed to match up withdrawalstatus objects with siglist objects.&lt;br /&gt;
&lt;br /&gt;
[[User:Larshesel|Larshesel]] ([[User talk:Larshesel|talk]]) 08:58, 29 September 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
In the output list initialization procedure we may return an empty output list if the smallest output is bigger than the sum of the inputs. What should happen if we return an empty output list? The next step (transaction initialization) seems to assume that it is not empty.&lt;br /&gt;
&lt;br /&gt;
As there are no longer any ouputs we cannot make a transaction. I don't seem to find any error code that reflects this situation.&lt;/div&gt;</summary>
		<author><name>Larshesel</name></author>
		
	</entry>
	<entry>
		<id>http://opentransactions.org/wiki/index.php?title=Talk:Transaction_Construction_Algorithm_(voting_pools)&amp;diff=2989</id>
		<title>Talk:Transaction Construction Algorithm (voting pools)</title>
		<link rel="alternate" type="text/html" href="http://opentransactions.org/wiki/index.php?title=Talk:Transaction_Construction_Algorithm_(voting_pools)&amp;diff=2989"/>
		<updated>2014-09-26T14:57:21Z</updated>

		<summary type="html">&lt;p&gt;Larshesel: Is roundID necessary in the algorithm?&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[User:Larshesel|Larshesel]] ([[User talk:Larshesel|talk]]) 14:57, 26 September 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
In the preparation step it is mentioned that we create a withdrawal status object which is referenced throughout the algorithm.&lt;br /&gt;
&lt;br /&gt;
We add the roundID to this object, but it does not seem to be used anywhere. Is it needed at all?&lt;/div&gt;</summary>
		<author><name>Larshesel</name></author>
		
	</entry>
	<entry>
		<id>http://opentransactions.org/wiki/index.php?title=Talk:Withdrawal_status&amp;diff=2982</id>
		<title>Talk:Withdrawal status</title>
		<link rel="alternate" type="text/html" href="http://opentransactions.org/wiki/index.php?title=Talk:Withdrawal_status&amp;diff=2982"/>
		<updated>2014-09-24T12:12:58Z</updated>

		<summary type="html">&lt;p&gt;Larshesel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;LARS:&lt;br /&gt;
I've seen the exclusiveMinimum boolean in several of the json objects. What does it mean? Can we maybe create some page where the different kind of common attributes are defined?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
All the json schema information I got from this site: http://json-schema.org/example1.html&lt;br /&gt;
&lt;br /&gt;
[[User:Justusranvier|Justusranvier]] ([[User talk:Justusranvier|talk]]) 12:08, 24 September 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
Lars: That makes sense. It specifies if we're talking about an open or a closed set.&lt;/div&gt;</summary>
		<author><name>Larshesel</name></author>
		
	</entry>
	<entry>
		<id>http://opentransactions.org/wiki/index.php?title=Talk:Withdrawal_status&amp;diff=2980</id>
		<title>Talk:Withdrawal status</title>
		<link rel="alternate" type="text/html" href="http://opentransactions.org/wiki/index.php?title=Talk:Withdrawal_status&amp;diff=2980"/>
		<updated>2014-09-24T08:26:49Z</updated>

		<summary type="html">&lt;p&gt;Larshesel: Created page with &amp;quot;LARS: I've seen the exclusiveMinimum boolean in several of the json objects. What does it mean? Can we maybe create some page where the different kind of common attributes are...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;LARS:&lt;br /&gt;
I've seen the exclusiveMinimum boolean in several of the json objects. What does it mean? Can we maybe create some page where the different kind of common attributes are defined?&lt;/div&gt;</summary>
		<author><name>Larshesel</name></author>
		
	</entry>
	<entry>
		<id>http://opentransactions.org/wiki/index.php?title=Keyset_(voting_pools)&amp;diff=2933</id>
		<title>Keyset (voting pools)</title>
		<link rel="alternate" type="text/html" href="http://opentransactions.org/wiki/index.php?title=Keyset_(voting_pools)&amp;diff=2933"/>
		<updated>2014-09-22T13:03:12Z</updated>

		<summary type="html">&lt;p&gt;Larshesel: Make it explicit that it is the private keys that are online&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Keysets==&lt;br /&gt;
&lt;br /&gt;
The multisig structure of a pool is called the keyset definition and is expressed in XML and stored in the OT asset contract:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;pool id=”uuid” version=”1”&amp;gt;&lt;br /&gt;
	&amp;lt;blockchain&amp;gt;bitcoin&amp;lt;/blockchain&amp;gt;&lt;br /&gt;
	&amp;lt;color&amp;gt;0&amp;lt;/color&amp;gt;&lt;br /&gt;
	&amp;lt;members&amp;gt;&lt;br /&gt;
		&amp;lt;server id=”server_id_y” /&amp;gt;&lt;br /&gt;
		&amp;lt;server id=”server_id_z” /&amp;gt;&lt;br /&gt;
		&amp;lt;server id=”server_id_w” /&amp;gt;&lt;br /&gt;
	&amp;lt;/members&amp;gt;&lt;br /&gt;
	&amp;lt;keyset schedule=”x”  m=”u” n=”v”&amp;gt;&lt;br /&gt;
		&amp;lt;series number=”1”&amp;gt;&lt;br /&gt;
			&amp;lt;key server=”server_id_y”&amp;gt;xpub_y1&amp;lt;/key&amp;gt;&lt;br /&gt;
			&amp;lt;key server=”server_id_z”&amp;gt;xpub_z1&amp;lt;/key&amp;gt;&lt;br /&gt;
			&amp;lt;key server=”server_id_w”&amp;gt;xpub_w1&amp;lt;/key&amp;gt;&lt;br /&gt;
		&amp;lt;/series&amp;gt;&lt;br /&gt;
		&amp;lt;series number=”2”&amp;gt;&lt;br /&gt;
			&amp;lt;key server=”server_id_y”&amp;gt;xpub_y2&amp;lt;/key&amp;gt;&lt;br /&gt;
			&amp;lt;key server=”server_id_z”&amp;gt;xpub_z2&amp;lt;/key&amp;gt;&lt;br /&gt;
			&amp;lt;key server=”server_id_w”&amp;gt;xpub_w2&amp;lt;/key&amp;gt;&lt;br /&gt;
		&amp;lt;/series&amp;gt;&lt;br /&gt;
	&amp;lt;/keyset&amp;gt;&lt;br /&gt;
&amp;lt;/pool&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the above example there are three servers, y, z, and w. All decisions made by the pool must be signed by u of v members of the pool. Every server contributes a different xpub for each series defined in the keyset.&lt;br /&gt;
&lt;br /&gt;
Each pool must explicitly define the crypto-currency being managed by the pool, and whether to treat the deposits as regular units or as colored units.&lt;br /&gt;
&lt;br /&gt;
Regular pools have a &amp;lt;color&amp;gt; value of 0. Colored coin pools are designated by including a [[color definition]] in the &amp;lt;color&amp;gt; section.&lt;br /&gt;
&lt;br /&gt;
Pool definitions are versioned for future extendibility.&lt;br /&gt;
&lt;br /&gt;
x is time interval expressed in [http://www.nncron.ru/help/EN/working/cron-format.htm Cron] format, either a semicolon-separated list of column values, or one of the [http://en.wikipedia.org/wiki/Cron#Predefined_scheduling_definitions predefined patterns]. The default and recommended schedule is “@weekly”. &lt;br /&gt;
&lt;br /&gt;
===Series===&lt;br /&gt;
&lt;br /&gt;
[[File:Voting_Pools_Series_Progression.png|800px]]&lt;br /&gt;
&lt;br /&gt;
The keyset contains a list of series numbers, each one of which contains an [[xpub]] for every member of the pool.&lt;br /&gt;
&lt;br /&gt;
Series numbers are always monotonic (strictly increasing). &lt;br /&gt;
&lt;br /&gt;
Series numbers are incremented on a schedule, shown above as “x”.&lt;br /&gt;
&lt;br /&gt;
All series rotations are calculated based on UTC time.&lt;br /&gt;
&lt;br /&gt;
At any given time, one series is “active”. This is the series containing the keys which will be used to create deposit and change addresses. Pool members will “fill up” this series with deposits until the next series rotation, then will begin filling up the next series.&lt;br /&gt;
&lt;br /&gt;
At any given time, one series is “hot”. The hot series is the one whose private keys are online and is currently being used to process withdrawals. All series between the hot series and the active series are inactive. Slightly before the hot series is depleted of unspent outputs (to avoid withdrawal delays) the private keys for the next inactive series are brought online and that series becomes the new hot series.&lt;br /&gt;
&lt;br /&gt;
Each series can be subdivided into two sub-series. The deposit series consists of n lists of deposit addresses, one for each member of the pool. The change series is a list of change outputs from previous withdrawal transactions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Voting Pool Technical Specifications]]&lt;/div&gt;</summary>
		<author><name>Larshesel</name></author>
		
	</entry>
	<entry>
		<id>http://opentransactions.org/wiki/index.php?title=Voting_Pool_Deposit_Process&amp;diff=2928</id>
		<title>Voting Pool Deposit Process</title>
		<link rel="alternate" type="text/html" href="http://opentransactions.org/wiki/index.php?title=Voting_Pool_Deposit_Process&amp;diff=2928"/>
		<updated>2014-09-22T12:37:43Z</updated>

		<summary type="html">&lt;p&gt;Larshesel: Fix bad link to Getdepositscript&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Procedure==&lt;br /&gt;
&lt;br /&gt;
===Initiation===&lt;br /&gt;
&lt;br /&gt;
[[File:Voting_Pools_Inbailment_Procedure-01.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Customers will normally request a deposit address by interacting with the service front end web site or some other software application. When the service receives such a request,  it notifies the OT client via the OT client API function: &amp;lt;code&amp;gt;[[request_bailment]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When the OT client receives notice of a user desire to deposit funds to a voting pool, via any method, it sends a &amp;lt;code&amp;gt;[[bailment]]&amp;lt;/code&amp;gt; transaction request to the transaction server to initiate the deposit process.&lt;br /&gt;
&lt;br /&gt;
The transaction server validates this request, and replies with a signed receipt. A copy of this receipt is broadcasted to the &amp;lt;code&amp;gt;[[audit stream]]&amp;lt;/code&amp;gt;, and another copy is stored inside an &amp;lt;code&amp;gt;[[initiatedBailment]]&amp;lt;/code&amp;gt; notice that’s placed in the user’s inbox. The transaction server adds this association to a [[deposit database]] for future reference.&lt;br /&gt;
&lt;br /&gt;
===Payment script generation===&lt;br /&gt;
&lt;br /&gt;
[[File:Voting_Pools_Inbailment_Procedure-02.png|800px]]&lt;br /&gt;
&lt;br /&gt;
When an audit server validates the transaction server’s reply to the &amp;lt;code&amp;gt;bailment&amp;lt;/code&amp;gt; message from the transaction server to which it is assigned, it adds the receipt identifier to its &amp;lt;code&amp;gt;[[deposit database]]&amp;lt;/code&amp;gt; and calls &amp;lt;code&amp;gt;[[Getdepositscript|getdepositscript]]&amp;lt;/code&amp;gt; via the websocket interface to the blockchain wallet, using the address identifier for the next unused deposit address.&lt;br /&gt;
&lt;br /&gt;
The wallet calculates and returns the designated [[Deposit Address (voting pools)|deposit address]] as [[P2SH]] output script. The audit server uses this information to update the deposit database, and to assemble and sign a &amp;lt;code&amp;gt;[[Payment Protocol (voting pools)|PaymentRequest]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===PaymentRequest delivery===&lt;br /&gt;
&lt;br /&gt;
[[File:Voting_Pools_Inbailment_Procedure-03.png|800px]]&lt;br /&gt;
&lt;br /&gt;
The audit server broadcasts the &amp;lt;code&amp;gt;PaymentRequest&amp;lt;/code&amp;gt; to all transaction servers and audit servers in the pool. The transaction server replaces the user’s &amp;lt;code&amp;gt;initiatedBailment&amp;lt;/code&amp;gt; notice in the inbox with a &amp;lt;code&amp;gt;[[pendingBailment]]&amp;lt;/code&amp;gt; notice containing a copy of the &amp;lt;code&amp;gt;PaymentRequest&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When the other audit servers in the pool receive the &amp;lt;code&amp;gt;PaymentRequest&amp;lt;/code&amp;gt; broadcast they add the deposit to their respective deposit databases. The other transaction servers in the pool cache the &amp;lt;code&amp;gt;PaymentRequest&amp;lt;/code&amp;gt; to answer verification requests from the OT client.&lt;br /&gt;
&lt;br /&gt;
The OT client should validate the &amp;lt;code&amp;gt;PaymentRequest&amp;lt;/code&amp;gt; against the voting pool [[asset contract (voting pools)|asset contract]]. If it is valid then it should query a random selection of other transaction servers, at least &amp;lt;code&amp;gt;m-1&amp;lt;/code&amp;gt;, using the &amp;lt;code&amp;gt;[[Payment_Protocol_(voting_pools)|PaymentRequest identifier]]&amp;lt;/code&amp;gt; to verify whether they have seen it. If this check is successful, it then initiates the blockchain transaction by passing the &amp;lt;code&amp;gt;PaymentRequest &amp;lt;/code&amp;gt;to the user's local wallet application which is configured to handle &amp;lt;code&amp;gt;[[bitcoin:]] URIs&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Deposit and crediting===&lt;br /&gt;
&lt;br /&gt;
[[File:Voting_Pools_Inbailment_Procedure-04.png|800px]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
;Type 1 Event - [[Fraudulent Deposit Address]]&lt;br /&gt;
:A malicious or hacked operator may give the customer an invalid &amp;lt;code&amp;gt;PaymentRequest&amp;lt;/code&amp;gt; in an attempt to steal deposits.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Each pool member’s Bitcoin wallet must notify its audit server of any deposits received to an address which the pool controls. When an incoming transaction is received to an address the audit servers are expecting due to previously broadcast &amp;lt;code&amp;gt;PaymentRequest&amp;lt;/code&amp;gt;, they will use the &amp;lt;code&amp;gt;[[Voting Pool Wallet API#getinfomultisigwalletaddress|getinfomultisigwalletaddress]]&amp;lt;/code&amp;gt; calls to identify the incoming transaction, and &amp;lt;code&amp;gt;[[Voting Pool Wallet API#gettransactionstatus|gettransactionstatus]]&amp;lt;/code&amp;gt; to monitor its confirmation status.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
;Type 0 Event - [[Deposit Never Received]]&lt;br /&gt;
:It’s possible that the customer may never actually transfer bitcoins after requesting a PaymentRequest.&lt;br /&gt;
&lt;br /&gt;
;Type 1 Event - [[Unknown Deposit]]&lt;br /&gt;
:A deposit may be received to an address which has never been used, and for which a PaymentRequest was never created so no member of the pool knows to which nym it should be credited. &lt;br /&gt;
&lt;br /&gt;
;Type 1 Event - [[Duplicate Deposit]]&lt;br /&gt;
:A deposit may be received from an address which has been previously used, so the audit servers know to which nym the address is assigned.&lt;br /&gt;
&lt;br /&gt;
;Type 0 Event - [[Dust Handling]]:&lt;br /&gt;
The size of the deposit may be below the network dust threshold (small enough that it would require more in transaction fees to spend than it is worth).&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
The audit server relays the number of confirmations the incoming transaction has received to the transaction server. Once the number is sufficient according to the [[Funds_Available_Policy_(voting_pools)|Funds Available Policy]] the transaction server will issue an OT asset for the amount of the deposit to the [[nym]] of the user.&lt;br /&gt;
&lt;br /&gt;
The transaction server will replace the &amp;lt;code&amp;gt;pendingBailment&amp;lt;/code&amp;gt; notice (in the inbox) with a &amp;lt;code&amp;gt;[[completedBailment]]&amp;lt;/code&amp;gt; notice, which includes a signed copy of the original &amp;lt;code&amp;gt;bailment&amp;lt;/code&amp;gt; request, as well as a copy of the audit server’s signed notice of confirmations, which includes the transaction identifier provided by the blockchain wallet.&lt;br /&gt;
&lt;br /&gt;
The OT client processes the user’s OT account inbox, removing the &amp;lt;code&amp;gt;completedBailment&amp;lt;/code&amp;gt; notice, which simultaneously closes the transaction number and updates his OT balance.&lt;br /&gt;
&lt;br /&gt;
The audit servers in the pool must monitor all deposits to ensure the [[Funds Available Policy (voting pools)|Funds Available Policy]] is satisfied to avoid the risk of a double spend or chain fork causing insolvency. Any server which offers more early deposit credits than what it can cover with its service account must have its audit status set to &amp;lt;code&amp;gt;[[Auditing (voting pools)|degraded]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
;Type 2 Event - [[Minority loss of consensus#Non-credited Deposit|Non-credited Deposit]]&lt;br /&gt;
:The transaction server fails to place a &amp;lt;code&amp;gt;completedBailment&amp;lt;/code&amp;gt; notice in the user’s inbox after a successful Bitcoin transfer.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If an initially-seen deposit fails due to a chain fork, and if the user has not yet been credited with an OT receipt for the deposit, the status of the deposit remains pending. The audit server should notify the transaction server by setting the number of confirmations back to zero. In the typical case of blockchain [[reorg]] event, the deposit transaction should re-enter the [[mempool]] automatically and the wallet can assist with this by rebroadcasting it.&lt;br /&gt;
&lt;br /&gt;
If an initially-seen deposit has become invalid due to conflicting transactions which made it into the blockchain, the audit server should mark the deposit as &amp;lt;code&amp;gt;failed&amp;lt;/code&amp;gt; by setting the number of confirmations to -1. The audit server should notify the transaction server of the failure, who then replaces the user’s &amp;lt;code&amp;gt;pendingBailment&amp;lt;/code&amp;gt; notice with a &amp;lt;code&amp;gt;[[failedBailment]]&amp;lt;/code&amp;gt; notice. The transaction server should update the status to &amp;lt;code&amp;gt;failed&amp;lt;/code&amp;gt; in the deposit database and the address should not be intentionally reused. The OT client can then process the user’s inbox, removing the &amp;lt;code&amp;gt;failedBailment&amp;lt;/code&amp;gt; notice and closing the transaction number. In this case there is no change to the OT account balance, unlike with a &amp;lt;code&amp;gt;completeBailment&amp;lt;/code&amp;gt; notice.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
;Type 1 Event - [[Reversed Deposit]]&lt;br /&gt;
:A deposit could disappear from the blockchain after the user has already been issued an OT receipt&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Category:Voting Pool Operations]]&lt;/div&gt;</summary>
		<author><name>Larshesel</name></author>
		
	</entry>
	<entry>
		<id>http://opentransactions.org/wiki/index.php?title=Talk:Consensus_Process_(voting_pools)&amp;diff=2927</id>
		<title>Talk:Consensus Process (voting pools)</title>
		<link rel="alternate" type="text/html" href="http://opentransactions.org/wiki/index.php?title=Talk:Consensus_Process_(voting_pools)&amp;diff=2927"/>
		<updated>2014-09-22T12:14:45Z</updated>

		<summary type="html">&lt;p&gt;Larshesel: Which wallet issues the transaction?&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In computer science anything based on consensus in a distributed network is an incredibly complicated thing to implement. There are some tools out there like zookeeper (never used it) which I understand can be used for this kind of thing.&lt;br /&gt;
&lt;br /&gt;
Something to keep in mind is, that roughly speaking you cannot get consensus, (two generals problem etc), but you can get consensus with some degree of certainty.&lt;br /&gt;
&lt;br /&gt;
Would there be any way where we could change this such that we do not need concensus?&lt;br /&gt;
&lt;br /&gt;
Why do the peers have to agree on the addresses every 5 minutes?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need consensus because each member of the voting pool to take the same actions. We're tried to restrict the scope of consensus to the bare minimum possible in order to make the withdrawal process work.&lt;br /&gt;
&lt;br /&gt;
As far as the algorithm, we'll be using a system similar to what Ripple uses. Last year Chris was contracted to produce a custom cryptocurrency and the algorithm he used for them is compatible with what we need for voting pools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Good to know the consensus has been scoped to be as minimal as possible. Can we add a reference to the algorithm we're going to use?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Yes, but it will probably be until after more of the auditor is documented before this page is filled out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
Lars:&lt;br /&gt;
bullet 3: A list of valid withdrawals to be processed, sorted in TBD order, which may be an empty list. &lt;br /&gt;
&lt;br /&gt;
So if each audit-server gets this list of withdrawals. And after they have all exchanged signatures and gotten consensus, which one of the wallets does actually issue a transaction to the blockchain? Do they all do that?&lt;/div&gt;</summary>
		<author><name>Larshesel</name></author>
		
	</entry>
	<entry>
		<id>http://opentransactions.org/wiki/index.php?title=Voting_Pool_Withdrawal_Process&amp;diff=2926</id>
		<title>Voting Pool Withdrawal Process</title>
		<link rel="alternate" type="text/html" href="http://opentransactions.org/wiki/index.php?title=Voting_Pool_Withdrawal_Process&amp;diff=2926"/>
		<updated>2014-09-22T11:56:56Z</updated>

		<summary type="html">&lt;p&gt;Larshesel: /* Consensus */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Procedure==&lt;br /&gt;
&lt;br /&gt;
===Initiation===&lt;br /&gt;
&lt;br /&gt;
Customers will normally request a withdrawal using one of the client applications that talk to the notary. These requests will end up in the auditor stream. The auditor will then validate and batch multiple withdrawal requests and ask the blockchain wallet to construct one or more transactions with one output for every withdrawal.&lt;br /&gt;
&lt;br /&gt;
'''TODO: explain why batching is important'''&lt;br /&gt;
&lt;br /&gt;
=== Consensus ===&lt;br /&gt;
&lt;br /&gt;
In order to withdraw funds from a M-of-N voting pool, M members must sign the blockchain transaction that moves the coins to the desired addresses. For that reason, auditors will have to periodically [[Consensus Process (voting pools)|agree on a set of parameters for the blockchain transactions]]. These parameters are then passed on to their wallets, allowing them to generate transactions deterministically.&lt;br /&gt;
&lt;br /&gt;
=== Transaction Construction ===&lt;br /&gt;
&lt;br /&gt;
The auditor sends a [[Startwithdrawal|startwithdrawal]] command to the wallet, which then attempts to construct blockchain transactions to satisfy the requested ouputs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Transaction Signing &amp;amp; Broadcasting ===&lt;br /&gt;
&lt;br /&gt;
Once an auditor receives new [[Siglist|signature lists]] for an in-progress transaction, it will send a [[Updatewithdrawal|updatewithdrawal]] command to the blockchain wallet, passing those new signatures. Once the blockchain wallet has received the minimum number of required signatures for a given transaction, it will be broadcast.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Voting Pool Operations]]&lt;/div&gt;</summary>
		<author><name>Larshesel</name></author>
		
	</entry>
	<entry>
		<id>http://opentransactions.org/wiki/index.php?title=Keyset_(voting_pools)&amp;diff=2923</id>
		<title>Keyset (voting pools)</title>
		<link rel="alternate" type="text/html" href="http://opentransactions.org/wiki/index.php?title=Keyset_(voting_pools)&amp;diff=2923"/>
		<updated>2014-09-22T10:00:34Z</updated>

		<summary type="html">&lt;p&gt;Larshesel: Move definition of x to keyset definition&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Keysets==&lt;br /&gt;
&lt;br /&gt;
The multisig structure of a pool is called the keyset definition and is expressed in XML and stored in the OT asset contract:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;pool id=”uuid” version=”1”&amp;gt;&lt;br /&gt;
	&amp;lt;blockchain&amp;gt;bitcoin&amp;lt;/blockchain&amp;gt;&lt;br /&gt;
	&amp;lt;color&amp;gt;0&amp;lt;/color&amp;gt;&lt;br /&gt;
	&amp;lt;members&amp;gt;&lt;br /&gt;
		&amp;lt;server id=”server_id_y” /&amp;gt;&lt;br /&gt;
		&amp;lt;server id=”server_id_z” /&amp;gt;&lt;br /&gt;
		&amp;lt;server id=”server_id_w” /&amp;gt;&lt;br /&gt;
	&amp;lt;/members&amp;gt;&lt;br /&gt;
	&amp;lt;keyset schedule=”x”  m=”u” n=”v”&amp;gt;&lt;br /&gt;
		&amp;lt;series number=”1”&amp;gt;&lt;br /&gt;
			&amp;lt;key server=”server_id_y”&amp;gt;xpub_y1&amp;lt;/key&amp;gt;&lt;br /&gt;
			&amp;lt;key server=”server_id_z”&amp;gt;xpub_z1&amp;lt;/key&amp;gt;&lt;br /&gt;
			&amp;lt;key server=”server_id_w”&amp;gt;xpub_w1&amp;lt;/key&amp;gt;&lt;br /&gt;
		&amp;lt;/series&amp;gt;&lt;br /&gt;
		&amp;lt;series number=”2”&amp;gt;&lt;br /&gt;
			&amp;lt;key server=”server_id_y”&amp;gt;xpub_y2&amp;lt;/key&amp;gt;&lt;br /&gt;
			&amp;lt;key server=”server_id_z”&amp;gt;xpub_z2&amp;lt;/key&amp;gt;&lt;br /&gt;
			&amp;lt;key server=”server_id_w”&amp;gt;xpub_w2&amp;lt;/key&amp;gt;&lt;br /&gt;
		&amp;lt;/series&amp;gt;&lt;br /&gt;
	&amp;lt;/keyset&amp;gt;&lt;br /&gt;
&amp;lt;/pool&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the above example there are three servers, y, z, and w. All decisions made by the pool must be signed by u of v members of the pool. Every server contributes a different xpub for each series defined in the keyset.&lt;br /&gt;
&lt;br /&gt;
Each pool must explicitly define the crypto-currency being managed by the pool, and whether to treat the deposits as regular units or as colored units.&lt;br /&gt;
&lt;br /&gt;
Regular pools have a &amp;lt;color&amp;gt; value of 0. Colored coin pools are designated by including a [[color definition]] in the &amp;lt;color&amp;gt; section.&lt;br /&gt;
&lt;br /&gt;
Pool definitions are versioned for future extendibility.&lt;br /&gt;
&lt;br /&gt;
x is time interval expressed in [http://www.nncron.ru/help/EN/working/cron-format.htm Cron] format, either a semicolon-separated list of column values, or one of the [http://en.wikipedia.org/wiki/Cron#Predefined_scheduling_definitions predefined patterns]. The default and recommended schedule is “@weekly”. &lt;br /&gt;
&lt;br /&gt;
===Series===&lt;br /&gt;
&lt;br /&gt;
[[File:Voting_Pools_Series_Progression.png|800px]]&lt;br /&gt;
&lt;br /&gt;
The keyset contains a list of series numbers, each one of which contains an [[xpub]] for every member of the pool.&lt;br /&gt;
&lt;br /&gt;
Series numbers are always monotonic (strictly increasing). &lt;br /&gt;
&lt;br /&gt;
Series numbers are incremented on a schedule, shown above as “x”.&lt;br /&gt;
&lt;br /&gt;
All series rotations are calculated based on UTC time.&lt;br /&gt;
&lt;br /&gt;
At any given time, one series is “active”. This is the series containing the keys which will be used to create deposit and change addresses. Pool members will “fill up” this series with deposits until the next series rotation, then will begin filling up the next series.&lt;br /&gt;
&lt;br /&gt;
At any given time, one series is “hot”. The hot series is the one whose keys are online and is currently being used to process withdrawals. All series between the hot series and the active series are inactive. Slightly before the hot series is depleted of unspent outputs (to avoid withdrawal delays) the private keys for the next inactive series are brought online and that series becomes the new hot series.&lt;br /&gt;
&lt;br /&gt;
Each series can be subdivided into two sub-series. The deposit series consists of n lists of deposit addresses, one for each member of the pool. The change series is a list of change outputs from previous withdrawal transactions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Voting Pool Technical Specifications]]&lt;/div&gt;</summary>
		<author><name>Larshesel</name></author>
		
	</entry>
	<entry>
		<id>http://opentransactions.org/wiki/index.php?title=Talk:Wallet_(blockchain)&amp;diff=2922</id>
		<title>Talk:Wallet (blockchain)</title>
		<link rel="alternate" type="text/html" href="http://opentransactions.org/wiki/index.php?title=Talk:Wallet_(blockchain)&amp;diff=2922"/>
		<updated>2014-09-22T09:31:26Z</updated>

		<summary type="html">&lt;p&gt;Larshesel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Wallet Creation section mentions that, when bringing extended private keys online, the auditor must specify them in the order matching the extended public keys, but there's no need for that as the wallet can figure out the matching extended public key for any given extended private key&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
Lars:&lt;br /&gt;
&lt;br /&gt;
''Series Identifier&lt;br /&gt;
&lt;br /&gt;
''Since one wallet will need to handle multiple pools and series, a series identifier must include the pool for which it belongs.&lt;br /&gt;
&lt;br /&gt;
''A wallet identifier is defined as JSON object and is composed of two parts:'' &lt;br /&gt;
&lt;br /&gt;
It's confusing that we're talking about a Series Identifier, but then define a wallet identifier. I suppose it should just say 'Series identifier?'&lt;/div&gt;</summary>
		<author><name>Larshesel</name></author>
		
	</entry>
	<entry>
		<id>http://opentransactions.org/wiki/index.php?title=Transaction_Construction_Algorithm_(voting_pools)&amp;diff=2889</id>
		<title>Transaction Construction Algorithm (voting pools)</title>
		<link rel="alternate" type="text/html" href="http://opentransactions.org/wiki/index.php?title=Transaction_Construction_Algorithm_(voting_pools)&amp;diff=2889"/>
		<updated>2014-09-19T13:18:57Z</updated>

		<summary type="html">&lt;p&gt;Larshesel: /* Initial Conditions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
In order to avoid an expensive and error-prone consensus process, it is mandatory for wallets to be able to construct withdrawal transactions in a deterministic manner, assuming they are given the withdrawal requests in a deterministic order. Once this is accomplished, then it only becomes necessary for wallets to share signatures among themselves because they know they all signed the exact same bitcoin transaction.&lt;br /&gt;
&lt;br /&gt;
==Procedure==&lt;br /&gt;
&lt;br /&gt;
===Overview===&lt;br /&gt;
&lt;br /&gt;
[[File:Transaction_Construction_Algorithm_-_Overview.png|500px|right|thumb]]&lt;br /&gt;
&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
The [[startwithdrawal]] API call has been received by the wallet, and all the arguments have been checked for errors.&lt;br /&gt;
&lt;br /&gt;
====Sequence====&lt;br /&gt;
&lt;br /&gt;
The basic flow of the procedure is:&lt;br /&gt;
&lt;br /&gt;
# Gather accounting information from the API call arguments&lt;br /&gt;
# Validate and sort the output list&lt;br /&gt;
# Start a new transactions&lt;br /&gt;
# Add outputs to the transaction until either all outputs are added or all inputs are used.&lt;br /&gt;
# Make sure all generated transactions are ready for signing.&lt;br /&gt;
# Create a list of all signatures which the wallet is capable of generating.&lt;br /&gt;
# Create a status list containing the deposition of every output the caller specified.&lt;br /&gt;
# Return the status list and signature list to the caller.&lt;br /&gt;
&lt;br /&gt;
Each step in this chart is more fully described below.&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Preparation===&lt;br /&gt;
&lt;br /&gt;
[[File:Transaction_Construction_Algorithm_-_Preparation.png|175px|right|thumb]]&lt;br /&gt;
&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
The [[startwithdrawal]] API call has been received by the wallet, and all the arguments have been checked for errors.&lt;br /&gt;
&lt;br /&gt;
====Sequence====&lt;br /&gt;
&lt;br /&gt;
# The algorithm must keep track of the next change address to be used. The initial value is supplied as the &amp;lt;code&amp;gt;[[Startwithdrawal#Arguments|changestart]]&amp;lt;/code&amp;gt; argument. Any time a change output is allocated, the index value of the [[address identifier]] is incremented, and if a change output is remove from a transaction the index value is decremented. The final value will be returned to the caller as the &amp;lt;code&amp;gt;[[Withdrawal status|nextchangestart]]&amp;lt;/code&amp;gt; value in the [[Withdrawal status| withdrawal status list]].&lt;br /&gt;
# Prepare an empty list for holding transactions as they are constructed and before they are signed.&lt;br /&gt;
# Prepare an empty array to hold the transaction signatures which will be returned to the caller as the &amp;lt;code&amp;gt;[[siglist| signatures]]&amp;lt;/code&amp;gt; value.&lt;br /&gt;
# Prepare an &amp;lt;code&amp;gt;withdrawal status&amp;lt;/code&amp;gt; object.&lt;br /&gt;
## &amp;lt;code&amp;gt;roundID&amp;lt;/code&amp;gt;: copied from &amp;lt;code&amp;gt;roundID&amp;lt;/code&amp;gt; argument&lt;br /&gt;
## &amp;lt;code&amp;gt;nextinputstart&amp;lt;/code&amp;gt;: nil&lt;br /&gt;
## &amp;lt;code&amp;gt;nextchangestart&amp;lt;/code&amp;gt;: nil&lt;br /&gt;
## &amp;lt;code&amp;gt;fees&amp;lt;/code&amp;gt;: 0&lt;br /&gt;
## &amp;lt;code&amp;gt;outputs&amp;lt;/code&amp;gt;: should contain an entry for every output passed:&lt;br /&gt;
### &amp;lt;code&amp;gt;outBailmentID&amp;lt;/code&amp;gt;: copied from &amp;lt;code&amp;gt;outBailmentID&amp;lt;/code&amp;gt; entry in &amp;lt;code&amp;gt;outputs&amp;lt;/code&amp;gt; argument&lt;br /&gt;
### &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt;: empty string&lt;br /&gt;
### &amp;lt;code&amp;gt;transactions&amp;lt;/code&amp;gt;: nil&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
===Output List Initialization===&lt;br /&gt;
&lt;br /&gt;
[[File:Transaction_Construction_Algorithm_-_Output List Initialization.png|350px|right|thumb]]&lt;br /&gt;
&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
The [[startwithdrawal]] API call has been received by the wallet, and all the arguments have been checked for errors.&lt;br /&gt;
&lt;br /&gt;
====Sequence====&lt;br /&gt;
&lt;br /&gt;
# Pass the &amp;lt;code&amp;gt;inputstart&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;inputstop&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;dustthreshold&amp;lt;/code&amp;gt; parameters to the [[Input Selection Algorithm (voting pools)|input selection algorithm]] to obtain an ordered list of eligible inputs.&lt;br /&gt;
# 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.&lt;br /&gt;
## Take the sum of both lists.&lt;br /&gt;
## 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.&lt;br /&gt;
# If the output list is non-empty, sort it by &amp;lt;code&amp;gt;outBailmentID&amp;lt;/code&amp;gt;&lt;br /&gt;
# 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.&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
===Initialize New Transaction===&lt;br /&gt;
&lt;br /&gt;
[[File:Transaction_Construction_Algorithm_-_Initialize New Transaction.png|175px|right|thumb]]&lt;br /&gt;
&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
There are no pending transactions to in the process of being constructed, either because this is the first transaction of the algorithm or because a previous pending transaction has been moved to the finished transaction list.&lt;br /&gt;
&lt;br /&gt;
The input stack contains at least one input.&lt;br /&gt;
&lt;br /&gt;
The output stack contains at least one output.&lt;br /&gt;
&lt;br /&gt;
====Sequence====&lt;br /&gt;
&lt;br /&gt;
# Create a minimal transaction skeleton with a header and one change output.&lt;br /&gt;
&lt;br /&gt;
After creating the transaction skeleton, and after any action which alters it, the new transaction size (bytes) and minimum required transaction fee must be recalculated.&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
===Add Next Output===&lt;br /&gt;
&lt;br /&gt;
[[File:Transaction_Construction_Algorithm_-_Add Next Output.png|500px|right|thumb]]&lt;br /&gt;
&lt;br /&gt;
====Initial Conditions====&lt;br /&gt;
&lt;br /&gt;
The output stack contains at least one output.&lt;br /&gt;
&lt;br /&gt;
There is a transaction in progress which is ready to accept new outputs. This transaction is either empty or it contains 1 or more outputs.&lt;br /&gt;
&lt;br /&gt;
If the transaction already contains outputs, then it also contains sufficient inputs to cover those outputs and any required transaction fees without exceeding size limits. This is because it must have already successfully passed through this procedure before.&lt;br /&gt;
&lt;br /&gt;
====Sequence====&lt;br /&gt;
&lt;br /&gt;
# Validate the output address. If it is invalid, update the withdrawal status list and from this procedure. If it is valid, add it to the transaction&lt;br /&gt;
# Check that the transaction does not exceed size limits. If it does, follow the [[Transaction Construction Algorithm (voting pools)#Oversize Transaction|Oversize Transaction]] procedure.&lt;br /&gt;
# Compare the sum of the inputs to the sum of the inputs and required transaction fee to determine if more inputs are required.&lt;br /&gt;
## If no more inputs are required, then update the status for the output's associated outBailmentID to &amp;quot;success&amp;quot;. The rest of the status data for this outBailmentID will be filled in at a later stage of the algorithm.&lt;br /&gt;
# If more inputs are required, then check to see if any more are available.&lt;br /&gt;
## According to the initial conditions, the input stack can not be empty on the first run through this loop.&lt;br /&gt;
## If the input stack is empty at this point, then the output has added at least one input beyond what was needed to satisfy the prior output (if there was a prior output)&lt;br /&gt;
## If the input stack is empty, then the output can only be partially fulfilled. Follow the [[Transaction Construction Algorithm (voting pools)#Split Output|Split Output]] procedure.&lt;br /&gt;
# Add the next input from the stack, and continue the loop at step 2.&lt;br /&gt;
&lt;br /&gt;
The loop will continue until either:&lt;br /&gt;
&lt;br /&gt;
* The transaction contains sufficient input value to satisfy the output plus transaction fees&lt;br /&gt;
* The transaction exceeds size limits&lt;br /&gt;
* There is not enough input value, but no more inputs are available&lt;br /&gt;
&lt;br /&gt;
[[Category:Voting Pool Technical Specifications]]&lt;/div&gt;</summary>
		<author><name>Larshesel</name></author>
		
	</entry>
	<entry>
		<id>http://opentransactions.org/wiki/index.php?title=Talk:Consensus_Process_(voting_pools)&amp;diff=2856</id>
		<title>Talk:Consensus Process (voting pools)</title>
		<link rel="alternate" type="text/html" href="http://opentransactions.org/wiki/index.php?title=Talk:Consensus_Process_(voting_pools)&amp;diff=2856"/>
		<updated>2014-09-16T14:34:42Z</updated>

		<summary type="html">&lt;p&gt;Larshesel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In computer science anything based on consensus in a distributed network is an incredibly complicated thing to implement. There are some tools out there like zookeeper (never used it) which I understand can be used for this kind of thing.&lt;br /&gt;
&lt;br /&gt;
Something to keep in mind is, that roughly speaking you cannot get consensus, (two generals problem etc), but you can get consensus with some degree of certainty.&lt;br /&gt;
&lt;br /&gt;
Would there be any way where we could change this such that we do not need concensus?&lt;br /&gt;
&lt;br /&gt;
Why do the peers have to agree on the addresses every 5 minutes?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need consensus because each member of the voting pool to take the same actions. We're tried to restrict the scope of consensus to the bare minimum possible in order to make the withdrawal process work.&lt;br /&gt;
&lt;br /&gt;
As far as the algorithm, we'll be using a system similar to what Ripple uses. Last year Chris was contracted to produce a custom cryptocurrency and the algorithm he used for them is compatible with what we need for voting pools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Good to know the consensus has been scoped to be as minimal as possible. Can we add a reference to the algorithm we're going to use?&lt;/div&gt;</summary>
		<author><name>Larshesel</name></author>
		
	</entry>
	<entry>
		<id>http://opentransactions.org/wiki/index.php?title=Input_Selection_Algorithm_(voting_pools)&amp;diff=2854</id>
		<title>Input Selection Algorithm (voting pools)</title>
		<link rel="alternate" type="text/html" href="http://opentransactions.org/wiki/index.php?title=Input_Selection_Algorithm_(voting_pools)&amp;diff=2854"/>
		<updated>2014-09-16T13:35:49Z</updated>

		<summary type="html">&lt;p&gt;Larshesel: /* Eligibility criteria */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
In order to avoid an expensive and error-prone consensus process, it is mandatory for wallets to be able to construct withdrawal transactions in a deterministic manner, assuming they are given the withdrawal requests in a deterministic order. Once this is accomplished, then it only becomes necessary for wallets to share signatures among themselves because they know they all signed the exact same bitcoin transaction.&lt;br /&gt;
&lt;br /&gt;
==Procedure==&lt;br /&gt;
&lt;br /&gt;
The input selection algorithm generates an ordered list of eligible inputs for a withdrawal transaction. It is called from [[startwithdrawal]] with a set of three parameters:&lt;br /&gt;
&lt;br /&gt;
# The first [[Wallet_(blockchain)#Address_Identification|address identifier]] to be considered.&lt;br /&gt;
# The last adress identifier to be considered.&lt;br /&gt;
# The minimum allowed input size.&lt;br /&gt;
&lt;br /&gt;
The algorithm returns all inputs associated with the inclusive range given by inputstart and inputstop which are considered eligable, in a specific order.&lt;br /&gt;
&lt;br /&gt;
===Eligibility criteria===&lt;br /&gt;
&lt;br /&gt;
An unspent output is considered eligable if it meets the following criteria:&lt;br /&gt;
&lt;br /&gt;
* Its size is larger than dustthreshold&lt;br /&gt;
* The transaction in which it was created has more than 100 confirmations&lt;br /&gt;
&lt;br /&gt;
The first criteria ensures the input will add more value to the transaction than the cost spend it in terms of fees.&lt;br /&gt;
&lt;br /&gt;
The second ensures determinism. &lt;br /&gt;
&lt;br /&gt;
Withdrawals are processed from the oldest deposits, in FIFO order and reuse of deposit addresses is not encouraged. However, it's not possible to prevent anyone from sending duplicate or unsolicited deposits to an address. The [[duplicate deposit]] procedure sweeps unsolicited deposits to their correct location, however at any given time it's not possible to ensure all nodes have performed this procedure at the exact same moment.&lt;br /&gt;
&lt;br /&gt;
If the recommended values of weekly key rotation and 95% cold storage are followed, then the inputs being selected should have about 20000 confirmations (two orders of magnitude higher than the limit.)&lt;br /&gt;
&lt;br /&gt;
By rejecting all inputs with less than 100 confirmations, the pool effectively has a 16 hour window in which to detect duplicate deposits and perform the duplicate deposit procedure before there is a risk of non-deterministic transaction construction.&lt;br /&gt;
&lt;br /&gt;
===Input Ordering===&lt;br /&gt;
&lt;br /&gt;
When moving from address to address, the various parameters of the address identifier are incremented in the following order:&lt;br /&gt;
&lt;br /&gt;
# branch (0 to n+1)&lt;br /&gt;
# index (0 to highest used for series)&lt;br /&gt;
# series (oldest to newest)&lt;br /&gt;
&lt;br /&gt;
If an address references more than one eligible inputs, they are all selected and are sorted by txid, then by output index.&lt;br /&gt;
&lt;br /&gt;
In an address contains no eligible inputs, it is skipped.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
[[File:Voting_Pools_Series_Table.png|800px]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Voting Pool Technical Specifications]]&lt;/div&gt;</summary>
		<author><name>Larshesel</name></author>
		
	</entry>
	<entry>
		<id>http://opentransactions.org/wiki/index.php?title=Talk:Consensus_Process_(voting_pools)&amp;diff=2853</id>
		<title>Talk:Consensus Process (voting pools)</title>
		<link rel="alternate" type="text/html" href="http://opentransactions.org/wiki/index.php?title=Talk:Consensus_Process_(voting_pools)&amp;diff=2853"/>
		<updated>2014-09-16T13:03:15Z</updated>

		<summary type="html">&lt;p&gt;Larshesel: Created page with &amp;quot;In computer science anything based on consensus in a distributed network is an incredibly complicated thing to implement. There are some tools out there like zookeeper (never ...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In computer science anything based on consensus in a distributed network is an incredibly complicated thing to implement. There are some tools out there like zookeeper (never used it) which I understand can be used for this kind of thing.&lt;br /&gt;
&lt;br /&gt;
Something to keep in mind is, that roughly speaking you cannot get consensus, (two generals problem etc), but you can get consensus with some degree of certainty.&lt;br /&gt;
&lt;br /&gt;
Would there be any way where we could change this such that we do not need concensus?&lt;br /&gt;
&lt;br /&gt;
Why do the peers have to agree on the addresses every 5 minutes?&lt;/div&gt;</summary>
		<author><name>Larshesel</name></author>
		
	</entry>
	<entry>
		<id>http://opentransactions.org/wiki/index.php?title=Talk:Keyset_(voting_pools)&amp;diff=2622</id>
		<title>Talk:Keyset (voting pools)</title>
		<link rel="alternate" type="text/html" href="http://opentransactions.org/wiki/index.php?title=Talk:Keyset_(voting_pools)&amp;diff=2622"/>
		<updated>2014-09-01T01:01:02Z</updated>

		<summary type="html">&lt;p&gt;Larshesel: Created page with &amp;quot;I understand what an xpub is (an extended public key) but it might not be clear for the first time reader, maybe we should write that. Do we have a good reference on extended ...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I understand what an xpub is (an extended public key) but it might not be clear for the first time reader, maybe we should write that. Do we have a good reference on extended keys? I guess this might be the best: https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#Extended_keys&lt;/div&gt;</summary>
		<author><name>Larshesel</name></author>
		
	</entry>
</feed>