Closed sourabhxyz closed 1 year ago
Hi @sourabhxyz ! CSL serializes an output to legacy_transaction_output
format if the output doesn't have inlined datum and inlined script, because of takes less bytes in CBOR. If the output contains inlined datum or inlined script the output will be serialized to post_alonzo_transaction_output
format.
For case when you need to deserialized and serialized a tx to add a signature you can use the FixedTransaction
type https://github.com/Emurgo/cardano-serialization-lib/releases/tag/11.3.0 . It keeps tx body bytes unchanged until you change it. You can see an example here https://github.com/Emurgo/cardano-serialization-lib/issues/604
Thanks @lisicky! Really appreciate it. This will work if we have access to private key but here we are bind to use signTx
method provided by a compatible CIP-30 wallet. If I understand you correctly, we would need these wallets to get updated to use FixedTransaction
type internally when signing?
@lisicky It is not an issue an with Nami & Eternl but is an issue with Lace. Thanks!
All the outputs in my transaction had outputs in
post_alonzo_transaction_output
format but after deserialization, outputs which could be simplified tolegacy_transaction_output
format, got simplified into it. Is this intentional? I can see it happening at wallet level (when wallet performs deserialization insignTx
method) and this changing of transaction cbor is leading to inconsistency with what transaction hash we expect and what actually turns out to be.