nami: Vasil branch produces incorrect witnesses
It looks like the vasil branch of nami properly understands babbage era transaction (at least, the ones that have all the babbage era features set to use the *None constructors from cardano-api) - however, I believe it creates the witnesses improperly, as subsequent transaction submission towards testnet yields:
ShelleyTxValidationError ShelleyBasedEraBabbage (ApplyTxError [UtxowFailure (FromAlonzoUtxowFail (WrappedShelleyEraFailure (InvalidWitnessesUTXOW [VKey (VerKeyEd25519DSIGN ...)])))])
When I try to manually sign with a private key using cardano-serialization-lib 11.0.0-rc.1, with effectively the same logic nami uses under the hood - everything works fine and the transaction goes through.
Since the issue probably lies in the cardano-multiplatform-lib wasm files used by nami, I’m unsure where exactly to look to try and quickly fix it via a PR.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 19 (8 by maintainers)
@TotallyNotChase I just updated the vasil branch for Nami. It should support now the legacy output serialization. Actually Nami makes now the witness on the raw cbor encoded tx body that is provided. So it should work for any tx.
And you may wanna check out Lucid 0.5.4 which also has the legacy output support now. Lemme know how all of this goes.
Completely understandable. Sometimes the ecosystem just chooses the fundamentally wrong thing… and we devs have to just follow by also doing the wrong thing. In this particular case though, I’d argue the specification shouldn’t leave room for ambiguity, and yet it does.
I always asked myself why this isn’t what all the wallets do. Just seems a lot more cryptographically reasonable to me.
I think what other wallets do is check if the output contains an inline datum or a refScript. If so use the new output format otherwise the legacy format. I can do that too, however I don’t like it actually that I’m forced to serialise transactions in a certain way although the specifications do allow me differently. Maybe wallets should sign the raw body instead of serialising it on their own and then sign it which results in wrong witnesses obviously. But I can support the legacy format for now as well.
I’m pretty sure it has to do with how the outputs are serialized. There is a new format, but the legacy format is the primary one supported by the CSL.