Safety-First Blockchain UX
Blockchain Primitives, Standards & Protocols
Compare how different chains model ownership, transactions, and safety guarantees. Every pattern enforces one rule: the app NEVER touches private keys.
Why This Exists
A wallet notification about a "Genesis token" silently deleted an active seed phrase. No balance detection, no warning. Funds permanently inaccessible.
These patterns prevent such disasters across every chain we support.
Supported Chains
Solana
Account-based model. Runtime ownership checks. Wallet adapter patterns, transaction simulation, balance guards.
Sui
Object-centric model. Compile-time ownership via Move type system. PTB inspection, zkLogin, Kiosk marketplace.
EVM (Ethereum)
Account-based with global state. RainbowKit/wagmi patterns, EIP-712 signing, ENS resolution.
Chain Comparison
| Dimension | Solana | Sui | EVM |
|---|---|---|---|
| Data Model | Account-based (data + lamports) | Object-centric (typed ownership) | Account-based (global state tree) |
| Ownership | Runtime check (program verifies) | Compile-time (Move type system) | Runtime check (msg.sender) |
| Transactions | Single instruction focus | PTBs batch 1024 ops atomically | Single call + internal calls |
| Smart Contracts | Rust programs (stateless) | Move modules (object-native) | Solidity contracts (stateful) |
| Wallet UX | Browser extensions required | Extensions OR zkLogin (OAuth) | Extensions OR WalletConnect |
| Safety Simulation | Transaction simulation API | Dry-run with full object diff | eth_call + Tenderly/Blowfish |
| Token Standard | SPL Token / Token-2022 | Coin<T> (generic typed coin) | ERC-20 / ERC-721 / ERC-1155 |
| Finality | ~400ms (optimistic) | ~390ms (fast path) | ~12s (slot) + 2 epochs |
Primitives & Standards
Solana
Primitives
- Accounts (data + lamports)
- Programs (stateless executables)
- PDAs (program-derived addresses)
- SPL Tokens (fungible + NFTs)
Standards
Key Protocols
Sui
Primitives
- Objects (owned, shared, immutable)
- Modules (Move packages)
- PTBs (programmable tx blocks)
- Coins (typed fungibles)
Standards
Key Protocols
EVM (Ethereum)
Primitives
- Accounts (EOA + contracts)
- Storage slots (key-value)
- Events (indexed logs)
- ERC tokens (20, 721, 1155)
Standards
Key Protocols
Core Safety Rules (All Chains)
App never sees private keys
Wallet adapters handle all signing. We only know public keys.
Balance check before destruction
Block actions that would strand funds or destroy valuable objects.
Nuclear warnings for one-way ops
Multi-step confirmation with typed phrase for irreversible actions.
Asset ops are not key ops
NFT transfers and coin operations never modify seed phrases.
Safety Pattern Categories
Connection Patterns
Safe wallet connection without key exposure. Disconnect flows. zkLogin for frictionless onboarding.
Transaction Safety
Simulate transactions before signing. Show users exactly what changes in their wallet.
Destructive Operations
Nuclear warnings with multi-step confirmation for irreversible actions. Chain-agnostic primitives.
Asset Handling
Correct patterns for token/NFT/object operations. Asset ops NEVER trigger key lifecycle changes.
Object Audit
Portfolio visibility: what you own, what it is worth, what is at risk before any operation.
Chain-Agnostic Components
These components work across all chains. Import from @stackmates/ui-onchain/common
NuclearWarningDialog
Multi-gate confirmation dialog for destructive operations. Typed phrase + countdown.
TypedConfirmationInput
Input that requires typing an exact phrase to enable a destructive action.
CountdownButton
Button with a timer gate. Action only available after countdown completes.
The Safety Mindset
Blockchain transactions are irreversible. Lost funds are lost forever. This fundamentally changes how we design interfaces.
Prevention over recovery — There is no undo button.
Friction is a feature — Dangerous actions should feel dangerous.
Show, don't tell — Simulate the outcome before execution.
Never surprise — Users must understand exactly what will happen.
Architecture
UI Components: libs/app-client/ui-onchain/ — React components (common, solana, sui)
Move Contracts: libs/blockchain/sui/move/ — DePIN, identity, loyalty, governance
TS Clients: libs/infrastructure/blockchain/ — Sui/Solana clients, indexer, multi-chain registry
Solidity Contracts: libs/blockchain/evm/ — Chainlink, DePIN, StackmatesToken (planned)