To limit maximum number of native token IDs in the output #60
Replies: 2 comments 1 reply
-
Definitions
Rational behind current parameter values
Considerations:
ProposalI see mainly two viable options here:
Any other option “in between” these two seems too arbitrary to me. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Introduction
Currently Stardust protocol puts cap on maximum different token IDs in the transaction. The number is quite big, something like 256.
Number of different native token ID in one output is unlimited, it can be all 256 in one output.
This limit is not enough to prevent certain attacks and complexities for development.
The problem
It is probably fine to keep many token IDs in an one time transaction. However keeping all of them in the wallet UTXOs is unreasonable. If wallet would keep it all in one UTXO, it will have to spend the whole output when moving even one token. This can result in much bigger transaction.
Therefore, reasonable strategy for the wallet developer is to split tokens into many UTXOs, for example one UTXO for 1 native token ID.
That is the strategy of the Stardust VM (a distributed wallet). It uses one output for native token ID to keep the total on the chain. Any other options are significantly more complicated to implement and costs more dust deposit.
This leads to the following problem:
If sender sends >125 tokens in the output, the Stardust VM won't be able to process it because if split, it will exceed maximum number of UTXOs in the transaction. The only option is to ignore the output. This funds will essentially be lost.
The same will happen with any wallet which splits multi-token outputs to separate UTXOs.
Ignoring the big multi-token output also creates and attack vector, because the output will remain in the backlog forever and It will keep coming again and again.
Solution
To introduce limit or maximum number of token IDs in the output. This will prevent this kind of attack.
The reasonable limit is maximum 4 different native token IDs in one output.
Pros
Cons
Beta Was this translation helpful? Give feedback.
All reactions