{% comment %} This file is licensed under the MIT License (MIT) available on http://opensource.org/licenses/MIT. {% endcomment %} #### addmultisigaddress ~~~ addmultisigaddress [account] ~~~ {% autocrossref %} Add a P2SH multisig address to the wallet. Related RPCs: `createmultisig` {% endautocrossref %} **Argument #1: Number Of Signatures Required** {% autocrossref %} *Number; required:* the *minimum* (*m*) number of signatures required to spend satoshis sent to this m-of-n P2SH multisig pubkey script. {% endautocrossref %} ~~~ ~~~ **Argument #2: Full Public Keys, Or Addresses For Known Public Keys** {% autocrossref %} *String; required:* A JSON array of hex-encoded public *keys* or *addresses* for public keys known to this Bitcoin Core instance. The multisig pubkey script can only use full (unhashed) public keys, so you generally must provide public keys for any address not known to this wallet. {% endautocrossref %} ~~~ [ "" ,[...] ] ~~~ **Argument #3: Account Name** {% autocrossref %} *String; optional:* The name of an *account* in the wallet which will store the address. {% endautocrossref %} ~~~ "" ~~~ **Result: A P2SH Address Printed And Stored In The Wallet** {% autocrossref %} *String:* a hash of the P2SH multisig redeem script, which is also stored in the wallet so Bitcoin Core can monitor the network and block chain for transactions sent to that address (which will be displayed in the wallet as spendable balances). {% endautocrossref %} **Example** {% autocrossref %} Adding a 2-of-3 P2SH multisig address to the "test account" by mixing two P2PKH addresses and one full public key: {% endautocrossref %} ~~~ > bitcoin-cli -testnet addmultisigaddress \ 2 \ ''' [ "mjbLRSidW1MY8oubvs4SMEnHNFXxCcoehQ", "02ecd2d250a76d204011de6bc365a56033b9b3a149f679bc17205555d3c2b2854f", "mt17cV37fBqZsnMmrHnGCm9pM28R1kQdMG" ] ''' \ 'test account' ~~~ Result: ~~~ 2MyVxxgNBk5zHRPRY2iVjGRJHYZEp1pMCSq ~~~ {% autocrossref %} (New P2SH multisig address also stored in wallet.) {% endautocrossref %} #### addnode ~~~ addnode : ~~~ {% autocrossref %} Attempts add or remove a node from the addnode list, or try a connection to a node once. {% endautocrossref %} **Argument #1: IP Address And Port Of Node** {% autocrossref %} *String, required:* the colon-delimited IP address and port of the node to add, remove, or connect to. {% endautocrossref %} **Argument #2: Add Or Remove The Node, Or Try Once To Connect** {% autocrossref %} *String, required:* whether to *add* or *remove* the node to the list of known nodes. This does not necessarily mean that a connection to the node will be established. To attempt to establish a connection immediately, use *onetry*. {% endautocrossref %} **Return: Empty Or Error** {% autocrossref %} Will not return any data if the node is added or if *onetry* is used (even if the connection attempt fails). Will return an error if you try removing an unknown node. {% endautocrossref %} **Example** {% autocrossref %} Try connecting to the following node. {% endautocrossref %} ~~~ > bitcoin-cli -testnet addnode 68.39.150.9:18333 onetry ~~~ #### backupwallet ~~~ backupwallet ~~~ {% autocrossref %} Safely copies `wallet.dat` to destination, which can be a directory or a path with filename. {% endautocrossref %} **Argument #1: Destination Directory Or Filename** {% autocrossref %} *String, required:* a directory or filename. If a directory, a file named `wallet.dat` will be created or overwritten. If a filename, a file of that name will be created or overwritten. {% endautocrossref %} **Return: Empty Or Error** {% autocrossref %} Nothing will be returned on success. If the file couldn't be created or written, an error will be returned. {% endautocrossref %} **Example** ~~~ > bitcoin-cli -testnet backupwallet /tmp/backup.dat ~~~ #### createmultisig ~~~ createmultisig ~~~ {% autocrossref %} Creates a multi-signature address. Related RPCs: `addmultisigaddress` {% endautocrossref %} **Argument #1: Number Of Signatures Required** {% autocrossref %} *Number; required:* the *minimum* (*m*) number of signatures required to spend satoshis sent to this m-of-n multisig pubkey script. {% endautocrossref %} ~~~ ~~~ **Argument #2: Full Public Keys, Or Addresses For Known Public Keys** {% autocrossref %} *String; required:* A JSON array of hex-encoded public *keys* or *addresses* for public keys known to this Bitcoin Core instance. The multisig pubkey script can only use full (unhashed) public keys, so you generally must provide public keys for any address not known to this wallet. {% endautocrossref %} ~~~ [ "" ,[...] ] ~~~ **Result: Address And Hex-Encoded Redeem Script** {% autocrossref %} *String:* JSON object with the P2SH *address* and hex-encoded *redeemScript*. {% endautocrossref %} ~~~ { "address":"", "redeemScript":"" } ~~~ **Example** {% autocrossref %} Creating a 2-of-3 P2SH multisig address by mixing two P2PKH addresses and one full public key: {% endautocrossref %} ~~~ > bitcoin-cli -testnet createmultisig 2 ''' [ "mjbLRSidW1MY8oubvs4SMEnHNFXxCcoehQ", "02ecd2d250a76d204011de6bc365a56033b9b3a149f679bc17205555d3c2b2854f", "mt17cV37fBqZsnMmrHnGCm9pM28R1kQdMG" ] ''' ~~~ {% autocrossref %} Result (redeemScript wrapped): {% endautocrossref %} ~~~ { "address" : "2MyVxxgNBk5zHRPRY2iVjGRJHYZEp1pMCSq", "redeemScript" : "522103ede722780d27b05f0b1169efc90fa15a601a32\ fc6c3295114500c586831b6aaf2102ecd2d250a76d20\ 4011de6bc365a56033b9b3a149f679bc17205555d3c2\ b2854f21022d609d2f0d359e5bc0e5d0ea20ff9f5d33\ 96cb5b1906aa9c56a0e7b5edc0c5d553ae" } ~~~ #### createrawtransaction ~~~ createrawtransaction ~~~ {% autocrossref %} Create an unsigned transaction in hex rawtransaction format that spends a previous output to an new output with a P2PKH or P2SH address. The transaction is not stored in the wallet or transmitted to the network. **Argument #1: References To Previous Outputs** *String; required:* A JSON array of JSON objects. Each object in the array references a previous output by its *txid* (string; required) and output index number, called *vout* (number; required). {% endautocrossref %} ~~~ [ { "txid":"", "vout": } ,[...] ] ~~~ **Argument #2: P2PKH Or P2SH Addresses For New Outputs** {% autocrossref %} *String; required:* A JSON object with P2PKH or P2SH addresses to pay as keys and the amount to pay each address as its value (number; required) in decimal bitcoins. {% endautocrossref %} ~~~ { "
": . ,[...] } ~~~ **Result: Unsigned Raw Transaction (In Hex)** {% autocrossref %} *String:* The resulting unsigned transaction in hex-encoded rawtransaction format, or a JSON error if any value provided was invalid. {% endautocrossref %} **Example** ~~~ > bitcoin-cli -testnet createrawtransaction ''' [ { "txid":"5a7d24cd665108c66b2d56146f244932edae4e2376b561b3d396d5ae017b9589", "vout":0 } ] ''' ''' { "mgnucj8nYqdrPFh2JfZSB1NmUThUGnmsqe": 0.1 } '''' ~~~ Result: ~~~ 010000000189957b01aed596d3b361b576234eaeed3249246f14562d6bc60851\ 66cd247d5a0000000000ffffffff0180969800000000001976a9140dfc8bafc8\ 419853b34d5e072ad37d1a5159f58488ac00000000 ~~~ #### decoderawtransaction ~~~ decoderawtransaction ~~~ {% autocrossref %} Decode a rawtransaction format hex string into a JSON object representing the transaction. {% endautocrossref %} **Argument: RawTransaction Hex** {% autocrossref %} *String; required:* a complete transaction in rawtransaction format hex. {% endautocrossref %} **Result: JSON Object** {% autocrossref %} A JSON object describing the the transaction is returned. The object is described in parts below. {% endautocrossref %} ~~~ { "txid" : "", "version" : , "locktime" : , ~~~ {% autocrossref %} The transaction identifier (*txid*), the transaction *version* number, and the *locktime*. {% endautocrossref %} ~~~ "vin" : [ { "txid": "", "vout": , "scriptSig": { "asm": "