Skip to content

Commit 8a2f2fc

Browse files
committed
fix metadata
1 parent e6e8126 commit 8a2f2fc

File tree

8 files changed

+166
-17
lines changed

8 files changed

+166
-17
lines changed

packages/apps/docs/src/pages/marmalade/architecture/index.md

+9-7
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ Manager provides below.
4444
In Marmalade v1, fixed-quote-policy served as an example for handling the
4545
fungible transfers at sales. With the upgrade to Marmalade V2, we have
4646
integrated this fungible transfer feature inside the Policy Manager, which
47-
includes various interactions between the Policy Manager, policies, and
48-
sale contracts. This allows secure escrowed transfers, creative auctions,
49-
guaranteed royalties, and standardized processes within marketplaces.
47+
includes various interactions between the Policy Manager, policies, and sale
48+
contracts. This allows secure escrowed transfers, creative auctions, guaranteed
49+
royalties, and standardized processes within marketplaces.
5050

5151
**Escrows**
5252

@@ -63,9 +63,11 @@ seller.
6363

6464
## Sale Contracts
6565

66-
The Sale Contract is a contract responsible for updating the final price
67-
of the quote during the buy process. By managing sale contracts within Marmalade, we can provide users a
68-
safe way to participate in various sale features such as creative auctions, while also guaranteeing royalty payout.
66+
The Sale Contract is a contract responsible for updating the final price of the
67+
quote during the buy process. By managing sale contracts within Marmalade, we
68+
can provide users a safe way to participate in various sale features such as
69+
creative auctions, while also guaranteeing royalty payout.
6970

70-
**[Marmalade on GitHub](https://github.com/kadena-io/marmalade)**
71+
---
7172

73+
**[Marmalade on GitHub](https://github.com/kadena-io/marmalade)**

packages/apps/docs/src/pages/marmalade/architecture/ledger.md

+2
Original file line numberDiff line numberDiff line change
@@ -171,4 +171,6 @@ workings of this ledger has helped to unravel some of the mysteries behind it.
171171
You could be buying a new digital art piece today or selling some tomorrow.
172172
Marmalade makes it possible.
173173

174+
---
175+
174176
[Ledger Code](https://github.com/kadena-io/marmalade/blob/v2/pact/ledger.pact)

packages/apps/docs/src/pages/marmalade/architecture/policy-manager.md

+2
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,6 @@ functionality. As you embark on this exciting journey, we await your innovative
137137
ideas and creativity to further enrich the NFT experience within Kadena's
138138
Marmalade ecosystem. Happy crafting!
139139

140+
---
141+
140142
[Policy Manager Code](https://github.com/kadena-io/marmalade/blob/v2/pact/policy-manager/policy-manager.pact)

packages/apps/docs/src/pages/marmalade/concrete-policies/collection-policy.md

+2
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ seamlessly implements the `kip.token-policy-v2` interface.
7474
With the Collection Policy, you have the power to showcase your creativity and
7575
share your favorite tokens in a safe and organised way.
7676

77+
---
78+
7779
[Quick guide: Creating a collection]: (/)
7880

7981
[Collection Policy Code](https://github.com/kadena-io/marmalade/blob/v2/pact/concrete-policies/collection-policy/collection-policy-v1.pact)

packages/apps/docs/src/pages/marmalade/concrete-policies/guard-policy.md

+3
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,7 @@ trust, control, and peace of mind in the digital assets realm.
8989
amount.
9090
9191
In summary, the Guard policy ensures the safety and integrity of digital assets.
92+
93+
---
94+
9295
[Guard Policy Code](https://github.com/kadena-io/marmalade/blob/v2/pact/concrete-policies/guard-policy/guard-policy-v1.pact)

packages/apps/docs/src/pages/marmalade/concrete-policies/non-fungible-policy.md

+2
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,6 @@ creation.
4040
- **enforce-mint**: Regulates the minting process, maintaining a fixed supply of
4141
1 for each token, thus preserving its non-fungible nature.
4242

43+
---
44+
4345
[Non Fungible Policy Code](https://github.com/kadena-io/marmalade/blob/v2/pact/concrete-policies/non-fungible-policy/non-fungible-policy-v1.pact)

packages/apps/docs/src/pages/marmalade/concrete-policies/royalty-policy.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ sold to a new owner.
2828

2929
Consider a digital artwork with a royalty specification as:
3030

31-
```
31+
```pact
3232
"royalty_spec": {
3333
"fungible": "coin",
3434
"creator": "k:creator",
@@ -94,3 +94,7 @@ payment is made to the token's creator. Emitting line:
9494
In conclusion, the Royalty Policy revolutionizes how digital artists benefit
9595
from their work. With each transaction, artists are rewarded, emphasizing the
9696
ongoing value of their creations.
97+
98+
---
99+
100+
[Royalty Policy Code](https://github.com/kadena-io/marmalade/blob/v2/pact/concrete-policies/non-fungible-policy/non-fungible-policy-v1.pact)

packages/apps/docs/src/pages/marmalade/metadata/index.md

+141-9
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ stored off-chain in a JSON format. The schema includes the following fields:
4141
| \*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. |
4242
| \*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. |
4343

44-
\* optional
45-
46-
##
44+
\* `optional`
4745

4846
### JSON Schema
4947

@@ -112,6 +110,146 @@ stored off-chain in a JSON format. The schema includes the following fields:
112110
}
113111
```
114112

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+
115253
---
116254

117255
The Marmalade v2 metadata standard for Non-Fungible Tokens (NFTs) adheres
@@ -142,9 +280,3 @@ dedication to following established industry norms, ensuring consistency,
142280
compatibility, and ease of migration for NFTs. This commitment enables a broader
143281
range of users to participate in the vibrant world of digital collectibles while
144282
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

Comments
 (0)