Skip to content

Change handling is too simplistic #800

@arjaz

Description

@arjaz

Describe the feature you'd like

Change handling is too simplistic. It's not possible to specify the position of the change output. That is critical for some smart contracts to work correctly, because the outputs positions are visible on-chain and controlled by the transaction builder.

It would be really useful to mark an output as a change output. This way a user can provide the minimum amounts the output is expected to have, and the library can calculate the change and put it in the marked output. Change outputs can easily be some script outputs with datums and complicated requirements for their positions.

Is your feature request related to a problem? Please describe.

Yes, change output is always added last and can't be controlled by users.

Describe the solution you'd like

Add an option to mark an output as "change" where the change would be added during building.

Additional context

No response

Would you be willing to implement it?

  • Yes, I will implement it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions