Skip to content

Commit 6d664f1

Browse files
Crypto2099rphairRyun1KtorZ
authored
CIP-0088? | Token Policy Registration (cardano-foundation#467)
* Add first draft of the on-chain token policy registration CIP. * qualify pull request discussion URL Co-authored-by: Ryan Williams <[email protected]> * correct anchor for CIP-0036 URL Co-authored-by: Ryan Williams <[email protected]> * reformat license to standard CIP form Co-authored-by: Ryan Williams <[email protected]> * Add proposed CIP-26 Fungible Token registration along with examples and schema documentation. * Minor formatting changes for CIP-26 README.md as well as first draft specification for CIP-25/68 NFT Metadata standards. * Minor updates to the URI Array schema definition and adding CIP-25 support documentation. * Update CIP-XXXX/README.md Co-authored-by: Matthias Benkort <[email protected]> * Update directory structure to use proposed CIP cardano-foundation#88 and add 867 metadatum label to the CIP-10 registry. * Update CIP Title * **CIP-0088: Token Policy Registration** Updates to README.md based on feedback of CIP editors and community. * **CIP-0088: Token Policy Registration** - Add v1.0.0 CDDL spec - Update primary README.md file to use updated CBOR CDDL notation for examples as well as enhance display formatting and examples. * **CIP-0088: Token Policy Registration** - Update readme to address issues and questions presented by CPS-0001 - Update CDDL to support a more flexible scoping structure for future expansion * Update CIP-0088/README.md Co-authored-by: Robert Phair <[email protected]> * Update CIP-0088/README.md Co-authored-by: Robert Phair <[email protected]> * **CIP-0088: Token Policy Registration** - Update for preliminary support for CIP-48 (Metadata References) - Updates to make the validation method a UInt format index of well-defined methods for validation - Clean-up of some of the CBOR examples * **CIP-0088: Registration Certificates** - Minor typo fix * **CIP-0088: Registration Certificates** - Fix typo in discussions link * **CIP-0088: Registration Certificates** - Rename and split CDDL files to better support dynamic versioning and iteration of CIP-Specific details in the future. * - Add NFT Project Details CDDL and Specification Details * Correct minor capitalization issue in NFT-Project-Details.md * Some minor changes to CDDL specs and building out a better directory structure. * Updates to CIP-88: - Complete restructuring of CIP-Specific Documentation - Provide context for when, where, and how to create extensions and modifications to the CIP - Improve documentation and optimize some data structures - Switch to Unsigned Integer version numbers for maximum on-chain compatibility - Finalize v1 documentation for most of the specification so that work on publication and validation can begin. This version should be approaching readiness to begin testing the publication and validation of information on testnet to confirm that all data structures work as expected. * Fix YAML header * Update CIP-0088/README.md Co-authored-by: Robert Phair <[email protected]> * Update Native Script scope Updated examples to include Native Script scope and also included some updates to examples and other documentation to ensure consistency. --------- Co-authored-by: Robert Phair <[email protected]> Co-authored-by: Ryan Williams <[email protected]> Co-authored-by: Matthias Benkort <[email protected]>
1 parent 7fa28f7 commit 6d664f1

35 files changed

+2273
-1
lines changed

CIP-0010/registry.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@
3333
},
3434
{
3535
"transaction_metadatum_label": 839,
36-
"description": "Agora - Proposal creation metadata"
36+
"description": "Agora - Proposal creation metadata"
37+
},
38+
{
39+
"transaction_metadatum_label": 867,
40+
"description": "CIP-0088 - Token Policy Registration Standard"
3741
},
3842
{
3943
"transaction_metadatum_label": 888,

CIP-0088/CIPs/0025/CIP25_v1.cddl

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
; CIP-0025: Token Metadata Standard
2+
; Version: 1
3+
4+
cip25-details = {
5+
? 0 : uint, ; version
6+
1 : token-project-details ; [CIP-0025 Token Project Details](../common/token-project-details.cddl)
7+
}

CIP-0088/CIPs/0025/CIP25_v1.json

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"25": {
3+
"0": 1,
4+
"1": {
5+
"0": "SpaceBudz",
6+
"1": [
7+
"10,000 SpaceBudz are out there.",
8+
"Where will your SpaceBudz take you?"
9+
],
10+
"2": [
11+
"https://",
12+
"static.spacebudz.io",
13+
"/images/logo.png"
14+
],
15+
"3": [
16+
"https://",
17+
"static.spacebudz.io",
18+
"/images/banner.jpg"
19+
],
20+
"4": 0,
21+
"5": [
22+
[
23+
"twitter",
24+
[
25+
"https://",
26+
"twitter.com/spacebudzNFT"
27+
]
28+
],
29+
[
30+
"discord",
31+
[
32+
"https://",
33+
"discord.gg/spacebudz"
34+
]
35+
]
36+
],
37+
"6": "SpaceBudz"
38+
}
39+
}
40+
}
+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"$id": "https://raw.githubusercontent.com/cardano-foundation/CIPs/main/CIP-0088/CIPs/0025/CIP25_v1.schema.json",
3+
"title": "CIP-25: Token Project Details",
4+
"description": "Additional context for token policy declaring support for CIP-25 token metadata standards",
5+
"type": "object",
6+
"properties": {
7+
"25": {
8+
"type": "object",
9+
"properties": {
10+
"0": {
11+
"type": "integer",
12+
"title": "Version",
13+
"description": "The version of the standard in use",
14+
"minimum": 1
15+
},
16+
"1": {
17+
"title": "Project Details",
18+
"description": "Describe top-level details about the Token Project",
19+
"$ref": "https://raw.githubusercontent.com/cardano-foundation/CIPs/main/CIP-0088/common/token-project-details_v1.schema.json"
20+
}
21+
},
22+
"required": [
23+
"1"
24+
]
25+
}
26+
},
27+
"required": [
28+
"25"
29+
]
30+
}

