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

# Execute Multi-Chain Transactions with One Signature

> Learn how to execute transactions across multiple blockchains with a single signature. Understand cross-chain orchestration, bridging, and unified multi-chain DeFi operations

# Execute Multi-Chain Transactions with One Signature

<Accordion title="What is multi-chain execution?">
  **Multi-chain execution** allows you to perform operations across multiple blockchains in a single, coordinated flow. Instead of manually switching networks, bridging assets, and executing separate transactions, everything happens with **one signature**.

  ```
  Traditional Multi-Chain:
  1. Sign tx on Ethereum      → Wait for confirmation
  2. Bridge to Arbitrum       → Wait 10+ minutes
  3. Switch to Arbitrum       → Sign tx
  4. Execute on Arbitrum      → Wait for confirmation
  Total: 4 signatures, multiple waits, manual coordination

  With Biconomy Multi-Chain:
  1. Sign once → Automatic execution across all chains
  Total: 1 signature, automated coordination
  ```
</Accordion>

<Accordion title="How does multi-chain execution work?">
  Biconomy's Multi-chain Execution Environment (MEE) orchestrates cross-chain operations:

  ```
  ┌──────────────────────────────────────────────────────────────┐
  │                    Supertransaction                           │
  │  ┌─────────────┐   ┌─────────────┐   ┌─────────────┐        │
  │  │ Instruction │   │ Instruction │   │ Instruction │        │
  │  │  Chain A    │──▶│   Bridge    │──▶│  Chain B    │        │
  │  └─────────────┘   └─────────────┘   └─────────────┘        │
  └──────────────────────────────────────────────────────────────┘
                             │
                      Single Signature
                             │
             ┌───────────────┼───────────────┐
             ▼               ▼               ▼
      ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
      │  Execute    │ │  Monitor    │ │  Execute    │
      │  Chain A    │ │   Bridge    │ │  Chain B    │
      └─────────────┘ └─────────────┘ └─────────────┘
  ```

  **The process:**

  1. **Build**: Define operations across chains
  2. **Quote**: Get execution cost and timing estimates
  3. **Sign**: User signs once for entire flow
  4. **Execute**: Biconomy handles coordination
  5. **Track**: Monitor progress across all chains
</Accordion>

<Accordion title="Which chains are supported?">
  Biconomy supports 70+ EVM chains including:

  | Category               | Chains                                   |
  | ---------------------- | ---------------------------------------- |
  | **L1s**                | Ethereum, BNB Chain, Avalanche, Polygon  |
  | **Optimistic Rollups** | Arbitrum, Optimism, Base, Mantle         |
  | **ZK Rollups**         | zkSync Era, Polygon zkEVM, Scroll, Linea |
  | **Alt L1s**            | Fantom, Gnosis, Celo                     |

  See [supported chains](/contracts-and-audits/supported-chains) for the complete list.

  **Cross-chain routes** are supported between any combination of these chains via integrated bridge providers.
</Accordion>

<Accordion title="How do I implement multi-chain transactions?">
  **Using AbstractJS SDK:**

  ```typescript theme={null}
  import { createMeeClient, runtime } from "@biconomy/abstractjs";

  const client = await createMeeClient({ account: smartAccount });

  // Define multi-chain operation
  const quote = await client.getQuote({
    instructions: [
      // Step 1: Swap on Ethereum
      {
        chainId: 1,
        type: "intent",
        intent: "swap",
        params: {
          from: { token: "ETH", amount: "1.0" },
          to: { token: "USDC" }
        }
      },
      // Step 2: Bridge to Base
      {
        type: "intent",
        intent: "bridge",
        params: {
          token: "USDC",
          amount: runtime.outputOf(0), // Use swap output
          fromChain: 1,
          toChain: 8453
        }
      },
      // Step 3: Deposit on Base
      {
        chainId: 8453,
        to: aavePoolBase,
        data: encodeDeposit(runtime.outputOf(1)) // Use bridge output
      }
    ],
    feeToken: { address: "USDC", chainId: 1 }
  });

  // Execute with single signature
  const result = await client.executeQuote(quote);
  console.log("Multi-chain tx:", result.hash);
  ```

  **Using Supertransaction API:**

  ```bash theme={null}
  curl -X POST "https://api.biconomy.io/v1/quote" \
    -H "x-api-key: $API_KEY" \
    -d '{
      "sender": "0x...",
      "instructions": [
        {"chainId": 1, "type": "intent", "intent": "swap", ...},
        {"type": "intent", "intent": "bridge", ...},
        {"chainId": 8453, "to": "0x...", "data": "0x..."}
      ]
    }'
  ```
