user1142: Let's say someone has 10'000 different tokens on one address. Each token is in a single UTxO. Would it be possible to send them all in one transaction to another address (or the same address), so they are all in one UTxO? Or is there a limit on how many distinct tokens one can send in a single transaction?

user255: To the best of my knowledge, there is no limit to the amount of tokens a transaction can contain.
A Value itself has the following Signature Map CurrencySymbol (Map TokenName Integer). Which literarily means an unlimited number of tokens, since Map poses no limit to the amount of elements it can contain.

user2042: We can simulate this in the playground. I set up three tokens T1,T2 and T3 and gave one of each to Wallet 1 at the beginning.
Then I sent three separate transactions, sending each token in its own transaction to Wallet 2, resulting in 3 new UTxOs in Wallet 2, one for each token.
I then paid all the tokens back to Wallet 1 in a single transaction.
If you zoom in on the image, you can see that there are four inputs, which are the lovelace for fees plus one UTxO for each token. One of the outputs to Wallet 1 is a single UTxO with all three tokens included. The other output is the change given back to Wallet 2 after Lovelace fees are deducted.
As mentioned by Aoaddeola, there should be no theoretical limit to the number of tokens this can scale for.


user1130: The maximum transaction size is specified in the genesis configuration of the chain. For reference, here is a genesis config for the Shelley Testnet.
The maxTxSize is set to 16384 (bytes, I assume).
"maxTxSize": 16384,

So. Yes, there is definitely a limit to how many different tokens you could include in a UTxO.
This doesn't answer the question on limits to the number of inputs for a transaction. Obviously these couldn't result in an output larger than maxTxSize, but I can't say if there are additional constraints on the number of inputs. I'm curious to know so I might keep looking. In the mean time, I hope that helps.

1142: <p>Let's say someone has 10'000 different tokens on one address. Each token is in a single UTxO. Would it be possible to send them all in one transaction to another address (or the same address), so they are all in one UTxO? Or is there a limit on how many distinct tokens one can send in a single transaction?</p>
 255: <p>To the best of my knowledge, there is no limit to the amount of tokens a transaction can contain.</p>
<p>A <code>Value</code> itself has the following Signature <code>Map CurrencySymbol (Map TokenName Integer)</code>. Which literarily means an unlimited number of tokens, since <code>Map</code> poses no limit to the amount of elements it can contain.</p>
 2042: <p>We can simulate this in the playground. I set up three tokens T1,T2 and T3 and gave one of each to Wallet 1 at the beginning.</p>
<p>Then I sent three separate transactions, sending each token in its own transaction to Wallet 2, resulting in 3 new UTxOs in Wallet 2, one for each token.</p>
<p>I then paid all the tokens back to Wallet 1 in a single transaction.</p>
<p>If you zoom in on the image, you can see that there are four inputs, which are the lovelace for fees plus one UTxO for each token. One of the outputs to Wallet 1 is a single UTxO with all three tokens included. The other output is the change given back to Wallet 2 after Lovelace fees are deducted.</p>
<p>As mentioned by Aoaddeola, there should be no theoretical limit to the number of tokens this can scale for.</p>
<p><a href="https://i.stack.imgur.com/0inWY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0inWY.png" alt="Plutus Playground Simulation" /></a></p>
 1130: <p>The maximum <em>transaction</em> size is specified in the genesis configuration of the chain. For reference, here is a genesis config for the <a href="https://hydra.iohk.io/build/6782523/download/1/testnet-shelley-genesis.json" rel="noreferrer">Shelley Testnet</a>.</p>
<p>The <code>maxTxSize</code> is set to <code>16384</code> (bytes, I assume).</p>
<pre><code>&quot;maxTxSize&quot;: 16384,
</code></pre>
<p>So. Yes, there is definitely a limit to how many different tokens you could include in a UTxO.</p>
<p>This doesn't answer the question on limits to the number of inputs for a transaction. Obviously these couldn't result in an output larger than <code>maxTxSize</code>, but I can't say if there are additional constraints on the number of inputs. I'm curious to know so I might keep looking. In the mean time, I hope that helps.</p>
