CHAIN connecting…
Build on Dznye

Everything about the chain, in one place

Use it, build on it, run it, or sell with it. Every blueprint below is a few lines of the developer kit, signs on your own machine, and needs no account, no API key and no company in between.

Chain dznye-mainnet · node https://api.dznye.com · open source (MIT) · live status

Blueprints

What you would use Stripe, Google or a game server for, on one chain

Every snippet starts the same way. In a page: import { connect, newKey } from 'https://developers.dznye.com/js/chain/sdk.js'; in Node 24, from chain/src/sdk.ts. Then const dz = connect() and a key (await newKey(); keep its secret safe).

1. Payments, like Stripe

A pay link or QR code for any amount, and your server sees each payment with its order number. A payment is final in about a second.

// a link for the checkout button (or a QR code of it)
const link = `https://wallet.dznye.com/pay?to=@my-shop&amount=12.5&for=order-881`;
// or charge from your own app, with the order attached
await dz.payShop(customer, '@my-shop', '12.5', { order: 'order-881' });
// on your server: read new blocks (GET https://api.dznye.com/blocks?from=N) and match each payment's note

Pay links, QR codes and receipts

2. Sign-in, like Google

No passwords and no user table to protect: the wallet signs a one-time code for your site, and you check it yourself.

// send people to the wallet
location.href = `https://wallet.dznye.com/login?app=${location.origin}&nonce=${nonce}&return=${location.origin}/signed-in`;
// when they come back (the proof is after #dzy=)
import { verifyLogin } from 'https://developers.dznye.com/js/chain/sdk.js';
const address = await verifyLogin(proof, { app: location.origin, nonce });   // throws if it is not genuine

Sign in with Dznye

3. Games: a currency and items

Your game's own coin, items that are really the player's, and rewards for many players in one transaction.

const gold = await dz.makeToken(studio, { symbol: 'GOLD', name: 'Game gold', decimals: 0, supply: 1000000 });
const sword = await dz.makeItem(studio, { symbol: 'SWORD1', name: 'Fire sword', content: fileSha256, link: 'https://example.com/sword.png' });
await dz.sendMany(studio, [['@ana', '50'], ['@ben', '20'], ['@kai', '10']], { asset: gold });   // up to 100 at once
await dz.send(studio, '@ana', 1, { asset: sword });                                              // the item is now hers

Make a token

4. NFTs and collectibles

An item is a token with exactly one in existence, for ever, carrying the SHA-256 of its file and where the file is. Sell it on the chain's own market.

const art = await dz.makeItem(artist, { symbol: 'DAWN', name: 'Dawn, no. 1', content: fileSha256, link: 'ipfs://...' });
await dz.trade(artist, { give: [art, 1], want: ['DZY', '25'] });   // an open offer anyone can take

Trade on the market

5. Trading and markets

Offers anyone can take, pools for instant swaps, and a price quote before every trade.

await dz.openPool(maker, gold, '100', '50000');                 // a pool: 100 DZY against 50,000 GOLD
const q = await dz.quote(gold, 'DZY', '1000');                   // what 1,000 GOLD gets now
await dz.swapNow(player, gold, 'DZY', '1000', { slip: 1 });      // swap, at most 1% worse than quoted

Pools and instant swaps

6. Smart contracts

Programs that hold coins and tokens, call each other and keep their own records. Deploying one costs 1 DZY; reading one is free.

const shop = await dz.deploy(me, programJson);
await dz.call(buyer, shop, 'buy', [], { pay: '1' });   // call it, sending 1 DZY with it
await dz.view(shop, 'sold');                           // ask it something, free

Contracts

7. Subscriptions and pay by the minute

A stream pays as time passes: a course, a server, a stream of music. Either side can stop it, and nothing is paid past the deposit.

await dz.openStream(viewer, '@my-channel', '0.01', '5');   // 0.01 DZY a minute, 5 DZY set aside

8. Loyalty points and cashback

Every payment to your shop can earn your own points automatically, in the same transaction.

const points = await dz.makeToken(shop, { symbol: 'BEAN', name: 'Bean points', decimals: 0, supply: 1000000 });
await dz.fundShop(shop, points, '100000');                   // the points it gives back come from here
await dz.setCashback(shop, 'DZY', 5, { reward: points });     // 5% back, in BEAN

