Bitcoin Forum
July 01, 2024, 12:17:42 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [ANN] txtool: Advanced transaction building  (Read 5237 times)
jgarzik (OP)
Legendary
*
qt
Offline Offline

Activity: 1596
Merit: 1097


View Profile
July 03, 2013, 04:15:45 PM
Last edit: July 03, 2013, 06:37:41 PM by jgarzik
Merited by ABCbits (9)
 #1

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.


Jeff Garzik, Bloq CEO, former bitcoin core dev team; opinions are my own.
Visit bloq.com / metronome.io
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
Remember remember the 5th of November
Legendary
*
Offline Offline

Activity: 1862
Merit: 1011

Reverse engineer from time to time


View Profile
July 03, 2013, 05:11:04 PM
 #2

Nodejs seems to be getting popular these days.

BTC:1AiCRMxgf1ptVQwx6hDuKMu4f7F27QmJC2
bittheodds
Newbie
*
Offline Offline

Activity: 12
Merit: 0


View Profile
July 03, 2013, 06:06:01 PM
 #3

This is really, really cool. Thanks for making it available.
Mike Hearn
Legendary
*
expert
Offline Offline

Activity: 1526
Merit: 1129


View Profile
July 03, 2013, 07:05:53 PM
 #4

Cool, awesome utility!
xeroc
Sr. Member
****
Offline Offline

Activity: 345
Merit: 250



View Profile
July 03, 2013, 07:11:53 PM
 #5

great stuff .. was waiting for things like that ..

let's get started with crazy txs
fellowtraveler
Sr. Member
****
Offline Offline

Activity: 440
Merit: 250


View Profile
July 03, 2013, 08:28:10 PM
 #6

Great work, and thanks very much.

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

co-founder, Monetas
creator, Open-Transactions
Financisto
Hero Member
*****
Offline Offline

Activity: 633
Merit: 768

BTC⇆⚡⇄BTC


View Profile WWW
July 03, 2013, 08:53:09 PM
 #7

Very nice open source collaborative project.

Congratulations!

Keep up the good work

Cheers!

LIST • ESCROW providers • Ranking & Scores available!LIST • FOSS BrainwalletsBTC ⇆⚡⇄ BTCBTC aka BTC: 16MBvhaJoRBxW3Vk6apnvz3UYT9HAgraVS ⚡ PGP: 2680207AA9A1B69FE7A033D80DE0F221074384C4 ⚡ If you think freedom matters, please support the development of these privacy projects→DONATE some sats: TailsQubes OSWhonixVeraCryptPicocryptKryptorSimpleX Chat
Steve
Hero Member
*****
Offline Offline

Activity: 868
Merit: 1007



View Profile WWW
July 04, 2013, 01:29:10 AM
Merited by ABCbits (1)
 #8

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).

(gasteve on IRC) Does your website accept cash? https://bitpay.com
WSDN
Sr. Member
****
Offline Offline

Activity: 493
Merit: 250


IDENA.IO - Proof-Of-Person Blockchain


View Profile
September 01, 2013, 02:37:42 PM
 #9

Thanks for this excellent job!

              ▄▄▄ ▀▀▀▀▀▀▀▀▀ ▄▄▄
           ▄▀▀    ▄▄▄▄▄▄▄▄▄    ▀▀▄
        ▄▀▀  ▄▄▀█          ▀█▀▄▄  ▀▀▄
      ▄▀▀ ▄▄▀    ▀▀▄▄▄▄▄▄▄▀▀    ▀▄▄ ▀▀▄
     █   █            ▀            █   █
   ▄▀ █  ▀▄▄                     ▄█▀  █ ▀▄
  ▄▀ ▄▀ █▄ ▀▀▀██▄▄▄       ▄▄▄██▀▀  ██ ▀▄ ▀▄
  ▀▄▀▀▄ ██ ▄▄▄▄▄▄  ▀▄   ▄▀  ▄▄▄▄▄▄ ██ ▄▀▀▄▀
 ██   █ ██ ▀▄    ▀▄ █   █ ▄▀    ▄▀ ██ █  ▀██
 █  ▄█  ▀█  ▀▀▀▀▀▀▀ █   █ ▀▀▀▀▀▀▀  █   █▄  █
