13

I have 20+ addresses I need to payout to. How can I send to all of these addresses without having to do it one at a time and paying a fee for each?

Which desktop and mobile wallet supports this type of feature?

  • Do you want to know how such a transaction would look at the low level? Or how you could use software to do this? – morsecoder Jan 23 '15 at 3:38
  • both would be good. but mainly want to know how to do this via an application like desktop or mobile. – Patoshi パトシ Jan 23 '15 at 3:41
12

With the Bitcoin Core client, you can create a transaction sending coins to several addresses. On the "Send" tab, there is an "Add Recipient" button at the bottom of the screen; click it as many times as needed to add a form for each recipient. Enter all the addresses and the corresponding amounts to be sent, and you will get a single transaction sending everything you request. (It will appear as multiple entries on the Recent Transactions pane or the Transactions tab, but inspection will show they all have the same transaction ID.)

Note that transaction fees are generally on a per-kilobyte basis, not per-transaction, so a large transaction with 20 outputs will incur a higher fee. It should still be less than sending 20 transactions, however.

11
+25

TL;DR: Just read the second paragraph of "Concrete Numbers".


Wallet Recommendation: Electrum

Doing this in Electrum is very simple. Just switch to the Send tab and then (in the menu) choose Tools → Pay to many. The "Pay to" field will become a text area and a popup will open, telling you how to send money to many addresses.

Note that the unit of the amount can be changed in the settings (Tools → Preferences → Appearance → Base unit) and is mBTC by default.

The amount field will be automatically filled in once you have at least one valid line in the "Pay to" field:

The amount field probably isn't grayed out from the beginning because you technically can switch between pay to many mode and pay to single address mode without choosing Tools → Pay to many by just hitting enter in the "Pay to" field which automatically makes it a text area.

The Fee

As the fee by default is paid per transaction – not per transaction output –, you only have to pay it once even if you send money to a large number of addresses. It can be adjusted as a linear function of the transaction size in Tools → Preferences → Transactions.

Adjusting the Fee in Electrum

Alternatively, you can check the box Dynamic fees in Tools → Preferences → Transactions to use Electrum's dynamic fees feature which changes the fee function to not only depend on the size of the transaction being submitted but also on the network conditions (the number of pending transactions and the current rate at which transactions are processed).

