Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Adding docs for Marmalade v2 to alpha-docs #761

Merged
merged 57 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
2252136
added marmalade docs
nillo Aug 8, 2023
8bc623a
feat(marmalade-docs): fix code + images + links
realdreamer Aug 9, 2023
611c663
feat(marmalade-docs): fix code + images + links
realdreamer Aug 9, 2023
904a08e
updated folder name to match actually menu item
nillo Aug 9, 2023
16d7ae5
change marmalade menu order to 6
nillo Aug 9, 2023
8fb367a
some minore text changes
nillo Aug 9, 2023
84a5349
added collection policy
nillo Aug 9, 2023
4dc5307
text-updates
nillo Aug 9, 2023
c2afbf9
minor textual changes
nillo Aug 9, 2023
e4409d9
updated text
nillo Aug 10, 2023
4af1afc
Changed the token policies according to new updates
Aug 11, 2023
9ed6918
Fixed issues, added links to github, fixed styling, fixed typos
nillo Aug 21, 2023
02e1e02
Merge branch 'main' into marmaladedocs
Randynamic Oct 3, 2023
22f80c1
update creation docs
Oct 4, 2023
2ee11bb
Merge branch 'main' into marmaladedocs
sstraatemans Oct 9, 2023
0f87930
add the changeset
sstraatemans Oct 9, 2023
4e415dd
renaming mdx to md
sstraatemans Oct 9, 2023
5187f7e
Remove Deprecated, Developer Tools, re-structure Introduction
Oct 9, 2023
26b3932
resolve merge conflict
Oct 9, 2023
81987d5
remove sitemap from source
sstraatemans Oct 9, 2023
ac3b44c
fix naming and double files
sstraatemans Oct 9, 2023
3342c8b
fix build
sstraatemans Oct 9, 2023
cb3c0eb
add a landing page to marmalade
sstraatemans Oct 9, 2023
3173f63
fix build
sstraatemans Oct 9, 2023
ff848c8
better text on landing page
sstraatemans Oct 9, 2023
94006d0
remove ipfs
Oct 9, 2023
b1e1150
fix the quickstart style
sstraatemans Oct 9, 2023
df4e483
Merge branch 'marmaladedocs' of github.com:kadena-community/kadena.js…
sstraatemans Oct 9, 2023
44ffa97
merge conflicts solved
sstraatemans Oct 9, 2023
0192d04
solved merge conflicts
sstraatemans Oct 17, 2023
36f17dd
remove quote manager and add sale whitelists
Oct 18, 2023
414fcd3
add easy minting tutorial
Oct 18, 2023
fd21984
remove outdated information, add easy minting guide
Oct 20, 2023
8b83139
update mint-basic-NFT
Oct 20, 2023
b907f17
remove sales
Oct 20, 2023
d5928ff
update quick start
Oct 20, 2023
7787769
remove broken link
Oct 20, 2023
6c20471
Update akord-storage.md
Randynamic Oct 23, 2023
91bccf0
Merge branch 'main' into marmaladedocs
nillo Oct 25, 2023
08e5b02
fixes in docs policymanager and ledger
nillo Oct 25, 2023
c02c07b
Updating main architecture index and adding sale contracts
jermaine150 Oct 25, 2023
acfe0ee
Removed architecture image
jermaine150 Oct 25, 2023
268354b
collection policy update
nillo Oct 25, 2023
fd06c2d
Merge branch 'marmaladedocs' of https://github.com/kadena-community/k…
nillo Oct 25, 2023
379c6a0
fix policies
nillo Oct 25, 2023
e6e8126
minor changes
nillo Oct 25, 2023
8a2f2fc
fix metadata
nillo Oct 25, 2023
9865f1e
Link to sale interface code
jermaine150 Oct 25, 2023
e7ce856
Fixed broken link
jermaine150 Oct 25, 2023
3ff79c4
updated docs, sorting pages etc
nillo Oct 25, 2023
3dcd8c0
Merge branch 'marmaladedocs' of https://github.com/kadena-community/k…
nillo Oct 25, 2023
eb83cae
added graphics / ipfs tuts / cleanup
nillo Oct 25, 2023
be0d45f
cleanup
nillo Oct 25, 2023
4139dc6
additional comments for doc
nillo Oct 25, 2023
001ebf5
small typo correction
nillo Oct 25, 2023
d3791a1
Merge branch 'main' into marmaladedocs
nillo Oct 25, 2023
f5e5cb8
Removed pending message
jermaine150 Oct 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion packages/apps/docs/src/pages/api/blog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ const search = async (
offset: number;
};

