-
Notifications
You must be signed in to change notification settings - Fork 2
Description
The current flow where the SDK swaps the static input and rebuilds the tx with the actual input may lead to problems when the static input is used for validation.
Examples:
- Minting an NFT where the static input is used to parameterize the minting policy.
- Input indexing where the index of a script UTxO is provided through the redeemer to more efficiently validate. As inputs are ordered lexicographically, the swap will change the order and break the validation.
Possible solutions:
Example 1 can be mitigated by not using the static UTxO as a parameter. Updating the documentation to make developers aware should be enough.
Example 2 is more complex and would require a different flow to "bypass" the SDK rebuilding the tx with the actual input. A possible flow would be that the SDK only swaps static to actual and it falls on the developer to make sure the transaction still validates. To correctly observe the available sponsor UTxOs, there could be an additional endpoint that allows the SDK to be informed about the inputs and change outputs.