bloxbean / cardano-client-lib

Cardano client library in Java
https://cardano-client.dev
MIT License
118 stars 47 forks source link

Wrong Data <=> CBOR encoding/decoding #399

Closed nau closed 1 month ago

nau commented 3 months ago

In Cardano Plutus ALL bytestring MUST be chunked up to 64 bytes. This includes Plutus Data ByteString AND BigInteger represented as byte strings.

So default CBOR encodings are incorrect and can not be used.

Instead, we all MUST implement custom byte string handling, especially for BigIntegers like here: decodeBoundedBigInteger

satran004 commented 1 month ago

@nau I am looking into this issue now.

Is it possible for you to provide some test data for this or point me to any available test cases?

nau commented 1 month ago

Here are a couple of test cases:

DataCborCodecSpec

Please, take a look at

test("ByteString chunks")

and

test("BigInt encoding/decoding of > 64 bits is chunked")
satran004 commented 1 month ago

Thanks @nau