Skip to content

sendmany JSON-RPC command

sendmany "" {"address":amount} ( minconf "comment" ["address",...] coinsel include_unsafe )

Send multiple times. Amounts are double-precision floating point numbers.

Arguments

1. "dummy"                   (string, required) Must be set to "" for backwards compatibility.
2. amounts                   (json object, required) A json object with addresses and amounts
     {
       "address": amount,    (numeric or string, required) The Bitcoin Cash address is the key, the numeric amount (can be string) in BCH is the value
     }
3. minconf                   (numeric, optional, default=1) Only use the balance confirmed at least this many times.
4. "comment"                 (string, optional) A comment
5. subtractfeefrom           (json array, optional) A json array with addresses.
                             The fee will be equally deducted from the amount of each selected address.
                             Those recipients will receive less bitcoins than you enter in their corresponding amount field.
                             If no addresses are specified here, the sender pays the fee.
     [
       "address",            (string) Subtract fee from this address
       ...
     ]
6. coinsel                   (numeric, optional, default=0) Which coin selection algorithm to use. A value of 1 will use a faster algorithm suitable for stress tests or use with large wallets. This algorithm is likely to produce larger transactions on average.0 is a slower algorithm using BNB and a knapsack solver, butwhich can produce transactions with slightly better privacy and smaller transaction sizes. Values other than 0 or 1 are reservedfor future algorithms.
7. include_unsafe            (boolean, optional, default=false) Include inputs that are not safe to spend (unconfirmed transactions from outside keys).
                             Warning: the resulting transaction may become invalid if one of the unsafe inputs disappears.
                             If that happens, you will need to fund the transaction with different inputs and republish it.

Result

"txid"                   (string) The transaction id for the send. Only 1 transaction is created regardless of
                                    the number of addresses.

Examples

Send two amounts to two different addresses

> bitcoin-cli sendmany "" "{\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\":0.01,\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\":0.02}"

Send two amounts to two different addresses setting the confirmation and comment

> bitcoin-cli sendmany "" "{\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\":0.01,\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\":0.02}" 6 "testing"

Send two amounts to two different addresses, subtract fee from amount

> bitcoin-cli sendmany "" "{\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\":0.01,\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\":0.02}" 1 "" "[\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\",\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\"]"

As a JSON-RPC call
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "sendmany", "params": ["", "{\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\":0.01,\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\":0.02}", 6, "testing"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/

Bitcoin Cash Node Daemon version v27.0.1-6a03070

Documentation on docs.bitcoincashnode.org reflects the current master branch in Git, and may include API changes that are not yet present in the latest release.