Author

Topic: [ANN] txtool: Advanced transaction building (Read 5239 times)

legendary
Activity: 1596
Merit: 1100
November 17, 2014, 10:10:48 AM
#14
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] [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

s2
full member
Activity: 198
Merit: 123
November 17, 2014, 07:46:49 AM
#13
Excellent work!  Thanks for sharing as was getting stuck on this.
newbie
Activity: 4
Merit: 0
Thank you!
newbie
Activity: 38
Merit: 0
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. Smiley

But that aside, thank you! This tool is aWeSoMe!!
legendary
Activity: 1596
Merit: 1100
September 12, 2013, 12:14:17 PM
#10
Warning:  Please avoid using bitcoinj-based wallets, with this tool.

The bitcoinj Java library does not support the P2SH feature (BIP 16).
sr. member
Activity: 493
Merit: 250
IDENA.IO - Proof-Of-Person Blockchain
September 01, 2013, 09:37:42 AM
#9
Thanks for this excellent job!
hero member
Activity: 868
Merit: 1008
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).
hero member
Activity: 640
Merit: 771
BTC⇆⚡⇄BTC
Very nice open source collaborative project.

Congratulations!

Keep up the good work

Cheers!
sr. member
Activity: 440
Merit: 251
Great work, and thanks very much.

jgarzik == great help/support for OT project :-)
sr. member
Activity: 345
Merit: 250
great stuff .. was waiting for things like that ..

let's get started with crazy txs
legendary
Activity: 1526
Merit: 1134
Cool, awesome utility!
newbie
Activity: 12
Merit: 0
This is really, really cool. Thanks for making it available.
legendary
Activity: 1862
Merit: 1011
Reverse engineer from time to time
Nodejs seems to be getting popular these days.
legendary
Activity: 1596
Merit: 1100
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:

Further examples such as decentralized crowdfunding and atomic coin swapping will be demonstrated soon.

Jump to: