> For the complete documentation index, see [llms.txt](https://bubblegum-reality.gitbook.io/bubblegum-reality-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bubblegum-reality.gitbook.io/bubblegum-reality-docs/architecture/chain-and-wallets.md).

# Robinhood Chain & Wallets

## Chain parameters

Defined once in `src/lib/chain.ts` and reused everywhere.

| Field           | Value                                                |
| --------------- | ---------------------------------------------------- |
| Chain ID        | `4663` (`0x1237`)                                    |
| Name            | Robinhood Chain                                      |
| Native currency | ETH, 18 decimals                                     |
| Public RPC      | `https://rpc.mainnet.chain.robinhood.com`            |
| Explorer        | Blockscout — `https://robinhoodchain.blockscout.com` |
| WETH            | `0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73`         |
| USDG            | `0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168`         |

All addresses pass through viem's `getAddress()`, so they are checksummed at module load. A malformed constant fails immediately rather than silently mismatching later.

### Explorer helpers

```ts
import { txUrl, tokenUrl, addressUrl, shortAddress } from "@/lib/chain";

txUrl(hash);          // https://robinhoodchain.blockscout.com/tx/0x…
tokenUrl(address);    // …/token/<checksummed>
addressUrl(address);  // …/address/<checksummed>
shortAddress(address);// 0x0Bd7…AD73
```

## Connectors

`src/lib/wagmi.ts` configures wagmi with SSR enabled and two connectors:

* **Injected (EIP-1193)** — MetaMask, Robinhood Wallet, any injected provider.
* **WalletConnect v2** — requires `VITE_WALLETCONNECT_PROJECT_ID`.

No account, email, or signature is required to connect a wallet. Connecting is read-only until the user initiates a transaction.

## Network switching

`useNetwork()` (`src/hooks/use-network.ts`) drives the wrong-chain banner:

```
wallet on wrong chain
        │
        ├─▶ wallet_switchEthereumChain(0x1237)
        │        └─ error 4902 (unknown chain)
        │                └─▶ wallet_addEthereumChain(addChainParams)
        │                        └─▶ retry switch
        ▼
read chainId back from the wallet
        └─ only if it equals 4663 → clear the banner
```

Success is asserted from the wallet's reported chain ID, never from the absence of an error. Some wallets resolve the switch request while remaining on the previous chain; reading back is the only correct check.

## Onchain reads

`decimals` and `symbol` are read from the contract for **both** stock tokens and USDG. They are never assumed to be 18 or 6. A wrong decimals assumption is an off-by-10^12 error in the user's balance, which is why it is read rather than inferred.

Server-side reads use `ROBINHOOD_RPC_URL` when configured, with the public RPC as a rate-limited fallback. The status strip reports which source answered (`configured` or `public`). There is no arbitrary RPC proxy endpoint and no RPC URL is exposed to the client.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://bubblegum-reality.gitbook.io/bubblegum-reality-docs/architecture/chain-and-wallets.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
