If you have no trouble with Alice, Bob and Claudia know about each other, you could create a single transaction with 3 outputs, one for each of them. In such case they will all three get bitcoins, or all three would not get bitcoins (because actually it would be 1 transaction, which will get into blockchain, or would not).
sendmany
I can show you the way to make it with bitcoin-cli. For this you'll need full node running on your machine (bitcoind
). This node must own your funds (privkeys for accounts with your funds must be in its wallet.dat). If this is the case, then you need sendmany method.
Run:
# Unlock the wallet (If your wallet is unencrypted, skip this step)
bitcoin-cli walletpassphrase "passphrase" 10
# Send all funds to everybody you need
bitcoin-cli sendmany "" '{"2N8hwP1WmJrFF5QWABn38y63uYLhnJYJYTF": 0.05, "2N5zxMH53RX3JLWbV5csmZrAhWY1R7Fr1SA": 0.05}'
# Lock the wallet
bitcoin-cli walletlock
You'll get transaction id as the result of sendmany call:
3a2addb48252889711a74f7e131816c8becfb112910342faefd17a8913ac2de7
(it is real transaction in bitcoin testnet)
To get more info about sendmany method, you can run bitcoin-cli help sendmany
, you'll see the list of available params and examples of using it with curl. Or you can go to the official documentation
createrawtransaction
If you have access to bitcoin node, but this node does not have your funds, you can create new unsigned transaction using createrawtransaction
method on the node, then sign this transaction in your wallet and send it, using sendrawtransaction
.