Difference between revisions of "Da2ce7:New Transaction"

From Bitcoin Wiki
Jump to: navigation, search
(Changed Input.)
(updated to unique_id)
Line 39: Line 39:
 
   newtransaction {name}
 
   newtransaction {name}
 
    
 
    
   response {txnumber}
+
   response {unique_id}
  
 
    
 
    
 
   /// add an input to the transaction. (1 overrides)
 
   /// add an input to the transaction. (1 overrides)
   addinput {txnumber} {txid} {index}
+
   addinput {unique_id} {txid} {index}
   addinput {txnumber} {txid} {index} {comment}
+
   addinput {unique_id} {txid} {index} {comment}
 
    
 
    
   response {txnumber} {inid}
+
   response {unique_id} {inid}
  
 
    
 
    
 
   /// add outputs to the transaction (6 overrides)
 
   /// add outputs to the transaction (6 overrides)
 
   /// add fee to transaction
 
   /// add fee to transaction
   addoutput {txnumber} {amount} {forced|suggested|optional}
+
   addoutput {unique_id} {amount} {forced|suggested|optional}
   addoutput {txnumber} {amount} {forced|suggested|optional} {comment}
+
   addoutput {unique_id} {amount} {forced|suggested|optional} {comment}
 
    
 
    
 
   // add change address to transaction
 
   // add change address to transaction
   addoutput {txnumber} {pubkey}
+
   addoutput {unique_id} {pubkey}
   addoutput {txnumber} {pubkey} {comment}
+
   addoutput {unique_id} {pubkey} {comment}
 
    
 
    
 
   // add send outputs
 
   // add send outputs
   addoutput {txnumber} {address} {amount}
+
   addoutput {unique_id} {address} {amount}
   addoutput {txnumber} {address} {amount} {comment}
+
   addoutput {unique_id} {address} {amount} {comment}
 
    
 
    
   response  {txnumber} {outid}
+
   response  {unique_id} {outid}
 
    
 
    
 
   // add many send outputs
 
   // add many send outputs
   addoutputlist {txnumber} [{address},{amount}]
+
   addoutputlist {unique_id} [{address},{amount}]
 
    
 
    
   response {txnumber}  [{outid}]
+
   response {unique_id}  [{outid}]
  
 
    
 
    
 
   /// remove input or outpus (1 override)
 
   /// remove input or outpus (1 override)
   remove {txnumber} {inid or outid}
+
   remove {unique_id} {inid or outid}
   remove {txnumber} [{inid or outid}]
+
   remove {unique_id} [{inid or outid}]
 
    
 
    
   response {txnumber} droped: {inid or outid}
+
   response {unique_id} droped: {inid or outid}
   response {txnumber} droped: [{inid or outid}]
+
   response {unique_id} droped: [{inid or outid}]
  
 
    
 
    
 
   /// prints out human readable information about the tranaction
 
   /// prints out human readable information about the tranaction
   shownewtransaction {txnumber} (1 override)
+
   shownewtransaction {unique_id} (1 override)
 
    
 
    
   response {txnumber}
+
   response {unique_id}
             in: [{inid},{address},{amount},(comment)]
+
             in: [{unique_id},{address},{amount},(comment)]
 
             in total: {amount}
 
             in total: {amount}
             out: [{outid},{address},{amount},(comment)]
+
             out: [{unique_id},{address},{amount},(comment)]
 
             out total: {amount}
 
             out total: {amount}
 
             fee: {amount}
 
             fee: {amount}
Line 93: Line 93:
 
    
 
    
 
   response {txid}
 
   response {txid}
             in: [{inid},{address},{amount},(comment)]
+
             in: [{txid},{address},{amount},(comment)]
 
             in total: {amount}
 
             in total: {amount}
             out: [{outid},{address},{amount},(comment)]
+
             out: [{address},{amount},(comment)]
 
             out total: {amount}
 
             out total: {amount}
 
             fee: {amount}
 
             fee: {amount}
Line 103: Line 103:
 
    
 
    
 
   /// demote a transaction (1 override)
 
   /// demote a transaction (1 override)
   demotetransaction {txnumber}
+
   demotetransaction {unique_id}
   demotetransaction {txnumber} {build|ready|done}
