createrawtransaction
POST
Creates an unsigned transaction from the given inputs and outputs and returns it as a serialized, hex-encoded string.
🚧 The transaction is neither validated nor sent!
This method only assembles the transaction. It does not check that the inputs exist or that the signatures are valid.
The created transaction must be signed and then broadcast with sendrawtransaction.
param[0]
inputsarrayrequired
The inputs the transaction will spend.param[1]
outputsarrayrequired
The outputs to create. Each address may be used only once, and at most one data object may be included.- To send to an address:
{ "<address>": <amount(BTC)> } - To record data:
{ "data": "<hex string>" }
param[2]
locktimeintegerrequired
The raw locktime of the transaction. A non-zero value also locktime-activates the inputs.param[3]
replaceablebooleanrequired
Whether to mark the transaction as replaceable by a higher-fee transaction under BIP 125.param[4]
versionintegerrequired
The transaction version.Responses
codestringrequired
Code identifying the cause of the failed request.messagestringrequired
Detailed message including the name and value of the invalid parameter.{"code": "ERROR_CODE","message": "Unauthorized"}
cURL
curl -X POST 'https://bitcoin-mainnet.nodit.io' \-H 'Content-Type: application/json' \-H 'X-API-KEY: nodit-demo' \-d '{"jsonrpc": "2.0","id": 1,"method": "createrawtransaction","params": [[{"txid": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b","vout": 0}],[{"bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh": 0.0125}],0,true,2]}'