> ## Documentation Index
> Fetch the complete documentation index at: https://www.helius.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Confidential Fiat On-Ramp and Off-Ramp

> On-ramp and off-ramp fiat directly to and from a private balance, without revealing the asset or amount.

Users can onramp and offramp fiat balances directly to and from their confidential Solana balance.
Neither action deposits to a public balance, so neither reveals the asset or amount a user on-ramps or off-ramps.

<Tabs>
  <Tab title="On-ramp from fiat balance">
    | Field                    | Visibility  | Why                                                                   |
    | ------------------------ | ----------- | --------------------------------------------------------------------- |
    | Fiat balance and payment | Not onchain | The fiat payment is not onchain                                       |
    | Asset                    | Private     | The asset is encrypted onchain                                        |
    | Amount                   | Private     | The transferred amount is encrypted onchain                           |
    | Onramp Provider          | Public      | In a confidential Ring the wallet address of the provider is visible. |
    | User wallet address      | Public      | In a confidential Ring the user wallet address is visible onchain.    |
  </Tab>

  <Tab title="Off-ramp to fiat balance">
    | Field               | Visibility  | Why                                                                   |
    | ------------------- | ----------- | --------------------------------------------------------------------- |
    | Fiat payout         | Not onchain | The fiat payout is not onchain                                        |
    | Asset               | Private     | The asset is encrypted onchain                                        |
    | Amount              | Private     | The transferred amount is encrypted onchain                           |
    | Offramp Provider    | Public      | In a confidential Ring the wallet address of the provider is visible. |
    | User wallet address | Public      | In a confidential Ring the user wallet address is visible onchain.    |
  </Tab>
</Tabs>

<img src="https://mintcdn.com/helius/q7LsEOD0O5LZhnha/images/privacy/on-off-ramp/on-offramp-overview.svg?fit=max&auto=format&n=q7LsEOD0O5LZhnha&q=85&s=5678250e0ea926b6461a4c09e2fa5886" alt="A fiat on-ramp and off-ramp. On the fiat side, a User fiat balance box connects by a two-way arrow to an Onramp Provider and Offramp Provider circle that straddles a dashed divider between fiat and onchain. On the private onchain side, the provider connects by a two-way arrow to user wallets holding private balances." width="1560" height="500" data-path="images/privacy/on-off-ramp/on-offramp-overview.svg" />

## Prerequisites:

* The provider (for example, a centralized exchange or fiat-to-crypto processor) holds a private balance of the asset for private on-ramps and off-ramps (SOL or any SPL / Token 2022 token, such as USDC).
* Make sure the private on-ramp and off-ramp account has a sufficient balance to serve your users.
* The user has a Private Wallet.

## High-Level Flows

The fiat leg depends on your internal ledger.
Private on-ramps and off-ramps can be integrated into the Default Ring or a Custom Ring. A Custom Ring can be confidential or anonymous.

### 1. On-Ramp

An on-ramp credits a private balance: the user pays fiat offchain; the provider sends a private transfer onchain from its on-ramp account to the user's Private Wallet.

1. The user deposits fiat.
2. The provider matches the user's fiat deposit to a Private Wallet in the internal ledger.
3. The provider syncs the private balance of the on-ramp account to get its latest balance, then sends a private transfer to the user's Private Wallet.

```mermaid theme={"system"}
%%{init: {
  'theme': 'base',
  'themeVariables': {
    'lineColor':           '#FF6B35',
    'primaryTextColor':    '#737373',
    'primaryBorderColor':  '#9CA3AF',
    'actorBkg':            '#FFFFFF',
    'actorBorder':         '#9CA3AF',
    'actorTextColor':      '#737373',
    'signalColor':         '#FF6B35',
    'signalTextColor':     '#737373',
    'labelBoxBkgColor':    '#FF6B351F',
    'labelBoxBorderColor': '#FF6B35',
    'noteBkgColor':        '#F5F5F5',
    'noteTextColor':       '#737373',
    'noteBorderColor':     '#9CA3AF'
  }
}}%%
sequenceDiagram
    participant User
    participant UW as UserWallet
    participant P as Provider OnOfframp
    participant RPC as RPC
    participant SPP as Solana

    User->>P: onramp request (fiat amount)

    P->>RPC: sync the on-ramp account balance
    RPC-->>P: latest on-ramp account balance
    Note over P: build and sign the private transfer
    P->>RPC: request proof
    RPC-->>P: proof
    P->>SPP: submit private transfer (on-ramp account to user)
    SPP-->>P: confirmed, transaction hash

    UW->>RPC: sync private balance
    RPC-->>UW: confirm private balance
```

