Decode the CIP-67 label before displaying a Cardano asset name

A labeled asset name begins with a four-byte prefix containing a numeric label and a checksum. Printing the whole name as UTF-8 can obscure both the label and the human-readable suffix.

Validate the first four bytes

Split the hex asset name into the four-byte candidate label and the remaining bytes. Check the bracket nibbles and verify the CRC-8 checksum for the two-byte label number before interpreting the prefix.

000643b0 414243
000de140 414243

The first example has label 100 and the second label 222. Both suffixes decode to ABC. They are distinct asset names even under the same minting policy. Preserve the prefix when constructing a transaction.

Allow arbitrary suffix bytes

CIP-67 labels classify names, but the rest need not be printable text. Show a hex fallback for invalid UTF-8 and retain the unmodified full name. A matching label alone does not prove that the issuer follows the corresponding application standard. cips.cardano.org Cardano CIP-67