> For the complete documentation index, see [llms.txt](https://docs.minervachain.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.minervachain.org/reference/chain-config.md). Agents can also search and read this documentation through its [MCP server](https://docs.minervachain.org/~gitbook/mcp).

# Chain configuration

## For wallets and dapps (`wallet_addEthereumChain`)

```json
{
  "chainId": "0x12d53",
  "chainName": "Minerva",
  "nativeCurrency": { "name": "Minerva", "symbol": "MRV", "decimals": 18 },
  "rpcUrls": ["https://mainnet.minervachain.org/rpc"],
  "blockExplorerUrls": ["https://mainnet.minervachain.org/explorer"]
}
```

```json
{
  "chainId": "0x12d52",
  "chainName": "Minerva Testnet",
  "nativeCurrency": { "name": "Minerva", "symbol": "MRV", "decimals": 18 },
  "rpcUrls": ["https://testnet.minervachain.org/rpc"],
  "blockExplorerUrls": ["https://testnet.minervachain.org/explorer"]
}
```

`@minervaquantum/chain-config` exports these as `walletAddEthereumChainParams(minervaMainnet)` and `walletAddEthereumChainParams(minervaTestnet)`.

## For viem

```ts
import { defineChain } from "viem";

export const minerva = defineChain({
  id: 77139,
  name: "Minerva",
  nativeCurrency: { name: "Minerva", symbol: "MRV", decimals: 18 },
  rpcUrls: { default: { http: ["https://mainnet.minervachain.org/rpc"] } },
  blockExplorers: { default: { name: "Minerva Explorer", url: "https://mainnet.minervachain.org/explorer" } },
});
```

Reads work with any viem public client. Writes need `sendPQTransaction` from `@minervaquantum/sdk`, because viem's account types sign with ECDSA.

## For Foundry and Hardhat

Reads, calls and simulations:

```sh
cast chain-id --rpc-url https://mainnet.minervachain.org/rpc          # 77139
cast block latest --rpc-url https://mainnet.minervachain.org/rpc
cast call 0x0000000000000000000000000000000000000303 "ledger()" --rpc-url https://mainnet.minervachain.org/rpc
```

`forge script --broadcast` and Hardhat signers cannot broadcast on Minerva (they produce legacy transaction types). Build with Foundry, deploy with the SDK: see [Smart contracts on Minerva](https://docs.minervachain.org/build/smart-contracts.md).

## Genesis chain config (excerpt)

Every EIP from Homestead through London is active at block 0, plus the four Minerva forks. The emission schedule is the `blockReward` map in the genesis: `1 MRV` at block 0, halving at each multiple of 10,500,000 (`0xa037a0`), 61 entries ending in zero.

```json
{
  "chainId": 77139,
  "networkId": 77139,
  "ethash": {},
  "eip1559FBlock": 0,
  "blockReward": { "0x0": "0xde0b6b3a7640000", "0xa037a0": "0x6f05b59d3b20000", "…": "…" }
}
```

The full files: `https://mainnet.minervachain.org/genesis.json` and `https://testnet.minervachain.org/genesis.json`.

## Services

Services in the network repository select their profile with `MINERVA_NETWORK=minerva-mainnet` or `MINERVA_NETWORK=minerva-testnet` (`mainnet` and `testnet` are accepted) and read the RPC from `MINERVA_RPC_URL`.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.minervachain.org/reference/chain-config.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
