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

# FAST RPC

The FAST RPC is a drop-in replacement for standard Ethereum RPC transaction sending endpoints that enables dapps and wallets to easily obtain preconfirmations. Users interact with the RPC like they would with a normal Ethereum node (via `eth_sendRawTransaction`, `eth_getTransactionReceipt`, etc.), but under the hood, the RPC leverages mev-commit to coordinate a decentralized network of block builders who issue and honor transaction commitments. Additionally, the RPC also provides additional methods (such as `mevcommit_getTransactionCommitments`) for advanced use cases. See [FAST RPC API](/v1.1.0/developers/fast-rpc-api) for an overview of the supported methods.

<Columns cols={2}>
  <Card title="For dApps" icon="code">
    <p><span style={{ textDecoration: 'underline' }}>[FAST RPC Usage Instructions for dApps](#usage-for-dapps)</span></p>
  </Card>

  <Card title="For Wallets" icon="wallet">
    <p><span style={{ textDecoration: 'underline' }}>[Usage Instructions for Wallets](#usage-for-wallets)</span></p> {/* Removed "FAST RPC" */}
  </Card>
</Columns>

## How it Works

Users first configure their application to use the FAST RPC. Since fees are paid through a pre-funded gas tank, the user needs to deposit some ETH before sending transactions. For basic usage, the RPC can then be used transparently as any other Ethereum RPC. In particular, `eth_sendRawTransaction` is used to send transactions to the RPC. Instead of sending the transaction to the public mempool, the RPC instead sends encrypted bids to block builders in the mev-commit network. Once all registered block builders have issued a commitment and if the next block proposer is opted in, the RPC considers the transaction as preconfirmed. From that point on, `eth_getTransactionReceipt` will return a receipt for that transaction, including a special block hash, that can be used to call `eth_getBlockByHash`. That call will in turn return a special block that only contains this specific preconfirmed transaction. This ensures compatibility with existing wallets to recognize preconfirmed transactions.

The RPC is designed to integrate easily into existing tools and infrastructure. That means after setup, basic usage is equivalent to using any regular RPC, except that transactions quickly get preconfirmed.

## Usage for dApps

This guide walks you through integrating and using the FAST RPC into your DApp to obtain preconfirmations for Ethereum transactions.

<Steps>
  <Step title="Point your application to the FAST RPC">
    To start using the FAST RPC, configure your application or wallet to use the following RPC endpoint:

    ```
    [https://fastrpc.mev-commit.xyz](https://fastrpc.mev-commit.xyz)
    ```

    This replaces your standard Ethereum RPC URL (e.g., from Infura or Alchemy).
  </Step>

  <Step title="Deposit funds in the gas tank">
    Before submitting transactions through the FAST RPC, you must fund your gas tank. This is an internal balance used to pay for preconfirmation bids. Use the following RPC method to initiate the deposit process: `mevcommit_estimateDeposit`. This call returns:

    * A deposit address (Ethereum address owned by the FAST RPC service),
    * A bid amount, representing the cost of confirming your initial deposit.
      Once you receive these details, fund the deposit address by sending a regular EOA transfer as described in the next step to the deposit address. The deposited amount will be the amount you send minus the bid amount.

    <Info>
      The deposit transaction will already be preconfirmed in the same way as all future transactions via the RPC.
    </Info>
  </Step>

  <Step title="Submit transactions">
    You can send transactions via the FAST RPC as usual using `eth_sendRawTransaction`.

    <Warning>
      Since fees are handled via mev-commit using the gas tank, the priority fee of the transaction should always be set to 0. To reflect this, the method `eth_maxPriorityFeePerGas` of the RPC therefore always returns 0.
    </Warning>
  </Step>

  <Step title="Monitor preconf status">
    To monitor the transaction status, you can as usual use the method `eth_getTransactionReceipt`. The FAST RPC will already return a receipt once a preconfirmation is obtained from all providers and if the next block proposer is opted in.

    For more detailed information, you can also call `mevcommit_getTransactionCommitments`. This method takes the transaction hash as input and returns the commitments received for that transactions on the mev-commit network. This can be useful for advanced decision making in case `eth_getTransactionReceipt` does not return a receipt, e.g., if the block proposer is not opted in or if some, but not all, providers have committed to a transaction.
  </Step>
</Steps>

### Additional Features

Some useful additional features are described here. For an overview of the full available functionality see [FAST RPC API](/v1.1.0/developers/fast-rpc-api).

#### Checking current deposit balance

The balance available in the deposit for future transactions can be checked using `mevcommit_getBalance`. Once this balance runs low, it should be topped up as in the initial deposit described above.

#### Checking for opted in validators

The RPC only issues preconfs via `eth_getTransactionReceipt` if the next block proposer is opted into mev-commit. The DApp may therefore want to adjust its strategy based on whether the next proposers are opted in or not. To enable this, the FAST RPC provides the method `mevcommit_optedInBlock`, which returns the time in seconds until the next block with a mev-commit opted-in proposer.

## Usage for Wallets

You can easily add the FAST RPC to your wallet by following the steps on the [FAST RPC website](https://www.mev-commit.xyz/fastrpc).

<Frame>
  <img src="https://mintcdn.com/primev-24/4WGjB8DW4_T8qPTp/v1.1.0/images/fastrpcsite.png?fit=max&auto=format&n=4WGjB8DW4_T8qPTp&q=85&s=b0109a4a977425451e6a1a2bdd268ce9" width="1120" height="796" data-path="v1.1.0/images/fastrpcsite.png" />
</Frame>

If you instead want to configure your wallet manually, you can do that as follows:

<Steps>
  <Step title={`Go to your wallet's "Add Custom RPC" screen and add the following details:`}>
    **Network Name:** Ethereum Mainnet
    **Default RPC URL:** `https://fastrpc.mev-commit.xyz`
    **Chain ID:** 1
    **Currency Symbol:** ETH
    **Block explorer URL:** etherscan.io

    This replaces your standard Ethereum RPC URL (e.g., from Infura or Alchemy) with the FAST RPC.
  </Step>

  <Step title="Deposit funds in the gas tank">
    Send some ETH to `0x24AFFA7b16A0771848f6CD49c2aa36506Bfc2ACf` to top up your bid balance.
  </Step>

  <Step title="Make a transaction!">
    Send some ETH, Use a dApp, Mint an NFT on mainnet with blazing speed
  </Step>
</Steps>

You're all set. Happy FAST Ethereum!
