Lux Docs
Chains

P-Chain (Platform)

The P-Chain manages validators, staking, and chain creation.

The P-Chain (Platform Chain) is the metadata chain of the Lux network. It coordinates validators, manages staking, handles chain creation, and tracks all blockchains deployed across the network. The P-Chain runs PlatformVM and uses linear chain consensus.

Networks, Chains, and Validators

Lux uses one consistent model end-to-end:

  • A network has validators. Validators validate networks.
  • A chain lives on a network. Chains are registered by CreateChainTx. A chain is (VM + genesis) and runs under the network's validator set — chains do not have their own validator set.
  • An L2 is a chain that lives on someone else's primary network. It has no separate validator set; it is validated by that primary network.
  • An L1 is a network with its own validators. New validators are added with AddValidatorTx issued against that L1's own primary network's P-Chain. An L1 may convert to a sovereign L1 via ConvertNetworkToL1Tx; after conversion the L1 picks its own validator-management model (PoA committee, native PoS, on-chain Solidity staking contract, etc.).
  • AddValidatorTx is the universal "add a validator to a network" transaction. The wire shape is the same whether the target network is the Lux primary network (networkID 1/2/3/1337) or a downstream sovereign L1's own primary network. The SDK wallet figures out which network to target from its connection context.

AddChainValidatorTx is legacy. It is retained for one release cycle of wire compatibility only; new code uses AddValidatorTx only.

Purpose

  • Validator Management: Adding and removing validators from networks (the primary network or any L1)
  • Staking: Delegating LUX to validators and distributing staking rewards
  • Chain Creation: Registering new chains under a network via CreateChainTx
  • L1 Validator Management: Managing sovereign-L1 validator sets via Warp messaging after ConvertNetworkToL1Tx

RPC Endpoint

https://api.lux.network/{network}/ext/bc/P

The P-Chain API uses the platform namespace with Lux-style JSON-RPC (not Ethereum JSON-RPC).

Configuration

PlatformVM is configured via JSON. Default values:

{
  "block-cache-size": 67108864,
  "tx-cache-size": 134217728,
  "checksums-enabled": false,
  "mempool-prune-frequency": "30m",
  "tx-fee": 1000,
  "create-asset-tx-fee": 1000,
  "create-network-tx-fee": 1000000,
  "create-chain-tx-fee": 1000000,
  "add-network-validator-fee": 0,
  "add-network-delegator-fee": 0
}

Fee Schedule

OperationFee (microLUX)
Base transaction1,000 (1 milliLUX)
Create asset1,000 (1 milliLUX)
Create chain1,000,000 (1 LUX)
Create blockchain1,000,000 (1 LUX)
Add network validator0
Add network delegator0

RPC Methods

Validator Operations

  • platform.getCurrentValidators -- Returns current validators for a chain
  • platform.getL1Validator -- Returns a specific L1 validator
  • platform.sampleValidators -- Samples validators from a chain
  • platform.getMinStake -- Returns minimum stake amounts
  • platform.getTotalStake -- Returns total staked amount for a chain
  • platform.getStake -- Returns staked amount for given addresses
  • platform.getAllValidatorsAt -- Returns all validators at a specific P-chain height
  • platform.getValidatorsAt -- Returns validators at a specific timestamp

Blockchain and Chain Operations

  • platform.getBlockchains -- Lists all blockchains
  • platform.getBlockchainStatus -- Returns bootstrap status of a blockchain
  • platform.getNets -- Lists chains
  • platform.getNet -- Returns chain details
  • platform.validates -- Lists blockchains validated by a chain
  • platform.validatedBy -- Returns chain that validates a blockchain

Block and Transaction Operations

  • platform.getBlock -- Returns a block by ID
  • platform.getBlockByHeight -- Returns a block by height
  • platform.getHeight -- Returns current chain height
  • platform.getProposedHeight -- Returns proposed height
  • platform.getTx -- Returns a transaction by ID
  • platform.getTxStatus -- Returns transaction status
  • platform.issueTx -- Issues a signed transaction

Balance and UTXO Operations

  • platform.getBalance -- Returns LUX balance for an address
  • platform.getUTXOs -- Returns UTXOs for given addresses (max 1024)
  • platform.getRewardUTXOs -- Returns reward UTXOs for a transaction
  • platform.getCurrentSupply -- Returns current LUX supply
  • platform.getStakingAssetID -- Returns the staking asset ID

Fee Operations

  • platform.getFeeConfig -- Returns the current fee configuration
  • platform.getFeeState -- Returns the current fee state
  • platform.getValidatorFeeConfig -- Returns validator fee configuration
  • platform.getValidatorFeeState -- Returns validator fee state

Timestamps

  • platform.getTimestamp -- Returns the P-chain timestamp

Example: Get Current Validators

curl -X POST --data '{
  "jsonrpc": "2.0",
  "method": "platform.getCurrentValidators",
  "params": {},
  "id": 1
}' -H "Content-Type: application/json" \
  https://api.lux.network/mainnet/ext/bc/P

See lps.lux.network for the relevant Lux Proposals governing this chain.

On this page