> For the complete documentation index, see [llms.txt](https://docs.oomus.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.oomus.org/mobile-app/mobile-wallet.md).

# OOMUS Wallet — Overview

> React Native 0.81.5 · Expo SDK 54 · TypeScript · iOS + Android · **v8.0**

The OOMUS Wallet mobile app allows every citizen to access their MPI sovereign identity, verify their identity via the KYC wizard, view their health passes, control data sharing, and check their insurance coverage — directly from their phone.

***

## Authentication

| Step           | Mechanism                                                           |
| -------------- | ------------------------------------------------------------------- |
| **Login**      | Phone number → SMS OTP (30 s resend)                                |
| **PIN**        | 6 digits, stored in `SecureStore` (iOS Keychain / Android Keystore) |
| **Biometrics** | Face ID (iOS) or Fingerprint (Android) — automatic background lock  |
| **Session**    | JWT access + refresh, automatic rotation via `AuthContext`          |

***

## Screens

| Screen                     | Description                                                                                                       |
| -------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| **LoginScreen**            | Phone number input, format validation, country code                                                               |
| **OtpScreen**              | 6-digit OTP code, auto-advance, automatic paste                                                                   |
| **PinScreen**              | PIN creation and verification — 6 animated fields                                                                 |
| **WalletHomeScreen**       | `SovereignCard` boarding-pass, MPI summary, quick actions (`adjustsFontSizeToFit`), recent activity               |
| **CitizenWalletScreen**    | Live WebSocket activity, `ACTION_LABELS` human labels, All · Wallet · Health · Identity filters, real-time toasts |
| **IdentityRegisterScreen** | Animated IAL card, IAL levels 0–3, unlocked services, cryptographic fingerprint, error reporting                  |
| **KycFlowScreen**          | 5-step wizard — ID card + biometric selfie, MPI score propagated in real time after completion                    |
| **PassesScreen**           | Health pass grid, filters, overlay `IAL level {n} required`, pull-to-refresh                                      |
| **PassDetailScreen**       | Pass detail + HMAC QR, temporary sharing TTL slider                                                               |
| **ConsentsScreen**         | Active consents + revocation. 2-step GrantModal                                                                   |
| **AuditScreen**            | Chronological activity log — human labels, fallback `'System event'`, category filters                            |
| **InsuranceScreen**        | Coverages, medical procedure verification, verification history                                                   |
| **SettingsScreen**         | MPI profile, security (PIN · biometrics), weekly identity recertification, language, logout                       |

***

## KYC → MPI Trust Score (v8.0)

The KYC wizard is connected to the OOMUS platform: each identity verification updates the `MpiTrustScore` in real time and automatically refreshes all mobile screens.

### Full flow

```
KycFlowScreen (step 5 — Confirmation)
  → POST /api/v1/mobile/kyc/finalize
    → kyc_trust_bridge.finalize_kyc_to_trust()
      → MpiTrustScore upsert  (signal kyc_document_verified=True, weight=25)
      → MpiVerificationEvent  (event_type="kyc_check")
    → publish_wallet_event(wallet_id, "kyc.completed", {trust_score, trust_level, upgraded})
      → WebSocket → SyncContext.syncNow() after 1.2 s
        → CitizenWalletScreen + IdentityRegisterScreen refreshed
  → OOMUS Admin GET /mpi/trust/{mpi_id} → TrustScoreCard displays the new score
```

### KYC Wizard — 5 steps

| Step                     | Content                                                     |
| ------------------------ | ----------------------------------------------------------- |
| **1 — Introduction**     | Process explanation, estimated duration, accepted documents |
| **2 — Document type**    | ID card / Passport / Residence permit selection             |
| **3 — Front/back scan**  | Guided capture, image quality validation                    |
| **4 — Biometric selfie** | Liveness check, face match score                            |
| **5 — Confirmation**     | Summary + submission + display of the new MPI score         |

***

## Real-time Citizen Wallet (v7/v8)

`CitizenWalletScreen` displays wallet activity in real time via WebSocket.

* Badge **LIVE** pulsing when the connection is active
* Animated toasts on every new received event
* `ACTION_LABELS` map (16 entries) — no technical names visible to the citizen
* Category filter: All · Wallet · Health · Identity

| Internal event    | Displayed label                 |
| ----------------- | ------------------------------- |
| `WALLET_ACCESSED` | Wallet login                    |
| `PASS_ISSUED`     | New document issued             |
| `CONSENT_GRANTED` | Authorization granted           |
| `CONSENT_REVOKED` | Authorization revoked           |
| `IDENTITY_SYNCED` | Identity synchronized           |
| `KYC_COMPLETED`   | Identity verification completed |
| *(unknown)*       | Activity                        |

***

## Sovereign Identity Register (v7/v8)

`IdentityRegisterScreen` is the citizen's sovereign identity dashboard.

| Item                          | Detail                                                                                                                 |
| ----------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| **Animated IAL card**         | Sovereign gradient, animated IAL progress bar, score 0–100                                                             |
| **IAL levels**                | IAL3 — Certified biometrics · IAL2 — Official document · IAL1 — Verified phone · IAL0 — Identity verification required |
| **Verifications**             | Phone · Validated official document · Certified biometrics · Certified identity                                        |
| **Unlocked services**         | IAL-level grid — health, payments, mobility, education                                                                 |
| **Cryptographic fingerprint** | `Digital fingerprint: <SHA-256>` — registry integrity                                                                  |
| **Reporting**                 | Modal `FlagModal` — 4 error types, tracking reference, asynchronous sending                                            |
| **Data source**               | Official Register · Campaign Register · Wallet only                                                                    |

***

## Bilingual FR / EN support

The app is fully translated into French and English.

| Component       | Detail                                                     |
| --------------- | ---------------------------------------------------------- |
| **Library**     | `i18next` + `react-i18next` + `expo-localization`          |
| **Persistence** | `AsyncStorage` — key `@oomus_language`                     |
| **Detection**   | Device system language on first launch, `fr` default       |
| **Selector**    | FR / EN modal in the Settings screen                       |
| **Coverage**    | 450+ keys — all screens, error messages, date/time formats |

***

## Offline mode

The `SyncContext` maintains a local cache of passes and identity. The app remains functional without a connection and automatically syncs when the network returns. After every WebSocket event, `syncNow()` is triggered after 1.2 s.

***

## Getting started

```bash
cd mobile
npm install

# Development
npx expo start          # Expo Go QR code
npx expo run:ios        # iOS simulator
npx expo run:android    # Android emulator

# Cloud build (EAS)
eas build --platform ios
eas build --platform android
```

Required environment variable:

```bash
EXPO_PUBLIC_API_URL=https://api.oomus.org
```

***

## Architecture

```
mobile/src/
├── i18n/
│   ├── fr.ts                    ← French translations (450+ keys)
│   ├── en.ts                    ← English translations
│   └── index.ts                 ← Init i18next + expo-localization
├── api/
│   ├── client.ts                ← Axios JWT + auto refresh
│   ├── walletApi.ts             ← passes, consents, audit
│   ├── kycApi.ts                ← KYC wizard + finalize
│   └── insuranceApi.ts          ← citizen insurance
├── auth/
│   └── AuthContext.tsx          ← JWT, PIN, biometrics
├── context/
│   └── SyncContext.tsx          ← Offline cache + WebSocket sync
├── features/
│   └── identity/
│       ├── KycFlowScreen.tsx    ← 5-step KYC wizard
│       └── types.ts             ← KycFlowStep, KycSubmitPayload…
├── navigation/
│   └── AppNavigator.tsx
├── screens/
│   ├── WalletHomeScreen.tsx
│   ├── CitizenWalletScreen.tsx
│   ├── IdentityRegisterScreen.tsx
│   ├── PassesScreen.tsx
│   ├── AuditScreen.tsx
│   ├── ConsentsScreen.tsx
│   ├── InsuranceScreen.tsx
│   └── SettingsScreen.tsx
├── components/
│   └── SovereignCard.tsx
└── theme/
    └── index.ts                 ← Color tokens + getPassConfig()
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.oomus.org/mobile-app/mobile-wallet.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
