1

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?

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

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.

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.