Architecture

How QR Wallet is built inside — for the curious and developers.


Tech Stack

Component
Technology

Mobile App

React Native + Expo

State Management

Zustand

Web3

viem, permissionless.js

Navigation

expo-router

Blockchain

ERC-4337 Account Abstraction

Infrastructure

Alchemy (RPC, Bundler, Paymaster)

Security

Biometric + Secure Enclave


Modular Architecture

QR Wallet is built on a modular architecture — each feature is isolated in its own module with clear layers:

modules/{feature}/
├── domain/          ← Pure business logic and types
├── infrastructure/  ← API, storage, external services
├── application/     ← State management and facades
└── ui/              ← React components (UI)

Layers

Layer
Responsibility
Example

Domain

Types, interfaces, business rules

Swap.entity.ts, StakingPool

Infrastructure

API calls and external services

SwapApi.ts, AlchemyPaymaster

Application

State, UI logic, facades

useSwapFacade.ts, SponsoredTxStore

UI

Visual components

SwapScreen.tsx, buttons, cards

Import Rule

UI never talks to Infrastructure directly — only through the Application layer. Domain is pure, with zero dependencies.


Chain Abstraction

Working with different blockchains is unified through an abstraction layer:

  • ChainRegistry — registry of all supported networks

  • ChainConfigProvider — configuration and capabilities per chain

  • TransactionService — unified TX sending (EVM, Solana, Tron)


Account Abstraction Stack

Three interfaces (IAccountProvider, IPaymaster, IBundler) abstract away the specific provider. Currently using Alchemy, but the architecture allows switching to any provider without changing business logic.


Token Registry

A single registry for all tokens in the system:

Modules get the tokens they need via flags:

  • swappable: true → Swap tokens

  • collateral: true → Borrow collateral tokens

  • borrowable: true → Borrowable tokens

  • stakable: true → Staking tokens

This eliminates duplication — token data is described once and used everywhere.


18 Languages

The app is localized in 18 languages:

EN, RU, ES, FR, HI, ID, JA, KO, MS, PT, TH, TL, TR, UR, VI, ZH, AR, BN

Last updated

Was this helpful?