CIP-0088/CIPs/0025/README.md

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# CIP-88 Extension: CIP-0025 | Token Project Information
2+
3+
`Version: 1`
4+
5+
## Top-Level Fields
6+
7+
Both CIP-25 and CIP-68 are specifications describing a standard for storing and retrieving token metadata from the
8+
chain. To this end, we have given them the same data structure although each will utilize their own numerical index in
9+
the feature set and CIP-Specific details section of the registration.
10+
11+
These sections may be separated in the future if the respective CIPs diverge in terms of the data or information that
12+
may be useful to provide about one format or the other in the future.
13+
14+
| index | name | type | required | notes |
15+
|-------|--------------------------|------------------|----------|-------------------------------------------------------------------------------------------------------------|
16+
| 0 | Version | Unsigned Integer | No | Default: 1, which version of this specification is in use |
17+
| 1 | Token Collection Details | Object | Yes | Provide additional context about this "Collection" for consumption by marketplaces, explorers, and wallets. |
18+
19+
The information registered here is helpful to aggregator services and marketplaces, it applies equally to both CIP-25
20+
and CIP-68 metadata standards. A project utilizing one or the other should reference this documentation and include the
21+
relevant information under index #6, prefixed by the number of the CIP (25 or 68) depending upon the metadata format.
22+
23+
## Token Collection Details Fields
24+
25+
| index | name | type | required |
26+
|-------|---------------------|----------|----------|
27+
| 0 | Collection Name | String | Yes |
28+
| 1 | Description | Array | No |
29+
| 2 | Project Image | UriArray | No |
30+
| 3 | Project Banner | UriArray | No |
31+
| 4 | NSFW Flag | 0 or 1 | No |
32+
| 5 | Social Media | Array | No |
33+
| 6 | Project/Artist Name | String | No |
34+
35+
For details on what these fields represent and how they should be structured in the metadata, please refer to
36+
[Token Project Details](../common/Token-Project-Details_v1.md)
37+
38+
## CIP-25 Example
39+
40+
```cbor
41+
{
42+
25: {
43+
0: 1,
44+
1: {
45+
0: "Cool NFT Project",
46+
1: [
47+
"This is a description of my project",
48+
"longer than 64 characters so broken up into a string array"
49+
],
50+
2: [
51+
"https://",
52+
"static.coolnftproject.io",
53+
"/images/icon.png"
54+
],
55+
3: [
56+
"https://",
57+
"static.coolnftproject.io",
58+
"/images/banner1.jpg"
59+
],
60+
4: 0,
61+
5: [
62+
[
63+
"twitter",
64+
[
65+
"https://",
66+
"twitter.com/spacebudzNFT"
67+
]
68+
],
69+
[
70+
"discord",
71+
[
72+
"https://",
73+
"discord.gg/spacebudz"
74+
]
75+
]
76+
],
77+
6: "Virtua Metaverse"
78+
}
79+
}
80+
}
81+
```

CIP-0088/CIPs/0026/CIP26_v1.cddl

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
; CIP-0026: Fungible Token Registration Standard
2+
; Version: 1
3+
4+
string = text .size (0..64)
5+
6+
; A uri should consist of a scheme and one or more path strings describing the path to the resource
7+
; The first entry should contain the URI "Scheme" (e.g. "https://", "ftp://", "ar://", "ipfs://")
8+
; One or more subsequent entries should describe the path of the URI
9+
10+
uri.scheme = text .size (5..64)
11+
uri.path = text .size (1..64)
12+
uri = {
13+
uri.scheme,
14+
+ uri.path
15+
}
16+
17+
policy_id = bytes .size(28)
18+
asset_name = bytes .size (0..32)
19+
20+
token-asset = {
21+
policy_id,
22+
asset_name
23+
}
24+
25+
fungible-details = {
26+
0 : token-asset, ; asset identifier
27+
1 : string, ; token name
28+
2 : [* string], ; description
29+
? 3 : string, ; token ticker
30+
? 4 : uint, ; token decimals
31+
? 5 : uri, ; uri of token website
32+
? 6 : uri, ; uri of token image
33+
? 7 : token-asset ; beacon token identifier
34+
}
35+
36+
cip26-details = {
37+
? 0 : uint, ; version
38+
1 : [+ fungible-details] ; CIP-0026 Fungible Token Registration(s)
39+
}