+
   demotetransaction {unique_id} {build|ready|done}
 
    
 
    
   response {txnumber} {building|ready|done}
+
   response {unique_id} {building|ready|done}
  
 
    
 
    
 
   /// exports a binary encoded transition (4 override)
 
   /// exports a binary encoded transition (4 override)
   exporttransaction {txnumber}
+
   exporttransaction {unique_id}
   exporttransaction [txnumber]
+
   exporttransaction [unique_id]
 
   exporttransaction {txid}
 
   exporttransaction {txid}
 
   exporttransaction [txid]
 
   exporttransaction [txid]
Line 122: Line 122:
 
   inporttransaction [{binary data}]
 
   inporttransaction [{binary data}]
 
    
 
    
   response [{txnumber}]
+
   response [{unique_id}]
  
 
    
 
    
 
   /// check and complete ''build'' translation (1 override)
 
   /// check and complete ''build'' translation (1 override)
   reddytransaction {txnumber}
+
   reddytransaction {unique_id}
   reddytransaction [{txnumber}]
+
   reddytransaction [{unique_id}]
 
    
 
    
   response [{txnumber}] {has made changes|no changes needed|not enough coins|invalid transaction}
+
   response [{unique_id}] {has made changes|no changes needed|not enough coins|invalid transaction}
  
 
    
 
    
 
   /// sign ''ready'' transaction (6 override)
 
   /// sign ''ready'' transaction (6 override)
   signtransaction {txnumber}
+
   signtransaction {unique_id}
   signtransaction [{txnumber}]
+
   signtransaction [{unique_id}]
 
    
 
    
 
   // calls reddytransaction before hand if needed
 
   // calls reddytransaction before hand if needed
   signtransaction -r {txnumber}
+
   signtransaction -r {unique_id}
   signtransaction -r [{txnumber}]
+
   signtransaction -r [{unique_id}]
 
    
 
    
 
   // sign a pre-signed/partial transaction (signs for owned private keys)
 
   // sign a pre-signed/partial transaction (signs for owned private keys)
   signtransaction -o {txnumber}
+
   signtransaction -o {unique_id}
   signtransaction -o [{txnumber}]
+
   signtransaction -o [{unique_id}]
 
    
 
    
   response [{txnumber},{done|failed}]
+
   response [{unique_id},{done|failed}]
  
 
    
 
    
Line 152: Line 152:
 
    
 
    
 
   // submits a single  'done'  transaction
 
   // submits a single  'done'  transaction
   submittransaction {txnumber}
+
   submittransaction {unique_id}
 
    
 
    
 
   //  submits a list of 'done'  transaction
 
   //  submits a list of 'done'  transaction
   submittransaction [{txnumber}]
+
   submittransaction [{unique_id}]
 
    
 
    
   response [{txnumber},{txid}]
+
   response [{unique_id},{txid}]
  
 
    
 
    
 
   /// complete transaction from any stage and publish it (1 override)
 
   /// complete transaction from any stage and publish it (1 override)
   completeransaction {txnumber}
+
   completeransaction {unique_id}
 
    
 
    
   response {txnumber} {txid}
+
   response {unique_id} {txid}
  
 
    
 
    
 
   /// delete a transaction from local client
 
   /// delete a transaction from local client
   droptransaction {txnumber}
+
   droptransaction {unique_id}
 
    
 
    
   responce dropped: {txnumber}
+
   responce dropped: {unique_id}

Revision as of 19:44, 25 July 2011

New Transaction is an proposal for a new extendable method of creating transactions.
Each new transaction is defined by a random txnumber that should be unique globally.
Advanced functions, such as transaction scripts, and importing and exporting can appropriately be done using the group of supporting functions.

Transaction life-cycle

Every New Transaction goes through the following steps. (not always in the same order)

Build

In this stage, a transaction is being built:

  • Any feature of the transaction may be modified.
  • Users can add, remove, any input, output or script.

Ready

In this stage, only certain features may be modified:

  • Only inputs may be changed. (is this correct, or will past signatures be destroyed if we change them?)
  • Any other attribute that doesn't effect the existing signatures.

Done

