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

# EVM integration

> Autheo Chain's Ethermint EVM runtime, JSON-RPC endpoints, address formats, ERC-721 license hooks, and Ethereum tool compatibility.

Autheo Chain runs a full Ethermint EVM derived from the Cronos codebase. A single `eth_secp256k1` keypair controls both Cosmos and EVM transactions, and all standard Ethereum development tools work without modification.

## JSON-RPC endpoints

| Port | Protocol | Default binding |
| - | - | - |
| 8545 | HTTP | `127.0.0.1` |
| 8546 | WebSocket | `127.0.0.1` |

Available namespaces:

| Namespace | Exposed publicly | Notes |
| - | - | - |
| `eth` | Yes | Full Ethereum JSON-RPC |
| `net` | Yes | Network info |
| `web3` | Yes | Client version |
| `autheo` | Public RPC nodes only | Chain-specific extensions |
| `debug` | No | Internal only |
| `personal` | No | Internal only |

> [!WARNING]
>
> Never expose the `debug` or `personal` namespaces on public-facing nodes. Use a reverse proxy with TLS on ports 8545 and 8546 for any public RPC endpoint.

## Address interoperability

Each account has three equivalent representations:

| Format | Example | Use |
| - | - | - |
| Cosmos Bech32 | `autheo1abc...` | Cosmos transactions, queries |
| Validator Bech32 | `autheovaloper1abc...` | Validator operations |
| Ethereum hex (EIP-55) | `0xAbCd...` | EVM transactions, MetaMask |

```bash theme={null}
autheod keys show <key-name> --keyring-backend file           # Cosmos
autheod keys show <key-name> --bech val --keyring-backend file # Validator
autheod keys show <key-name> --bech eth --keyring-backend file # Ethereum hex
```

## ERC-721 license minting hook

When Ethermint processes an ERC-721 `Transfer` event from a recognized contract, the `x/license` EVM hook fires synchronously:

1. Identifies the contract category (Sovereign, Prime, or Core) from module parameters
2. Maps the EVM recipient address to its Cosmos Bech32 equivalent
3. Creates a `LicenseRecord` with `ISSUED` status
4. Deduplicates using `(originChain, originContract, tokenId)` — returns `ErrLicenseAlreadyMinted` for duplicates

```bash theme={null}
autheod query license params   # View current contract addresses
```

## Ethereum tool compatibility

When connecting tools to a **local node** (e.g., during development), use port `8545` and the chain ID matching your node's network. When connecting to public endpoints, use the values below.

| Tool | Local node | Mainnet (public) | Testnet (public) |
| - | - | - | - |
| MetaMask | `http://localhost:8545`, Chain ID: `2127` | `https://rpc1.autheo.com`, Chain ID: `2127` | `https://rpc.testnet.autheo.com`, Chain ID: `21270` |
| ethers.js | `new ethers.JsonRpcProvider("http://localhost:8545")` | `new ethers.JsonRpcProvider("https://rpc1.autheo.com")` | `new ethers.JsonRpcProvider("https://rpc.testnet.autheo.com")` |
| Hardhat | `chainId: 2127` | `chainId: 2127` | `chainId: 21270` |
| Foundry | `--rpc-url http://localhost:8545` | `--rpc-url https://rpc1.autheo.com` | `--rpc-url https://rpc.testnet.autheo.com` |

## Deploying contracts

> [tab] ethers.js
>
> ```javascript theme={null}
> const provider = new ethers.JsonRpcProvider("http://localhost:8545");
> const wallet = new ethers.Wallet(privateKey, provider);
> const factory = new ethers.ContractFactory(abi, bytecode, wallet);
> const contract = await factory.deploy();
> ```

> [tab] Hardhat
>
> ```javascript theme={null}
> // hardhat.config.js
> networks: {
>   autheoMainnet: {
>     url: "https://rpc1.autheo.com",
>     chainId: 2127,
>     accounts: [privateKey]
>   },
>   autheoTestnet: {
>     url: "https://rpc.testnet.autheo.com",
>     chainId: 21270,
>     accounts: [privateKey]
>   }
> }
> ```

> [tab] Foundry
>
> ```bash theme={null}
> forge create --rpc-url http://localhost:8545 \
>   --private-key <private-key> \
>   src/MyContract.sol:MyContract
> ```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.