Your first transaction
On the side-chain, a transaction is a JSON text plus a signature over exactly that text:
{ "body": "{\"v\":1,\"chain\":\"divi-games-testnet-1\",\"from\":\"y…\",\"nonce\":0,\"action\":{\"type\":\"faucet\",\"token\":\"GOLD\"}}",
"sig": "H3k…" }
The body is a string. The node never re-serialises it; it parses the string, verifies sig as a Divi signed
message over those exact bytes, and checks the recovered address equals from. A wallet can therefore show
you precisely what you are signing.
The body fields
| Field | Meaning |
|---|---|
v | format version, 1 |
chain | divi-games-testnet-1; stops a tx being replayed on another chain |
from | your address |
nonce | your account's next nonce, starting at 0 |
action | what to do, e.g. {"type":"transfer", ...} |
memo | optional, up to 140 characters |
The txid is hex(SHA256(body bytes)).
Nonces
The nonce makes each of your transactions unique and ordered. A tx with a wrong nonce or a bad signature never enters the mempool. A tx that is valid but whose action fails, say an illegal move, is included in a block with a failed receipt, and it still uses up its nonce.
Try it
- Create or open a key and note its address.
- Sign a
faucetaction forGOLDwith nonce 0 and submit it toPOST /v1/tx. - Look up
GET /v1/tx/<txid>until it has a receipt, thenGET /v1/account/<address>to see 1000 GOLD (amounts are shown as base units:"100000").
The SDK (web/sdk/divigames.js) does all of this: signTx(key, {nonce, action}), chain.submit(...) and
chain.waitForReceipt(txid).