Skip to main content

Overview

The Private Ephemeral SPL Token API allows you to build transactions with SPL tokens on MagicBlock’s Ephemeral Rollup. This API provides endpoints to manage ephemeral token accounts, deposits, withdrawals, and delegation operations.

Health & Configuration

  • Root - Check API health
  • Get Config - Retrieve API configuration settings

Setup & Initialization

Token Operations

Permission Management

Private SPL Token Flow

The typical flow for private token transfers involves the following steps:
┌─────────────────────────────────────────────────────────────────────┐
│ Step 1: Initialize Infrastructure (if not exist)                   │
├─────────────────────────────────────────────────────────────────────┤
│ • Initialize Global Vault for token mint                            │
│ • Initialize Global Vault ATA                                       │
└─────────────────────────────────────────────────────────────────────┘

┌─────────────────────────────────────────────────────────────────────┐
│ Step 2: Initialize User Accounts (if not exist)                    │
├─────────────────────────────────────────────────────────────────────┤
│ • Initialize Sender ATA                                             │
│ • Initialize Receiver ATA                                           │
│ • Initialize Sender Ephemeral ATA                                   │
│ • Initialize Receiver Ephemeral ATA                                 │
└─────────────────────────────────────────────────────────────────────┘

┌─────────────────────────────────────────────────────────────────────┐
│ Step 3: Setup Permissions                                           │
├─────────────────────────────────────────────────────────────────────┤
│ • Create Permission(s) for Ephemeral ATA                            │
│ • Delegate Permission(s)                                            │
└─────────────────────────────────────────────────────────────────────┘

┌─────────────────────────────────────────────────────────────────────┐
│ Step 4: Deposit & Delegate                                          │
├─────────────────────────────────────────────────────────────────────┤
│ • Deposit SPL tokens to Global Vault                                │
│ • Delegate Sender and Receiver Ephemeral ATA                        │
└─────────────────────────────────────────────────────────────────────┘

┌─────────────────────────────────────────────────────────────────────┐
│ Step 5: Private Transfer                                            │
├─────────────────────────────────────────────────────────────────────┤
│ • Transfer tokens between Ephemeral ATAs (Sender → Receiver)        │
└─────────────────────────────────────────────────────────────────────┘

┌─────────────────────────────────────────────────────────────────────┐
│ Step 6: Undelegate & Withdraw                                       │
├─────────────────────────────────────────────────────────────────────┤
│ • Undelegate Ephemeral ATA                                          │
│ • Withdraw SPL tokens from Ephemeral ATA                            │
└─────────────────────────────────────────────────────────────────────┘

Response Format

Transaction Responses (POST endpoints)

All successful POST responses return a transaction object with the following structure:
{
  "transaction": "base64-encoded-transaction",
  "message": "Transaction created successfully"
}

Status Responses (GET endpoints)

GET endpoints return configuration and status information specific to each endpoint.