Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: jgarzik on July 03, 2013, 04:15:45 PM



Title: [ANN] txtool: Advanced transaction building
Post by: jgarzik on July 03, 2013, 04:15:45 PM
URL: https://github.com/jgarzik/txtool

txtool is a command line tool written in node.js that interfaces with Bitcoin-Qt/bitcoind, to automate or assist in building interesting, unusual, complicated or just plain odd transactions.  The goal is to demonstrate advanced bitcoin features, and make it easier for users to experiment.  The intended audience has a basic awareness of how bitcoin transactions look and work.

The theory of operation and full list of commands may be reviewed at https://github.com/jgarzik/txtool/blob/master/README

Initially, two working examples are presented:
  • Easy multi-signature transaction building, spending: https://github.com/jgarzik/txtool/blob/master/examples/multisig.txt
  • Passing around transactions (possibly multi-signature) for signing: https://github.com/jgarzik/txtool/blob/master/examples/tx-signing.txt

Further examples such as decentralized crowdfunding and atomic coin swapping (https://bitcointalk.org/index.php?topic=112007.msg1212356#msg1212356) will be demonstrated soon.



Title: Re: [ANN] txtool: Advanced transaction building
Post by: Remember remember the 5th of November on July 03, 2013, 05:11:04 PM
Nodejs seems to be getting popular these days.


Title: Re: [ANN] txtool: Advanced transaction building
Post by: bittheodds on July 03, 2013, 06:06:01 PM
This is really, really cool. Thanks for making it available.


Title: Re: [ANN] txtool: Advanced transaction building
Post by: Mike Hearn on July 03, 2013, 07:05:53 PM
Cool, awesome utility!


Title: Re: [ANN] txtool: Advanced transaction building
Post by: xeroc on July 03, 2013, 07:11:53 PM
great stuff .. was waiting for things like that ..

let's get started with crazy txs


Title: Re: [ANN] txtool: Advanced transaction building
Post by: fellowtraveler on July 03, 2013, 08:28:10 PM
Great work, and thanks very much.

jgarzik == great help/support for OT project :-)


Title: Re: [ANN] txtool: Advanced transaction building
Post by: Financisto on July 03, 2013, 08:53:09 PM
Very nice open source collaborative project.

Congratulations!

Keep up the good work

Cheers!


Title: Re: [ANN] txtool: Advanced transaction building
Post by: Steve on July 04, 2013, 01:29:10 AM
For non-nodejs people, you should now be able to install this as follows:
a) install nodejs (from nodejs.org)
b) run: $ npm install -g txtool

After that, you should be able run txtool from the shell:
$ txtool

This installs the nodejs txtool package with all dependencies in your global nodejs environment and then creates a symlink to the executable in your $PATH (usually /usr/local/bin).


Title: Re: [ANN] txtool: Advanced transaction building
Post by: WSDN on September 01, 2013, 02:37:42 PM
Thanks for this excellent job!


Title: Re: [ANN] txtool: Advanced transaction building
Post by: jgarzik on September 12, 2013, 05:14:17 PM
Warning:  Please avoid using bitcoinj-based wallets, with this tool.

The bitcoinj Java library does not support the P2SH feature (BIP 16 (https://en.bitcoin.it/wiki/BIP_0016)).


Title: Re: [ANN] txtool: Advanced transaction building
Post by: KawalGrover on March 18, 2014, 10:12:47 PM
For non-nodejs people, you should now be able to install this as follows:
a) install nodejs (from nodejs.org)
b) run: $ npm install -g txtool

After that, you should be able run txtool from the shell:
$ txtool

This installs the nodejs txtool package with all dependencies in your global nodejs environment and then creates a symlink to the executable in your $PATH (usually /usr/local/bin).


It would be a good idea to put these instructions in the README on github. Will save non-nodejs people like me some time. :)

But that aside, thank you! This tool is aWeSoMe!!


Title: Re: [ANN] txtool: Advanced transaction building
Post by: techhead on March 18, 2014, 11:52:15 PM
Thank you!


Title: Re: [ANN] txtool: Advanced transaction building
Post by: s2 on November 17, 2014, 12:46:49 PM
Excellent work!  Thanks for sharing as was getting stuck on this.


Title: Re: [ANN] txtool: Advanced transaction building
Post by: jgarzik on November 17, 2014, 03:10:48 PM
Bitcoin Core now has "bitcoin-tx" which may be used in this manner.  Command line summary:

Code:
Bitcoin Core bitcoin-tx utility version v0.9.99.0-83f5daf

Usage:
  bitcoin-tx [options] <hex-tx> [commands]  Update hex-encoded bitcoin transaction
  bitcoin-tx [options] -create [commands]   Create hex-encoded bitcoin transaction

Options:
  -?                      This help message
  -create                 Create new, empty TX.
  -json                   Select JSON output
  -regtest                Enter regression test mode, which uses a special chain in which blocks can be solved instantly.
  -testnet                Use the test network

Commands:
  delin=N                Delete input N from TX
  delout=N               Delete output N from TX
  in=TXID:VOUT           Add input to TX
  locktime=N             Set TX lock time to N
  nversion=N             Set TX version to N
  outaddr=VALUE:ADDRESS  Add address-based output to TX
  outscript=VALUE:SCRIPT Add raw script output to TX
  sign=SIGHASH-FLAGS     Add zero or more signatures to transaction
      This command requires JSON registers:
      prevtxs=JSON object
      privatekeys=JSON object
      See signrawtransaction docs for format of sighash flags, JSON objects.

Register Commands:
  load=NAME:FILENAME     Load JSON file FILENAME into register NAME
  set=NAME:JSON-STRING   Set register NAME to given JSON-STRING