You may consider a transaction as a melting pot. All of the inputs get melted down and recast into the outputs, so there’s a few of each enter in every enter. All inputs create all outputs collectively.
Exceptions would maybe be if an enter makes use of the SIGHASH_SINGLE flag that make inputs solely commit to 1 output within the transaction as a substitute of all outputs, or if an enter declares SIGHASH_NONE that solely commits to the inputs of a transaction however not the outputs. (See Raghav Sood’s glorious rationalization of the Signature Flags for extra info.) These might seem within the context of multi-user transactions.
There could also be different hints which will permit a surveillant to guess the possession of outputs, although. E.g. if a transaction solely spends one kind of UTXOs for its inputs and creates two completely different output kinds of which one matches the inputs, which may be an indicator that the matching output is a change output. The Bitcoin Wiki has a wonderful web page on Privateness, additional describing this and different privateness leaks.
If a transaction has a number of inputs and a number of outputs, however the values of some inputs (or subset sums of some inputs) instantly correspond with quantities showing within the outputs, it might be guessed that sure enter units funded the creation of particular outputs, however a number of customers banded collectively to create a transaction. A colleague of mine, Felix Maurer wrote his grasp thesis “Anonymity in Bitcoin – Unlinkable transactions in cryptocurrencies” in 2016 on a subject intently associated to that, however I couldn’t rapidly discover the thesis on-line. IIRC it resulted within the paper Maurer et al (2017): Nameless CoinJoin Transactions with Arbitrary Values which you will discover fascinating.
