bitcoin core – What is payment batching?

How does batching Bitcoin transactions work exactly?

Instead of paying multiple people using a new transaction for each person, you make one transaction that pays those multiple people.

For example, suppose you need to pay 5 people. Instead of doing 5 different transactions with one output each, you are doing one transaction with 5 outputs for the 5 people you pay.

What does this ultimately look like compared to a regular block of a bunch of transactions?

It’s cheaper partly because every transaction has a certain amount of overhead. By coupling transactions, you only have to pay for the overheads once, not several times. Moreover, every transaction usually has switch output, and many times change output has to be spent again in the next transaction. This means that if you’re sending to 5 people, you’re creating 5 switch outputs, and 4 inputs that have to spend from switch output. By batching, you only need one switch output and you don’t need to get those 4 extra inputs spending the switch. Those are effectively cancellations and are therefore removed from the transaction.

In a typical case with paying 3 people:

Input 1 -> Person 1
        -> Change 1 -> Spend Change 1 -> Person 2
                                      -> Change 2 -> Spend Change 2 -> Person 3
                                                                    -> Change 3

By batching:

Input 1 -> Person 1
        -> Person 2
        -> Person 3
        -> Change 3

So you’ve cut out Change 1 and 2, and Spending Change 1 and 2 which means you’re paying less transaction fees.

Also, I’ve read people claim that batching causes weaker privacy, how exactly is this?

All the people who are paid in a transaction in batch can see who else you pay and how much. However, it is difficult for observers to know the true identities of those people.

Source