You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* docs: correct data contract error range
* docs(api): update token event info
* docs(ref): fix contract links
* docs: add token fee info to explanation
* docs: update token config info and action rules
* docs: add token direct purchase info
* docs(ref): data contract updates
* docs: link updates
* docs: add contract fees info
Based on dashpay/platform#2584
* docs: add js-sdk connection example for local build
-**Access Control [Groups](#groups)**: Multi-party groups with user-defined thresholds support complex authorization schemes for token management
17
17
-**Built-in [Distribution](#distribution-rules)**: Manual minting or scheduled release over time
18
18
-**Seamless Integration**: Tokens live alongside documents in a single data contract, enabling additional use cases (e.g., ticketing, digital assets, stablecoins)
19
+
-**Token-Based Document [Fees](#token-based-fees)**: Charge tokens for an application's document actions (e.g., create, transfer), with options to burn tokens or reward the contract owner
19
20
20
21
The following sections describe the features and configuration options available for token creators
21
22
using Dash Platform.
@@ -103,11 +104,12 @@ When creating a token, you define its configuration using the following paramete
|[Allow transfer to frozen balance](#allow-transfer-to-frozen-balance)| Yes | True |
111
113
|[Main control group](#main-control-group)| Yes | None |
112
114
| Main control group can be modified | Yes | NoOne |
113
115
@@ -137,6 +139,10 @@ When creating a token, you define its configuration using the following paramete
137
139
- Whether the authority to change these parameters can be transferred or locked to "no one"
138
140
- Example: "Only group #1 can update the max supply.” See the [Rules section](#rules) for details.
139
141
142
+
#### Allow Transfer to Frozen Balance
143
+
144
+
- Allow transferring and minting of tokens to frozen identity token balances
145
+
140
146
#### Main Control Group
141
147
142
148
- A group that can be referenced in other fields to control multiple aspects of the token with the same group.
@@ -179,19 +185,46 @@ Rules can authorize no one, specific identities, or multiparty groups. The compl
179
185
180
186
##### Action Rules
181
187
182
-
Token action rules can be configured to allow updating who has access to many [token actions](#actions). The following table summarizes the available action rules:
188
+
Token action rules can be configured to control access to many [token actions](#actions). The
189
+
following table summarizes the configurable rules and their default authorized parties:
190
+
191
+
###### General Controls
192
+
193
+
| Configuration Rule | Can be Changed? | Default Authorized Party |
@@ -430,6 +463,21 @@ For example, a group is defined with a required threshold of 10. The group membe
430
463
431
464
In this group, Member A and Member C have a combined power of 11 and can perform actions without approval from Member B. If Member B proposes an action, Member A and C must both approve to authorize the action.
432
465
466
+
### Token-Based Fees
467
+
468
+
Dash Platform allows developers to charge token fees for document-related actions (e.g., creating or transferring a document). This provides a way to monetize app usage or implement economic incentives using tokens. These fees are configured in the data contract and apply to all document types in the contract.
469
+
470
+
Examples:
471
+
472
+
- Require 1000 tokens to create a document
473
+
- Burn 200 tokens when a document is transferred
474
+
475
+
This allows for:
476
+
477
+
- Spam protection (pay-to-post)
478
+
- Revenue generation for app creators
479
+
- Deflationary models via token burning
480
+
433
481
## Token Creation
434
482
435
483
Creating a token on Dash Platform consists of creating a data contract, registering it on the network, and then creating tokens based on the schema defined in the data contract.
@@ -510,4 +558,14 @@ Once the data contract design is completed, the contract can be registered on th
510
558
511
559
## Token Trading
512
560
561
+
### Direct Purchase
562
+
563
+
Tokens can be configured to enable direct purchase by users. This allows the contract owner (or other authorized party) to sell the token directly to users at a fixed price or according to a tiered pricing schedule.
564
+
565
+
The token’s [change control rules](#change-control-rules) include a `changeDirectPurchasePricingRules` setting to determine who is authorized to set or update the price. By default this is set to no one (`NoOne`) to disable direct sales. To allow direct sales, this rule should be set to authorize someone (e.g., the contract owner) to change pricing.
566
+
567
+
When enabled, the authorized party can set the token price using a state transition. Users can purchase the token through Platform’s built-in mechanism (see [Token Set Purchase Price Transition](../protocol-ref/token.md#token-set-purchase-price-transition) and [Token Purchase Transition](../protocol-ref/token.md#token-purchase-transition)). The direct purchase system supports defining a minimum purchase amount and volume discounts via pricing tiers. The token’s price can also be removed to stop sales.
568
+
569
+
### Marketplace
570
+
513
571
A planned token marketplace will support the trading of tokens.
Copy file name to clipboardExpand all lines: docs/protocol-ref/data-contract.md
+116-4Lines changed: 116 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,34 @@
8
8
9
9
Data contracts define the schema (structure) of data an application will store on Dash Platform. Contracts are described using [JSON Schema](https://json-schema.org/understanding-json-schema/) which allows the platform to validate the contract-related data submitted to it.
10
10
11
-
The following sections provide details that developers need to construct valid contracts. All data contracts must define one or more [documents](#data-contract-documents) or [tokens](#data-contract-tokens), whereas definitions are optional and may not be used for simple contracts.
11
+
The following sections provide details that developers need to construct valid contracts. All data contracts must define at least one [document](#data-contract-documents) or [token](#data-contract-tokens). A contract may define multiple documents and/or tokens.
12
+
13
+
### Fees
14
+
15
+
Dash Platform charges fees for registering data contracts based on complexity. These fees compensate evonodes for their role in storing and processing contract-related data.
16
+
17
+
The table below outlines the current fee structure for various data contract components. Fees are denominated in DASH and are charged at registration time based on the structure of the contract.
|`base_contract_registration_fee`| 0.1 | Fixed fee for every data contract. Covers the baseline cost of anchoring a contract into platform state. |
22
+
|`document_type_registration_fee`| 0.02 | Charged per [document type](./data-contract-document.md#contract-documents). Reflects indexing and storage schema overhead. |
23
+
|`document_type_base_non_unique`<br>`_index_registration_fee`| 0.01 | Per non-unique [index](./data-contract-document.md#document-indices) in a document type. Supports query operations. |
24
+
|`document_type_base_unique_index`<br>`_registration_fee`| 0.01 | Per unique [index](./data-contract-document.md#document-indices). Enforces uniqueness and adds validation complexity. |
25
+
|`document_type_base_contested`<br>`_index_registration_fee`| 1.0 | Per [contested index](./data-contract-document.md#contested-indices). Used for identity/username resolution; requires voting and [conflict resolution](../explanations/dpns.md#conflict-resolution) by masternodes and evonodes. |
26
+
|`token_registration_fee`| 0.1 | Per token defined in the contract. Reflects additional overhead from managing balances, transfers, and supply. |
27
+
|`token_uses_perpetual`<br>`_distribution_fee`| 0.1 | Additional fee for tokens that use perpetual (e.g., block-based) distribution mechanisms. These create ongoing state changes triggered by network events. |
28
+
|`token_uses_pre_programmed`<br>`_distribution_fee`| 0.1 | Charged when tokens use scheduled distributions (e.g., airdrops). Adds periodic complexity. |
29
+
|`search_keyword_fee`| 0.1 per keyword | Charged per search keyword defined. Keywords enable reverse lookups and indexing, increasing on-chain storage and filtering load. |
30
+
31
+
These fees are additive. For example, a contract that defines two document types, each with one unique index, and one token using a perpetual distribution will incur the following total fee:
@@ -40,7 +67,7 @@ Include the following at the same level as the `properties` keyword to ensure pr
40
67
41
68
## Data Contract Object
42
69
43
-
The data contract object consists of the following fields as defined in the Rust reference client ([rs-dpp](https://github.com/dashpay/platform/blob/v2.0-dev/packages/rs-dpp/src/data_contract/v1/data_contract.rs#L67-L105)):
70
+
The data contract object consists of the following fields as defined in the Rust reference client ([rs-dpp](https://github.com/dashpay/platform/blob/v2.0-dev/packages/rs-dpp/src/data_contract/v1/data_contract.rs#L77-L121)):
@@ -54,6 +81,8 @@ The data contract object consists of the following fields as defined in the Rust
54
81
| $defs | object | Varies | (Optional) Definitions for `$ref` references used in the `documents` object (if present, must be a non-empty object with \<= 100 valid properties) |
55
82
|[groups](#data-contract-groups)| Group | Varies | (Optional) Groups that allow for specific multiparty actions on the contract. |
56
83
|[tokens](./data-contract-token.md)| object | Varies | (Optional \*) Token definitions (see [Contract Tokens](./data-contract-token.md) for details) |
84
+
| keywords | array of strings | Varies | (Optional) Keywords associated with the contract to improve searchability. Maximum of 20 words. |
85
+
| description | string | 3-100 characters | (Optional) Brief description of the contract. |
57
86
58
87
\* The data contract object must define documents or tokens. It may include both documents and tokens.
59
88
@@ -293,7 +322,9 @@ The full schema is [defined is rs-dpp](https://github.com/dashpay/platform/blob/
293
322
"properties": {
294
323
"position": true
295
324
},
296
-
"required": ["position"]
325
+
"required": [
326
+
"position"
327
+
]
297
328
}
298
329
}
299
330
}
@@ -353,6 +384,50 @@ The full schema is [defined is rs-dpp](https://github.com/dashpay/platform/blob/
Copy file name to clipboardExpand all lines: docs/protocol-ref/token.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ Each token transition must comply with the [token base transition defined in rs-
24
24
25
25
#### Token id
26
26
27
-
The `$tokenId` is created by double sha256 hashing the token `$dataContractId` and `$tokenContractPosition` with a byte vector of the string "dash_token" as shown in [rs-dpp](https://github.com/dashpay/platform/blob/v2.0-dev/packages/rs-dpp/src/tokens/mod.rs#L22-L27).
27
+
The `$tokenId` is created by double sha256 hashing the token `$dataContractId` and `$tokenContractPosition` with a byte vector of the string "dash_token" as shown in [rs-dpp](https://github.com/dashpay/platform/blob/v2.0-dev/packages/rs-dpp/src/tokens/mod.rs#L26-L31).
28
28
29
29
```rust
30
30
// From the Rust reference implementation (rs-dpp)
@@ -57,7 +57,7 @@ The token transition actions [defined in rs-dpp](https://github.com/dashpay/plat
57
57
58
58
### Token Notes
59
59
60
-
Some token transitions include optional notes fields. The maximum note length for these fields is [2048 characters](https://github.com/dashpay/platform/blob/v2.0-dev/packages/rs-dpp/src/tokens/mod.rs#L14).
60
+
Some token transitions include optional notes fields. The maximum note length for these fields is [2048 characters](https://github.com/dashpay/platform/blob/v2.0-dev/packages/rs-dpp/src/tokens/mod.rs#L18).
0 commit comments