Difference between revisions of "Da2ce7:New Transaction"

From Bitcoin Wiki
Jump to: navigation, search
(updated)
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
''make new transaction''
+
''New Transaction'' is an proposal for a new extendable method of creating transactions.<br />
 +
Each new transaction is defined by a random ''txnumber'' that should be unique globally.<br />
 +
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:<br />
 +
* 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:<br />
 +
* 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.<br />
 
''txnumber'' is a random string given to every transaction for identification purposes.<br />
 
''pubkey'' is assumed to be owned by the client that preforms the 'readying' of the transition (build > ready states)
 
''pubkey'' is assumed to be owned by the client that preforms the 'readying' of the transition (build > ready states)
 
States:
 
''build'' this state a transaction doesn't need to fulfil any rules. The user just defines what she wants in the transaction.
 
''ready'' this state is after a client that has (or knows of the), private keys checks the transaction, checking and adding more inputs or change output if necessary.
 
''done'' the transaction has been signed by and all the inputs are vaild.
 
''submited'' the transaction has successfully publicly announced.
 
  
 
'''This entire processing is lazy!  Bitcoin will automatically fill-out everything just as it dose at-the-moment with the ''readytransaction'' stage.'''
 
'''This entire processing is lazy!  Bitcoin will automatically fill-out everything just as it dose at-the-moment with the ''readytransaction'' stage.'''
Line 16: Line 35:
 
== commands: ==
 
== commands: ==
 
    
 
    
   /// make a new transaction (1 override)
+
   /// make a new transaction (6 override)
 
   newtransaction
 
   newtransaction
 
   newtransaction {name}
 
   newtransaction {name}
 
    
 
    
   response {txnumber}
+
  newtransaction {txuniqueid}
 +
  newtransaction {txuniqueid} {name}
 +
 
 +
  newtransaction {txid}
 +
  newtransaction {txid} {name}
 +
 
 +
   response {txtxuniqueid}
  
 
    
 
    
 
   /// add an input to the transaction. (1 overrides)
 
   /// add an input to the transaction. (1 overrides)
   addinput {txnumber} {txid} {pubkey}
+
   addinput {txuniqueid} {txid} {index}
   addinput {txnumber} {txid} {pubkey} {comment}
+
   addinput {txuniqueid} {txid} {index} {comment}
 
    
 
    
   response {txnumber} {inid}
+
   response {txuniqueid} {iouniqueid}
  
 
    
 
    
 
   /// 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 {txuniqueid} {amount} {forced|suggested|optional}
   addoutput {txnumber} {amount} {forced:suggested:optional} {comment}
+
   addoutput {txuniqueid} {amount} {forced|suggested|optional} {comment}
 
    
 
    
 
   // add change address to transaction
 
   // add change address to transaction
   addoutput {txnumber} {pubkey}
+
   addoutput {txuniqueid} {pubkey}
   addoutput {txnumber} {pubkey} {comment}
+
   addoutput {txuniqueid} {pubkey} {comment}
 
    
 
    
 
   // add send outputs
 
   // add send outputs
   addoutput {txnumber} {address} {amount}
+
   addoutput {txuniqueid} {address} {amount}
   addoutput {txnumber} {address} {amount} {comment}
+
   addoutput {txuniqueid} {address} {amount} {comment}
 
    
 
    
   response  {txnumber} {outid}
+
   response  {txuniqueid} {iouniqueid}
 
    
 
    
 
   // add many send outputs
 
   // add many send outputs
   addoutputlist {txnumber} [{address},{amount}]
+
   addoutputlist {txuniqueid} [{address},{amount}]
 
    
 
    
   response {txnumber}  [{outid}]
+
   response {txuniqueid}  [{iouniqueid}]
  
 
    
 
    
 
   /// remove input or outpus (1 override)
 
   /// remove input or outpus (1 override)
   remove {txnumber} {inid or outid}
+
   remove {txuniqueid} {iouniqueid}
   remove {txnumber} [{inid or outid}]
+
   remove {txuniqueid} [{iouniqueid}]
 
    
 
    
   response {txnumber} droped: {inid or outid}
+
   response {txuniqueid} droped: {iouniqueid}
   response {txnumber} droped: [{inid or outid}]
+
   response {txuniqueid} droped: [{iouniqueid}]
  
 
    
 
    
 
   /// prints out human readable information about the tranaction
 
   /// prints out human readable information about the tranaction
   shownewtransaction {txnumber} (1 override)
+
   shownewtransaction {txuniqueid} (1 override)
 
    
 
    
   response {txnumber}
+
   response {txuniqueid}
             in: [{inid},{address},{amount},(comment)]
+
             in: [{iouniqueid},{address},{amount},(comment)]
 
             in total: {amount}
 
             in total: {amount}
             out: [{outid},{address},{amount},(comment)]
