As an aside from the CoinJoin
discussion, it occurred to me that another transaction size optimization is possible with CoinJoin like transactions.
Say there is a collection of related unconfirmed transactions:
(u signifies an unconfirmed output)
A -> uB -> uH - uJ
D -> uE -\
uK -> uL
F -> uG -/
The authors of the earliest unconfirmed transactions could write replacements for their transactions:
This transformation is lossless with respect to the final coin ownership, but the intermediate transactions were cut-through. This works even if the original coin ending up in the final outputs came from multiple parties, as they can coinjoin to preserve the final outcome.
Because the replacements are atomic and consume the original inputs this transformation is safe, assuming people in the middle can handle any accounting complications that arise. (E.g. figuring out that their payment really was completed). So you'd want to have a way of signaling "I permit you to conflict this transaction with one that pays its children, if you can figure out how".
Nlocktime could be set in the mild future in order to create time for these kinds of arrangements to be found, and if blocks are found to fast— no harm, the cutthrough doesn't have to happen all the time.
Because people don't currently spend unconfirmed inputs I expect this wouldn't get much compression now, but in the future it might have quite an impact.