Open klntsky opened 2 years ago
CC @alessandrokonrad @KtorZ
That's how we approached the differences in CTL:
version
a required field in V2policy_id
length to be 28 bytesasset_name
maximum length of 32 bytes @klntsky What do you mean with "... there's no limit for string byte lengths." ? the metadata attached to a transaction still must be within the specs: https://github.com/input-output-hk/cardano-node/blob/master/doc/reference/tx-metadata.md Or do i get your question wrong?
@klntsky What do you mean with "... there's no limit for string byte lengths." ? the metadata attached to a transaction still must be within the specs: https://github.com/input-output-hk/cardano-node/blob/master/doc/reference/tx-metadata.md Or do i get your question wrong?
I mean splitting the string in chunks is needed only for plutus data encoding (it's format-specific), but it does not make sense with JSON with no string length restrictions.
Some wording should be improved I suggest:
In version 2 the the raw bytes of the policy_id are used.
Shouldn't there be "hex-encoded bytes"?
Also would be nice to mention somewhere in the document that v.2 isn't supported by major indexers like Blockfrost and Maestro.
Shouldn't there be "hex-encoded bytes"?
No in version 2, it must be raw bytes, so actual binary bytes in the CBOR data. Hex encoded policy IDs as strings are not valid in version 2.
@SmaugPool Thanks, I misplaced the initial quote, I intended to mention the analogous part for asset_name
:
In version 1 the asset_name must be utf-8 encoded and in text format for the key in the metadata map. In version 2 the the raw bytes of the asset_name are used.
It looks like we are doing it the wrong way in CTL @klntsky, this might be the reason BF/Maestro were not able to read CIP25 v2 tokens minted. I will take a look later on.
It looks like we are doing it the wrong way in CTL @klntsky, this might be the reason BF/Maestro were not able to read CIP25 v2 tokens minted. I will take a look later on.
It's the same for asset_name
, only raw bytes are supported in version 2. A lot get this wrong indeed and use hex encoded strings which is not correct.
@euonymos yes, and we patched it for one of the clients
@klntsky do you think it would help to talk about this at the next CIP meeting (Tuesday 06 August) to get some broader attention?
I'm working on implementing CIP-25 in CTL. Here are some problems I encountered:
version
property in V2 defined as optional in the description, but required in CDDL. I think it should be required, because otherwise some metas can be decoded using both V1 and V2 and the contents would be different.policy_id
is ScriptHash, its length limit should be 28 bytes (not reflected in CDDL)asset_name
is TokenName and thus must be 0-32 bytes (not reflected in CDDL)