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

# Connect to Berachain

> Add Berachain to your wallet and switch networks.

export const addNetworkMainnet = () => {
  if (typeof window === "undefined" || !window.ethereum) {
    console.warn("[AddNetwork] No wallet detected");
    return;
  }
  const params = {
    chainId: "0x138de",
    chainName: "Berachain",
    nativeCurrency: {
      name: "BERA Token",
      symbol: "BERA",
      decimals: 18
    },
    rpcUrls: ["https://rpc.berachain.com/"],
    blockExplorerUrls: ["https://berascan.com/"]
  };
  console.log("[AddNetwork] add mainnet", params);
  window.ethereum.request({
    method: "wallet_addEthereumChain",
    params: [params]
  }).then(r => console.log("[AddNetwork] result", r)).catch(e => console.error("[AddNetwork] error", e));
};

export const addNetworkBepolia = () => {
  if (typeof window === "undefined" || !window.ethereum) {
    console.warn("[AddNetwork] No wallet detected");
    return;
  }
  const params = {
    chainId: "0x138c5",
    chainName: "Berachain Bepolia",
    nativeCurrency: {
      name: "Testnet BERA Token",
      symbol: "BERA",
      decimals: 18
    },
    rpcUrls: ["https://bepolia.rpc.berachain.com/"],
    blockExplorerUrls: ["https://testnet.berascan.com/"]
  };
  console.log("[AddNetwork] add bepolia (testnet)", params);
  window.ethereum.request({
    method: "wallet_addEthereumChain",
    params: [params]
  }).then(r => console.log("[AddNetwork] result", r)).catch(e => console.error("[AddNetwork] error", e));
};

Blockchain wallets let you access your assets on Berachain. They create and store your private keys so you can prove ownership when you trade tokens, buy NFTs, play games, and more.

## Berachain Mainnet RPC

Use these values in any wallet that supports custom RPCs. Add the network in one click, or copy from the table:

<button
  type="button"
  onClick={() => addNetworkMainnet()}
  style={{
display: "inline-flex",
alignItems: "center",
justifyContent: "center",
minWidth: "140px",
height: "44px",
padding: "0 16px",
borderRadius: "8px",
border: "2px solid #c96516",
backgroundColor: "#E17726",
color: "#1a1a1a",
fontWeight: 600,
cursor: "pointer",
}}
>
  Add Berachain
</button>

| Key                | Value                        |
| ------------------ | ---------------------------- |
| Network            | `Berachain`                  |
| RPC URL            | `https://rpc.berachain.com/` |
| Chain ID           | `80094`                      |
| Currency symbol    | `BERA`                       |
| Block explorer URL | `https://berascan.com/`      |

## Berachain Bepolia Testnet RPC

Use these values for the testnet. Add in one click, or copy from the table:

<button
  type="button"
  onClick={() => addNetworkBepolia()}
  style={{
display: "inline-flex",
alignItems: "center",
justifyContent: "center",
minWidth: "140px",
height: "44px",
padding: "0 16px",
borderRadius: "8px",
border: "2px solid #c96516",
backgroundColor: "#E17726",
color: "#1a1a1a",
fontWeight: 600,
cursor: "pointer",
}}
>
  Add Berachain Bepolia
</button>

| Key                | Value                                |
| ------------------ | ------------------------------------ |
| Network            | `Berachain Bepolia`                  |
| RPC URL            | `https://bepolia.rpc.berachain.com/` |
| Chain ID           | `80069`                              |
| Currency symbol    | `BERA`                               |
| Block explorer URL | `https://testnet.berascan.com/`      |

### Bepolia testnet dApps

