I'm trying to create a raw transaction using Bitcoin Core v0.10.0 (on Windows 7 x64, and with txindex=1 optioned).
Bitcoin Core v0.10.0 comes with a new Bitcoin-tx executable utility. The help menu is as follows (under Windows 7 x64):
Bitcoin Core bitcoin-tx utility version v0.10.0
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
-txid Output only the hex-encoded transaction id of the resultant transaction.
-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
Using Windows CLI, I'm running into issues with createrawtransaction as it's not parsing the command the same as it does in the Bitcoin-QT console window.
bitcoin-cli createrawtransaction [{"txid":"dbdc2e2c7f143af70c5e7e8725f55d226b3c058d7bf34a303091b3c6a514848c","vout":1}] {"1BCi1L25GC9hUSvtSyGjmEvSyywoYubk4P":0.00011}
Gives error: Error parsing JSON:[{txid:dbdc2e2c7f143af70c5e7e8725f55d226b3c058d7bf34a303091b3c6a514848c,vout:1}]
Likewise, the bitcoin-tx
utility won't work with this:
bitcoin-tx.exe -create in=dbdc2e2c7f143af70c5e7e8725f55d226b3c058d7bf34a303091b3c6a514848c:1 locktime=0 nversion=1 outaddr=2000:1BCi1L25GC9hUSvtSyGjmEvSyywoYubk4P outscript=0:687474703a2f2f676f6f2e676c2f7869556243555
How can I create a raw transaction using Bitcoin-cli and bitcoin-tx?
Error parsing JSON:
, it give you the token that confused it, exactly as it got it. Is your shell eating your"
characters?