A whole shop with sign-in and points in one file: the loyalty template. For points worth something fixed, use reward points with DZY behind them.

9. Payroll and mass payouts

Pay up to 100 people in one transaction, with one fee for every 20 of them.

await dz.sendMany(company, team.map((p) => [p.name, p.amount]), { memo: 'November' });

10. Daily credits for using your app

Your own credits token, and once a day your server pays everyone who signed in that day: up to 100 people in one transaction. For a one-time bonus (signing up, a first purchase), use a reward task that people claim instead (postTask).

const credits = await dz.makeToken(appKey, { symbol: 'CRED', name: 'App credits', decimals: 0, supply: 100000000 });
// once a day, on your server: the addresses that signed in today (from verifyLogin)
for (let i = 0; i < today.length; i += 100)
  await dz.sendMany(appKey, today.slice(i, i + 100).map((a) => [a, '10']), { asset: credits, memo: 'daily credit' });

Rewards, tasks and partners

11. Earn while you play: quests, new areas, areas to take over

Players earn your game's coin for finishing quests, spend it to open new areas, and an area can be a one-of-a-kind item a player owns, that others can buy or win from them. Your server decides what counts as done; the chain pays and keeps score.

// a quest that pays 25 GOLD to each of up to 5,000 players (the rewards are set aside from your balance now)
const quest = await dz.postTask(game, '25', 5000, { asset: gold, checker: checker.address, note: 'Clear the north mine' });
// on your server, when the game sees a player finish it
import { approveTask } from 'https://developers.dznye.com/js/chain/sdk.js';
const proof = await approveTask(checker, 'dznye-mainnet', quest, player.address);
await dz.claimTask(player, quest, proof);                                  // the player gets 25 GOLD
// opening an area: the player pays, your game sees the payment and its note, and opens it
await dz.send(player, '@my-game', '100', { asset: gold, memo: 'open:north-mine' });
// owning an area: one of a kind; whoever holds it controls it, and it changes hands by sale or by a win
const mine = await dz.makeItem(game, { symbol: 'NMINE', name: 'North mine', content: mapSha256 });
await dz.send(game, '@ana', 1, { asset: mine });

Each player pays tiny fees in DZY; a new player can start on starter credit. Rewards and tasks

12. AI agents with a spending limit

The MCP server gives an AI its own account, and you set the most it may move in one action. Read-only if you prefer.

DZNYE_MAX_SEND=10 node ~/.dznye/mcp/mcp.js     # install line: https://chain.dznye.com/llms.txt

13. Launch a coin, with no rug pull

A billion coins in their own market from the first second, priced by a curve. Nobody gets free coins, its maker included, and nobody can ever take the market's DZY out. The maker earns 0.5% of every trade. In the wallet: Trade, Launch a coin.

const moon = await dz.launch(maker, { symbol: 'MOON', name: 'To the moon', link: 'https://example.com/moon.png' });
await dz.swapNow(fan, 'DZY', moon, '10');      // buy with 10 DZY (at most 1% worse than quoted)
await dz.swapNow(fan, moon, 'DZY', '5000000'); // sell back into its market

Make a token: launch a coin

14. Reward points with real value

Points with DZY behind every one, held by the chain. You make them only by paying their backing in; whoever holds them cashes them in whenever they like, and you can never take the backing back. Cashback, daily rewards, prizes, pay.

const cafe = await dz.makePoints(shop, { symbol: 'CAFE', name: 'Cafe points', value: '0.01' });   // 1 point = 0.01 DZY
await dz.mintPoints(shop, cafe, 500, '@ana');   // 500 points to Ana; 5 DZY goes behind them
await dz.redeemPoints(ana, cafe, 500);          // Ana cashes in: 5 DZY back, no permission needed

15. A checker beside every product, paid for staying on

Run a node beside each app or shop. With 1 DZY staked, it checks the chain and says so a few times an hour; on days it was seen in 12 or more hours, checkers share 20% of the validators' daily pay, by stake. The wallet can do it too while it is open (Earn, Check the chain).

await dz.stake(checkerKey, '1');   // once
CHECKER_ADDRESS=... CHECKER_SECRET=... node chain/node/server.mjs --follow https://api.dznye.com --data ./dznye-data

Run a node: checkers