Overview

Flashblocks enable up to 200 millisecond transaction confirmations on Base by leveraging preconfirmations, ultra-fast signals that arrive before the next block is sealed. Built for developers who demand instant UX, it’s ideal for high-frequency apps, games, and real-time interactions where waiting even a few seconds is too long. By integrating directly within Base’s infrastructure, Flashblocks enables, seamless, ultrafast and snappy user experiences without compromising security.

Integrating Flashblocks

Flashblocks is enabled for developers on Base. There are two ways you can integrate with Flashblocks data. You can either use the WebSocket API to stream real-time block updates, or use the RPC API to query the Flashblocks-aware RPC endpoint.

RPC API

Base offers the following public Flashblocks aware RPC endpoints. These are rate limited and may not be suitable for production use - we recommend using a node provider that runs Flashblocks integrated nodes. Major node providers such as Alchemy, Infura, QuickNode and dRPC have Flashblocks-aware RPCs that can be leveraged

NetworkURL
Mainnethttps://mainnet-preconf.base.org
Sepoliahttps://sepolia-preconf.base.org

The following RPC methods can return Flashblocks specific data. All standard Ethereum JSON-RPC methods are still supported as usual.

eth_getBlockByNumber

Use the pending tag to retrieve the latest Flashblock:

curl https://sepolia-preconf.base.org -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["pending",true],"id":1}'

Example Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "number": "0x1234",
    "hash": "0x...",
    "transactions": [...]
  }
}

eth_getTransactionReceipt

Use the existing receipt RPC to get preconfirmed receipts:

curl https://sepolia-preconf.base.org -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["0x..."],"id":1}'

Example Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "transactionHash": "0x...",
    "blockNumber": "0x1234",
    "status": "0x1"
  }
}

eth_getBalance

Use the pending tag to get the address balance in the latest Flashblock:

curl https://sepolia-preconf.base.org -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0x...","pending"],"id":1}'

Example Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x0234"
}

eth_getTransactionCount

Use the pending tag to get the address nonce in the latest Flashblock:

curl https://sepolia-preconf.base.org -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_getTransactionCount","params":["0x...","pending"],"id":1}'

Example Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x1b" // 27 transactions
}

eth_getTransactionByHash

Use the existing get transaction by hash RPC to get preconfirmed transactions:

curl https://sepolia-preconf.base.org -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0x..."],"id":1}'

Example Response

{
  "type": "0x2",
  "chainId": "...",
  "nonce": "...",
  ...
}

Libraries

For popular libraries, they sometimes require additional RPC support for transaction preconfirmation to work properly. We are working on adding Flashblocks support to the following libraries:

Ethers

  const providerA = new ethers.JsonRpcProvider(
    "https://sepolia-preconf.base.org"
  );

  const wallet = new ethers.Wallet(process.env.PRIVATE_KEY, providerA);

  try {
    // Create a simple transaction (sending 0.001 ETH to a random address)
    const tx = {
      to: "<SOME ADDRESS>",
      value: ethers.parseEther("0.0000001"),
    };

    // Submit transaction
    const submissionTime = new Date();
    const transaction = await wallet.sendTransaction(tx);

    console.log(`Submitting transaction at: ${submissionTime.toISOString()}`);
    console.log(`Transaction hash: ${transaction.hash}`);

    await transaction.wait(0); // Make sure to set the confirmation count to 0

    console.log("Transaction confirmed");
    const confirmationTime = new Date();
    console.log(`Transaction confirmed at: ${confirmationTime.toISOString()}`);
    console.log(`Time difference: ${confirmationTime - submissionTime}ms`);
  }

You should see the confirmation time significantly lower than the standard RPC endpoint.

Viem/Wagmi

// Create wallet client
  const account = privateKeyToAccount(`0x${process.env.PRIVATE_KEY}`);
  const walletClient = createWalletClient({
    account,
    chain: {
      id: 84532,
      name: "base-sepolia",
      network: "base-sepolia",
    },
    transport: http(
      "https://sepolia-preconf.base.org"
    ),
  });

  // Create public client for waiting
  const publicClient = createPublicClient({
    chain: {
      id: 84532,
      name: "base-sepolia",
      network: "base-sepolia",
    },
    transport: http(
      "https://sepolia-preconf.base.org"
    ),
  });

  try {
    const submissionTime = new Date();
    console.log(`Submitting transaction at: ${submissionTime.toISOString()}`);

    // Send transaction
    const hash = await walletClient.sendTransaction({
      to: "<SOME ADDRESS>",
      value: parseEther("0.0000001"),
    });
    console.log(`Transaction hash: ${hash}`);

    // Wait for transaction to be mined
    const receipt = await publicClient.waitForTransactionReceipt({ hash });
    const confirmTime = new Date();

    console.log(`Transaction mined at: ${confirmTime.toISOString()}`);
    console.log(`Time difference: ${confirmTime - submissionTime}ms`);
  } catch (error) {
    console.error("Error:", error);
  }

Support

For feedback, support or questions about Flashblocks, please don’t hesitate to contact us in the #developer-chat channel in the Base Discord.