input-output-hk / nami

Nami Wallet is a browser based wallet extension to interact with the Cardano blockchain. Support requests: https://iohk.zendesk.com/hc/en-us/requests/new
https://namiwallet.io
Apache License 2.0
374 stars 168 forks source link

Issue Burning Tokens with Ledger/Trezor #775

Open codybutz opened 1 year ago

codybutz commented 1 year ago

Hello!

We were testing out Ledger/Trezor devices on Indigo and found that whenever you burn tokens the Ledger/Trezor device gives back a invalid witness. I believe that https://github.com/berry-pool/nami/blob/f77c709a6aecbab666f341f697ea222ec9d7c747/src/api/util.js#L1142 might be incorrectly processing negative values.

For example, when I Burn a CDP on https://preview.indigoprotocol.io when using Nami, the Ledger device shows a positive amount for the Token Amount during signing, when its meant to be a negative value. This is shown as I go through the steps of signing the transaction on the Ledger device.

This error results in an invalid witness passed back from the CIP30 request.

alessandrokonrad commented 1 year ago

Hey @codybutz sorry for the super late reply, but you are right. Totally oversaw this. Fixing this now.