const data = getInitBlogPosts(menuData as IMenuData[], offset, limit);
const data = getInitBlogPosts(
menuData as unknown as IMenuData[],
offset,
limit,
);

res.json(data);
};
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/docs/src/pages/api/semanticsearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const filenameToRoute = (filename: string): string => {
};

const getData = (file: string): IFrontmatterData => {
const tree = menuData as IMenuData[];
const tree = menuData as unknown as IMenuData[];

let foundItem: IMenuData;
const findPage = (tree: IMenuData[], file: string): IMenuData | undefined => {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
title: Collection Policy
description: Utilizing the Collection Pßolicy
menu: Collection Policy
label: Collection Policy
order: 1
layout: normal
nillo marked this conversation as resolved.
Show resolved Hide resolved
---

# Collection Policy

Marmalade's Collection Policy is a policy designed for creators or operators to
organise their tokens into a curated group, just like creating an art gallery or
a collection of precious items. Imagine you have a bunch of unique tokens, each
representing something special to you. With the Collection Policy, you can
gather these tokens into a curated group called a "Collection."

Creating an NFT collection in this example could be seen as curating an art
exhibition in a digital realm. It's a captivating process where you bring
together unique creations under a single theme or concept. Here's a simplified
step-by-step guide on how to create an NFT collection.

**Step 1: The Birth of the Collection**

Creating a collection is the first and one of the most exciting steps. It's akin
to establishing a new art gallery. You're essentially giving life to a new space
that will host a collection of unique pieces of digital art. This process
involves defining the name of your collection and the maximum size it can have.
In the virtual world of code, it's as simple as calling the `create-collection`
function and setting the parameters. In the art analogy, it's deciding the name
of your gallery and how much wall space you have for the artworks.

**Step 2: Crafting the Tokens**

The second step involves crafting the tokens. In the art world, this would be
the equivalent of creating the individual pieces of art that would be displayed
in the gallery. In the NFT space, this involves two sub-steps.

First, you create a token-ID. This is a unique identifier for your NFT. This can
be likened to giving a unique name to each artwork in your gallery. Each
token-ID is created with specific policies attached to it. You can think of
these policies as the rules and guidelines attached to each artwork. These rules
could be about ownership, transferability, and even royalty distribution.

Alternatively, you could also create your custom policies that best fit your
needs.

The second sub-step is creating the actual token. This process utilizes the
token-ID created previously and embeds all the related details into the token.
If a `royalty-policy` is used, you must provide a `royalty_spec` detailing the
royalty rate, the form of payment, and the creator's details.

**Step 3: Minting - The Final Touch**

The final step is minting the token. Minting is like the grand opening of your
art gallery. This is the process where the token (or digital art piece) is
officially issued and added to the blockchain, making it a part of the digital
art ecosystem. Once minted, the token now exists and can be purchased, sold, or
held just like an artwork in a gallery.

In conclusion, creating a collection of NFTs can be seen as a beautiful blend of
technology and artistry. Each step, from the birth of the collection, crafting
the tokens, to the final act of minting, is a delicate process that brings
together creativity and programming prowess to curate a unique digital
experience.

With the Collection Policy, you have the power to showcase your creativity and
share your favorite tokens in a safe and organised way.
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
title: The Guard Policy
description: Utilizing the Guard Policy
menu: The Guard Policy
label: The Guard Policy
order: 2
layout: normal
---

# The Guard Policy: Securing the Lifecycle of Digital Assets in the Crypto Landscape

In the ever-evolving landscape of digital assets, security has emerged as a
paramount concern. The Guard Policy is an essential mechanism that ensures that
token-related actions such as minting, burning, transferring, and buying/selling
tokens, are performed securely and by the authorized entities only.

Visualize being an owner of a valuable Non-Fungible Token (NFT). You want to
ensure that all operations involving your asset - minting new tokens, burning
existing ones, transferring ownership, or even facilitating buying/selling
actions - are fully guarded against unauthorized usage. The Guard Policy acts
like an invisible fortress that ensures the secure transaction of your NFT,
allowing only authorized parties to perform certain actions on the token.

The brilliance of the Guard Policy is embedded in its comprehensive coverage and
meticulous attention to each aspect of a token's lifecycle. It defines a schema
for "guards", which entails keysets for various actions, thus ensuring robust
security checks for every transaction related to your token.

To get a sense of the Guard Policy, let's navigate through the journey of an
NFT - from creation to secure transactions. For illustrative purposes, we can
refer to a sample guard configuration:

```pact
'mint-guard': {"keys": ["mint"], "pred": "keys-all"},
'burn-guard': {"keys": ["burn"], "pred": "keys-all"},
'sale-guard': {"keys": ["sale"], "pred": "keys-all"},
'transfer-guard': {"keys": ["transfer"], "pred": "keys-all"}
```

**Token Creation and Initialization**: As the owner of a unique digital asset,
your journey begins with the creation of your NFT. While defining the creation
terms, you configure the Guard Policy, which sets the rules for minting,
burning, selling, and transferring your NFT. Each of these operations is
assigned a unique guard. A keyset, which comprises a set of keys and predicates
is one type of a guard, and Pact provides various types of guards including pact
guards, user guards, and capability guards.

**Token Minting**: Once your token is created, you may want to mint new tokens.
The Guard Policy ensures that only the entities possessing the mint key can
execute this operation.

**Token Burning**: When it comes to diminishing the supply of your tokens, the
Guard Policy guarantees that only the holders of the burn key are authorized to
burn your tokens.

**Token Transfer**: When you transfer your token, the Guard Policy steps in to
ensure the process's security. Only the entities holding the transfer key are
allowed to perform this operation, safeguarding your tokens from unauthorized
transfers.

**Token Sale**: As you enter the marketplace to sell your token, the Guard
Policy serves as your gatekeeper, ensuring that only the holders of the sale key
can sell your token. It verifies the sale ID against the currently executing
pact, ensuring that only authorized sales proceed.

While the mechanics of this process may sound complex, they're handled smoothly
in the background by the crypto platform where you create and transact with your
NFT. As a token owner, you're only required to set up your preferred guard
configuration, and the platform takes care of the rest.

In summary, the Guard Policy fundamentally redefines the security of digital
assets in the crypto world. It empowers you with robust control over every
action associated with your token, ensuring that your asset's value and
integrity remain uncompromised. The Guard Policy is not just about security;
it's about trust, control, and the peace of mind knowing your digital assets are
securely shielded.
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
title: Concrete Policies
description: What are concrete-policies
menu: Concrete Policies
label: Overview
order: 4
layout: normal
---

# What are concrete-policies

A concrete policy in Marmalade V2 is a pre-built, ready-to-use implementation of
commonly used features in token creation. It simplifies the process of adding
functionality to NFTs and offers convenience for token creators. With concrete
policies, Marmalade aims to provide a rich set of features that can be easily
added to tokens without the need for extensive custom development.

When using a concrete policy, token creators can simply activate a policy by
adding the policy to the respective `policies` fields at token creation. This
goes for concrete-policies and custom-policies. The concrete policies available
in Marmalade V2 are the Guard Policy, Collection Policy, Non-fungible Policy,
and Royalty Policy.

## The Guard Policy

This policy ensures the initiation of a guard with each Marmalade activity.
Guards are optional but recommended, as they help prevent unauthorised entities
from minting tokens without permission.

## The Collection Policy

This policy allows the creation of collections with pre-defined token lists,
enabling easier organisation and categorisation of NFTs.

## The Non-fungible Policy

This policy sets the token supply to 1 and precision to 0, effectively making
the token non-fungible. This is useful when creating unique, one-of-a-kind
digital assets.

## The Royalty Policy

This policy allows creators to define an account that receives royalties
whenever an NFT is sold. This provides a mechanism for creators to earn ongoing
rewards from the sales of their NFTs.

The great thing about concrete policies is that they offer a straightforward and
flexible ways to enhance their NFTs with new and exciting capabilities. With
concrete policies, Marmalade V2 makes the process of creating and managing NFTs
more accessible and efficient, enabling a wider range of individuals and
projects to participate in Kadena's NFT ecosystem.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
title: Non Fungible Policy
description: Utilizing the Non Fungible Policy
menu: Non Fungible Policy
label: Non Fungible Policy
order: 3
layout: normal
---

# Non-Fungible Policy

Step into a realm where all forms of art are as distinct as a fingerprint, where
once materialised, they maintain their individual identity. This sphere is where
Non-Fungible Tokens (NFTs) come to life.

## Crafting your Exclusive Masterpiece

The beginning of your journey involves conceiving your NFT, a digital
representation of your creativity. See yourself as a sculptor, your NFT, your
piece of art. With the Non-Fungible Policy, your masterpiece gets an impervious
shield, protecting it from duplication or destruction.

This process, referred to as "minting," is like bringing your unique digital
artwork into existence. You hold the reins of this progression, with the outcome
being a piece standing in its category, akin to the unmatched sculptures of
Michelangelo.

In simple terms, the Non-Fungible Policy is the golden rule that puts a seal on
the originality of your digital creation. As you 'mint', or form, your item,
this policy guarantees its individuality. Whether it's a piece of digital art or
a rare online collectible, the policy ensures that the authenticity of your
creation remains uncontested.

By integrating the Non-Fungible Policy with your digital creation (by including
the policy in the `policies` field at token creation), you provide a firm
foundation that supports its originality. The policy acts as a protective
barrier (a guard), confirming that your digital item, once born, remains
solitary in its existence.
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
title: The Royalty Policy
description: Utilizing the Royalty Policy
menu: The Royalty Policy
label: The Royalty Policy
order: 4
layout: normal
---

# The Royalty Policy: Ensuring Enduring Benefits for Artists in the Digital Era

In the dynamic world of digital art, creators are continuously exploring new
avenues to express their creativity and capitalize on their work. The Royalty
Policy is a powerful policy ensuring that these artists enjoy benefits from
their creations far beyond the initial sale.

Imagine being a digital artist. You've poured your heart into creating a unique
digital asset – a one-of-a-kind piece of art. The relationship with your work,
however, does not end with its first sale. The Royalty Policy is like an
invisible tether that connects you with your creation, assuring you a portion of
the profits every time it is sold.

The Royalty Policy is essentially an agreement that entitles you, the creator,
to a cut from any future sales of your artwork. This mechanism ensures you reap
continuous rewards from your creative work, even after it has been sold to a new
owner. A predetermined fraction of each sale, known as the royalty, is
automatically transferred to you every time your work is purchased by a new
owner.

To put this into context, let's walk through a simplified journey of an artwork
– from creation to sale – in the digital art space. And let's use a sample
royalty specification as an example:

```json
"royalty_spec": {
"fungible": "coin",
"creator": "k:creator",
"creator-guard": {"keys": ["creator"], "pred": "keys-all"},
"royalty-rate": 0.05
}
```

**Creation of Artwork**: As an artist, your creative journey commences with the
creation of a unique piece of digital art, materialising as an NFT (Non-Fungible
Token). Part of this creative process is defining your royalty terms. To do
this, you add the Royalty Policy to the `policies` field at token creation and
provide the royalty specification. The royalty specification should indicate a
royalty rate of 5% (0.05), ensuring that you, as the creator, will receive 5% of
all future sales. It also stipulates in what fungible form these royalties will
be compensated. This ensures that with every resale, a portion of the proceeds
finds its way back to you, recognising your enduring contribution.

2. **Listing Artwork for Sale**: Once your artwork has been created, you list
it for sale, much like displaying your work in a gallery. You include
details of the sale such as price and duration.

3. **Artwork Purchase**: An interested buyer purchases your artwork, akin to a
collector acquiring your piece from a gallery.

4. **Royalty Application**: After the sale is completed, the royalty kicks in.
The smart contract (think of it as the digital contract between the buyer
and the seller) automatically calculates your 5% royalty from the sale and
transfers it to you.

While the mechanics of this process may sound technical, they are handled
seamlessly in the background by the digital platform where you create and sell
your NFT. As an artist, you only need to set your preferred royalty percentage,
and the platform takes care of the rest.

To sum it up, the Royalty Policy is a game changer in how artists interact with
their work in the digital realm. It acknowledges the enduring value of your
artistic endeavour and rewards you with each subsequent sale of your creation.
Remember, your artwork is not a one-off transaction; it's an enduring asset
echoing your creativity, continually rewarding you through the Royalty Policy.
In the world of digital art, your creation keeps reverberating with each
transaction, continually singing the tune of royalties.
Loading