In any case, Electrum shows you the fee in a popup before the transaction is sent if you check check View transactions before signing in Tools → Preferences → Transactions (not sure whether it does if you don't). If you use the dynamic fees feature, you will receive a warning if the fees are currently unusually high due to inconvenient network conditions.

As an alternative even for that, you can check the checkbox Set transactions fees manually in Tools → Preferences → Transactions which lets you set the fee manually for every transaction.

The Amount of Fee

As for how much the fee will be, let's say you pay a fee of ρ/Byte where ρ is around 10 Satoshi. This is equal to what you mean by

Would it be .0001 x 20 = .002 in fees?

if you mean ".0001 BTC/kB" by ".0001" because .0001 BTC/kB * 100'000'000 Satoshi/BTC / (1000 B/kB) = 10 Satoshi/B

You can inform yourself about fee recommendations in articles like this one.

For simplicity, let's assume you use P2PKH with compressed keys (which is standard), have a UTXO large enough for the entire transaction but not of just the right size, so you need a change address (which is almost always the case).

Under these assumptions, you have to use 148 Byte per input and 34 Byte. In addition to this, the transaction header needs 10 more Bytes.

We can now write down a function φ : ℕ×ℕ×ℝ → Satoshi which tells us the transaction fee provided the number of inputs and outputs as well as ρ. This function is: φ(ni, no, ρ) := (10 + ni*148 + no*34) * ρ * Satoshi

Let γ : ℕ×ℝ → Satoshi be the function which tells us the fee for a transaction with 1 input, 1 change address, and and n addresses you want to send money to. This function is defined as: γ(n, ρ) := (192 + n*34) * ρ * Satoshi

Concrete Numbers

If you pay the 20 people individually, you will spend 20*γ(1, ρ) = 4'520*ρ*Satoshi = 0.0452*ρ*mBTC as the fee. On the other hand, if you pay them all at once, you only spend γ(20, ρ) = 872*ρ*Satoshi = 0.00872*ρ*mBTC. If we assume ρ=10, that's 0.452 mBTC or 0.0872 mBTC respectively.

The difference is that you would spend (0.452 mBTC)/(0.0872 mBTC) = 5.18 times as much of a fee if you made individual transactions compared to if you made one cumulative transaction.

If you pay the 200 people individually, you will spend 200*γ(1, ρ) = 45'200*ρ*Satoshi = 0.452*ρ*mBTC as the fee. On the other hand, if you pay them all at once, you only spend γ(200, ρ) = 6'992*ρ*Satoshi = 0.06992*ρ*mBTC. If we assume ρ=10, that's 4.52 mBTC or 0.6992 mBTC.

The difference is that you would spend 6.46 as much of a fee if you made individual transactions compared to if you made one cumulative transaction.

Data Import

Furthermore, it's probably easier to make one big transaction than to make many small ones. If you have such a table in LibreOffice Calc, you can just save it as a CVS (comma-separated values) file and feed it to Electrum as it itself describes it in the popup seen in the first screenshot.

  • if i were to send to 200 different addresses how much would the average fees be? – Patoshi パトシ Nov 22 '16 at 18:04
  • @duckx I added it. 4.52 mBTC vs 0.6992 mBTC. – UTF-8 Nov 22 '16 at 18:57
  • @duckx I'm sorry, I somehow read "200" instead of "20". I fixed it. It's now "only" 0.452 mBTC vs 0.0872 mBTC. – UTF-8 Nov 22 '16 at 20:17
  • @duckx I now know where I read "200". You asked for it here in your comment but the bounty question talks about 20. I now put the version for 200 back in but didn't remove the one for 20. – UTF-8 Nov 25 '16 at 16:52
7

Transactions have a list of inputs and a list of outputs. Many transactions just have two outputs, one that pays to the receiver of the funds, and one that sends the leftovers ("change") back to the sender of the funds. Since this is the most common transaction type, this is what most bitcoin interfaces are designed for.

With that said, there are a few tools that making sending to many addresses easy. The reference implementation, Bitcoin Core, has support in the GUI to let you send to many addresses. When you are in the "send" tab, just click "Add Recipient" until you have enough outputs for your desired transaction.

The bitcoin core client also has support for sending to many addresses in the same transaction through the use of the sendmany JSON-RPC command, which may be more useful for doing automated payouts to multiple addresses.

To try this command out, open up Bitcoin-Qt, and go to:

Help > Debug Window > Console

From there, do:

sendmany "" '{"address2":0.1, "address2":0.2}'

Be careful that you don't list the same address twice, or you will get this error: Error trying to send payments with RPC sendmany.

I believe Armory (https://bitcoinarmory.com/) also has support for sending to multiple addresses, but would appreciate it if someone could add a comment to confirm.

  • 2
    Multiple outputs actually is supported in the Bitcoin Core GUI; see the "Add Recipients" button at the bottom of the Send tab. I added another answer describing this. – Nate Eldredge Jan 23 '15 at 4:35
  • Hi, thx for reply. But with daemon, are there no command to send to many addresses? And are there no limit of how many addresses possible? – creator Apr 12 '18 at 8:37
0

Armory can do this in a couple of clicks as far as I remember, you'll be able to do it with one fee if I'm not mistaken but you are going to need to download the whole blockchain.

  • whats the max amount of people you can send to? – Patoshi パトシ Nov 17 '16 at 4:00
  • There is only a size limit for the resulting transaction. So you can add as many outputs/recipients as you want as long as you stay below the 1MB limit (probably a bit lower). But keep in mind that transaction fees are proportional to the size, so every output you add, also adds to the fee. Combining transactions this way amortizes the fixed overhead, so this is still worthwhile. – cdecker Nov 24 '16 at 15:13
0

As Stephen and Nate have already said, Bitcoin Core supports this. I'm not surprised that Armory does as well, since AFAIU it depends on Bitcoin Core.

Concerning the fee:

A transaction header is ten bytes, a transaction input is 148 bytes, and a transaction output is 34 bytes.

Fees for transactions today are calculated on basis of the transaction's size in bytes.

A P2PKH transaction with 2 inputs and 2 outputs (one recipient and one change output) would have 374 bytes. A transaction with 2 inputs and 21 outputs (20 recipients and one change output) would have 1020 bytes.

Assuming that you have sufficiently large UTXO available to fund each transaction with 2 inputs, sending a transaction to twenty recipients would therefore be about 7 times cheaper than sending twenty transactions to a single recipient.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.