magicblock

Build Solana programs with MagicBlock Ephemeral Rollups for sub-10ms gasless execution.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @magicblock-labs/ephemeral-rollups-sdk, @magicblock-labs/ephemeral-vrf-sdk, @coral-xyz/anchor, @solana/web3.js, ephemeral-rollups-sdk, ephemeral-vrf-sdk, anchor-lang.

What problem does it solve? Standard Solana transactions have ~400ms latency and gas fees, which blocks real-time applications like games and high-frequency trading. 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 base layer, delegate to an Ephemeral Rollup, execute fast operations, commit state, and undelegate with correct Anchor macros (#[ephemeral], #[delegate], #[commit]). - Solana Plugins: Integrate verifiable randomness (VRF), real-time price feeds, AI oracles, and crank-based scheduled automation. - Templates & References: Ready-to-use Rust program and TypeScript client templates, API reference, program IDs, validator endpoints, and troubleshooting guides. - Use Case: Build a fully on-chain multiplayer game where player actions execute in ~10ms on an Ephemeral Rollup, with VRF-driven dice rolls and a crank running the game loop every 100ms, then finalize state back to Solana. ## 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 the 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 `#[delegate]` on the delegate instruction, marking the account with the `del` constraint. On the client, send the delegate transaction on the base layer, then verify the account owner equals the delegation program ID before sending ER transactions.

How to use MagicBlock VRF for on-chain randomness in Solana games?

Add the `#[vrf]` macro alongside `#[ephemeral]`, then define a request function and a callback named `<request_fn>_callback` that receives the VrfResult. Convert the 32-byte randomness to integers for dice rolls, ranges, or weighted selections.

Why does my Ephemeral Rollup transaction fail or timeout?

ER transactions require `skipPreflight: true` in the provider or RPC call. Also verify the account is actually delegated first, wait 1-3 seconds after delegation for propagation, and use the Magic Router endpoint for automatic validator selection.

What is the difference between commit and undelegate in MagicBlock?

Commit syncs account state from the Ephemeral Rollup to Solana base layer while keeping the account delegated. Undelegate commits the final state and returns account ownership to your program, ending the ER session.

Can I run scheduled on-chain tasks with MagicBlock cranks?

Yes, use `schedule_crank` from the ephemeral-rollups-sdk to invoke a program function at fixed millisecond intervals, such as a game loop every 100ms. Stop cranks with `cancel_crank` before undelegating accounts.