+
             out: [{iouniqueid},{address},{amount},(comment)]
 
             out total: {amount}
 
             out total: {amount}
 
             fee: {amount}
 
             fee: {amount}
 +
            size: {readytxn bit}
 
             state: {building:ready:done:submitted}
 
             state: {building:ready:done:submitted}
 
    
 
    
Line 73: Line 99:
 
    
 
    
 
   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}
 +
            size: {readytxn bit}
 
             block: {block number}
 
             block: {block number}
  
 
    
 
    
 
   /// demote a transaction (1 override)
 
   /// demote a transaction (1 override)
   demotetransaction {txnumber}
+
   demotetransaction {txuniqueid}
   demotetransaction {txnumber} {build:ready:done}
+
   demotetransaction {txuniqueid} {build|ready|done}
 
    
 
    
   response {txnumber} {building:ready:done}
+
   response {txuniqueid} {building|ready|done}
  
 
    
 
    
   /// exports a binary encoded transition (1 override)
+
   /// exports a binary encoded transition (4 override)
   exporttransaction {txnumber}
+
   exporttransaction {txuniqueid}
 +
  exporttransaction [txuniqueid]
 
   exporttransaction {txid}
 
   exporttransaction {txid}
 +
  exporttransaction [txid]
 
    
 
    
   response {binary data base 64 (or 58?) encoded}
+
   response {binary data}
  
 
    
 
    
   /// import a binary encoded transition
+
   /// import binary encoded transition(s) (1 override)
   exporttransaction {binary data base 64 (or 58?) encoded}
+
   inporttransaction {binary data}
 +
  inporttransaction [{binary data}]
 
    
 
    
   response {txnumber}
+
   response [{txuniqueid}]
  
 
    
 
    
   /// check and complete ''build'' translation
+
   /// check and complete ''build'' translation (1 override)
   reddytransaction {txnumber}
+
   reddytransaction {txuniqueid}
 +
  reddytransaction [{txuniqueid}]
 
    
 
    
   response {txnumber} {has made changes:no changes needed:not enough coins:invalid transaction}
+
   response [{txuniqueid}] {has made changes|no changes needed|not enough coins|invalid transaction}
  
 
    
 
    
   /// sign ''ready'' transaction
+
   /// sign ''ready'' transaction (6 override)
   signtransaction {txnumber}
+
   signtransaction {txuniqueid}
 +
  signtransaction [{txuniqueid}]
 
    
 
    
   response {txnumber} {done:failed}
+
  // calls reddytransaction before hand if needed
 +
  signtransaction -r {txuniqueid}
 +
  signtransaction -r [{txuniqueid}]
 +
 
 +
  // sign a pre-signed/partial transaction (signs for owned private keys)
 +
  signtransaction -o {txuniqueid}
 +
  signtransaction -o [{txuniqueid}]
 +
 
 +
   response [{txuniqueid},{done|failed}]
 +
 
 +
 
 +
  /// publish a ''done'' transaction to peers (2 override)
 +
  // submits all 'done'  transactions
 +
  submittransaction -a
 +
 
 +
  // submits a single  'done'  transaction
 +
  submittransaction {txuniqueid}
 +
 
 +
  //  submits a list of 'done'  transaction
 +
  submittransaction [{txuniqueid}]
 +
 
 +
  response [{txuniqueid},{txid}]
  
 
    
 
    
   /// publish a ''done'' transaction to peers
+
   /// complete transaction from any stage and publish it (1 override)
   submittransaction {txnumber}
+
   completeransaction {txuniqueid}
   response {txnumber} {txid}
+
 
 +
   response {txuniqueid} {txid}
  
 
    
 
    
 
   /// delete a transaction from local client
 
   /// delete a transaction from local client
   droptransaction {txnumber}
+
   droptransaction {txuniqueid}
 
    
 
    
   responce dropped: {txnumber}
+
   responce dropped: {txuniqueid}

Latest revision as of 19:56, 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 (6 override)
 newtransaction
 newtransaction {name}
 
 newtransaction {txuniqueid}
 newtransaction {txuniqueid} {name}
 
 newtransaction {txid}
 newtransaction {txid} {name}
 
 response {txtxuniqueid}


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


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


 /// remove input or outpus (1 override)
 remove {txuniqueid} {iouniqueid}
 remove {txuniqueid} [{iouniqueid}]
 
 response {txuniqueid} droped: {iouniqueid}
 response {txuniqueid} droped: [{iouniqueid}]


 /// prints out human readable information about the tranaction
 shownewtransaction {txuniqueid} (1 override)
 
 response {txuniqueid}
           in: [{iouniqueid},{address},{amount},(comment)]
           in total: {amount}
           out: [{iouniqueid},{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 {txuniqueid}
 demotetransaction {txuniqueid} {build|ready|done}
 
 response {txuniqueid} {building|ready|done}


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


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


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


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


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


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


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