| App      | URL                                                                        |
| -------- | -------------------------------------------------------------------------- |
| Hub      | [https://bepolia.hub.berachain.com](https://bepolia.hub.berachain.com)     |
| BEX      | Not publicly available on Bepolia                                          |
| Berascan | [https://testnet.berascan.com](https://testnet.berascan.com)               |
| Honey    | [https://bepolia.honey.berachain.com](https://bepolia.honey.berachain.com) |

## Supported Wallets

Any [EVM-based wallet](https://ethereum.org/en/wallets/find-wallet/) that supports custom RPCs works with Berachain. Examples:

* [MetaMask](https://metamask.io)
* [Rabby](https://rabby.io)
* [Coinbase Wallet](https://www.coinbase.com/wallet)
* [Brave Wallet](https://brave.com/wallet/)
* [Frame](https://frame.sh)
* [Gem Wallet](https://gemwallet.com/)
* [Zerion](https://zerion.io/download?utm_source=berachain)

## Set Up MetaMask With Berachain

<Note>Chrome is recommended.</Note>

<Steps>
  <Step title="Install MetaMask">
    On [metamask.io](https://metamask.io/), download the browser extension. Confirm it is from `metamask.io`.

    <Frame>
      <img src="https://mintcdn.com/berachain-422fce37/t_xR8qCqqtWXRidI/images/general/metamask-chrome-store.png?fit=max&auto=format&n=t_xR8qCqqtWXRidI&q=85&s=d68c65be0f200b8636205a1ac3199b16" alt="MetaMask extension in the Chrome Web Store" width="2848" height="1804" data-path="images/general/metamask-chrome-store.png" />
    </Frame>
  </Step>

  <Step title="Create your wallet">
    Click `Create a new wallet`. Set a password, then follow the steps to back up your recovery phrase. The phrase proves you own the wallet—store it safely.

    <Frame>
      <img src="https://mintcdn.com/berachain-422fce37/t_xR8qCqqtWXRidI/images/general/metamask-get-started.png?fit=max&auto=format&n=t_xR8qCqqtWXRidI&q=85&s=08ecf5565d04631ac26538e65e0da2e3" alt="MetaMask get started screen with create wallet option" width="2150" height="2214" data-path="images/general/metamask-get-started.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/berachain-422fce37/t_xR8qCqqtWXRidI/images/general/metamask-create-password.png?fit=max&auto=format&n=t_xR8qCqqtWXRidI&q=85&s=98fa289e59f8e2ef00ffe5b59d8d5894" alt="MetaMask password creation screen" width="2150" height="2214" data-path="images/general/metamask-create-password.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/berachain-422fce37/t_xR8qCqqtWXRidI/images/general/metamask-recovery-phrase.png?fit=max&auto=format&n=t_xR8qCqqtWXRidI&q=85&s=1bbe6d8cd37c8f090e925b86a7039ddc" alt="MetaMask recovery phrase backup screen" width="2150" height="2414" data-path="images/general/metamask-recovery-phrase.png" />
    </Frame>
  </Step>
</Steps>

## Add Berachain Network Manually

If you prefer not to use the one-click buttons above, add the network in MetaMask manually:

1. **Open the network list** — Click the drop-down in the top-left of MetaMask.

<Frame>
  <img src="https://mintcdn.com/berachain-422fce37/t_xR8qCqqtWXRidI/images/general/metamask-add-network-01.png?fit=max&auto=format&n=t_xR8qCqqtWXRidI&q=85&s=2e02b73ffef8f32d5eeb68231dd8271e" alt="MetaMask network dropdown menu" width="2150" height="2286" data-path="images/general/metamask-add-network-01.png" />
</Frame>

2. **Add network** — Click `Add network` in the modal.

<Frame>
  <img src="https://mintcdn.com/berachain-422fce37/t_xR8qCqqtWXRidI/images/general/metamask-add-network-02.png?fit=max&auto=format&n=t_xR8qCqqtWXRidI&q=85&s=17e31b976cf5537d05cef176426c38cb" alt="MetaMask add network button in modal" width="2150" height="2286" data-path="images/general/metamask-add-network-02.png" />
</Frame>

3. **Add network manually** — At the bottom of the list, click `Add network manually`.

<Frame>
  <img src="https://mintcdn.com/berachain-422fce37/t_xR8qCqqtWXRidI/images/general/metamask-add-network-03.png?fit=max&auto=format&n=t_xR8qCqqtWXRidI&q=85&s=d748c437712a80ebec41d706b8a5b50f" alt="MetaMask add a network manually option" width="2150" height="2414" data-path="images/general/metamask-add-network-03.png" />
</Frame>

4. **Enter details** — Use the values from the [Mainnet](#berachain-mainnet-rpc) or [Bepolia Testnet](#berachain-bepolia-testnet-rpc) RPC tables above.

5. **Save** — Click `Save`.

<Frame>
  <img src="https://mintcdn.com/berachain-422fce37/t_xR8qCqqtWXRidI/images/general/metamask-add-network-04.png?fit=max&auto=format&n=t_xR8qCqqtWXRidI&q=85&s=c66b459a3ef0b22f8a8e676a9aa62400" alt="MetaMask network configuration form with Berachain details" width="2150" height="2414" data-path="images/general/metamask-add-network-04.png" />
</Frame>

You should now be connected to Berachain or Berachain Bepolia.

<Frame>
  <img src="https://mintcdn.com/berachain-422fce37/t_xR8qCqqtWXRidI/images/general/metamask-testnet.png?fit=max&auto=format&n=t_xR8qCqqtWXRidI&q=85&s=0e344b0f41bc537666c06bf6ea9ac9e6" alt="MetaMask wallet connected to Berachain network" width="2150" height="2414" data-path="images/general/metamask-testnet.png" />
</Frame>