</Accordion>

<Accordion title="How are bridge routes selected?">
  Biconomy aggregates multiple bridge providers to find optimal routes:

  | Provider     | Strengths                        |
  | ------------ | -------------------------------- |
  | **Across**   | Fast finality, competitive rates |
  | **Stargate** | Deep liquidity, many chains      |
  | **Connext**  | Trustless, EVM-focused           |
  | **Hop**      | L2-optimized, fast               |
  | **Synapse**  | Wide chain support               |

  **Route selection criteria:**

  * **Speed**: How quickly funds arrive
  * **Cost**: Bridge fees + gas on destination
  * **Reliability**: Historical success rate
  * **Liquidity**: Available for transaction size

  ```typescript theme={null}
  // Get quote with route details
  const quote = await client.getQuote({
    instructions: [
      { type: "intent", intent: "bridge", params: {...} }
    ]
  });

  console.log(quote.bridgeRoute);
  // {
  //   provider: "Across",
  //   estimatedTime: "2-5 minutes",
  //   fee: "0.05%",
  //   outputAmount: "999.50 USDC"
  // }
  ```
</Accordion>

<Accordion title="How do I handle gas on destination chains?">
  Multi-chain execution requires gas on each destination chain. Biconomy handles this automatically:

  **Option 1: Pay from source chain (Recommended)**

  ```typescript theme={null}
  const quote = await client.getQuote({
    instructions: [...],
    // Pay all gas from USDC on Ethereum
    feeToken: {
      address: USDC_ADDRESS,
      chainId: 1 // Ethereum
    }
  });
  // Biconomy converts and allocates gas for all chains
  ```

  **Option 2: Sponsored gas**

  ```typescript theme={null}
  const quote = await client.getQuote({
    instructions: [...],
    feeToken: { address: "sponsored" }
  });
  // Your Paymaster covers gas on all chains
  ```

  **Option 3: Pre-funded on each chain**

  ```typescript theme={null}
  // Ensure smart account has gas tokens on each chain
  // Biconomy uses local balance for each chain's gas
  ```
</Accordion>

<Accordion title="How do I track cross-chain execution?">
  Multi-chain transactions have multiple stages. Track progress with:

  ```typescript theme={null}
  const result = await client.executeQuote(quote);

  // Poll for status
  const status = await client.getExecutionStatus(result.hash);

  console.log(status);
  // {
  //   overall: "in_progress",
  //   steps: [
  //     { chain: 1, action: "swap", status: "completed", txHash: "0x..." },
  //     { chain: "bridge", action: "bridge", status: "in_progress", 
  //       estimatedCompletion: "2024-01-15T10:30:00Z" },
  //     { chain: 8453, action: "deposit", status: "pending" }
  //   ]
  // }

  // Wait for completion
  const finalResult = await client.waitForExecution(result.hash);
  console.log("All chains completed:", finalResult);
  ```

  **Webhook notifications:**

  ```typescript theme={null}
  // Configure webhook for status updates
  await client.setWebhook({
    url: "https://your-app.com/api/tx-status",
    events: ["step_completed", "execution_completed", "execution_failed"]
  });
  ```
</Accordion>

