Skip to main content
zend.random draws a value with Sui’s built-in randomness in Zend’s zend::draws contract, and records it once per interaction and label. Both players’ pages can call it; the second call gets the same result.

Kinds

Rules

  • Each (interaction, label) is drawn once, ever. You can’t redraw "flip" until you like the answer.
  • Asking again with the same label and the same settings returns the recorded result. Asking with different settings fails with DRAW_MISMATCH.
  • Labels are 1–25 characters of a-z, 0-9, _ and -.
  • Up to 50 draws per interaction (TOO_MANY_DRAWS).
  • Everyone in the interaction’s live room also gets the result as a message from "zend" with data: { type: "random", result }.
  • Draws cost the user nothing. Each one counts against your app’s network budget.

Result

From your server

Your server also receives a random.drawn webhook for every draw, from a page or from your server.

Show that a result was checked

Set check: true on a result card’s slots:
Zend shows Result checked ✓ under the card only when its own check passes: every record for the interaction is intact and signed by Zend, and each draw matches its record. Interactions without a draw get no badge. Tapping the badge explains what was checked.

Check a draw yourself

  • On Sui: look up transactionId and find the Drawn event from the package in verify.package.
  • Offline: check attestation against Zend’s public key with verifyAttestation.