Lux Docs
Cloud

Chains

Create and deploy custom chains on Lux Network

Chains

Chains are sovereign networks within Lux that define their own rules for membership, consensus parameters, and virtual machine implementations. Every chain is validated by a dynamic set of validators who also validate the Lux Primary Network.

What Are Chains?

A chain is an independent network with its own:

  • Validator set - Choose which validators participate
  • Consensus parameters - Tune finality speed and throughput
  • Virtual machine - Run EVM, Sovereign L1 EVM, or a fully custom VM
  • Gas token - Use LUX or a custom native token
  • Access control - Public or permissioned networks

Chains do not share state or execution with other chains. They are isolated environments that leverage the Lux Primary Network for validator coordination and security.

Create a Chain

Using the CLI

Install the Lux CLI

npm install -g @luxfi/cli

Create the Chain Configuration

lux chain create my-chain

You will be prompted to select:

  • VM type: Sovereign L1 EVM (recommended), Custom
  • Chain ID: A unique EVM chain identifier
  • Gas configuration: Fee structure and limits
  • Airdrop: Optional initial token distribution

Deploy to Local Network

lux chain deploy my-chain --local

This starts a local multi-node network with your chain for testing.

Deploy to Testnet

lux chain deploy my-chain --testnet

This creates the chain on-chain and registers validators on the Lux testnet.

Deploy to Mainnet

lux chain deploy my-chain --mainnet

Sovereign L1 EVM Configuration

Sovereign L1 EVM is the most common VM for chains. It is a configurable fork of the Lux C-Chain EVM.

Genesis Configuration

{
  "config": {
    "chainId": 12345,
    "feeConfig": {
      "gasLimit": 15000000,
      "targetBlockRate": 2,
      "minBaseFee": 25000000000,
      "targetGas": 15000000,
      "baseFeeChangeDenominator": 36,
      "minBlockGasCost": 0,
      "maxBlockGasCost": 1000000,
      "blockGasCostStep": 200000
    },
    "allowFeeRecipients": false
  },
  "alloc": {
    "0xYourAddress": {
      "balance": "0x52B7D2DCC80CD2E4000000"
    }
  },
  "nonce": "0x0",
  "timestamp": "0x0",
  "gasLimit": "0xE4E1C0"
}

Key Configuration Options

OptionDescriptionDefault
chainIdUnique chain identifierRequired
gasLimitMaximum gas per block15,000,000
targetBlockRateTarget seconds between blocks2
minBaseFeeMinimum gas price in Wei25 Gwei
allowFeeRecipientsAllow validators to collect feesfalse

Precompiles

Enable optional precompiles in your chain genesis:

{
  "config": {
    "contractNativeMinterConfig": {
      "blockTimestamp": 0,
      "adminAddresses": ["0xAdminAddress"]
    },
    "contractDeployerAllowListConfig": {
      "blockTimestamp": 0,
      "adminAddresses": ["0xAdminAddress"]
    },
    "txAllowListConfig": {
      "blockTimestamp": 0,
      "adminAddresses": ["0xAdminAddress"]
    }
  }
}

Validator Management

Adding Validators

Validators validate networks, not chains. Chains live on a network and inherit the network's validator set. To add a validator to a network — whether the Lux primary network or your own sovereign L1's primary network — use AddValidatorTx (the universal "add validator to a network" transaction). The CLI helper:

lux network addValidator my-network \
  --node-id=NodeID-... \
  --stake-amount=2000 \
  --start-time="2025-01-01T00:00:00Z" \
  --end-time="2026-01-01T00:00:00Z"

Validator Requirements

RequirementValue
Primary Network stakeMinimum 2,000 LUX
Network stakeDefined by network creator
UptimeNetwork-specific (recommended 80%+)
DurationMust overlap with Primary Network validation period

Custom Virtual Machines

For use cases that require non-EVM execution, you can build a custom VM.

A Lux VM implements the block.ChainVM interface:

type ChainVM interface {
    Initialize(ctx *consensus.Context, db database.Database, genesisBytes []byte, ...) error
    BuildBlock() (Block, error)
    ParseBlock([]byte) (Block, error)
    GetBlock(ids.ID) (Block, error)
    SetPreference(ids.ID) error
    LastAccepted() (ids.ID, error)
}

Custom VMs are powerful but require careful design. For most applications, Sovereign L1 EVM with custom precompiles provides sufficient flexibility without the complexity of a fully custom VM.

Chain Architecture

┌──────────────────────────────────────────────┐
│               Primary Network                │
│  ┌──────────┬──────────┬──────────┐         │
│  │ P-Chain  │ X-Chain  │ C-Chain  │         │
│  └──────────┴──────────┴──────────┘         │
│        Validators: {A, B, C, D, E}           │
└──────────────────────────────────────────────┘
           │                    │
    ┌──────┴──────┐     ┌──────┴──────┐
    │  Chain-1   │     │  Chain-2   │
    │  EVM-based  │     │  Custom VM  │
    │  Validators:│     │  Validators:│
    │  {A, B, C}  │     │  {B, D, E}  │
    └─────────────┘     └─────────────┘

Use Cases

DeFi Chains

High-throughput chains optimized for decentralized finance with custom gas tokens and fee structures.

Gaming Networks

Low-latency chains with fast block times and permissioned validator sets for predictable performance.

Enterprise Chains

Permissioned chains with transaction allow-lists and KYC-compliant validator sets.

AI Compute

Specialized chains for decentralized AI inference and training coordination.

Further Reading

On this page