@@ -41,9 +41,7 @@ stored off-chain in a JSON format. The schema includes the following fields:
41
41
| \* animation_url | string | URL to a multimedia attachment of the asset. The supported file formats are MP4 and MOV for video, MP3, FLAC and WAV for audio, GLB for AR/3D assets, and HTML for HTML pages. You may use the ?ext={file_extension} query to provide information on the file type. |
42
42
| \* collection | object | an object with a "name" field specifying the name of the collection, and a “family” field specifying the larger category or group to which the collection belongs. |
43
43
44
- \* optional
45
-
46
- ##
44
+ \* ` optional `
47
45
48
46
### JSON Schema
49
47
@@ -112,6 +110,146 @@ stored off-chain in a JSON format. The schema includes the following fields:
112
110
}
113
111
```
114
112
113
+ ### JSON Basic example
114
+
115
+ ``` json
116
+ {
117
+ "name" : " My NFT" ,
118
+ "description" : " This is my awesome NFT" ,
119
+ "image" : " https://example.com/my-nft.jpg"
120
+ }
121
+ ```
122
+
123
+ ### JSON Additional fields example
124
+
125
+ ``` json
126
+ {
127
+ "name" : " My NFT" ,
128
+ "description" : " This is my non-fungible token." ,
129
+ "image" : " https://example.com/image.png" ,
130
+ "external_url" : " https://example.com" ,
131
+ "animation_url" : " https://example.com/animation.mp4" ,
132
+ "authors" : [
133
+ {
134
+ "name" : " John Doe"
135
+ },
136
+ {
137
+ "name" : " Jane Smith"
138
+ }
139
+ ],
140
+ "collection" : {
141
+ "name" : " My Collection" ,
142
+ "family" : " Art"
143
+ }
144
+ }
145
+ ```
146
+
147
+ ### JSON Properties example
148
+
149
+ ``` json
150
+ {
151
+ "name" : " Sword of the Thunder God" ,
152
+ "description" : " A legendary sword imbued with the power of the thunder god." ,
153
+ "image" : " https://example.com/sword-of-thunder-god.jpg" ,
154
+ "properties" : {
155
+ "damage" : 50 ,
156
+ "element" : " Thunder" ,
157
+ "rarity" : " Legendary"
158
+ },
159
+ "external_url" : " https://example.com/sword-of-thunder-god" ,
160
+ "authors" : [
161
+ {
162
+ "name" : " John Smith"
163
+ }
164
+ ],
165
+ "collection" : {
166
+ "name" : " Legendary Weapons" ,
167
+ "family" : " Fantasy"
168
+ }
169
+ }
170
+ ```
171
+
172
+ ---
173
+
174
+ ### Pact schema
175
+
176
+ With marmalade V2, the ** on-chain** metadata schema for non-fungible tokens
177
+ (NFTs) has been deprecated. This means that the manifest schema, which was
178
+ previously used to store the metadata for NFTs on-chain, is no longer being
179
+ used. Instead, a new schema has been introduced, which is off-chain and conforms
180
+ to the widely accepted standard for NFT metadata.
181
+
182
+ ``` pact
183
+ (defschema token-schema
184
+ manifest:object{manifest}
185
+ ...
186
+ )
187
+ ```
188
+
189
+ Has been replaced with:
190
+
191
+ ``` pact
192
+ (defschema token-schema
193
+ uri:string
194
+ ...
195
+ )
196
+ ```
197
+
198
+ Token schema now has the following structure:
199
+
200
+ ``` pact
201
+ (defschema token-schema
202
+ id:string
203
+ uri:string
204
+ precision:integer
205
+ supply:decimal
206
+ policies:[module{kip.token-policy-v2}]
207
+ )
208
+ ```
209
+
210
+ - uri: A string representing the URI that points to an external JSON-Schema for
211
+ the NFT.
212
+
213
+ ** Generating t:{hash}**
214
+
215
+ The previous schema used by Marmalade V1 was called 'manifest', and it consisted
216
+ of a URI, a hash value, and an array of data objects. To create a new manifest,
217
+ the 'create-manifest' function was used, which took a URI object and an array of
218
+ data objects as input. The 'create-datum' function was used to create a data
219
+ object, which consisted of a URI object and a datum object. The
220
+ 'verify-manifest' function was used to verify that a given manifest was valid,
221
+ and the 'enforce-verify-manifest' function was used to enforce the validity of a
222
+ manifest.
223
+
224
+ ``` pact
225
+ (defschema token-details
226
+ uri:string
227
+ precision:integer
228
+ policy:module{kip.token-policy-v2}
229
+ )
230
+ ```
231
+
232
+ Since ** onchain** manifest is deprecated, token-details schema is hashed.
233
+
234
+ The reason for hashing the token-details is to capture all the data on the
235
+ ledger for cross-chain data. Previously, the manifest was hashed to create a
236
+ unique identifier for each NFT, but now the token-details schema is hashed to
237
+ create a unique identifier for each NFT.
238
+
239
+ ## Rationale
240
+
241
+ ** Why the Manifest was Replaced by URI**
242
+
243
+ We decided to replace the manifest schema with a URI-based schema. The new
244
+ schema for NFT metadata is a simple JSON schema that describes the properties of
245
+ the metadata. This schema enables compatibility with various marketplaces and
246
+ wallets, making Marmalade tokens more interoperable. By utilising a URI-based
247
+ schema, Marmalade tokens can improve scalability, and provide greater
248
+ flexibility for developers and most of all simplicity of usage in general.
249
+
250
+ The decision to move NFT metadata off-chain and use a widely accepted standard
251
+ for the metadata schema is a positive step for Marmalade tokens.
252
+
115
253
---
116
254
117
255
The Marmalade v2 metadata standard for Non-Fungible Tokens (NFTs) adheres
@@ -142,9 +280,3 @@ dedication to following established industry norms, ensuring consistency,
142
280
compatibility, and ease of migration for NFTs. This commitment enables a broader
143
281
range of users to participate in the vibrant world of digital collectibles while
144
282
fostering interoperability between different blockchain ecosystems.
145
-
146
- A more extensive metadata guide with some JSON examples can be found on our
147
- github
148
- [ here] ( https://github.com/kadena-io/marmalade/blob/v2/README.md#marmalade-v2-metadata-standard )
149
-
150
- ---
0 commit comments