magicblock

Implement Solana programs with MagicBlock Ephemeral Rollups for low-latency gasless execution.

6|20|Updated Mar 14, 2026
One-click install
npx skills add https://github.com/andresdefi/cryptoskills --skill magicblock-andresdefi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: magicblock
Source: https://github.com/andresdefi/cryptoskills/tree/main/skills/magicblock
Command: npx skills add https://github.com/andresdefi/cryptoskills --skill magicblock-andresdefi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Building real-time applications on Solana is constrained by ~400ms block times and per-transaction gas fees, making use cases like on-chain games and high-frequency interactions impractical. This Skill provides the patterns, SDKs, and templates to delegate accounts to MagicBlock Ephemeral Rollups for sub-10ms, gasless execution while keeping full composability with Solana. ## Core Features & Use Cases - Delegation Lifecycle: Initialize accounts on Solana, delegate them to an Ephemeral Rollup, execute fast operations, commit state, and undelegate back to the base layer using the #[ephemeral], #[delegate], and #[commit] Anchor macros. - Solana Plugins: Integrate verifiable randomness (VRF), real-time price feeds, AI oracles, and privacy via Intel TDX Trusted Execution Environments. - Crank Automation: Schedule recurring on-chain function calls at fixed millisecond intervals for game loops, countdowns, and resource generation. - Use Case: Build a fully on-chain multiplayer game where player actions execute in under 10ms on an Ephemeral Rollup, VRF provides provably fair dice rolls, and final game state commits back to Solana mainnet. ## Quick Start Use the magicblock skill to scaffold an Anchor counter program with delegation and a TypeScript client that delegates the account, increments it on an Ephemeral Rollup, and undelegates it back to Solana devnet.

Frequently Asked Questions about magicblock

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I delegate a Solana account to a MagicBlock Ephemeral Rollup?

Add the #[ephemeral] macro to your Anchor program and mark the account with the del constraint in a Delegate context, then call the delegate instruction from the base layer. Verify delegation by checking that the account owner equals the delegation program ID DELeGGvXpWV2fqJUhqcF5ZSYMS4JTLjteaAMARRSaeSh.

How do I send transactions to a MagicBlock Ephemeral Rollup from TypeScript?

Create a separate Connection to the ER endpoint such as https://devnet-router.magicblock.app and build an AnchorProvider with skipPreflight set to true. Send all operations on delegated accounts through this ER provider, never through the base layer connection.

What is the difference between commit and undelegate in Ephemeral Rollups?

Commit syncs the current ER state back to the Solana base layer while keeping the account delegated for continued fast execution. Undelegate commits the final state and returns account ownership to your program, ending ER execution for that account.

Why is my Ephemeral Rollup transaction failing or timing out?

Most ER transaction failures come from missing skipPreflight: true, sending to the wrong layer, or operating on an account before delegation propagates. Verify delegation status first, wait 1-3 seconds after delegating, and use the Magic Router endpoint for automatic validator selection.

How do I get verifiable randomness on Solana with MagicBlock VRF?

Add the #[vrf] macro alongside #[ephemeral], define a request function, and implement a callback named <request_fn>_callback that receives the VrfResult. The callback delivers 32 bytes of randomness you can convert to numbers, ranges, or weighted selections.

What are the limitations of MagicBlock Ephemeral Rollups?

Delegated accounts cannot be used in base-layer transactions until undelegated, and you cannot mix base-layer and ER operations in one transaction. Mainnet endpoints are not yet generally available, so current development targets Solana devnet.