CloudSketch AI Logo
FeaturesTemplatesPricingEnterpriseAboutContactLog in
🌙☀️
Log inStart free
Home/Templates/Blockchain & Web3

⛓️ Blockchain & Web3 · Database ERD

Crypto Wallet and Holdings Schema

Tables for a crypto portfolio app: users, wallets on different chains, tokens, balances and transaction history.

More Blockchain & Web3 templates

Drawing diagram…

What this diagram shows

  • One user can link wallets on many chains
  • Balances are stored per wallet and token
  • Each transaction records its chain hash for lookup

Prompt used

Database for a portfolio tracker: users own wallets; each wallet is on a chain; tokens belong to a chain; balances link wallet and token with an amount; transactions belong to a wallet and record hash, token, amount, direction and block time.

Mermaid code
erDiagram
  APP_USER ||--o{ WALLET : owns
  CHAIN ||--o{ WALLET : "hosts"
  CHAIN ||--o{ TOKEN : "issues"
  WALLET ||--o{ BALANCE : holds
  TOKEN ||--o{ BALANCE : "held as"
  WALLET ||--o{ CHAIN_TX : records
  TOKEN ||--o{ CHAIN_TX : moves
  APP_USER {
    int id PK
    string email
  }
  CHAIN {
    int id PK
    string name
    int chain_id
  }
  WALLET {
    int id PK
    int user_id FK
    int chain_ref FK
    string address
  }
  TOKEN {
    int id PK
    int chain_ref FK
    string symbol
    string contract_address
    int decimals
  }
  BALANCE {
    int id PK
    int wallet_id FK
    int token_id FK
    decimal amount
  }
  CHAIN_TX {
    int id PK
    int wallet_id FK
    int token_id FK
    string tx_hash
    decimal amount
    string direction
    datetime block_time
  }

Related templates

C4 ArchitectureProBlockchain & Web3

Crypto Exchange Architecture

The main parts of a centralised crypto exchange: a matching engine, wallets split between hot and cold storage, deposits and withdrawals, and compliance checks.

SequenceBlockchain & Web3

Crypto Withdrawal Sequence

How an exchange processes a crypto withdrawal safely: balance hold, 2FA, risk and address screening, signing, broadcast and confirmations.

C4 ArchitectureProBlockchain & Web3

NFT Marketplace

How an NFT marketplace works: listings signed off-chain, metadata on IPFS, and sales settled by a marketplace smart contract.

FlowchartBlockchain & Web3

Smart Contract Upgrade Process

How a team safely upgrades a smart contract behind a proxy: audit, testnet rehearsal, multi-signature approval and a timelock before the change goes live.

State MachineBlockchain & Web3

Blockchain Transaction States

The states a blockchain transaction goes through from signing to final confirmation, including replacement and dropped transactions.

NetworkBlockchain & Web3

Hot and Cold Wallet Custody

How a custodian separates internet-connected hot wallets from offline cold storage, with signing hardware and an air-gapped transfer process.