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

chore: misc updates and cleanup #70

Merged
merged 5 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion docs/explanations/dashpay.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ used to store private information about other Dash identities.
### Implementation

DashPay has many constraints as defined in the [DashPay data
contract](https://github.com/dashevo/platform/blob/master/packages/dashpay-contract/schema/dashpay.schema.json).
contract](https://github.com/dashpay/platform/blob/master/packages/dashpay-contract/schema/dashpay.schema.json).
Additionally, the DashPay data triggers defined in
[rs-drive-abci](https://github.com/dashpay/platform/tree/master/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/documents_batch/data_triggers/triggers/dashpay)
enforce additional validation rules related to the `contactRequest` document.
Expand Down
2 changes: 1 addition & 1 deletion docs/explanations/dpns.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ DPNS names have several constraints as defined in the [DPNS data contract](https

* Maximum length - 63 characters
* Character set - `0-9`, `-` (hyphen), and `A-Z` (case insensitive)
* Note: Use of `-` as a prefix/suffix to a name is _not_ allowed (e.g. `-name` or `name-`). This constraint is defined by this JSON-Schema [pattern](https://github.com/dashevo/platform/blob/master/packages/dpns-contract/schema/dpns-contract-documents.json#L38) in the DPNS data contract: `^[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]$`
* Note: Use of `-` as a prefix/suffix to a name is _not_ allowed (e.g. `-name` or `name-`). This constraint is defined by this JSON-Schema [pattern](https://github.com/dashpay/platform/blob/master/packages/dpns-contract/schema/dpns-contract-documents.json#L38) in the DPNS data contract: `^[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]$`
* Domain labels are converted to lowercase for case-insensitive uniqueness validation. Then, "o", "i" and "l" replaced with "0" and "1" to mitigate [homograph attacks](https://en.wikipedia.org/wiki/IDN_homograph_attack). For example, "Alice" is normalized "a11ce".

Additional validation rules related to the `domain` document are enforced by the DPNS [data triggers](../explanations/platform-protocol-data-trigger.md) defined in [rs-drive-abci](https://github.com/dashpay/platform/tree/master/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/documents_batch/data_triggers/triggers).
Expand Down
4 changes: 2 additions & 2 deletions docs/explanations/platform-protocol-data-contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Data contracts are owned by the [identity](../explanations/identity.md) that reg

### Structure

Each data contract must define several fields. When using the [reference implementation](https://github.com/dashevo/platform/tree/master/packages/rs-dpp) of the Dash Platform Protocol, some of these fields are automatically set to a default value and do not have to be explicitly provided. These include:
Each data contract must define several fields. When using the [reference implementation](https://github.com/dashpay/platform/tree/master/packages/rs-dpp) of the Dash Platform Protocol, some of these fields are automatically set to a default value and do not have to be explicitly provided. These include:

* The platform protocol schema it uses
* A contract ID (generated from a hash of the data contract's owner identity plus some entropy)
Expand Down Expand Up @@ -62,7 +62,7 @@ Dash Platform v0.22 added the ability to update existing data contracts in certa
## Example Contract

The [DashPay contract](https://github.com/dashevo/platform/blob/master/packages/dashpay-contract/schema/dashpay.schema.json) is included below for reference. It defines a `contact` document and a `profile` document. Each of these documents then defines the properties and indices they require:
The [DashPay contract](https://github.com/dashpay/platform/blob/master/packages/dashpay-contract/schema/dashpay.schema.json) is included below for reference. It defines a `contact` document and a `profile` document. Each of these documents then defines the properties and indices they require:

```json
{
Expand Down
4 changes: 2 additions & 2 deletions docs/explanations/platform-protocol-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Documents are defined in an application's [Data Contract](../explanations/platfo

### Base Fields

Dash Platform Protocol (DPP) defines a set of base fields that must be present in all documents. For the [reference implementation](https://github.com/dashevo/platform/tree/master/packages/rs-dpp), the base fields shown below are defined in the [document base schema](https://github.com/dashevo/platform/blob/master/packages/rs-dpp/src/schema/document/v0/documentBase.json).
Dash Platform Protocol (DPP) defines a set of base fields that must be present in all documents. For the [reference implementation](https://github.com/dashpay/platform/tree/master/packages/rs-dpp), the base fields shown below are defined in the [document base schema](https://github.com/dashpay/platform/blob/master/packages/rs-dpp/src/schema/document/v0/documentBase.json).

| Field Name | Description |
| - | - |
Expand All @@ -32,7 +32,7 @@ Dash Platform Protocol (DPP) defines a set of base fields that must be present i
### Data Contract Fields

Each application defines its own fields via document definitions in its data contract. Details of the [DPNS data contract documents](https://github.com/dashevo/platform/blob/master/packages/dpns-contract/schema/dpns-contract-documents.json) are described below as an example. This contract defines two document types (`preorder` and `domain`) and provides the functionality described in the [Name Service explanation](../explanations/dpns.md).
Each application defines its own fields via document definitions in its data contract. Details of the [DPNS data contract documents](https://github.com/dashpay/platform/blob/master/packages/dpns-contract/schema/dpns-contract-documents.json) are described below as an example. This contract defines two document types (`preorder` and `domain`) and provides the functionality described in the [Name Service explanation](../explanations/dpns.md).

| Document Type | Field Name | Data Type |
| - | - | - |
Expand Down
4 changes: 2 additions & 2 deletions docs/explanations/platform-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ For additional detail, see the [State Transition](../explanations/platform-proto
| :------ | :---------- |
| 0.25 | See details in the [GitHub release](https://github.com/dashpay/platform/releases/tag/v0.25.0). |
| 0.24 | See details in the [GitHub release](https://github.com/dashpay/platform/releases/tag/v0.24.0). |
| 0.23 | See details in the [GitHub release](https://github.com/dashevo/platform/releases/tag/v0.23.0). |
| 0.22 | See details in the [GitHub release](https://github.com/dashevo/platform/releases/tag/v0.22.0). |
| 0.23 | See details in the [GitHub release](https://github.com/dashpay/platform/releases/tag/v0.23.0). |
| 0.22 | See details in the [GitHub release](https://github.com/dashpay/platform/releases/tag/v0.22.0). |
| 0.21 | See details in the [GitHub release](https://github.com/dashevo/js-dpp/releases/tag/v0.21.0). |
| 0.20 | This release updated to a newer version of JSON Schema (2020-12 spec) and also switched to a new regex module ([Re2](https://github.com/google/re2)) for improved security. See more details in the [GitHub release](https://github.com/dashevo/js-dpp/releases/tag/v0.20.0). |

Expand Down
6 changes: 3 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,11 @@ protocol-ref/errors
:hidden:
resources/repository-overview
Testnet Block Explorer <https://testnet-insight.dashevo.org/insight/>
Testnet Block Explorer <https://insight.testnet.networks.dash.org:3002/insight/>
Testnet Faucet <http://faucet.testnet.networks.dash.org/>
JavaScript SDK <https://github.com/dashevo/platform/tree/master/packages/js-dash-sdk#readme>
JavaScript SDK <https://github.com/dashpay/platform/tree/master/packages/js-dash-sdk#readme>
resources/source-code
Previous Version of Docs <https://docs.dash.org/projects/platform/en/0.24.0/docs/>
Previous Version of Docs <https://docs.dash.org/projects/platform/en/0.25.0/docs/>
```

```{toctree}
Expand Down
2 changes: 1 addition & 1 deletion docs/intro/testnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Testnet is the Dash testing network used for experimentation and evaluation of D

Dash Core Group provides the core Testnet infrastructure consisting of 150 masternodes running Dash Core along with the platform services that provide the [decentralized API (DAPI)](../explanations/dapi.md) and [storage (Drive)](../explanations/drive.md) functionality.

Testnet also includes a [block explorer](https://testnet-insight.dashevo.org/insight/) for the core blockchain and a [test Dash faucet](https://testnet-faucet.dash.org/) that dispenses funds to users/developers experimenting on the network.
Testnet also includes a [block explorer](https://insight.testnet.networks.dash.org:3002/insight/) for the core blockchain and a [test Dash faucet](http://faucet.testnet.networks.dash.org/) that dispenses funds to users/developers experimenting on the network.

### Features

Expand Down
4 changes: 2 additions & 2 deletions docs/intro/what-is-dash-platform.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ The source for both DAPI and dapi-client are available on GitHub:

Drive is Dash Platform's storage component, allowing for consensus-based verification and validation of user-created data. In order for this to occur, developers create a [data contract](../explanations/platform-protocol-data-contract.md). This data contract describes the data structures that comprise an application, similar to creating a schema for a document-oriented database like MongoDB.

Data created by users of the application is validated and verified against this contract. Upon successful validation/verification, application data is submitted to Drive (via DAPI), where it is stored on the masternode network. Drive uses Dash's purpose-built database, [GroveDB](https://github.com/dashevo/grovedb/), to provide efficient proofs with query responses, so you don't have to trust the API provider to be certain your data is authentic.
Data created by users of the application is validated and verified against this contract. Upon successful validation/verification, application data is submitted to Drive (via DAPI), where it is stored on the masternode network. Drive uses Dash's purpose-built database, [GroveDB](https://github.com/dashpay/grovedb/), to provide efficient proofs with query responses, so you don't have to trust the API provider to be certain your data is authentic.

The source is available on GitHub:

- Drive: <https://github.com/dashpay/platform/tree/master/packages/js-drive>
- Drive: <https://github.com/dashpay/platform/tree/master/packages/rs-drive>
2 changes: 1 addition & 1 deletion docs/other/key-concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ In order to pay for these various operations, Dash must be spent by either the a

# Data Contracts

A data contract is an agreement between your application and the Dash network as to how your data should be stored and validated by the Dash network. The concept is analogous to creating a schema for a document-oriented database. Data contracts are JSON objects, and an example contract for the [Dash Platform Naming Service (DPNS)](https://github.com/dashevo/platform/blob/master/packages/dpns-contract/schema/dpns-contract-documents.json) is included below:
A data contract is an agreement between your application and the Dash network as to how your data should be stored and validated by the Dash network. The concept is analogous to creating a schema for a document-oriented database. Data contracts are JSON objects, and an example contract for the [Dash Platform Naming Service (DPNS)](https://github.com/dashpay/platform/blob/master/packages/dpns-contract/schema/dpns-contract-documents.json) is included below:

```json
{
Expand Down
4 changes: 2 additions & 2 deletions docs/protocol-ref/data-contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ There are a variety of constraints currently defined for performance and securit

> 🚧
>
> The `$ref` keyword has been [disabled](https://github.com/dashevo/platform/pull/300) since Platform v0.22.
> The `$ref` keyword has been [disabled](https://github.com/dashpay/platform/pull/300) since Platform v0.22.
| Keyword | Constraint |
| ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
Expand Down Expand Up @@ -346,7 +346,7 @@ The `indices` array consists of:
**Note:**

- The `indices` object should be excluded for documents that do not require indices.
- When defining an index with multiple properties (i.e a compound index), the order in which the properties are listed is important. Refer to the [mongoDB documentation](https://docs.mongodb.com/manual/core/index-compound/#prefixes) for details regarding the significance of the order as it relates to querying capabilities. Dash uses [GroveDB](https://github.com/dashevo/grovedb) which works similarly but does requiring listing _all_ the index's fields in query order by statements.
- When defining an index with multiple properties (i.e a compound index), the order in which the properties are listed is important. Refer to the [mongoDB documentation](https://docs.mongodb.com/manual/core/index-compound/#prefixes) for details regarding the significance of the order as it relates to querying capabilities. Dash uses [GroveDB](https://github.com/dashpay/grovedb) which works similarly but does requiring listing _all_ the index's fields in query order by statements.

```json
"indices": [
Expand Down
4 changes: 2 additions & 2 deletions docs/protocol-ref/identity.md
Original file line number Diff line number Diff line change
Expand Up @@ -714,14 +714,14 @@ fn sign_by_private_key(
match key_type {
KeyType::BLS12_381 => self.set_signature(bls.sign(&data, private_key)?.into()),

// https://github.com/dashevo/platform/blob/9c8e6a3b6afbc330a6ab551a689de8ccd63f9120/packages/js-dpp/lib/stateTransition/AbstractStateTransition.js#L169
// https://github.com/dashpay/platform/blob/9c8e6a3b6afbc330a6ab551a689de8ccd63f9120/packages/js-dpp/lib/stateTransition/AbstractStateTransition.js#L169
KeyType::ECDSA_SECP256K1 | KeyType::ECDSA_HASH160 => {
let signature = signer::sign(&data, private_key)?;
self.set_signature(signature.to_vec().into());
}

// the default behavior from
// https://github.com/dashevo/platform/blob/6b02b26e5cd3a7c877c5fdfe40c4a4385a8dda15/packages/js-dpp/lib/stateTransition/AbstractStateTransition.js#L187
// https://github.com/dashpay/platform/blob/6b02b26e5cd3a7c877c5fdfe40c4a4385a8dda15/packages/js-dpp/lib/stateTransition/AbstractStateTransition.js#L187
// is to return the error for the BIP13_SCRIPT_HASH
KeyType::BIP13_SCRIPT_HASH => {
return Err(ProtocolError::InvalidIdentityPublicKeyTypeError(
Expand Down
2 changes: 1 addition & 1 deletion docs/protocol-ref/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ In addition to ensuring data complies with predefined JSON Schemas, DPP also def

## Reference Implementation

The current reference implementation is the (Rust) [rs-dpp](https://github.com/dashevo/platform/tree/master/packages/rs-dpp) library. The schemas and meta-schemas referred to in this specification can be found here in the reference implementation: <https://github.com/dashpay/platform/tree/master/packages/rs-dpp/src/schema>.
The current reference implementation is the (Rust) [rs-dpp](https://github.com/dashpay/platform/tree/master/packages/rs-dpp) library. The schemas and meta-schemas referred to in this specification can be found here in the reference implementation: <https://github.com/dashpay/platform/tree/master/packages/rs-dpp/src/schema>.

## Release Notes

Expand Down
4 changes: 2 additions & 2 deletions docs/reference/dapi-endpoints-core-grpc-endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -784,5 +784,5 @@ grpcurl -proto protos/core/v0/core.proto \

Implementation details related to the information on this page can be found in:

- The [Platform repository](https://github.com/dashevo/platform/tree/master/packages/dapi) `packages/dapi/lib/grpcServer/handlers/core` folder
- The [Platform repository](https://github.com/dashevo/platform/tree/master/packages/dapi-grpc) `packages/dapi-grpc/protos/core` folder
- The [Platform repository](https://github.com/dashpay/platform/tree/master/packages/dapi) `packages/dapi/lib/grpcServer/handlers/core` folder
- The [Platform repository](https://github.com/dashpay/platform/tree/master/packages/dapi-grpc) `packages/dapi-grpc/protos/core` folder
2 changes: 1 addition & 1 deletion docs/reference/dapi-endpoints-grpc-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Clients for a number of languages are built automatically from the protocol defi

Some examples shown in the endpoint details pages use a command-line tool named [gRPCurl](https://github.com/fullstorydev/grpcurl) that allows interacting with gRPC servers in a similar way as `curl` does for the [JSON-RPCs](../reference/dapi-endpoints-json-rpc-endpoints.md). Additional information may be found in the [gRPC documentation](https://grpc.io/docs/guides/).

To use gRPCurl as shown in the detailed examples, clone the [platform](https://github.com/dashevo/platform/) repository and execute the example requests from the `packages/dapi-grpc` directory of that repository as shown in this example:
To use gRPCurl as shown in the detailed examples, clone the [platform](https://github.com/dashpay/platform/) repository and execute the example requests from the `packages/dapi-grpc` directory of that repository as shown in this example:

```shell
## Clone the dapi-grpc repository
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/dapi-endpoints-json-rpc-endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,4 +363,4 @@ There are no recently deprecated endpoint, but the previous version of documenta

Implementation details related to the information on this page can be found in:

- The [DAPI repository](https://github.com/dashevo/platform/tree/master/packages/dapi) `lib/rpcServer/commands` folder
- The [DAPI repository](https://github.com/dashpay/platform/tree/master/packages/dapi) `lib/rpcServer/commands` folder
8 changes: 4 additions & 4 deletions docs/reference/dapi-endpoints-platform-endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ Please refer to the [gRPC Overview](../reference/dapi-endpoints-grpc-overview.md

## Data Proofs and Metadata

Platform gRPC endpoints can provide [proofs](https://github.com/dashpay/platform/blob/master/packages/dapi-grpc/protos/platform/v0/platform.proto#L17-L22) so the data returned for a request can be verified as being valid. When requesting proofs, the data requested will be encoded as part of the proof in the response. Full support is not yet available in the JavaScript client, but can be used via the low level [dapi-grpc library](https://github.com/dashevo/platform/tree/master/packages/dapi-grpc).
Platform gRPC endpoints can provide [proofs](https://github.com/dashpay/platform/blob/master/packages/dapi-grpc/protos/platform/v0/platform.proto#L17-L22) so the data returned for a request can be verified as being valid. When requesting proofs, the data requested will be encoded as part of the proof in the response. Full support is not yet available in the JavaScript client, but can be used via the low level [dapi-grpc library](https://github.com/dashpay/platform/tree/master/packages/dapi-grpc).

Some [additional metadata](https://github.com/dashevo/platform/blob/master/packages/dapi-grpc/protos/platform/v0/platform.proto#L48-L55) is also provided with responses:
Some [additional metadata](https://github.com/dashpay/platform/blob/master/packages/dapi-grpc/protos/platform/v0/platform.proto#L48-L55) is also provided with responses:

| Metadata field | Description |
| :---------------------- | :---------------------------------------------------- |
Expand Down Expand Up @@ -1872,5 +1872,5 @@ The following endpoints were recently deprecated. See the [previous version of d

Implementation details related to the information on this page can be found in:

* The [Platform repository](https://github.com/dashevo/platform/tree/master/packages/dapi) `packages/dapi/lib/grpcServer/handlers/core` folder
* The [Platform repository](https://github.com/dashevo/platform/tree/master/packages/dapi-grpc) `packages/dapi-grpc/protos` folder
* The [Platform repository](https://github.com/dashpay/platform/tree/master/packages/dapi) `packages/dapi/lib/grpcServer/handlers/core` folder
* The [Platform repository](https://github.com/dashpay/platform/tree/master/packages/dapi-grpc) `packages/dapi-grpc/protos` folder
Loading