MagicBlock Ephemeral Rollups Skill
What this Skill is for
Use this Skill when the user asks for:
-
MagicBlock Ephemeral Rollups integration
-
Delegating/undelegating Solana accounts to ephemeral rollups
-
High-performance, low-latency transaction flows
-
Crank scheduling (recurring automated transactions)
-
VRF (Verifiable Random Function) for provable randomness
-
Dual-connection architecture (base layer + ephemeral rollup)
-
Gaming and real-time app development on Solana
Key Concepts
Ephemeral Rollups enable high-performance, low-latency transactions by temporarily delegating Solana account ownership to an ephemeral rollup. Ideal for gaming, real-time apps, and fast transaction throughput.
Delegation transfers account ownership from your program to the delegation program, allowing the ephemeral rollup to process transactions at ~10-50ms latency vs ~400ms on base layer.
Architecture:
┌─────────────────┐ delegate ┌─────────────────────┐ │ Base Layer │ ───────────────► │ Ephemeral Rollup │ │ (Solana) │ │ (MagicBlock) │ │ │ ◄─────────────── │ │ └─────────────────┘ undelegate └─────────────────────┘ ~400ms ~10-50ms
Default stack decisions (opinionated)
Programs: Anchor with ephemeral-rollups-sdk
-
Use ephemeral-rollups-sdk with Anchor features
-
Apply #[ephemeral] macro before #[program]
-
Use #[delegate] and #[commit] macros for delegation contexts
Dual Connections
-
Base layer connection for initialization and delegation
-
Ephemeral rollup connection for operations on delegated accounts
Transaction Routing
-
Delegate transactions → Base Layer
-
Operations on delegated accounts → Ephemeral Rollup
-
Undelegate/commit transactions → Ephemeral Rollup
Operating procedure (how to execute tasks)
- Classify the operation type
-
Account initialization (base layer)
-
Delegation (base layer)
-
Operations on delegated accounts (ephemeral rollup)
-
Commit state (ephemeral rollup)
-
Undelegation (ephemeral rollup)
- Pick the right connection
-
Base layer: https://api.devnet.solana.com (or mainnet)
-
Ephemeral rollup: https://devnet.magicblock.app/
- Implement with MagicBlock-specific correctness
Always be explicit about:
-
Which connection to use for each transaction
-
Delegation status checks before operations
-
PDA seeds matching between delegate call and account definition
-
Using skipPreflight: true for ER transactions
-
Waiting for state propagation after delegate/undelegate
- Add appropriate features
-
Cranks for recurring automated transactions
-
VRF for verifiable randomness in games/lotteries
- Deliverables expectations
When you implement changes, provide:
-
Exact files changed + diffs
-
Commands to install/build/test
-
Risk notes for anything touching delegation/signing/state commits
Progressive disclosure (read when needed)
-
Core delegation patterns: delegation.md
-
TypeScript frontend setup: typescript-setup.md
-
Cranks (scheduled tasks): cranks.md
-
VRF (randomness): vrf.md
-
Reference links & versions: resources.md