2

As I understand it, CoinJoin is a method to aggregate multiple transactions into a single transaction, mostly for privacy purposes.

  • How does this aggregation affect the total size of the transactions? I believe it contains the same number of inputs and outputs, but I wonder if the total size decreases due to reducing some overhead.
  • How many transactions can be aggregated? I believe there is a cap on the transaction size, which will limit the total number of inputs and outputs.
  • For the maximal number of inputs/outputs, what will be the total size with and without CoinJoin?
  • Are there additional factors which might affect the CoinJoin transaction size?

1 Answer 1

3

Status Quo

The CoinJoin transaction only has a minimally reduced blockspace requirement in comparison to the unaggregated transactions:

Transaction sizes (example is P2PKH) can be calculated by the following formula:

 size = #inputs * 148 bytes + #outputs * 34 bytes + 10 bytes

By combining multiple transactions only the 10 bytes of the transaction overhead will be saved, the inputs and outputs will require the same amount of space as in the separate transactions before.

The transaction size is limited by the blocksize, however transactions bigger than 100kB are non-standard.

Outlook Schnorr Signatures

The latter will change with the planned introduction of Schnorr signatures and the subsequent possibility of signature aggregation. Schnorr signatures have the nice feature that multiple signatures can be combined into one.

Hence, more inputs on one transaction would reduce the blockspace requirement in the following fashion. Assuming the signature is about half of the input size (it's 72 bytes of 148 for P2PKH) you would get:

inputSizeTotal(n inputs) = 1 * inputSize + (n - 1) * ¹/₂ * inputSize

With the number of inputs going up (i.e. n → ∞) you'd about halve the inputSizeTotal. ;)


Update 2023: Note that Cross-input signature aggregation was not shipped with the Taproot softfork, and if/when it will get shipped, it will require a new output type since it is incompatible with the rules for P2TR. You can find more information about the approximate savings in What block space savings would we get for coinjoins (and payjoins) if we had cross input signature aggregation? and more general information by perusing topics tagged with .

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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