> ## Documentation Index
> Fetch the complete documentation index at: https://cosmos-docs-tweak-colors.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect to the Network

> This page provides general information to help you connect to the network and get started building.

export const Footnote = ({children}) => {
  return <span style={{
    fontSize: '0.8em',
    opacity: 0.75,
    display: 'block',
    marginTop: '0.5em'
  }}>
      {children}
    </span>;
};

## Chain Info

| Info                | Value    | Purpose                                     |
| ------------------- | -------- | ------------------------------------------- |
| **Cosmos Chain ID** | `4321`   | Network Identifier for Cosmos tooling       |
| **EVM Chain ID**    | `4231`   | Network identifier for EVM tooling          |
| **EVM Version**     | `Prague` | EVM hard fork compatibility version         |
| **Native Token**    | `ATOM`   | Staking / gas token                         |
| **Denom Exponent**  | `6`      | Native token has 6 decimal places (`uatom`) |

## Public Endpoints

| Endpoint            | Value                                   | Purpose                                                  |
| ------------------- | --------------------------------------- | -------------------------------------------------------- |
| **EVM JSON-RPC**    | `https://devnet-1-evmrpc.ib.skip.build` | Ethereum-compatible tools (MetaMask, Hardhat, ethers.js) |
| **EVM RPC WS**      | `wss://devnet-1-evmws.ib.skip.build`    | Streaming real-time, selective data for applications     |
| **Cosmos RPC**      | `https://devnet-1-rpc.ib.skip.build`    | Tendermint-level interactions (blocks, consensus state)  |
| **Cosmos REST API** | `https://devnet-1-lcd.ib.skip.build`    | Query Cosmos SDK modules (bank, staking, etc.)           |
| **gRPC**            | `devnet-1-grpc.ib.skip.build:443`       | High-performance Protobuf endpoint for back-ends         |

## How to Interact with the Chain

You can interact with the Gaia EVM Devnet in several different ways. This section provides a brief overview of how to setup the various environments for testing.

### Extension-Based Wallets

To test out your dApp via a web UI using an extension-based wallet, you'll need to first add the Gaia EVM Devnet to the wallet:

#### Example Setup (Recommended)

