Architecture Decisions

Key design choices behind the DUAL platform and when to use each pattern.

Why a Hybrid On-Chain / Off-Chain Model?

DUAL processes actions off-chain for speed and cost, then anchors cryptographic fingerprints on Ethereum for finality. This lets you achieve sub-second confirmations while retaining the security guarantees of a public blockchain.

The trade-off is a 4-hour challenge window before batches are fully settled. For most asset-tokenization use cases — event tickets, loyalty points, provenance certificates — this latency is invisible to end-users.

Optimistic Execution with ZK Fallback

By default, batches are accepted optimistically: the Sequencer publishes a Merkle root and anyone can challenge it during the fraud window. If you need instant finality — for example, a high-value real-estate transfer — you can request a ZK proof at batch submission time. The proof is verified on-chain immediately, bypassing the challenge window at a higher gas cost.

Choose optimistic mode for high-throughput, low-value flows and ZK mode when settlement speed outweighs gas savings.

EIP-712 Signed Actions

Every mutation in DUAL is an Action signed with EIP-712 typed data. This gives you:

  • Cryptographic proof of user intent without on-chain transactions
  • Human-readable signature prompts in wallets like MetaMask
  • Replay protection via nonces managed by the Sequencer

Multi-Tenancy via Organizations

Each Organization is a fully isolated workspace with its own templates, objects, API keys, and billing. This makes DUAL suitable for SaaS-style platforms where multiple brands or business units share the same infrastructure but must not see each other's data.

Within an Organization, role-based access control (Owner → Admin → Member → Viewer) governs who can create templates, mint objects, or manage billing.

Event-Sourced State

DUAL stores every action as an immutable event. Current state is derived by replaying actions, which means you get a full audit trail for free. The Event Bus API lets you subscribe to real-time action streams for analytics, compliance, or triggering downstream workflows.

When to Use Templates vs. Objects

Think of Templates as the class and Objects as the instance. Define a Template once — including its property schema, faces, and allowed actions — then mint as many Objects as you need. If you find yourself duplicating template definitions, consider using template variations instead of separate templates.

Decision Matrix

QuestionRecommendation
Need sub-second confirmation?Use optimistic mode (default)
High-value settlement?Enable ZK proof on the batch
Multiple brands on one platform?One Organization per brand
Same asset structure, different metadata?Template variations
Need a full audit log?Query the Event Bus — it's already there

Further Reading