<Accordion title="What happens if one chain fails?">
  Biconomy implements safeguards for cross-chain failures:

  **Before bridging:**

  * Transaction reverts atomically
  * No funds leave source chain
  * User can retry immediately

  **After bridging (during destination execution):**

  * Funds arrive on destination chain safely
  * Destination execution is retried automatically
  * If retries fail, funds remain in user's destination account

  ```typescript theme={null}
  const result = await client.executeQuote(quote);
  const status = await client.getExecutionStatus(result.hash);

  if (status.overall === "partial_failure") {
    console.log("Failed step:", status.failedStep);
    console.log("Funds location:", status.fundsLocation);
    
    // Option 1: Retry failed step
    await client.retryStep(result.hash, status.failedStep.index);
    
    // Option 2: Manual recovery
    // Funds are in your account on destination chain
  }
  ```
</Accordion>

<Accordion title="How fast is multi-chain execution?">
  Execution time depends on the chains and bridge used:

  | Route                                   | Typical Time                             |
  | --------------------------------------- | ---------------------------------------- |
  | **Same L2 (e.g., Base → Base)**         | 2-5 seconds                              |
  | **L2 → L2 (e.g., Arbitrum → Base)**     | 1-5 minutes                              |
  | **L1 → L2 (e.g., Ethereum → Base)**     | 2-10 minutes                             |
  | **L2 → L1 (e.g., Arbitrum → Ethereum)** | 7 days (native) / 5-30 min (fast bridge) |

  **Speed vs. cost tradeoffs:**

  ```typescript theme={null}
  // Prioritize speed
  const fastQuote = await client.getQuote({
    instructions: [...],
    preferences: { priority: "speed" }
  });

  // Prioritize cost
  const cheapQuote = await client.getQuote({
    instructions: [...],
    preferences: { priority: "cost" }
  });
  ```
</Accordion>

<Accordion title="What are real-world multi-chain examples?">
  **Example 1: Cross-Chain Yield Farming**

  ```typescript theme={null}
  // Move funds from Ethereum to higher-yield farm on Base
  const instructions = [
    // Withdraw from Aave on Ethereum
    {
      chainId: 1,
      to: aaveEth,
      data: encodeWithdraw(usdc, maxAmount)
    },
    // Bridge to Base
    {
      type: "intent",
      intent: "bridge",
      params: { token: "USDC", fromChain: 1, toChain: 8453 }
    },
    // Deposit to higher-yield protocol on Base
    {
      chainId: 8453,
      to: yieldProtocol,
      data: encodeDeposit(runtime.outputOf(1))
    }
  ];
  ```

  **Example 2: Cross-Chain NFT Purchase**

  ```typescript theme={null}
  // Use ETH on Arbitrum to buy NFT listed on Base
  const instructions = [
    // Swap ETH to USDC on Arbitrum
    {
      chainId: 42161,
      type: "intent",
      intent: "swap",
      params: { from: "ETH", to: "USDC", amount: "0.5" }
    },
    // Bridge USDC to Base
    {
      type: "intent",
      intent: "bridge",
      params: { token: "USDC", fromChain: 42161, toChain: 8453 }
    },
    // Buy NFT on Base
    {
      chainId: 8453,
      to: nftMarketplace,
      data: encodeBuy(nftAddress, tokenId),
      value: runtime.outputOf(1)
    }
  ];
  ```

  **Example 3: Multi-Chain Portfolio Rebalancing**

  ```typescript theme={null}
  // Consolidate assets from multiple chains
  const instructions = [
    // Withdraw from Polygon
    { chainId: 137, to: protocolA, data: encodeWithdraw() },
    { type: "intent", intent: "bridge", params: { fromChain: 137, toChain: 1 } },
    
    // Withdraw from Arbitrum
    { chainId: 42161, to: protocolB, data: encodeWithdraw() },
    { type: "intent", intent: "bridge", params: { fromChain: 42161, toChain: 1 } },
    
    // Consolidated deposit on Ethereum
    { chainId: 1, to: mainVault, data: encodeDeposit(totalAmount) }
  ];
  ```
</Accordion>

***

## Continue learning

<CardGroup cols={2}>
  <Card title="Onchain Orchestration" icon="diagram-project" href="/faq/onchain-orchestration">
    Deep dive into orchestration
  </Card>

  <Card title="Batched Transactions" icon="layer-group" href="/faq/batched-transactions-evm">
    Combine operations efficiently
  </Card>
</CardGroup>
