Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Non-token outputs seem to sometimes contain empty token bundle #189

Closed
refi93 opened this issue Aug 16, 2021 · 2 comments · Fixed by #190
Closed

Non-token outputs seem to sometimes contain empty token bundle #189

refi93 opened this issue Aug 16, 2021 · 2 comments · Fixed by #190
Assignees
Milestone

Comments

@refi93
Copy link

refi93 commented Aug 16, 2021

We got a report in ledgerjs repo that a user of cardano-serialization-lib with a transaction containing tokens only in some of its outputs had an empty token bundle in all of them when serialized, which then breaks compatibility with hw wallets which never add this empty token bundle to non-token outputs. Is including an empty token bundle in the CBOR-serialized outputs intended?

Link to related issue: vacuumlabs/ledgerjs-cardano-shelley#125

@SebastienGllmt
Copy link
Contributor

I asked to get a repro of this issue written in code as a unit test that way we can easily tell if this is a user issue or not and validate a fix if it is an issue with the txbuilder interface.

@Scitz0
Copy link

Scitz0 commented Aug 17, 2021

I have today been able to test this a bit more and narrowed it down to a problem with add_change_if_needed() helper method to tx builder. This helper method adds the empty token map instead of omitting it completely. If I manually build the change output (without adding MultiAsset to Value) and add it to the builder and calculate/set the fee there is no issue and ledgerjs handles the witnessing of tx body correctly.

As per spec in CIP-0021 (updated today) a new section was added that mentions:

**Optional empty lists and maps**

Unless mentioned otherwise in this CIP, optional empty lists and maps must not be included as part of the transaction body or its elements.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants