Skip to content

realxreal-ai/realxreal-demo-iOS

Repository files navigation

realxreal-demo-iOS (Engineering Demo)

The "B-Side" Prototype: Deepfake-Proof Identity Verification

Note: This is the internal engineering MVP (Minimum Viable Product). It demonstrates the core Shared Memory Verification logic using a local Python server for embeddings, rather than the full production Firebase/ECIES infrastructure.


🎯 The Mission

AI-generated deepfakes are making it impossible to trust digital identities. realxreal verifies identity through something AI can't fake: Shared Memories.

Instead of biometrics (which can be cloned), we ask: "What restaurant did we go to in Denver?" The AI compares the semantic meaning of the answers, allowing for natural variation ("The Italian spot" vs "Mario's Pasta") while rejecting impostors.


🏗 Architecture (MVP)

This demo consists of two parts that must run simultaneously:

  1. iOS Client (realxreal-vibe-mvp):
  • UI: UIKit (Programmatic).
  • Pattern: MVVM-C (Coordinators).
  • Data: MockDataStore (In-memory, resets on launch).
  • Networking: Communicates with a local Python server.
  1. Verification Server (realxreal-server):
  • Framework: Python / Flask.
  • AI Model: sentence-transformers/all-MiniLM-L6-v2 (HuggingFace).
  • Function: Handles semantic cosine similarity checks and manages "Live Challenge" state polling.

🚀 Getting Started

1. Prerequisites

  • Xcode 15+
  • Python 3.9+
  • CocoaPods (if applicable, though this demo appears to use embedded frameworks).

2. Start the AI Server

The iOS app needs this server running to verify answers.

cd realxreal-server

# Install dependencies
pip install flask sentence-transformers

# Run the server
python server.py

*You should see: Running on http://0.0.0.0:5001*

3. Configure Network (Important)

Open Services.swift in Xcode.

  • If using iOS Simulator: Keep the URL as is:
private let pythonBaseURL = "http://127.0.0.1:5001"
  • If using a Physical Device: Change 127.0.0.1 to your computer's local IP address (e.g., 192.168.1.5).

4. Run the iOS App

Open realxreal-vibe-mvp.xcodeproj and run on your target.


🧪 How to Demo (The Flow)

Since this MVP uses a local mock database, here is how to simulate a full interaction:

Scenario A: The "Shared Memory" Invite

  1. Login: Tap "Get Started" -> Sign up as User A (e.g., "Alice").
  2. Create Challenge: Tap + -> Enter User B's details (e.g., "Bob").
  3. Set Question:
  • Q: "Where did we meet?"
  • A: "At the coffee shop" (This is hashed/embedded).
  1. Send: The app generates a deep link.
  2. Logout: Tap "Logout" (Top left).
  3. Login as User B: Sign in as "Bob".
  4. Simulate Link: (In a real app, you'd tap the link). In this MVP, the deep link handler logic in AppCoordinator simulates receiving the challenge.
  5. Answer: Bob types "The cafe downtown" (Semantic match!).
  6. Result: Success! Contact verified.

Scenario B: The "Live" Challenge (Push/Poll)

Used when you are on a suspicious call and need to verify someone instantly.

  1. Setup: Ensure Alice and Bob have "verified" each other via Scenario A (creates a Shared Memory link).
  2. Alice: Go to Bob's contact detail -> Type "Are you really on Zoom?" -> Tap Send Live Challenge.
  • Alice's screen enters "Polling Mode" (spinner).
  1. Server: The Python server stores the challenge ID.
  2. Bob (Simulator 2 or Logout/Login):
  • Bob receives the challenge (simulated via deep link or manual refresh in this MVP).
  • Bob taps "Yes, it's me".
  1. Alice: Her screen automatically updates to "✅ Verified!" via long-polling.

📂 Project Structure

.
├── realxreal-server/          # The Brains
│   └── server.py              # Flask app + Vector Embeddings
├── realxreal-vibe-mvp/        # The Client
│   ├── App_Entry.swift        # Entry point & Deep Link handling
│   ├── Coordinators.swift     # Navigation Flow
│   ├── Services.swift         # MockAPI + Calls to Python Server
│   ├── CactusEmbeddingManager # (Experimental) On-device inference
│   └── ViewControllers.swift  # Programmatic UI


🛠 Tech Notes & "B-Side" Quirks

  • MockDataStore: Data is not persistent. If you kill the app, users and contacts disappear.
  • Python Dependency: The app will fail gracefully (fallback to exact string match) if server.py is not running, but semantic verification will be disabled.
  • Deep Links: The SceneDelegate handles realxreal:// schemes to simulate incoming push notifications for the demo.

🔮 Future / Production Path

This MVP validates the UX and the Vector logic. The production roadmap (see main repo) moves:

  1. Python Server -> On-Device CoreML (Privacy preservation).
  2. MockDataStore -> Firebase Firestore.
  3. HTTP -> ECIES Encrypted Payloads.

Contact

Engineering: Trust-Worthy Repo: realxreal-demo-mvp

About

Secure, private, and fast deepfake detection via shared memories on iOS

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors