Phoenix Wallet

Core Concepts

Understand the fundamental building blocks of Phoenix Wallet

Phoenix Wallet is built on proven financial system principles. Understanding these concepts will help you design effective integrations.

Overview

How They Work Together

The following diagram shows how Phoenix Wallet concepts relate to each other:

┌─────────────────────────────────────────────────────────────────┐
│                           TENANT                                │
│  (Isolated environment for your application)                    │
│                                                                 │
│  ┌─────────────────────────────────────────────────────────┐   │
│  │                        WALLET                            │   │
│  │  (Container for a user's balances)                       │   │
│  │                                                          │   │
│  │  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐      │   │
│  │  │   LOT #1    │  │   LOT #2    │  │   LOT #3    │      │   │
│  │  │             │  │             │  │             │      │   │
│  │  │ Amount: 100 │  │ Amount: 50  │  │ Amount: 25  │      │   │
│  │  │ Asset: USD  │  │ Asset: USD  │  │ Asset: PTS  │      │   │
│  │  │ Policy: P1  │  │ Policy: P2  │  │ Policy: P1  │      │   │
│  │  │ Expires: -- │  │ Expires: 7d │  │ Expires: 30d│      │   │
│  │  └─────────────┘  └─────────────┘  └─────────────┘      │   │
│  │                                                          │   │
│  │  Total USD: 150 (available) + reservations               │   │
│  │  Total PTS: 25  (available) + reservations               │   │
│  └─────────────────────────────────────────────────────────┘   │
│                              │                                  │
│                              ▼                                  │
│  ┌─────────────────────────────────────────────────────────┐   │
│  │                        LEDGER                            │   │
│  │  (Immutable record of all transactions)                  │   │
│  │                                                          │   │
│  │  Entry #1: Credit  LOT#1  +100 USD  (deposit)           │   │
│  │  Entry #2: Credit  LOT#2  +50  USD  (bonus)             │   │
│  │  Entry #3: Credit  LOT#3  +25  PTS  (reward)            │   │
│  │  Entry #4: Reserve LOT#1  -20  USD  (auth hold)         │   │
│  └─────────────────────────────────────────────────────────┘   │
└─────────────────────────────────────────────────────────────────┘

Data Flow

When a transaction occurs, Phoenix Wallet follows this flow:

  1. Request received - API call specifies wallet, amount, asset, and intent
  2. Policy evaluation - System finds matching lots and validates against policies
  3. Reservation (optional) - For two-phase operations, funds are held first
  4. Ledger entry - Double-entry accounting records the transaction
  5. Balance update - Wallet balances are recalculated
  6. Event emission - Webhooks notify your systems of the change

Next Steps

Start with Wallets to understand the primary container for user funds, then explore the other concepts as needed for your integration.