Skip to content
Open
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
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ Schema-based specifications that describe the structure and validation rules for
their application data. The network stores, indexes, and enforces these schemas
directly. Applications interact with the platform through structured data reads
and writes (called **state transitions**) rather than arbitrary code execution.
Smart contract support is planned for Platform v4.0 (targeted for mainnet in
2027).
Smart-contract execution (DashVM: Rust contracts compiled to WebAssembly and
run on Wasmtime) is in development for Platform 5.0. The plan and the design
decisions are tracked in
[dashpay/platform#4626](https://github.com/dashpay/platform/issues/4626).

### How Dash Platform compares

Expand All @@ -60,7 +62,7 @@ Smart contract support is planned for Platform v4.0 (targeted for mainnet in
| **State proofs** | Merkle-Patricia proofs | No native proofs | **GroveDB Merkle proofs for every query** |
| **Light client trust** | Needs sync committee | Trusts RPC provider | **Cryptographic proof per response -- same security as a full node** |
| **Data model** | Account / key-value | Account / key-value | **Structured documents with secondary indexes** |
| **Smart contracts** | **Yes (Solidity / Vyper on EVM)** | **Yes (Rust / C on SVM)** | Coming in v4.0 |
| **Smart contracts** | **Yes (Solidity / Vyper on EVM)** | **Yes (Rust / C on SVM)** | In development for 5.0 (Rust on WebAssembly) |

The standout difference is light client verification. Most chains either offer
no state proofs (Solana) or give proofs that are expensive to verify
Expand Down Expand Up @@ -170,7 +172,9 @@ are located in the [packages](./packages) directory. Key packages include:
- **rs-sdk** -- Rust SDK for building applications on Dash Platform
- **wasm-sdk** / **wasm-dpp2** -- WebAssembly bindings for browser-based
applications
- **rs-sdk-ffi** / **swift-sdk** -- FFI layer and iOS/Swift SDK
- **rs-sdk-ffi** / **rs-platform-wallet-ffi** / **rs-unified-sdk-ffi** /
**rs-unified-sdk-jni** -- FFI and JNI layers under the mobile SDKs
- **swift-sdk** / **kotlin-sdk** -- iOS/Swift SDK and Android/Kotlin SDK
- **js-evo-sdk** -- JavaScript SDK
- **dashmate** -- Node management and local development tool
- **dapi** / **rs-dapi** -- Decentralized API server implementations
Expand All @@ -181,8 +185,8 @@ are located in the [packages](./packages) directory. Key packages include:
|-----|--------|---------|
| **Rust** | Available now | [`rs-sdk`](./packages/rs-sdk) |
| **JavaScript** | Available now | [`js-evo-sdk`](./packages/js-evo-sdk) |
| **iOS (Swift)** | Coming in v3.1 | [`swift-sdk`](./packages/swift-sdk) |
| **Android** | Coming in v3.2 | -- |
| **iOS (Swift)** | Available; built from source with `build_ios.sh` (Swift Package Manager, iOS 18+ / macOS 15+) | [`swift-sdk`](./packages/swift-sdk) |
| **Android (Kotlin)** | Available; shipped as an AAR asset on each platform GitHub release | [`kotlin-sdk`](./packages/kotlin-sdk) |

For details on choosing an SDK and what each one provides, see the
[SDK Support](https://dashpay.github.io/platform/sdk-support.html) chapter in
Expand Down
20 changes: 11 additions & 9 deletions book/src/architecture/overview.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Monorepo Overview

Dash Platform ships as a single Git repository containing 47 Rust crates, a
Dash Platform ships as a single Git repository containing 49 Rust crates, a
handful of JavaScript/TypeScript packages, and supporting tooling. This chapter
maps the territory: what each crate owns, how they depend on one another, and
where the boundaries are drawn.
Expand All @@ -17,8 +17,9 @@ a few critical external dependencies at the workspace level -- most notably
dashcore = { git = "https://github.com/dashpay/rust-dashcore", rev = "53d699c..." }
```

The workspace version (`4.2.0-dev` at time of writing, Rust edition 2021, MSRV
1.98) is shared by all member crates through `version.workspace = true`.
The workspace version (`4.2.0-beta.N` in the root `Cargo.toml` at the time of
writing; Rust edition 2021, MSRV 1.98) is shared by all member crates through
`version.workspace = true`.

## The Core Dependency Chain

Expand Down Expand Up @@ -273,17 +274,18 @@ Here is a simplified view of every Rust workspace member, grouped by role:

| Role | Crates |
|------|--------|
| **Protocol types** | `dpp`, `platform-value`, `platform-serialization`, `platform-serialization-derive`, `platform-versioning`, `platform-value-convertible` |
| **Protocol types** | `dpp`, `platform-version`, `platform-value`, `platform-serialization`, `platform-serialization-derive`, `platform-versioning`, `platform-value-convertible`, `dpp-json-convertible-derive` |
| **Storage** | `drive` |
| **Application server** | `drive-abci` |
| **Client SDK** | `dash-sdk`, `rs-dapi-client`, `dash-context-provider`, `rs-sdk-trusted-context-provider` |
| **Client SDK** | `dash-sdk`, `rs-dapi-client`, `dash-context-provider`, `rs-sdk-trusted-context-provider`, `dash-async`, `dash-platform-queries` |
| **Proof verification** | `drive-proof-verifier` |
| **gRPC definitions** | `dapi-grpc` |
| **WASM bindings** | `wasm-dpp`, `wasm-dpp2`, `wasm-sdk`, `wasm-drive-verify` |
| **iOS/FFI** | `rs-sdk-ffi` |
| **System contracts** | `dpns-contract`, `dashpay-contract`, `withdrawals-contract`, `masternode-reward-shares-contract`, `wallet-utils-contract`, `token-history-contract`, `keyword-search-contract`, `document-history-contract`, `app-connect-contract`, `moderation-charters-contract`, `data-contracts` |
| **Tooling** | `dashmate` (JS), `strategy-tests`, `simple-signer`, `check-features`, `json-schema-compatibility-validator` |
| **Other** | `dash-platform-macros`, `rs-dash-event-bus`, `rs-platform-wallet`, `dash-platform-balance-checker`, `rs-dapi` |
| **Wallet** | `platform-wallet`, `platform-wallet-storage`, `platform-encryption` |
| **Mobile/FFI** | `rs-sdk-ffi`, `platform-wallet-ffi`, `rs-unified-sdk-ffi` (C ABI consumed by `swift-sdk`), `rs-unified-sdk-jni` (JNI shim consumed by `kotlin-sdk`); the Swift and Kotlin SDKs themselves are non-Rust packages layered on these crates |
| **System contracts** | `dpns-contract`, `dashpay-contract`, `withdrawals-contract`, `masternode-reward-shares-contract`, `wallet-utils-contract`, `token-history-contract`, `document-history-contract`, `keyword-search-contract`, `app-connect-contract`, `moderation-charters-contract`, `data-contracts` |
| **Tooling** | `dashmate` (JS), `strategy-tests`, `simple-signer`, `check-features`, `json-schema-compatibility-validator`, `rs-scripts` |
| **Other** | `dash-platform-macros`, `rs-dash-event-bus`, `dash-platform-balance-checker`, `rs-dapi` |

## Rules

Expand Down
4 changes: 2 additions & 2 deletions book/src/error-handling/consensus-errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ There are five things worth understanding here.

Every consensus error falls into one of four categories:

- **BasicError** -- structural and syntactic validation failures. The state transition itself is malformed, references a nonexistent document type, has an invalid identifier, exceeds size limits, or fails schema validation. These are caught before the node ever checks persistent state. The `BasicError` enum in `packages/rs-dpp/src/errors/consensus/basic/basic_error.rs` contains over 130 variants organized into sub-groups: versioning errors, structure errors, data contract errors, group errors, document errors, token errors, identity errors, state transition errors, and address errors.
- **BasicError** -- structural and syntactic validation failures. The state transition itself is malformed, references a nonexistent document type, has an invalid identifier, exceeds size limits, or fails schema validation. These are caught before the node ever checks persistent state. The `BasicError` enum in `packages/rs-dpp/src/errors/consensus/basic/basic_error.rs` contains over 200 variants organized into sub-groups: versioning errors, structure errors, data contract errors, group errors, document errors, token errors, identity errors, state transition errors, and address errors.

- **StateError** -- the transition is structurally valid but conflicts with the current platform state. A document already exists, an identity nonce is wrong, a token account is frozen, a group action was already completed. The `StateError` enum in `packages/rs-dpp/src/errors/consensus/state/state_error.rs` contains roughly 80 variants covering data contracts, documents, identities, voting, tokens, groups, and address balances.
- **StateError** -- the transition is structurally valid but conflicts with the current platform state. A document already exists, an identity nonce is wrong, a token account is frozen, a group action was already completed. The `StateError` enum in `packages/rs-dpp/src/errors/consensus/state/state_error.rs` contains roughly 150 variants covering data contracts, documents, identities, voting, tokens, groups, and address balances.

- **SignatureError** -- the cryptographic signature on the transition is invalid. The identity was not found, the key type is wrong, the key is disabled, the security level is insufficient, or the raw signature verification failed.

Expand Down
4 changes: 2 additions & 2 deletions book/src/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ with `rs-` on disk but have shorter names in `Cargo.toml`:
| `packages/rs-platform-serialization` | `platform-serialization` |
| `packages/rs-drive-proof-verifier` | `drive-proof-verifier` |

The workspace currently targets Rust 1.98 and protocol version 14 (as of
4.2.0-dev). The workspace `Cargo.toml` lists 47 member crates, but the core
The workspace currently targets Rust 1.98 and protocol version 14 (the 4.2
line). The workspace `Cargo.toml` lists 49 member crates, but the core
platform logic lives in the first eight listed above.

Let's begin with the architecture.
16 changes: 10 additions & 6 deletions book/src/platform-comparison.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,22 @@ security guarantees as a full node.

| | Bitcoin | Ethereum | Solana | Polkadot | NEAR | Cosmos SDK | Avalanche | Dash Platform |
|---|---|---|---|---|---|---|---|---|
| **Smart contracts** | `-` Limited Script opcodes | `+++` Solidity / Vyper on EVM | `+++` Rust / C on SVM | `++` Per-parachain, typically Wasm | `++` Rust / JS / AssemblyScript on Wasm VM | `+` App-specific (Go) | `++` Solidity on EVM, Rust on Wasm | `-` Coming in v4.0 |
| **VM / execution** | `-` Script interpreter | `+++` EVM | `+++` SVM (eBPF) | `++` Wasm (per parachain) | `++` Wasm VM | `+` No VM (compiled Go) | `++` EVM + Wasm subnets | `-` No VM (data contracts; VM planned for v4.0) |
| **Developer languages** | `-` Script | `+++` Solidity, Vyper | `++` Rust, C | `++` Rust (Substrate) | `++` Rust, JS, AssemblyScript | `+` Go | `++` Solidity, Rust | `+` JSON Schema (data contracts), Rust/JS/Swift (SDKs) |
| **Smart contracts** | `-` Limited Script opcodes | `+++` Solidity / Vyper on EVM | `+++` Rust / C on SVM | `++` Per-parachain, typically Wasm | `++` Rust / JS / AssemblyScript on Wasm VM | `+` App-specific (Go) | `++` Solidity on EVM, Rust on Wasm | `-` In development for 5.0 (Rust on WebAssembly, DashVM) |
| **VM / execution** | `-` Script interpreter | `+++` EVM | `+++` SVM (eBPF) | `++` Wasm (per parachain) | `++` Wasm VM | `+` No VM (compiled Go) | `++` EVM + Wasm subnets | `-` No VM today (data contracts); DashVM (Wasmtime) in development for 5.0 |
| **Developer languages** | `-` Script | `+++` Solidity, Vyper | `++` Rust, C | `++` Rust (Substrate) | `++` Rust, JS, AssemblyScript | `+` Go | `++` Solidity, Rust | `+` JSON Schema (data contracts), Rust/JS/Swift/Kotlin (SDKs) |
| **Smart contract security** | N/A | `+` Reentrancy, gas exploits | `++` No reentrancy, but complexity | `++` Sandboxed per parachain | `++` Wasm sandboxing | N/A | `+` Inherits EVM risks | N/A (data contracts are declarative) |

Dash Platform takes a fundamentally different approach: instead of a VM that
executes arbitrary code, developers define **data contracts** -- JSON
Schema-based specifications that describe the structure and validation rules for
their application data. The network stores, indexes, and enforces these schemas
directly. This eliminates entire classes of smart contract vulnerabilities
(reentrancy, unchecked external calls, gas manipulation). Smart contract support
is planned for Platform v4.0 (targeted for mainnet in 2027).
(reentrancy, unchecked external calls, gas manipulation). Smart-contract
execution (DashVM: Rust contracts compiled to WebAssembly and run on Wasmtime)
is in development for Platform 5.0, tracked in
[dashpay/platform#4626](https://github.com/dashpay/platform/issues/4626). The
data-contract model stays: contracts compose with the existing native rules
rather than replacing them.

## Token Support

Expand All @@ -70,7 +74,7 @@ enforced by the protocol itself.
| **License** | MIT | Various (GPL, Apache, MIT) | Apache 2.0 | GPL 3.0 | Apache 2.0 / MIT | Apache 2.0 | BSD 3-Clause | MIT |
| **Open source** | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| **Core language** | C++ | Go, Rust | Rust | Rust | Rust | Go | Go | Rust |
| **Client SDKs** | `+` Multiple (community) | `+++` web3.js, ethers.js, viem | `++` @solana/web3.js | `+` Polkadot.js | `+` near-api-js | `+` CosmJS | `++` ethers.js (C-Chain) | `++` Rust, JavaScript, Swift (iOS), Android (coming) |
| **Client SDKs** | `+` Multiple (community) | `+++` web3.js, ethers.js, viem | `++` @solana/web3.js | `+` Polkadot.js | `+` near-api-js | `+` CosmJS | `++` ethers.js (C-Chain) | `++` Rust, JavaScript, Swift (iOS), Kotlin (Android) |
| **Launched** | 2009 | 2015 | 2020 | 2020 | 2020 | 2019 (SDK) | 2020 | 2024 (v1.0 mainnet) |
| **Ecosystem maturity** | `+++` Largest, most established | `+++` Largest smart contract ecosystem | `++` Fast-growing DeFi ecosystem | `+` Growing parachain ecosystem | `+` Growing dApp ecosystem | `++` Many sovereign chains | `++` Growing subnet ecosystem | `+` Early stage, growing |
| **Identity system** | `-` Addresses only | `+` ENS (contract-based) | `-` No native identity | `-` No native identity | `+` Named accounts | `-` No native identity | `-` No native identity | `+++` Protocol-native identities with hierarchical keys and DPNS usernames |
Expand Down
15 changes: 9 additions & 6 deletions book/src/sdk-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,29 @@ developers can build applications on whatever stack they prefer.
|-----|----------|--------|---------|----------|
| **Rust SDK** | Rust | Available now | [`rs-sdk`](https://github.com/dashpay/platform/tree/master/packages/rs-sdk) | Server-side applications, full-node tooling, direct protocol access |
| **JavaScript SDK** | JavaScript / TypeScript | Available now | [`js-evo-sdk`](https://github.com/dashpay/platform/tree/master/packages/js-evo-sdk) | Node.js backends, scripts, CLI tools |
| **iOS SDK** | Swift | Coming in v3.1 | [`swift-sdk`](https://github.com/dashpay/platform/tree/master/packages/swift-sdk) | iOS and macOS applications |
| **Android SDK** | Kotlin | Coming in v3.2 | -- | Android applications |
| **iOS SDK** | Swift | Available; iOS 18+ and macOS 15+ via Swift Package Manager. The `DashSDKFFI.xcframework` binary target is built locally by `build_ios.sh` | [`swift-sdk`](https://github.com/dashpay/platform/tree/master/packages/swift-sdk) | iOS and macOS applications |
| **Android SDK** | Kotlin | Available; an AAR is attached to every platform GitHub release. Maven coordinates `org.dashj:dash-sdk-android` are the publishing target described in the package's `PUBLISHING.md` | [`kotlin-sdk`](https://github.com/dashpay/platform/tree/master/packages/kotlin-sdk) | Android applications |

### Supporting packages

| Package | Purpose |
|---------|---------|
| [`rs-sdk-ffi`](https://github.com/dashpay/platform/tree/master/packages/rs-sdk-ffi) | C FFI layer over the Rust SDK; used by the Swift SDK, the Android SDK, and any language that can call C |
| [`rs-platform-wallet-ffi`](https://github.com/dashpay/platform/tree/master/packages/rs-platform-wallet-ffi) | C FFI layer over the platform wallet (persistence, key management, shielded pool) |
| [`rs-unified-sdk-ffi`](https://github.com/dashpay/platform/tree/master/packages/rs-unified-sdk-ffi) | Unified C ABI combining the SDK, wallet and core wallet FFI crates; packaged as `DashSDKFFI.xcframework` for the Swift SDK |
| [`rs-unified-sdk-jni`](https://github.com/dashpay/platform/tree/master/packages/rs-unified-sdk-jni) | JNI shim over the same FFI crates, loaded by the Kotlin SDK as `libdash_sdk_jni.so` |

## Choosing an SDK

**Building a server or CLI tool?** Use the **Rust SDK** for maximum
performance and direct access to all protocol features, or the **JavaScript
SDK** if your stack is Node.js.

**Building an iOS or macOS app?** Use the **Swift SDK** (v3.1+), which wraps
the Rust SDK through an FFI layer and provides native Swift types.
**Building an iOS or macOS app?** Use the **Swift SDK**, which wraps the
Rust SDK through an FFI layer and provides native Swift types.

**Building an Android app?** The **Android SDK** (v3.2+) will wrap the same
FFI layer with native Kotlin types.
**Building an Android app?** Use the **Android SDK**, which wraps the same
FFI crates through a JNI shim with native Kotlin types.

**Building for another language?** The **FFI layer** (`rs-sdk-ffi`) exposes a
C-compatible interface that can be called from Python, C#, or any language
Expand Down
Loading
Loading