<p>A standard transaction may use up to 400,000 weight units (=100,000 vbytes). Every transaction must have at least one input and at least one output. It is possible to perform multiple payments in one transaction by adding several outputs that each pay one recipient. This is often referred to as <em>payment batching</em>. Usually, a <em>change output</em> is used to return the remaining funds to the sender's wallet.</p>
<p><a href="https://i.sstatic.net/pko3y.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/pko3y.png" alt="enter image description here" /></a></p>
<p>Let's assume that the sender is using the most blockspace efficient output format, Pay to Witness Public Key Hash (single-sig native segwit). A P2WPKH input weighs 68 vB, and each P2WPKH output weighs 31 vB. A transaction must have a header that tracks the meta information of the transaction. For a segwit transaction, the header weighs 10.5 vB.</p>
<p>The maximum number of payments in one transaction can therefore be calculated with:</p>
<pre><code>(limit - header_size - input_size - change_output_size) / output_size

(100,000 - 10.5 - 68 - 31) / 31 = 99,890.5 / 31 = 3,222.27
</code></pre>
<p>A pure P2WPKH transaction with a single input can therefore perform 3,222 payments, or 3,223 when it does not need a change output. If the transaction uses more inputs, the number of possible payments decreases accordingly.</p>
<p>I would expect that this limit is not usually reached in practice. I don't know for sure whether Bitcoin Core would allow you to create a non-standard transaction with <code>sendmany</code>, but I'd expect that it would allow it. I guess one could check in the source code if one would expect the limit actually to actually be met.</p>

CC BY-SA 4.0
2021-02-13T17:31:31.283Z
2021-02-13T17:31:31.283Z
Murch
<p><a href="https://bitcoincore.org/en/doc/0.21.0/rpc/wallet/sendmany/" rel="nofollow noreferrer">https://bitcoincore.org/en/doc/0.21.0/rpc/wallet/sendmany/</a></p>
<p>What is the limit on the number of &quot;transactions&quot; you can make inside one &quot;sendmany&quot; call/transaction? 10? 50? 500? Thousands? Tens of thousands? Unlimited?</p>
<p>What happens if that (presumed, undocumented) limit is reached? Will the client not allow it or will it allow it and then sit there in limbo forever or for a long time?</p>

<bitcoin-core><transactions><payment-batching>
What is the limit on the number of "transactions" you can make inside one "sendmany" call/transaction?
Drapper L.
# What is the limit on the number of "transactions" you can make inside one "sendmany" call/transaction?

(Asked by: username_0 on 2021-02-13)

<https://bitcoincore.org/en/doc/0.21.0/rpc/wallet/sendmany/>

What is the limit on the number of "transactions" you can make inside one "sendmany" call/transaction? 10? 50? 500? Thousands? Tens of thousands? Unlimited?

What happens if that (presumed, undocumented) limit is reached? Will the client not allow it or will it allow it and then sit there in limbo forever or for a long time?

**Tags:** bitcoin-core, transactions, payment-batching


---

## 1 answers

### Answer by username_1 on 2021-02-13. Score: 1

A standard transaction may use up to 400,000 weight units (=100,000 vbytes). Every transaction must have at least one input and at least one output. It is possible to perform multiple payments in one transaction by adding several outputs that each pay one recipient. This is often referred to as *payment batching*. Usually, a *change output* is used to return the remaining funds to the sender's wallet.

[![enter image description here](https://i.sstatic.net/pko3y.png)](https://i.sstatic.net/pko3y.png)

Let's assume that the sender is using the most blockspace efficient output format, Pay to Witness Public Key Hash (single-sig native segwit). A P2WPKH input weighs 68 vB, and each P2WPKH output weighs 31 vB. A transaction must have a header that tracks the meta information of the transaction. For a segwit transaction, the header weighs 10.5 vB.

The maximum number of payments in one transaction can therefore be calculated with:

```
(limit - header_size - input_size - change_output_size) / output_size

(100,000 - 10.5 - 68 - 31) / 31 = 99,890.5 / 31 = 3,222.27

```

A pure P2WPKH transaction with a single input can therefore perform 3,222 payments, or 3,223 when it does not need a change output. If the transaction uses more inputs, the number of possible payments decreases accordingly.

I would expect that this limit is not usually reached in practice. I don't know for sure whether Bitcoin Core would allow you to create a non-standard transaction with `sendmany`, but I'd expect that it would allow it. I guess one could check in the source code if one would expect the limit actually to actually be met.


---

