Code for the tutorials found on the Platform documentation
site. This repo
uses @dashevo/evo-sdk. For the legacy js-dash-sdk tutorials, see
v2.0.1.
The included dev container provides a ready-to-use environment with Node.js, dependencies, and editor tooling pre-configured. Open the repo in GitHub Codespaces or locally with the VS Code Dev Containers extension.
On first launch the container installs dependencies and creates a starter .env file from
.env.example. Run node create-wallet.mjs to generate a mnemonic, then set PLATFORM_MNEMONIC in
your .env file to begin the tutorials.
Note: NodeJS (v20+) must be installed to run the tutorial code.
git clone https://github.com/dashpay/platform-tutorials.gitDo a clean install of project dependencies:
npm ciCopy .env.example to .env. Set NETWORK if needed (defaults to testnet).
You will set PLATFORM_MNEMONIC when configuring a wallet in the Usage section.
cp .env.example .envFollow these steps to go through the full Platform flow (wallet → funding → identity):
- Check connection:
node connect.mjs - Create a wallet:
node create-wallet.mjs - Fund the platform address using the bridge URL printed in the previous step
- Set
PLATFORM_MNEMONICin.envto the mnemonic from step 2 - To inspect the wallet after configuring
PLATFORM_MNEMONIC, runnode view-wallet.mjs - Proceed with Next Steps
If you want to start interacting with Platform as quickly as possible, you can use Dash Bridge to create a wallet and register an identity in one step.
Then, just set PLATFORM_MNEMONIC in .env, run node view-wallet.mjs to confirm the wallet
and identity are found, and proceed with Next Steps.
This is useful for quick experimentation, but the standard setup above is recommended to understand the full flow.
Proceed with the Identities and Names tutorials first and the Contracts and Documents tutorials next. They align with the tutorials section on the documentation site.
The identity ID is automatically resolved from your mnemonic, so there is no need to set it
manually. After registering a data
contract, set DATA_CONTRACT_ID in your
.env file to the new contract ID for use in subsequent document tutorials.
Some client configuration options are included as comments in
setupDashClient.mjs if more advanced configuration is required.
Tests run each tutorial as a subprocess and validate its output. No test framework dependencies are required — tests use the Node.js built-in test runner.
Ensure your .env file is configured (see .env.example) before running tests.
# Read-only tests (default) — safe to run, no credits consumed
npm test
# Write tests — registers identities/contracts/documents (consumes testnet credits)
npm run test:read-write
# All tests
npm run test:allIf you already have a Dash identity created with another tool (e.g. Dash
Bridge), you can use it directly by setting PLATFORM_MNEMONIC to
your existing mnemonic. Run node view-wallet.mjs to confirm the derived address and identity ID.
Note: Dash Bridge can handle wallet creation and identity registration in one step.
For compatibility, the external tool must use the same derivation paths (no BIP39 passphrase):
| Key type | Testnet | Mainnet |
|---|---|---|
| Platform address (BIP44) | m/44'/1'/0'/0/i |
m/44'/5'/0'/0/i |
| Identity keys (DIP-13) | m/9'/1'/5'/0'/0'/0'/k' |
m/9'/5'/5'/0'/0'/0'/k' |
The first platform address (i=0) must be funded for top-up and send-funds operations.
PRs accepted.