System Architecture
This guide provides an overview of Intuition's technical architecture and how the various components work together.
High-Level Architectureβ
Intuition is built as a multi-layer system:
Layer 1: On-Chain Primitivesβ
- Smart Contracts: Core protocol logic
- MultiVault System: Atom and Triple vaults
- Bonding Curves: Price discovery mechanisms
- ERC-1155 Tokens: Atom and Triple representations
Layer 2: Off-Chain Dataβ
- IPFS/Arweave: Decentralized storage for Atom data
- DIDs: Decentralized identifier resolution
- Metadata: Rich context and descriptions
Layer 3: Indexing & Queryβ
- GraphQL API: Efficient data querying
- PostgreSQL: Indexed on-chain data
- Real-time Subscriptions: Live updates
- Aggregation Tables: Pre-computed statistics
Layer 4: Application Layerβ
- SDK: Developer-friendly abstractions
- React Hooks: Frontend integrations
- UI Components: Reusable interface elements
Core Componentsβ
MultiVault Contractβ
Central smart contract managing:
- Atom creation and storage
- Triple creation and validation
- Vault deposits and redemptions
- Fee distribution
- Share calculations
Key functions:
createAtom(bytes atomData)
createTriple(uint256 subject, uint256 predicate, uint256 object)
deposit(uint256 vaultId, uint256 amount)
redeem(uint256 vaultId, uint256 shares)
Trust Bonding Contractβ
Manages staking and rewards:
- Epoch-based rewards
- Lock mechanisms
- Utilization tracking
- APY calculations
Atom Wardenβ
Controls Atom wallets:
- Grants agency to Atoms
- Manages Atom-owned assets
- Executes transactions on behalf of Atoms
Data Flowβ
Creating an Atomβ
- User submits atomData
- Data hashed to generate unique ID
- Check for existing Atom with same ID
- If new, mint ERC-1155 token
- Create associated vault
- Emit AtomCreated event
- Optional: Initial deposit to signal
Creating a Tripleβ
- Verify subject, predicate, object Atoms exist
- Generate Triple ID from component hashes
- Create Triple vault (for)
- Create counter-triple vault (against)
- Emit TripleCreated event
- Optional: Initial deposit to signal
Staking/Signalingβ
- User deposits tokens into vault
- Bonding curve calculates shares to mint
- Distribute fees to existing shareholders
- Mint shares to depositor
- Update vault TVL
- Emit Deposited event
- Index in GraphQL database
Event Systemβ
Key Eventsβ
event AtomCreated(uint256 indexed vaultId, bytes atomData)
event TripleCreated(uint256 indexed vaultId, uint256 subject, uint256 predicate, uint256 object)
event Deposited(uint256 indexed vaultId, address indexed depositor, uint256 amount, uint256 shares)
event Redeemed(uint256 indexed vaultId, address indexed redeemer, uint256 shares, uint256 amount)
event FeeTransfer(uint256 indexed vaultId, address indexed recipient, uint256 amount)
Event Processingβ
- Smart contract emits event
- Indexer catches event
- Parse event data
- Update PostgreSQL tables
- Trigger GraphQL subscriptions
- Notify connected clients
Security Modelβ
Access Controlβ
- Permissionless Atom/Triple creation
- Wallet-controlled deposits/redemptions
- Protocol-controlled fee distribution
- Governance-controlled parameters
Economic Securityβ
- Bonding curves prevent manipulation
- Fees deter spam and abuse
- Staking aligns incentives
- Slashing for malicious behavior (potential)
Data Integrityβ
- Deterministic Atom IDs prevent duplicates
- IPFS ensures data availability
- On-chain proofs of existence
- DIDs provide verifiable credentials
Scalability Considerationsβ
On-Chain Efficiencyβ
- Batch operations where possible
- Optimized storage patterns
- Event-based indexing
- Layer 2 compatibility planned
Off-Chain Scalingβ
- GraphQL for efficient queries
- Aggregation tables for statistics
- Caching strategies
- CDN for static content
Future Optimizationsβ
- ZK-proofs for privacy
- Optimistic rollups for throughput
- Sharding for data distribution
- Cross-chain bridges
Next Stepsβ
- Protocol Overview - Detailed contract documentation
- SDK Overview - Using the SDK
- GraphQL API - Querying the system