Build on Dznye
Plain HTTP and JSON. Every change is a transaction you sign yourself; there is no privileged endpoint, and no account needed with us.
Node address: https://chain.dznye.com/api
dznye-1
| Name | dznye-1 (inside every signature) |
|---|---|
| Genesis hash | 1085eabf51d40005d6e8ad6d70dcdd66d7cb6b4a6c4eb8eae858ff2e6a33ad77 |
| Genesis file | dznye-1.genesis.json |
| Fee | 0.001 DZY per transaction (1,000 parts; 1 DZY = 1,000,000 parts) |
| Coin | DZY, 6 decimals, at most 12,000,000, never destroyed |
Check that a node runs exactly this chain: node chain/cli.mjs genesis check dznye-1.genesis.json --node https://chain.dznye.com/api
The API
| Request | Gives |
|---|---|
GET /api/ | chain, block height, validators, the fee, the latest snapshot, this node's role, any alert |
GET /api/account/<address> | balances, the nonce to use next, device keys, agent keys, guardian, stake |
GET /api/validators | the validators, each one's say, every stake |
GET /api/assets, /api/offers | every token and every open offer |
GET /api/supply, /api/supply/<token> | limit, issued, existing, circulating; for DZY the treasury, stake and each pool |
GET /api/genesis, /api/blocks?from=1&limit=100, /api/block/<n> | everything needed to replay and check the chain |
GET /api/snapshot | the latest kept snapshot: a block and the whole state after it |
GET /api/peers, POST /api/peers {url} | places known to hold this chain; announce yours (checked before it is listed) |
POST /api/tx { "tx": … } | send a signed transaction (60 a minute per address) |
Signing a transaction
A transaction is { chain, from, nonce, type, data, sig }. The signature is Ed25519 over "dzy-tx:" + canon({ chain, from, nonce, type, data, signer, payer }), where canon writes JSON with keys sorted and whole numbers only. Amounts are whole numbers of the smallest part.
import { Client } from './chain/src/client.ts';
const c = new Client('https://chain.dznye.com/api');
await c.send(myKey, 'transfer', { asset: 'DZY', to: address, amount: 1_500_000 }); // 1.5 DZY
// an app paying its user's fee: the user signs naming the app, the app adds its signature
const tx = await c.prepare(userKey, 'transfer', { asset: tokenId, to, amount: 5 }, { payer: appKey.address });
await c.submit(await Client.sponsor(appKey, tx));
| Type | Does |
|---|---|
transfer | send any asset, with an optional public memo |
asset.create, mint, burn | make a token (1 DZY to the treasury), issue it (its maker only), destroy your own (DZY goes to the treasury instead) |
offer.create, offer.take, offer.cancel | swap any asset for any other, both sides at once |
key.add, key.remove | devices on one account |
agent.allow, agent.revoke | a limited key for software: one asset, a total, a fee budget, an end time |
guardian.set, recover.start / .cancel / .finish | recovery through a guardian, with a 3-day wait |
stake.bond, stake.unbond, stake.withdraw, validator.unjail | validators locking DZY |
evidence | proof that a validator signed two different votes |
treasury.spend | the treasury paying out (the issuing key only, with a public reason) |
No installs: Node 24 is enough
node chain/cli.mjs key new me.json
node chain/cli.mjs info --node https://chain.dznye.com/api
node chain/cli.mjs balance <address> --node https://chain.dznye.com/api
node chain/cli.mjs send --key me.json --to <address> --amount 1.5 --node https://chain.dznye.com/api
node chain/cli.mjs token create --key me.json --symbol GOLD --name "Game gold" --node https://chain.dznye.com/api
node chain/cli.mjs validators --node https://chain.dznye.com/api
Keep a copy of the chain
No single place should hold the only copy. Every copy can be checked against the chain's own fingerprints, so a copy from anywhere is safe to use.
The archive: the whole chain as plain files, at /archive/index.json. Make your own and keep it anywhere (a folder, a USB stick, a git repository, a web server, IPFS):
node chain/archive.mjs update --node https://chain.dznye.com/api --out ./dznye-archive
The swarm: /api/peers lists the nodes known to hold this chain. A follower can copy from several sources at once (nodes and archives), finds more through them, and raises an alert if any of them shows a different history:
node chain/node/server.mjs --follow https://chain.dznye.com/archive/index.json,https://chain.dznye.com/api --data ./dznye-data
# with a public address, others learn of your node too:
PUBLIC_URL=https://my-node.example.org node chain/node/server.mjs --follow https://chain.dznye.com/api --host 0.0.0.0
Check it yourself, or help run it
A follower holds no key: it copies every block, checks every rule and signature, and raises an alert if anything is wrong.
node chain/node/server.mjs --follow https://chain.dznye.com/api --data ./dznye-data
A validator stakes at least 1,000 DZY and runs a node with its key and the other validators as peers. The whole process, from keys to upgrades, is in the runbook (chain/launch/RUNBOOK.md).
Watching any set of nodes: node chain/launch/check.mjs https://chain.dznye.com/api --genesis dznye-1.genesis.json