Skip to main content

EVM Compatibility

Specter embeds a full Ethereum Virtual Machine within its Cosmos SDK application using the cosmos/evm module v1.0.0-rc2. This means any smart contract that runs on Ethereum can run on Specter — with the same Solidity code, the same tooling, and the same developer experience. The EVM is not a simulation or a compatibility shim; it is a complete execution environment that processes the same opcodes, supports the same precompiles, and follows the same gas accounting as mainnet Ethereum.

EVM Configuration

ParameterValue
EVM Modulecosmos/evm v1.0.0-rc2
EVM Chain ID (Testnet)5445
Go-Ethereum ForkSpecter-Foundation/go-ethereum v1.15.11-specter-2
Solidity Version^0.8.20
Max Code Size64 KB (increased from Ethereum's 24 KB default)
Max Transaction Gas25,000,000
Fee ModelEIP-1559 (dynamic base fee + priority fee)
Ethereum Fork LevelCancun

Custom go-ethereum Fork

Specter uses a patched version of go-ethereum (Specter-Foundation/go-ethereum v1.15.11-specter-2) that includes Cosmos-specific opcode modifications required by the cosmos/evm module. Beyond the Cosmos integration patches, the fork increases the MaxCodeSize from 24 KB to 64 KB.

Why 64 KB?

The Poseidon hash function — which is fundamental to the entire data protocol — requires an on-chain library (PoseidonT3) that compiles to approximately 55 KB of deployed bytecode. Ethereum's default limit of 24,576 bytes (24 KB, introduced in EIP-170) would reject this deployment.

Poseidon is not a typical smart contract — it is a cryptographic primitive that performs BN254 scalar field arithmetic with a specific round structure optimized for ZK circuits. The bytecode is large because it encodes the full round constant table and S-box transformations in Solidity. There is no way to meaningfully reduce its size without compromising the hash function's security properties.

Increasing MaxCodeSize to 64 KB is a targeted change that affects only deployment validation. It does not alter gas costs, execution semantics, or any other EVM behavior.

LibraryDeployed SizeStandard LimitSpecter Limit
PoseidonT3 (2-input Poseidon)~55 KB24 KB64 KB
Standard Solidity contracts< 24 KB24 KB64 KB

Solidity Toolchain

Specter's smart contracts are developed and deployed using standard Ethereum tooling:

ToolPurpose
Solidity ^0.8.20Contract language (overflow checks, custom errors, immutable variables)
FoundryDevelopment framework (forge compile, forge test, forge script, forge create)
OpenZeppelin ContractsAudited base contracts (access control, upgradability patterns, utilities)

No custom compiler or language extensions are required. Any Solidity developer can read, modify, and deploy Specter contracts using their existing toolchain.

EIP-1559 Fee Market

The feemarket module implements Ethereum's EIP-1559 dynamic fee mechanism:

Base fee adjusts dynamically based on block gas utilization. When blocks are more than 50% full, the base fee increases; when they are less than 50% full, it decreases. The base fee portion of transaction fees is burned (removed from circulating supply).

Priority fee (tip) is an optional additional fee that users include to incentivize validators to prioritize their transaction. The priority fee goes directly to the block proposer.

This mechanism provides predictable fee estimation and prevents fee spikes from sustained congestion. Users can set a maxFeePerGas and maxPriorityFeePerGas using standard Ethereum transaction types (EIP-1559 Type 2 transactions).

Precompiles

Specter supports all standard Ethereum precompiled contracts at the Cancun fork level, plus a set of Cosmos-specific precompiles from the cosmos/evm module, plus the custom ghostmint precompile.

Standard Ethereum Precompiles

AddressNamePurpose
0x01ecRecoverECDSA public key recovery
0x02SHA-256SHA-256 hash function
0x03RIPEMD-160RIPEMD-160 hash function
0x04IdentityData copy (returns input as output)
0x05ModExpModular exponentiation (big integer)
0x06ecAddBN254 elliptic curve point addition
0x07ecMulBN254 elliptic curve scalar multiplication
0x08ecPairingBN254 elliptic curve pairing check
0x09Blake2fBLAKE2b compression function
0x0aPoint EvaluationKZG point evaluation (EIP-4844)

The BN254 precompiles (0x06, 0x07, 0x08) are particularly important for Specter because Groth16 proof verification requires elliptic curve pairing operations on the BN254 curve. These precompiles make on-chain ZK proof verification gas-efficient.

Cosmos EVM Precompiles

The cosmos/evm module provides precompiles in the 0x0800–0x0807 range that allow EVM contracts to interact with Cosmos SDK modules:

Address RangePurpose
0x0800–0x0807Cosmos SDK module interactions (staking, distribution, governance, IBC from EVM)

Ghostmint Precompile

AddressNamePurpose
0x0808ghostmintNative GHOST token minting and burning from EVM contracts

The ghostmint precompile at 0x0808 is Specter's custom addition. It bridges EVM contract calls to the Cosmos x/bank module, enabling the NativeAssetHandler contract to mint GHOST tokens during reveals and burn them during commits. See the Ghostmint Precompile page for full details.

EVM-Cosmos Address Mapping

Every account on Specter has both a Cosmos bech32 address and an Ethereum hex address. They represent the same underlying account:

FormatExampleUsed By
Cosmos bech32specter19c95kr4qjnfsqldwsgen007zuv2vs3gajsasdzCosmos SDK transactions, staking, governance
Ethereum hex0x2E0B4b0Ea094d3007dae823337BfC2e314C8451DEVM transactions, MetaMask, smart contract calls

The conversion is deterministic — the same secp256k1 key pair produces both addresses. Users can interact with the chain using either format, and balances are shared between the Cosmos and EVM representations.

Developer Experience

Deploying and interacting with contracts on Specter works identically to Ethereum:

JSON-RPC compatibility. Specter exposes standard Ethereum JSON-RPC endpoints (eth_sendTransaction, eth_call, eth_getBalance, eth_estimateGas, etc.). Any Ethereum client library — ethers.js, viem, web3.js — works out of the box by pointing at the Specter RPC URL with chain ID 5445.

MetaMask and wallet support. Users can add Specter as a custom network in MetaMask or any EVM-compatible wallet using the chain ID and RPC URL. Token balances, transaction history, and contract interactions work as expected.

Contract verification. Contracts deployed on Specter can be verified using standard Solidity source verification tools. The same compiler version and optimization settings used on Ethereum apply on Specter.