**For dApp developers**: Use an [EIP-6963](https://eips.ethereum.org/EIPS/eip-6963) compatible wallet connector\*, and `wallet_addEthereumChain` to prompt adding the network. If it already exists, the "switch network" prompt will handle it.

```javascript Add Chain Example
const chainConfig = {
  chainId: '0x1087', // 4231 in hex
  chainName: 'Cosmos-EVM-Devnet',
  nativeCurrency: {
    name: 'ATOM',
    symbol: 'ATOM',
    decimals: 6
  },
  rpcUrls: ['https://devnet-1-evmrpc.ib.skip.build'],
  blockExplorerUrls: ['https://evm-devnet-1.cloud.blockscout.com/']
};

await window.ethereum.request({
  method: 'wallet_addEthereumChain',
  params: [chainConfig]
});
```

#### Manual Setup

1. Install [Keplr](https://www.keplr.app/), [Metamask](https://metamask.io/) or [Rabby](https://rabby.io/) (Chrome/Mobile).
2. Add a custom network:
   * \[Cosmos] Chain ID: `4321`
   * \[EVM] Chain ID: `4231`
   * \[Cosmos] RPC URL: `https://devnet-1-rpc.ib.skip.build`
   * \[EVM] RPC URL: `https://devnet-1-evmrpc.ib.skip.build`
   * Chain Name: `Skip Devnet`
   * Currency Symbol: `ATOM`
   * Currency Decimals: `6`
3. Use the UI to send tokens, view balances, and interact with dApps.

<Tip>
  *Users can quickly add the network by using the [Devnet Faucet](https://faucet.cosmos.network).*
</Tip>

<Footnote>
  See the [tooling/libraries](./tooling-and-resources/testing-and-fuzzing) page for more wallet-related resources.
</Footnote>

### CLI

Using the CLI may be a great choice for one-off tasks and queries that do not require a full node. **For the EVM Devnet you need the `evmd` binary built from the [`cosmos/evm`](https://github.com/cosmos/evm) repository.**

```bash
# Option A — download a pre-built artifact once they are published
# (replace VERSION with the latest tag that contains evmd)
VERSION=v1.0.0-rc1
curl -LO "https://github.com/cosmos/evm/releases/download/${VERSION}/evmd_${VERSION}_linux_amd64.tar.gz"

tar -xzf evmd_${VERSION}_linux_amd64.tar.gz
chmod +x evmd && sudo mv evmd /usr/local/bin/

# Option B — build from source (requires Go ≥ 1.22)
git clone https://github.com/cosmos/evm.git
cd evm && make install   # installs evmd into $(go env GOPATH)/bin
```

#### Key Management & Wallet Derivation

Gaia (feature/evm) supports two different key derivation methods, each producing different address formats from the same underlying private key:

| Algorithm                   | HD Path             | Address Format     | Characteristics                                                                                                                                   |
| --------------------------- | ------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| `eth_secp256k1` *(default)* | `m/44'/60'/0'/0/0`  | `0x…` / `cosmos1…` | Uses Ethereum's derivation standard (cointype 60), full compatibility with MetaMask and EVM tooling while retaining complete Cosmos compatibility |
| `secp256k1`                 | `m/44'/118'/0'/0/0` | `cosmos1…`         | Uses Cosmos's derivation standard (cointype 118), compatible with traditional Cosmos wallets                                                      |

<Footnote>
  The `eth_secp256k1` algorithm with cointype 60 is the default, providing full EVM compatibility.
</Footnote>

**Key derivation behavior:**

* The same mnemonic phrase will produce different addresses when using different algorithms and HD paths
* When importing an existing wallet, you must use the same algorithm and derivation path that was originally used
* The EVM-compatible path (`m/44'/60'/0'/0/0`) is what most Ethereum tools expect
* You can derive both address formats from the same private key, effectively giving you two addresses for one account

**Technical difference:**

* `secp256k1`: Uses **SHA-256 → RIPEMD-160 → Bech32** hashing (traditional Cosmos/Bitcoin approach)
* `eth_secp256k1`: Uses **Keccak-256** hashing on the full uncompressed public key (64 bytes after removing the 0x04 prefix), takes the last 20 bytes of the hash, then converts those bytes to either hex (`0x...`) or bech32 format

This means the same private key produces two completely different addresses depending on the derivation method used. The `eth_secp256k1` method follows Ethereum's standard address derivation while maintaining compatibility with Cosmos bech32 addressing, effectively giving you both address formats for the same underlying account.

```bash
# Key creation examples showing different algorithms
evmd keys add mykey                        # uses eth_secp256k1 by default
evmd keys add mykey --key-type secp256k1       # explicitly uses traditional Cosmos

# When recovering, the algorithm must match what was originally used
evmd keys add recovered --recover --key-type eth_secp256k1
```

***

<AccordionGroup>
  <Accordion title="Query Examples">
    <CodeGroup>
      ```bash Query balances for a given address
      evmd q bank balances cosmos1... --node https://devnet-1-rpc.ib.skip.build:443
      ```

      ```bash Query the list of validators
      evmd q staking validators --node https://devnet-1-rpc.ib.skip.build:443
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Broadcast a Transaction">
    <CodeGroup>
      ```bash Bank Send
      evmd tx bank send cosmos1... cosmos1... 1000uatom \
        --node https://devnet-1-rpc.ib.skip.build:443 \
        --chain-id 4321 \
        --gas auto --fees 500uatom \
        --yes
      ```

      ```bash EVM Raw Transaction
      evmd tx evm raw 0x02e20180010182520894de0b295669a9fd93d5f28d9ec85e40f4cb697bae8080c0808080 \
        --node https://devnet-1-rpc.ib.skip.build:443 \
        --chain-id 4231 \
        --gas auto --fees 500uatom \
        --yes
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Generate Transaction Messages">
    You can use the `--generate-only` flag to create transaction messages without broadcasting them. This can be useful for finding the correct syntax and creating reusable transaction templates.

    ```bash Generate Only Example
    evmd tx bank send cosmos1... cosmos1... 1000uatom \
      --node https://devnet-1-rpc.ib.skip.build:443 \
      --chain-id 4321 \
      --gas auto --fees 500uatom \
      --generate-only | jq
    ```
  </Accordion>
</AccordionGroup>

### Cosmos REST Endpoint

> **Use for HTTP-based integrations**

Cosmos SDK chains expose a REST API at port `1317` by default. For the devnet:

`https://devnet-1-lcd.ib.skip.build`

Basic endpoints:

* `GET /cosmos/bank/v1beta1/balances/{address}`
* `POST /cosmos/tx/v1beta1/txs` (broadcast)

### Cosmos RPC

> **For Tendermint-level interactions**

`https://devnet-1-rpc.ib.skip.build`

### EVM JSON-RPC

> **For Ethereum-compatible tooling**

Connect your Ethereum tools to the EVM module:

```
RPC:       https://devnet-1-evmrpc.ib.skip.build
WebSocket: wss://devnet-1-evmws.ib.skip.build
Chain ID:  4321 (0x10e1)
```

Use with MetaMask, Hardhat, Foundry, or any Ethereum-compatible client.

## Connecting to the Network

### Using Remote Endpoints

The `evmd` CLI tool and other clients require a connection to the network in order to interact with the chain.

**Method 1 — configure `evmd`**

Edit `~/.evmd/config/client.toml`:

```toml title="~/.evmd/config/client.toml"
# ~/.evmd/config/client.toml
node = "https://devnet-1-rpc.ib.skip.build"
chain-id = "4321"
```

All subsequent `evmd` commands use the remote node:

```sh lines
evmd q bank balances $(evmd keys show <wallet_name> --address)
```

**Method 2 — API**

Applications typically interact with the network programmatically using the EVM JSON-RPC, in addition to the standard Cosmos GRPC/REST API.

<Footnote>
  Full API reference page coming soon
</Footnote>