█▀ █  █  █          █   █          █  █  █ ▀▀
 █▀  ▄▀  █▀▄        █   █        ▄▀█  ▀▄  ▀█
 ▄  █▀   █ ▀█▄      ▀   ▀      ▄█▀ █  ▄▀█  ▄
 █▄▀  █  █                         █  █  ▀▄█
 ▀▄  █   ▀█        ▄▄▀▄▀▄▄        █▀   █  ▄
  ▀▄▀▀  █▄ █     ▀█  ▀▀▀  █▀     █ ▄█ ▄▀▀▄▀
   ▀ ▄  ██ █▀▄     ▀▀▄▄▄▀▀     ▄▀█ ██ ▀▄ ▀
    ▀█  ██ █ █▀▄    ▄▄▄▄▄    ▄▀█ █ ██  █▀
      ▀▄ ▀ █ █ ██▄         ▄██ █ █ ▀ ▄▀
        ▀▄ █ █ █ ▀█▄     ▄█▀ █ █ █ ▄▀
          ▀▀▄█ █    ▀▀▀▀▀    █ █▄▀▀
              ▀▀ ▄▄▄▄▄▄▄▄▄▄▄ ▀▀
   
I  D  E  N  A
   
Proof-of-Person Blockchain

Join the mining of the first human-centric
cryptocurrency
 



 
▲    2 6 8 0

N  O  D  E  S
   
                ██
                ██
                ██
                ██
                ██
         ▄      ██      ▄
         ███▄   ██   ▄███
          ▀███▄ ██ ▄███▀
            ▀████████▀
              ▀████▀
                ▀▀
██▄                            ▄██
███                            ███
███                            ███
███                            ███
 ███▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄███
  ▀▀██████████████████████████▀▀
   
D O W N L O A D

Idena node

   
   
▄▄▄██████▄▄▄
▄▄████████████████▄▄
▄█████▀▀        ▀▀█████▄
████▀                ▀████
███▀    ▄▄▄▄▄▄▄▄▄       ▀███
███      █   ▄▄ █▀▄        ███
██▀      █  ███ █  ▀▄      ▀██
███       █   ▀▀ ▀▀▀▀█       ███
███       █  ▄▄▄▄▄▄  █       ███
███       █  ▄▄▄▄▄▄  █       ███
██▄      █  ▄▄▄▄▄▄  █      ▄██
███      █          █      ███
███▄    ▀▀▀▀▀▀▀▀▀▀▀▀    ▄███
████▄                ▄████
▀█████▄▄        ▄▄█████▀
▀▀████████████████▀▀
▀▀▀██████▀▀▀
   
    ███





███

REQUEST INVITATION
███
  █
  █
  █
  █
  █
███
jgarzik (OP)
Legendary
*
qt
Offline Offline

Activity: 1596
Merit: 1097


View Profile
September 12, 2013, 05:14:17 PM
Last edit: September 12, 2013, 05:35:06 PM by jgarzik
 #10

Warning:  Please avoid using bitcoinj-based wallets, with this tool.

The bitcoinj Java library does not support the P2SH feature (BIP 16).

Jeff Garzik, Bloq CEO, former bitcoin core dev team; opinions are my own.
Visit bloq.com / metronome.io
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
KawalGrover
Newbie
*
Offline Offline

Activity: 38
Merit: 0


View Profile
March 18, 2014, 10:12:47 PM
 #11

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!!
techhead
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
March 18, 2014, 11:52:15 PM
 #12

Thank you!
s2
Full Member
***
Offline Offline

Activity: 198
Merit: 123


View Profile
November 17, 2014, 12:46:49 PM
 #13

Excellent work!  Thanks for sharing as was getting stuck on this.
jgarzik (OP)
Legendary
*
qt
Offline Offline

Activity: 1596
Merit: 1097


View Profile
November 17, 2014, 03:10:48 PM
 #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] <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


Jeff Garzik, Bloq CEO, former bitcoin core dev team; opinions are my own.
Visit bloq.com / metronome.io
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!