Skip to content

Commit

Permalink
docs: data contract updates (#75)
Browse files Browse the repository at this point in the history
* docs: update contract ref overview and add config section

* docs: add document config options

* docs: add transient properties

* doc: update property constraints

* docs: reorganize

* docs: add contested index info

* chore: index info updates

* docs: update index constraints and document syntax

* docs: update constraint links

* docs: add contract bounds details to key mgmt section

* chore: caps inconsistency

* chore: fix some more links

* docs: clarify read-only contract

* docs: link to nft page for more details

* docs: add labels for nft sections
  • Loading branch information
thephez authored Aug 26, 2024
1 parent 5f0f5b6 commit 5222735
Show file tree
Hide file tree
Showing 5 changed files with 292 additions and 75 deletions.
28 changes: 28 additions & 0 deletions docs/explanations/nft.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,29 @@ Although Dash Platform was not designed with NFTs in mind, it provides a solid f

Platform's flexible design also provides more built-in management abilities than many alternative NFT solutions. For example, NFT creators can decide to make [mutable](#mutate) or [deletable](#delete) NFTs if their use-case benefits from those features. Also, the simple integrated [purchase system](#transfer-and-trade) provides NFT owners with a safe, decentralized option for selling their NFTs.

```{eval-rst}
.. _explanations-dash-nfts:
```

## Dash NFT Features

The following sections describe the features and options available for NFT creators using Dash Platform.

```{eval-rst}
.. _explanations-nft-transfer:
```

### Transfer and Trade

NFTs can be directly transferred or traded without the need for a marketplace:

* Transferring allows the owner to assign a new owner without making the NFT available for purchase.
* Trading involves a two-step process where the seller sets the NFT's price, and the first buyer that matches this price receives the NFT automatically. Once the transaction is complete, the price is reset to prevent further immediate purchases, ensuring a non-interactive and seamless trading experience.

```{eval-rst}
.. _explanations-nft-create-restrict:
```

### Creation Restrictions

To preserve the authenticity of NFTs, Dash Platform includes creation restriction options. This ensures that only authorized entities can create certain types of NFTs. For example, in the case of land ownership NFTs, a designated authority may be the only one that can issue tokens. Restriction options are:
Expand All @@ -31,14 +43,26 @@ To preserve the authenticity of NFTs, Dash Platform includes creation restrictio
* **System Only**: Only the system can create NFTs (used for specific system contracts)
* **No Restrictions**: Anyone can create NFTs for the contract

```{eval-rst}
.. _explanations-nft-mutate:
```

### Mutate

NFTs can be immutable or mutable, depending on their intended use. Immutable NFTs cannot be altered after creation. This is crucial for items like digital artwork, where authenticity and originality are necessary. Mutable NFTs can be helpful in scenarios like updating a character in a game or altering a digital asset.

```{eval-rst}
.. _explanations-nft-delete:
```

### Delete

Since some NFTs may represent transient or consumable things, Dash Platform allows NFTs to be deleted. This is more efficient than the "burn" mechanism many projects use to make an NFT unusable and provides flexibility in managing assets that may no longer be needed or valid.

```{eval-rst}
.. _explanations-nft-create:
```

## NFT Creation

Creating an NFT on Dash Platform consists of creating a data contract, registering it on the network, and then creating NFT documents based on the schema defined in the data contract.
Expand All @@ -55,6 +79,10 @@ Once the data contract design is completed, the contract can be registered on th

Tokens are minted by creating new documents under the data contract. Each token is an instance of one of the document types defined in the contract.

```{eval-rst}
.. _explanations-nft-trade:
```

## NFT Trading

The trading process for Dash Platform NFTs is designed to be user-friendly and efficient by enabling direct transactions between users without requiring trusted third parties.
Expand Down
2 changes: 1 addition & 1 deletion docs/explanations/platform-protocol-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Dash Platform Protocol (DPP) defines a set of base fields that must be present i
| $updatedAt | Time (in milliseconds) the document was last updated |

:::{attention}
The `$createdAt` and `$updatedAt` fields will only be present in documents that add them to the list of [required properties](../reference/data-contracts.md#required-properties-optional).
The `$createdAt` and `$updatedAt` fields will only be present in documents that add them to the list of [required properties](../reference/data-contracts.md#required-properties).
:::

### Data Contract Fields
Expand Down
2 changes: 1 addition & 1 deletion docs/protocol-ref/data-contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ property must be incremented if the contract is updated.

### Data Contract Documents

The `documents` object defines each type of document required by the data contract. At a minimum, a document must consist of 1 or more properties. Documents may also define [indices](#document-indices) and a list of [required properties](#required-properties-optional). The `additionalProperties` properties keyword must be included as described in the [constraints](#additional-properties) section.
The `documents` object defines each type of document required by the data contract. At a minimum, a document must consist of 1 or more properties. Documents may also define [indices](#document-indices) and a list of [required properties](#required-properties). The `additionalProperties` properties keyword must be included as described in the [constraints](#additional-properties) section.

The following example shows a minimal `documents` object defining a single document (`note`) that has one property (`message`).

Expand Down
Loading

0 comments on commit 5222735

Please sign in to comment.