### 2. Off-Ramp

An off-ramp is a private transfer from the user's Private Wallet to the off-ramp account and an update of the provider's internal ledger to pay out fiat to the user.

The steps to complete a private off-ramp include:

1. The user syncs their private balance and sends a private transfer to the provider's off-ramp account.
2. In a confidential Ring the provider can match the transfer by the visible user wallet address. In an anonymous Ring the public ledger does not reveal sender or recipient; match via the off-ramp request in the internal ledger.

```mermaid theme={"system"}
%%{init: {
  'theme': 'base',
  'themeVariables': {
    'lineColor':           '#FF6B35',
    'primaryTextColor':    '#737373',
    'primaryBorderColor':  '#9CA3AF',
    'actorBkg':            '#FFFFFF',
    'actorBorder':         '#9CA3AF',
    'actorTextColor':      '#737373',
    'signalColor':         '#FF6B35',
    'signalTextColor':     '#737373',
    'labelBoxBkgColor':    '#FF6B351F',
    'labelBoxBorderColor': '#FF6B35',
    'noteBkgColor':        '#F5F5F5',
    'noteTextColor':       '#737373',
    'noteBorderColor':     '#9CA3AF'
  }
}}%%
sequenceDiagram
    participant User
    participant UW as UserWallet
    participant P as Provider OnOfframp
    participant RPC as RPC
    participant SPP as Solana

    User->>P: send off-ramp request (amount)

    UW->>RPC: sync private balance
    Note over UW: build and sign the private transfer
    UW->>RPC: request proof
    RPC-->>UW: proof
    UW->>SPP: submit private transfer (user to off-ramp account)
    SPP-->>UW: confirmed, transaction hash

    P->>RPC: sync off-ramp account
    RPC-->>P: off-ramp request confirmed
    Note over P: match sender to a user, credit fiat ledger
    P->>User: pay out fiat
```

### 3. On-Ramp and Off-Ramp Account

The on-ramp and off-ramp account is a private balance of the provider to serve on-ramps and off-ramps of users. It can hold SOL or any SPL or Token-2022 token you want to support, such as USDC.

Make sure the on-ramp and off-ramp account has a sufficient balance to serve your users, similar to public on-ramps and off-ramps.

#### Funding the On-Ramp and Off-Ramp Account

To fund the account's private balance, deposit from a public Solana balance (Source public wallet) to a private balance. Users only interact with the account via private transfers, so the amounts and assets transferred to the user are never exposed.

| Field                      | Visibility | Why                                                |
| -------------------------- | ---------- | -------------------------------------------------- |
| Source public wallet       | Public     | The source wallet address is visible onchain       |
| Asset                      | Public     | The asset is visible onchain                       |
| Amount                     | Public     | The deposited amount is visible onchain            |
| Destination wallet address | Public     | The destination wallet address is visible onchain  |
| Resulting private balance  | Private    | The resulting private balance is encrypted onchain |

## Start Integrating

<Card title="Native Wallet Integration" icon="wallet" href="/docs/privacy/integration/wallet">
  Add privacy support with your own key management. For providers that want to manage encryption keys and run state sync.
</Card>

<Card title="Integrate Embedded Privacy Wallet" icon="key" href="/docs/privacy/integration/embedded-wallet">
  Add privacy support to your app via REST API. For providers and apps that want to get started quickly without their own key management and state sync.
</Card>

<Card title="Integration with Custom Ring" icon="building" href="/docs/privacy/integration/enterprise">
  Add privacy support via REST API and configure a custom ring with policy and compliance controls.
  For fintechs, payroll platforms, remittance companies, neobanks, and enterprises.
</Card>

## Didn't find what you were looking for?

<Callout type="info">
  Reach out! [Telegram](https://t.me/tilo_light) | [E-Mail](mailto:sales@helius.xyz) | [Contact](https://www.helius.dev/contact)
</Callout>
