> ## 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.

# Magic Router

> Learn how Magicblock's Magic Router accelerates transactions by routing them to the right execution environment.

<div
  style={{
position: "relative",
paddingBottom: "56.25%",
height: 0,
overflow: "hidden",
}}
>
  <iframe
    src="https://www.youtube.com/embed/Wc2XMAKtEug?si=bjitIDG7w5fY5zmK&list=PLWR_ZQiGMS8mIe1kPZe8OfHIbhvZqaM8V"
    title="Why Build with MagicBlock? Solve Scaling & UX Pain Points with Ephemeral Rollups"
    style={{
  position: "absolute",
  top: 0,
  left: 0,
  width: "100%",
  height: "100%",
}}
    frameBorder="0"
    allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
    allowFullScreen
    referrerPolicy="strict-origin-when-cross-origin"
  />
</div>

**Magicblock's Magic Router** is an dynamic transaction routing engine that accelerates transactions by intelligently deciding where they should be executed — either on **Ephemeral Rollups** or **Solana** — based on transaction metadata.

This removes the complexity of infrastructure decisions from the developer’s workflow, enabling seamless user experiences across different execution environments.

<Tip>
  {" "}

  Try out a demo of the Magic Router [here](https://router-demo.magicblock.app/)
  or explore our Pyth price data demo [here](https://pyth-template.magicblock.app/)
</Tip>

### **What Does It Do**

<img class="w-full h-auto max-w-5xl" src="https://mintcdn.com/magicblock-42/5iyVpKJBt1PkwHw4/images/magic-router.png?fit=max&auto=format&n=5iyVpKJBt1PkwHw4&q=85&s=89797c78d3081846949e7e8ad36fd3fb" width="1748" height="920" data-path="images/magic-router.png" />

The Magic Router analyzes each transaction’s metadata (e.g. writable accounts, owner, and signer) and automatically routes it to the closest dedicated endpoint:

* **Ephemeral Rollup** for fast, low-latency, zero-cost execution
* **Solana** for persistent, high-throughput execution

This eliminates the need for manual routing logic from the developer, providing significant benefits in transaction speed and development experience.

* ✅ **Simple Integration with Single Endpoint**: Just connect to a single RPC endpoint.
* ✅ **Seamless Wallet Experience**: Connect, sign, and submit — no need to know what’s happening behind the scenes.
* ✅ **Faster Confirmations**: Magic Router routes to the fastest available endpoint.

### **How It Works**

<img class="w-full h-auto max-w-5xl" src="https://mintcdn.com/magicblock-42/5iyVpKJBt1PkwHw4/images/magic-router-scenarios.png?fit=max&auto=format&n=5iyVpKJBt1PkwHw4&q=85&s=4ef8b83ef98061f9073bb11f834d7cc2" width="1800" height="970" data-path="images/magic-router-scenarios.png" />

1. **Client - Transaction Submission**\
   The dApp or user sends a transaction to the Magic Router RPC endpoint.

2. **RPC - Metadata Inspection**\
   The Magic Router inspects the transaction metadata and checks the owner of writable accounts.

3. **Validator - Smart Routing and Execution**\
   Based on the metadata, the router determines whether to send it to:

   * **Ephemeral Rollup**
   * **Solana**

   The router sends the transaction to the right execution layer. Users just sign and submit — no extra steps needed.

<Note>
  These public RPC endpoints are currently free and supported for development:
  <br /> Magic Router Devnet: [https://devnet-router.magicblock.app](https://devnet-router.magicblock.app) <br />
  Solana Devnet: [https://api.devnet.solana.com](https://api.devnet.solana.com) <br />
  ER Devnet: [https://devnet.magicblock.app](https://devnet.magicblock.app) <br />
  TEE Devnet: [https://devnet-tee.magicblock.app/](https://devnet-tee.magicblock.app/) <br />
  Find out more details{" "}
  <a href="/pages/ephemeral-rollups-ers/how-to-guide/local-development">here</a>
  .
</Note>

<CardGroup cols={2}>
  <Card title="Magic Router SDK" icon="route" href="/pages/tools/magic-router-sdk/introduction" iconType="duotone">
    Use the Magic Router SDK for seamless integration
  </Card>

  <Card title="Core Concepts" icon="lightbulb" href="/pages/tools/magic-router-sdk/core-concepts" iconType="duotone">
    Understand delegation, blockhash handling, and validator selection
  </Card>

  <Card title="Getting Started with SDK" icon="play" href="/pages/tools/magic-router-sdk/getting-started" iconType="duotone">
    Quick start guide for implementing the SDK
  </Card>

  <Card title="Why MagicBlock?" icon="wand" href="/pages/get-started/introduction/why-magicblock" iconType="duotone">
    Find out why building with MagicBlock
  </Card>

  <Card title="Ephemeral Rollup" icon="bolt" href="/pages/get-started/introduction/ephemeral-rollup" iconType="duotone">
    Learn how Ephemeral Rollups works
  </Card>

  <Card title="Use Cases" icon="star" href="/pages/get-started/use-cases/introduction" iconType="duotone">
    Discover new ideas from examples
  </Card>

  <Card title="Pyth Demo" icon="dollar-sign" href="https://pyth-template.magicblock.app/" iconType="duotone">
    Live demo of Pyth price data streams
  </Card>
</CardGroup>