CIP-0088/CIPs/0026/CIP26_v1.json

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"26": {
3+
"0": 1,
4+
"1": [
5+
{
6+
"0": [
7+
"d894897411707efa755a76deb66d26dfd50593f2e70863e1661e98a0",
8+
"7370616365636f696e73"
9+
],
10+
"1": "spacecoins",
11+
"2": "SPACE",
12+
"3": [
13+
"the OG Cardano community token",
14+
"-",
15+
"whatever you do, your did it!",
16+
"",
17+
"Learn more at https://spacecoins.io!"
18+
],
19+
"4": 0,
20+
"5": [
21+
"https://",
22+
"spacecoins.io"
23+
],
24+
"6": [
25+
"ipfs://",
26+
"bafkreib3e5u4am2btduu5s76rdznmqgmmrd4l6xf2vpi4vzldxe25fqapy"
27+
],
28+
"7": [
29+
"d894897411707efa755a76deb66d26dfd50593f2e70863e1661e98a0",
30+
""
31+
]
32+
}
33+
]
34+
}
35+
}
+118
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
{
2+
"$id": "https://raw.githubusercontent.com/cardano-foundation/CIPs/main/CIP-0088/CIPs/0026/CIP26_v1.schema.json",
3+
"title": "CIP-26: Fungible Token",
4+
"description": "Additional context for a policy declaring support for fungible token standards",
5+
"type": "object",
6+
"properties": {
7+
"26": {
8+
"type": "object",
9+
"properties": {
10+
"0": {
11+
"type": "integer",
12+
"title": "Version",
13+
"description": "The version of the standard in use",
14+
"minimum": 1
15+
},
16+
"1": {
17+
"type": "array",
18+
"minItems": 1,
19+
"items": {
20+
"title": "Fungible Token Details",
21+
"description": "Describes details about a particular fungible token under this policy",
22+
"type": "object",
23+
"properties": {
24+
"0": {
25+
"title": "Subject",
26+
"description": "The hex-encoded Policy ID and Asset ID of the token",
27+
"$ref": "#/$defs/tokenAsset"
28+
},
29+
"1": {
30+
"title": "Name",
31+
"description": "The full display name of the token",
32+
"type": "string",
33+
"example": "spacecoins"
34+
},
35+
"2": {
36+
"title": "Symbol/Ticker",
37+
"description": "The ticker or listing symbol for the token",
38+
"type": "string",
39+
"example": "SPACE"
40+
},
41+
"3": {
42+
"title": "Description",
43+
"description": "A short description for the token",
44+
"type": "array",
45+
"items": {
46+
"type": "string",
47+
"maxLength": 64
48+
},
49+
"example": [
50+
"The OG Cardano Community Token","- whatever you do, your did it!"
51+
]
52+
},
53+
"4": {
54+
"title": "Decimals",
55+
"description": "How many decimal places this token should be rendered with",
56+
"type": "integer",
57+
"example": 0,
58+
"default": 0
59+
},
60+
"5": {
61+
"title": "URL",
62+
"description": "A URL to the project's web page",
63+
"$ref": "https://raw.githubusercontent.com/cardano-foundation/CIPs/main/CIP-0088/common/uri-array.schema.json"
64+
},
65+
"6": {
66+
"title": "Logo",
67+
"description": "A URI to the token's logo",
68+
"$ref": "https://raw.githubusercontent.com/cardano-foundation/CIPs/main/CIP-0088/common/uri-array.schema.json"
69+
},
70+
"7": {
71+
"title": "Reference Token",
72+
"description": "A reference to a 'Beacon Token' that can provide additional context via inline datum to smart contracts",
73+
"$ref": "#/$defs/tokenAsset"
74+
}
75+
},
76+
"required": [
77+
"0",
78+
"1",
79+
"2"
80+
]
81+
}
82+
}
83+
},
84+
"required": [
85+
"1"
86+
]
87+
}
88+
},
89+
"required": [
90+
"26"
91+
],
92+
"$defs": {
93+
"tokenAsset": {
94+
"title": "Token Asset",
95+
"description": "The hex-encoded Policy ID and hex-encoded Asset ID of the token",
96+
"type": "array",
97+
"minItems": 2,
98+
"maxItems": 2,
99+
"items": [
100+
{
101+
"title": "Policy ID",
102+
"description": "The hex-encoded Policy ID of the token",
103+
"type": "string",
104+
"maxLength": 56,
105+
"minLength": 56
106+
},
107+
{
108+
"title": "Asset ID",
109+
"description": "The hex-encoded Asset ID of the token",
110+
"type": "string",
111+
"minLength": 0,
112+
"maxLength": 64
113+
}
114+
],
115+
"additionalItems": false
116+
}
117+
}
118+
}

0 commit comments

Comments
 (0)