Skip to content

Commit

Permalink
Add "Versions 1 and 2" section to README
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeFlerovsky committed Feb 27, 2023
1 parent 6a8da4f commit 4797911
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions CIP-????/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,42 @@ It is equivalent to the following simple metadata update:
}
```

### Versions 1 and 2
Like CIP-25, CIP-86 supports two different methods of
representing policy IDs and token name:

- In version 1,
policy IDs and token names must be expressed as text
(see [cddl/version_1.cddl](cddl/version_1.cddl)).
- In version 2,
policy IDs and token names must be expressed as raw bytes
(see [cddl/version_2.cddl](cddl/version_2.cddl)).

By default, all CIP-86 metadata updates use version 1.
However, version 2 can be used if the `version` field of the object
under the top-level `"86"` CBOR tag is set to `2`.

For example:

```json
{
"86": {
"version": 2,
"simple_metadata_update": {
"<policyIdRawBytes>": {
"<tokenNameRawBytes>": {
"<metadataField>": "<metadataValue>"
}
}
}
}
}
```

Regex updates are disallowed in version 2, because it is unclear
how to apply regular expressions to non-UTF-8 bytestrings (or their
corresponding hex encodings).

### Order of application for updates

Up to network consensus, the Cardano blockchain imposes
Expand Down

0 comments on commit 4797911

Please sign in to comment.