Flashblocks are a new development on the Base L2 that allow for faster transaction confirmation times, with most pre-confirmations happening close to 200ms. Privy offers Flashblocks support on Base and Base Sepolia by default. There is nothing you need to do to enable Flashblocks support – your application automatically leverages Flashblocks pre-confirmations for faster transaction experiences. If you’d like to integrate your own Flashblocks provider instead of using Privy’s default offering, you can do so following the guide below.

0. Set up Privy in your app

To start, if you haven’t yet set up Privy, get your application on service set up with Privy’s basic functionality. Follow the linked quickstarts depending on your If using Privy’s React or Expo SDKs, install the @privy-io/chains package as well:

1. Get your Flashblocks RPC URL

Next, get your custom Flashblocks RPC URL from your own RPC provider. Most RPC providers like Quicknode, Alchemy, and Infura offer Flashblocks RPCs for Base.

2. Use your custom RPC URL for Base and/or Base Sepolia

Next, configure Privy with your custom Flashblocks RPC URL.
In addition to Privy’s React or Expo SDKs, install the @privy-io/chains and viem packages:
npm i @privy-io/chains viem
Next, use the addRpcUrlOverride method from @privy-io/chains to set your RPC URL in a viem/chains object:
import {base, baseSepolia} from 'viem/chains';
import {addRpcUrlOverride} from '@privy-io/chains';

const baseWithFlashblocks = addRpcUrlOverride(base, 'insert-flashblocks-rpc-url-for-base');
const baseSepoliaWithFlashblocks = addRpcUrlOverride(
    baseSepolia,
    'insert-flashblocks-rpc-url-for-base-sepolia'
);
Then, pass the chain representations with your custom Flashblocks RPC URLs to the PrivyProvider’s defaultChain and supportedChains property:
<PrivyProvider
    appId='your-privy-app-id'
    config={{
        ...theRestOfYourConfig,
        // Replace this with your desired default chain
        defaultChain: baseWithFlashblocks
        supportedChains: [baseWithFlashblocks, baseSepoliaWithFlashblocks, ...otherChains]
    }}
>
    {/* your app's content */}
</PrivyProvider>

3. Send transactions

That’s it! Privy will now route transactions on Base and/or Base Sepolia through the Flashblocks RPC URL you configured. Transactions should execute with near-200ms pre-confirmation times.