In the following I focus on Confidential Transactions (instead of the extension Confidential Assets) for simplicity, but all of what I say is also true for Confidential Assets.
Yes, it’s possible to use cryptographic protocols to organize the CoinJoin transaction in a privacy-preserving manner. The ValueShuffle protocol is designed for exactly this purpose.
ValueShuffle indeed makes sure that no third party (e.g., a server facilitating the CoinJoin) learns the involved amounts (or assets). But its privacy guarantees go beyond this requirement: In a nutshell, ValueShuffle makes sure that the amounts of your inputs and output, and the relationship between inputs and output remain private not only to third parties but also to the other the participants of the CoinJoin.
See the ValueShuffle paper for all the details and limitations. Disclaimer: I’m one of the authors.
Your intuition that CoinJoin and Confidential Transactions are a good match is correct.
More concretely, we can exploit two important synergies.
- If we have Confidential Transactions, CoinJoins with different output amounts are suddenly possible. This eliminates one of the major restrictions of CoinJoin in practice.
- The combination of CoinJoin and Confidential Transaction makes it possible to mix multiple payments instead of merely mixing self-sends (if the payer additionally has a mechanism to get more than one possible address of the payee). As a result, you can mix and pay with your coins in a single transaction. This is much better than CoinJoins without Confidential Transactions, where you first need to perform a mixing transaction and only after mixing you can perform an actual payment in a second transaction. This means that CoinJoining your payments will actually be cheaper (in terms of blockchain space and thus transaction fees) than performing payments individual. This provides a great incentive for doing CoinJoins. This is remarkable because privacy usually comes at a cost — but in a scenario where Confidential Transactions are already available, CoinJoin comes with a discount.
My talk at Scaling Bitcoin 2017 provides a more detailed explanation on the advantages of combining CoinJoin and Confidential Transactions.