> ## Documentation Index
> Fetch the complete documentation index at: https://docs.magicblock.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> Automatically execute base-layer actions while Delegated

> [!TIP]
>
> **Building with an AI coding agent?** Install the MagicBlock Dev Skill to give your agent MagicBlock-specific patterns — delegation flows, Magic Actions, cranks, VRF, and more.
>
> **Hit an error?** Ask your coding agent with the skill installed, not the docs assistant. The assistant only sees the docs, so it cannot debug your code.
>
> Quick install for Claude Code:
>
> ```bash theme={null}
> npx skills add https://github.com/magicblock-labs/magicblock-dev-skill
> ```
>
> Using Cursor, Codex, Windsurf, Cline, or another agent? See the [AI Dev Skill](https://docs.magicblock.gg/pages/overview/additional-information/ai-dev-skill.md) page for all install targets.

***

### Quick Access

> [card] [Magic Actions Example](https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/magic-actions/anchor)
>
> Explore reference implementation on GitHub

> [card] [Prediction-market settlement](https://docs.magicblock.gg/pages/solutions/prediction-markets.md)
>
> Compare ER custody with post-commit base-layer payouts in a complete protocol flow.

***

### What are Magic Actions?

Magic Actions let you attach one or more call instructions that run automatically on the Solana base layer immediately after an Ephemeral Rollup
(ER) commit. Use committed state as inputs to orchestrate multi-step workflows in
a single transaction.

* **State sync**: propagate ER changes to base-layer accounts
* **Cross-program composition**: invoke other programs after commit
* **Automated workflows**: chain complex operations from one commit
* **Event-driven actions**: branch logic based on committed state

### How it works

1. Delegate accounts to an Ephemeral Rollup
2. Execute low-latency transactions on Ephemeral Rollup
3. Commit to base layer with attached instruction actions while staying delegated
4. Handlers execute automatically using the freshly committed state

***

### See also

Magic Action work along with Ephemeral Rollups.

> [card] [Ephemeral Rollups](https://docs.magicblock.gg/pages/ephemeral-rollups-ers/introduction/ephemeral-rollup.md)
>
> Delegation, Commitment & Undelegation


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.