In this stage, the transaction is complete, and would be accepted by the network:

  • User still can add inputs, however all the outputs have already been fulfilled, these new inputs will be counted as fees.
  • After any change, a 'done' transaction gets automatically demoted to 'Ready' state.

Submitted

In this stage the transaction has been published to the bitcoin network and is in/or is awaiting to be included in a block.

Terms

txnumber is a random string given to every transaction for identification purposes.
pubkey is assumed to be owned by the client that preforms the 'readying' of the transition (build > ready states)

This entire processing is lazy! Bitcoin will automatically fill-out everything just as it dose at-the-moment with the readytransaction stage.

Please not this draft doesn't include all possible error responses.

commands:

 /// make a new transaction (1 override)
 newtransaction
 newtransaction {name}
 
 response {unique_id}


 /// add an input to the transaction. (1 overrides)
 addinput {unique_id} {txid} {index}
 addinput {unique_id} {txid} {index} {comment}
 
 response {unique_id} {inid}


 /// add outputs to the transaction (6 overrides)
 /// add fee to transaction
 addoutput {unique_id} {amount} {forced|suggested|optional}
 addoutput {unique_id} {amount} {forced|suggested|optional} {comment}
 
 // add change address to transaction
 addoutput {unique_id} {pubkey}
 addoutput {unique_id} {pubkey} {comment}
 
 // add send outputs
 addoutput {unique_id} {address} {amount}
 addoutput {unique_id} {address} {amount} {comment}
 
 response  {unique_id} {outid}
 
 // add many send outputs
 addoutputlist {unique_id} [{address},{amount}]
 
 response {unique_id}  [{outid}]


 /// remove input or outpus (1 override)
 remove {unique_id} {inid or outid}
 remove {unique_id} [{inid or outid}]
 
 response {unique_id} droped: {inid or outid}
 response {unique_id} droped: [{inid or outid}]


 /// prints out human readable information about the tranaction
 shownewtransaction {unique_id} (1 override)
 
 response {unique_id}
           in: [{unique_id},{address},{amount},(comment)]
           in total: {amount}
           out: [{unique_id},{address},{amount},(comment)]
           out total: {amount}
           fee: {amount}
           size: {readytxn bit}
           state: {building:ready:done:submitted}
 
 shownewtransaction {txid} (1 override)
 
 response {txid}
           in: [{txid},{address},{amount},(comment)]
           in total: {amount}
           out: [{address},{amount},(comment)]
           out total: {amount}
           fee: {amount}
           size: {readytxn bit}
           block: {block number}


 /// demote a transaction (1 override)
 demotetransaction {unique_id}
 demotetransaction {unique_id} {build|ready|done}
 
 response {unique_id} {building|ready|done}


 /// exports a binary encoded transition (4 override)
 exporttransaction {unique_id}
 exporttransaction [unique_id]
 exporttransaction {txid}
 exporttransaction [txid]
 
 response {binary data}


 /// import binary encoded transition(s) (1 override)
 inporttransaction {binary data}
 inporttransaction [{binary data}]
 
 response [{unique_id}]


 /// check and complete build translation (1 override)
 reddytransaction {unique_id}
 reddytransaction [{unique_id}]
 
 response [{unique_id}] {has made changes|no changes needed|not enough coins|invalid transaction}


 /// sign ready transaction (6 override)
 signtransaction {unique_id}
 signtransaction [{unique_id}]
 
 // calls reddytransaction before hand if needed
 signtransaction -r {unique_id}
 signtransaction -r [{unique_id}]
 
 // sign a pre-signed/partial transaction (signs for owned private keys)
 signtransaction -o {unique_id}
 signtransaction -o [{unique_id}]
 
 response [{unique_id},{done|failed}]


 /// publish a done transaction to peers (2 override)
 // submits all 'done'  transactions
 submittransaction -a
 
 // submits a single  'done'  transaction
 submittransaction {unique_id}
 
 //  submits a list of 'done'  transaction
 submittransaction [{unique_id}]
 
 response [{unique_id},{txid}]


 /// complete transaction from any stage and publish it (1 override)
 completeransaction {unique_id}
 
 response {unique_id} {txid}


 /// delete a transaction from local client
 droptransaction {unique_id}
 
 responce dropped: {unique_id}