Quick Access
binary-prediction
eATA custody end to end
rewards-delegated-vrf
Base-layer post-commit payouts
spl-tokens
Non-custody transfers
Moving tokens from a client instead of on-chain? See the
Quickstart.
Two custody models
The walkthrough below covers eATA custody, with the post-commit variant in the advanced snippets.
Step-By-Step Guide
Give your program authority over an eATA, delegate it, move funds PDA-signed on the ER, then settle back to Solana:1
Add the
#[ephemeral] attribute and import the SDK helpers.2
Create the custody PDA and eATA
Own an eATA under the Ephemeral SPL Token program from your custody PDA.
3
CPI into the Ephemeral SPL Token program to delegate it to the ER.
4
Sign the transfer as the custody PDA inside the rollup.
5
Return the account to the base layer.
Custody Example
The following software packages may be required, other versions may also be compatible:Code Snippets
1. ER-aware program
Wrap#[program] with #[ephemeral] and import the SDK helpers you need.
2. Create eATA
Your program owns a state PDA (for example, aPool) that is the authority over the funds. Custody
on the ER uses an ephemeral ATA (eATA) owned by that PDA, derived from [owner, mint] under the
Ephemeral SPL Token program (SPLxh1LVZzEkX99H6rqYizhytLWPZVV296zyYDPagv2).
3. Delegate eATA
Delegate the eATA with a CPI to the Ephemeral SPL Token program (DelegateEphemeralAta,
discriminator 4).
4. PDA-signed transfer
With the eATA delegated, move tokens inside the rollup with an SPL Token CPI signed by the custody PDA viaCpiContext::new_with_signer. The signer seeds are [POOL_SEED, bump] — the program
authorizes the payout itself, with no user signature.
5. Commit & undelegate
Commit the ER state and return the account to the base layer withMagicIntentBundleBuilder.
Advanced Code Snippets
- Non-custody transfer
- Base-layer post-commit payout
If your program doesn’t custody funds — it moves tokens between two already-delegated accounts on a
user’s behalf — no PDA signer is needed. The authority is the user’s ⬆️ Back to Top
Signer, with a plain
CpiContext::new.Solana Explorer
Get insights about your transactions and accounts on Solana:Solana Explorer
Official Solana Explorer
Solscan
Explore Solana Blockchain
Solana RPC Providers
Send transactions and requests through existing RPC providers:Solana
Free Public Nodes
Helius
Free Shared Nodes
Triton
Dedicated High-Performance Nodes
Solana Validator Dashboard
Find real-time updates on Solana’s validator infrastructure:Solana Beach
Get Validator Insights
Validators App
Discover Validator Metrics
Server Status
Subscribe to Solana’s and MagicBlock’s server status:Solana Status
Subscribe to Solana Server Updates
MagicBlock Status
Subscribe to MagicBlock Server Status

