1

I am building dApps on cardano, and I faced an issue.

I was trying to let the users sign message to verify them. (using signData method of wallet)

But signData method is not supported for ledger type wallet yet.

So I try to fix this using signTx method which is supported both for ledger and seed-phrase account.

And I got the signedTx (hex string) and the transaction string and

build the signedData like this.

const signedData = {
    signature: transaction string,
    key: signed transaction
}

And I tried to verify this in the same way I verify the signed message using

@emurgo/cardano-message-signing-nodejs
@emurgo/cardano-serialization-lib-nodejs

But I got error like this.

Deserialization failed in TransactionWitnessSet because: Invalid cbor: not the right type, expected Map' byte received Array'.

Can anyone help me with this issue?

Thank you very much.

1 Answer 1

1

The error you're seeing is related to deserialization. It suggests that the data format you're trying to read doesn't match the expected format. In Cardano, the data structures are often serialized using Concise Binary Object Representation (CBOR).

Here are some things to check:

  • Data Type Mismatch: Make sure that the data type of the signedData you're trying to deserialize matches what is expected. Your error message indicates that it's expecting a CBOR Map, but it received an Array instead.

  • Correct Libraries: Ensure you're using the right versions of the @emurgo/cardano-message-signing-nodejs and @emurgo/cardano-serialization-lib-nodejs libraries.

  • Method Mismatch: If you're trying to verify a signed transaction, make sure you're using the appropriate methods for transaction verification and not the ones meant for message signing.

  • Documentation and Examples: Check any provided examples or documentation to ensure you're using the correct data formats and methods.

It's hard to pinpoint the exact issue without more code or context, but checking these areas might help you resolve the issue. If I have to guess, you are giving it a string instead of array of bytes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.