skill_skill
- Shell
4
GitHub Stars
6
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill magicblock-labs/magicblock-dev-skill --skill skill- cranks.md2.8 KB
- delegation.md3.7 KB
- resources.md1.7 KB
- SKILL.md3.9 KB
- typescript-setup.md3.9 KB
- vrf.md2.9 KB
Overview
This skill describes MagicBlock Ephemeral Rollups development patterns for Solana, focusing on delegation flows, dual-connection architecture, cranks, VRF, and TypeScript/Anchor integration. It explains how to get high-throughput, low-latency transactions for gaming and real-time apps by temporarily delegating account ownership to an ephemeral rollup. The guidance is opinionated and practical, with concrete defaults for stacks and runtime behavior.
How this skill works
Ephemeral rollups let you delegate Solana accounts to a MagicBlock rollup so operations run at ~10–50ms instead of the base layer ~400ms. Use a dual-connection approach: a base-layer connection for initialization and delegation operations, and an ephemeral-rollup connection for actions on delegated accounts, commits, and undelegation. Patterns include explicit delegation checks, PDA seed alignment, skipPreflight for ER transactions, cranks for scheduled tasks, and VRF for provable randomness.
When to use it
- Building high-performance multiplayer games or real-time financial apps that need low-latency state updates
- When you need bursty, high-throughput transactions that would be slow on the Solana base layer
- Implementing recurring automated workflows (cranks) that must run reliably on a schedule
- Integrating provable randomness (VRF) for fair in-game events, lotteries, or randomness-dependent logic
- When you can accept temporary delegation of account authority to a trusted rollup runtime
Best practices
- Always choose the connection based on operation type: base-layer for delegation/init, ER for on-delegate ops and commits
- Verify delegation status and PDA seeds before sending operations to the rollup to avoid mismatches
- Use skipPreflight: true for ER transactions and wait for state propagation after delegate/undelegate
- Keep delegation lifecycles explicit: delegate → operate → commit → undelegate, with clear retry/reconciliation rules
- Provide clear deliverables: changed files + diffs, build/test commands, and risk notes for delegation/signing changes
Example use cases
- Multiplayer battle game where player account updates need sub-50ms latency for responsive interactions
- Real-time order matching or market-making that requires high transaction throughput
- Scheduled in-game reward distribution using cranks to run automated payouts
- Provably fair loot drops or lottery draws using VRF integrated with the rollup
- Migration flow: initialize account on base layer, delegate for live play, then commit and undelegate for settlement
FAQ
Yes. Use Anchor with ephemeral-rollups-sdk and apply macros like #[ephemeral], #[delegate], and #[commit] where appropriate.
Which RPC endpoints should I use?
Use the base-layer RPC (e.g., https://api.devnet.solana.com or mainnet endpoints) for delegation/init and the ephemeral-rollup endpoint (e.g., https://devnet.magicblock.app/) for delegated operations.