LPsLux Proposals
Consensus Systems
LP-1000

P-Chain - Core Platform Specification

Review

Core specification for the P-Chain (Platform Chain), the metadata and coordination chain of Lux Network

Category
Core
Created
2025-12-11

Abstract

LP-1000 specifies the P-Chain (Platform Chain), Lux Network's metadata and coordination blockchain. The P-Chain manages validator sets, staking operations, chain coordination, and chain creation. It operates using Lux consensus optimized for platform operations.

Motivation

A dedicated platform chain provides:

  1. Validator Management: Centralized tracking of all network validators
  2. Staking Operations: Handle staking, delegation, and rewards
  3. chain Coordination: Manage chain creation and membership
  4. Chain Creation: Enable permissionless blockchain deployment

Specification

Chain Parameters

ParameterValue
Chain IDP
VM IDplatformvm
VM Nameplatformvm
Block Time2 seconds
ConsensusLux (Linear)

Implementation

Go Package: github.com/luxfi/node/vms/platformvm

import (
    pvm "github.com/luxfi/node/vms/platformvm"
    "github.com/luxfi/node/utils/constants"
)

// VM ID constant
var PlatformVMID = constants.PlatformVMID // ids.ID{'p', 'l', 'a', 't', 'f', 'o', 'r', 'm', 'v', 'm'}

// Create P-Chain VM
factory := &pvm.Factory{}
vm, err := factory.New(logger)

Directory Structure

node/vms/platformvm/
├── block/            # Block definitions and execution
├── config/           # Chain configuration
├── reward/           # Reward calculation engine
├── signer/           # Transaction signing
├── state/            # Validator and staking state
├── txs/              # Transaction types
├── warp/             # Cross-chain messaging
├── factory.go        # VM factory
├── vm.go             # Main VM implementation
└── *_test.go         # Tests

Core Responsibilities

  1. Validator Management: Track and coordinate all network validators
  2. Staking Operations: Handle staking, delegation, and rewards
  3. chain Coordination: Manage chain creation and membership
  4. Chain Creation: Enable permissionless blockchain deployment

Transaction Types

TypeDescription
AddValidatorTxAdd a validator to the primary network
AddDelegatorTxDelegate stake to a validator
CreateChainTxCreate a new chain
CreateBlockchainTxCreate a new blockchain
AddChainValidatorTxAdd validator to chain
RemoveChainValidatorTxRemove validator from chain
TransformChainTxTransform chain to elastic chain

Staking Parameters

ParameterValue
Minimum Validator Stake2,000 LUX
Maximum Validator Stake3,000,000 LUX
Minimum Delegation25 LUX
Minimum Duration2 weeks
Maximum Duration1 year
Maximum Delegation Ratio5x validator stake

Staking Rewards

Annual Percentage Yield (APY) = f(totalStaked, supplyRemaining)

Where:
- Maximum APY: 11% (at 50% network staked)
- Minimum APY: 7% (at 80% network staked)
- Rewards decrease as total stake increases

API Endpoints

RPC Methods

MethodDescription
platform.getCurrentValidatorsGet current validator set
platform.getPendingValidatorsGet pending validators
platform.getStakeGet stake information
platform.addValidatorAdd validator transaction
platform.addDelegatorAdd delegator transaction
platform.createChainCreate chain transaction
platform.createBlockchainCreate blockchain transaction

REST Endpoints

GET  /ext/bc/P/validators/current
GET  /ext/bc/P/validators/pending
GET  /ext/bc/P/stake/{address}
POST /ext/bc/P/validators/add
POST /ext/bc/P/delegators/add
POST /ext/bc/P/chains/register
POST /ext/bc/P/blockchains/create

recursive network architecture

type chain struct {
    ID           ids.ID
    ControlKeys  []Address
    Threshold    uint32
    Blockchains  []BlockchainID
    Validators   ValidatorSet
}

chain Properties:

  • Primary Network: All validators must validate
  • chains: Subset of primary validators
  • Weight: Determines influence in consensus

UTXO Model

P-Chain uses a UTXO model for:

  • Tracking staked funds
  • Managing locked outputs
  • Handling rewards distribution
UTXO States:
1. Available → Staked (via AddValidator)
2. Staked → Locked (during validation)
3. Locked → Available + Rewards (after validation)

Consensus Integration

P-Chain uses Lux consensus (linear chain):

  • Finality: ~2 seconds
  • Byzantine fault tolerance: 80% honest stake
  • No forks or uncles

Configuration

{
  "platformvm": {
    "minValidatorStake": 2000000000000,
    "maxValidatorStake": 3000000000000000,
    "minDelegatorStake": 25000000000,
    "minStakeDuration": 1209600,
    "maxStakeDuration": 31536000,
    "rewardConfig": {
      "maxConsumptionRate": 120000,
      "minConsumptionRate": 100000,
      "mintingPeriod": 31536000,
      "supplyCap": 720000000000000000
    }
  }
}

Rationale

Design decisions for P-Chain:

  1. Separate Chain: Platform operations isolated from transaction chains
  2. UTXO Model: Simple state tracking for staking operations
  3. Linear Chain: No need for DAG structure for platform operations
  4. Quasar Integration: Compatible with quantum-safe consensus

Backwards Compatibility

LP-1000 supersedes LP-0010. Both old and new numbers resolve to this document.

Test Cases

See github.com/luxfi/node/vms/platformvm/*_test.go:

func TestAddValidatorTx(t *testing.T)
func TestAddDelegatorTx(t *testing.T)
func TestCreateChainTx(t *testing.T)
func TestCreateBlockchainTx(t *testing.T)
func TestRewardCalculation(t *testing.T)
func TestUTXOStateTransitions(t *testing.T)

Reference Implementation

Repository: github.com/luxfi/node Package: vms/platformvm Dependencies:

  • github.com/luxfi/node/vms/platformvm/state
  • github.com/luxfi/node/vms/platformvm/txs
  • github.com/luxfi/node/vms/platformvm/reward

Security Considerations

  1. Sybil Resistance: Minimum stake requirements prevent cheap validator spam
  2. Stake Locking: Validators cannot unstake during validation period
  3. Delegation Limits: 5x cap prevents excessive concentration
  4. Key Management: Validator keys must be kept secure
LPTitleRelationship
LP-0010P-Chain Platform SpecificationSuperseded by this LP
LP-1100Validator ManagementSub-specification
LP-1200Staking MechanicsSub-specification
LP-1300chain ManagementSub-specification

Copyright and related rights waived via CC0.