LPsLux Proposals
Consensus Systems
LP-5624

Appchain Cloud Substrate

Final

Permissionless decentralized cloud where every customer runs in its own Quasar-native appchain — GPU compute, storage, AI inference, DEX engines, and FHE priced per appchain via on-chain markets

LP-5624: Appchain Cloud Substrate

Abstract

Lux Cloud is the decentralized cloud substrate of the Lux Network. Every customer runs inside their own Quasar-native appchain, or shares one with similar-tenancy customers, executed by the QuasarGPU adapter and finalized by the Quasar certificate pipeline. Anyone can run a node by staking on P-Chain. Anyone can deploy an appchain. Resource consumption — GPU compute, storage, bandwidth, FHE bootstraps, AI inference tokens — is priced per appchain via on-chain markets and paid in native LUX or appchain-native tokens.

The unifying observation: every cloud workload is a Quasar appchain preset. There is no separate cloud stack; the same chains and the same wave-tick GPU kernel run consensus, DEX, EVM, FHE, AI inference, and customer workloads in lockstep.

Decentralization

Permissionlessness

PropertyMechanism
Anyone can run a nodestake LUX on P-Chain, register a validator key, become eligible for any appchain's validator subset
Anyone can deploy an appchainsubmit DeployAppchainTx on P-Chain with a BaseAppchainConfig; the validator subset auto-selects from the staked pool
No gatekeeper for tenancythe appchain ID space is permissionless; collisions resolve by stake-weighted priority
No central operatorevery workload runs across more than 2/3 of its appchain's validator subset; loss of any 1/3 is tolerated
Open sourcenode, adapter, EVM, FHE, and AI inference are MIT/Apache; builds are reproducible

Validator selection per appchain

Each appchain's validator subset is committed in the BaseAppchainConfig (see lp-5623):

struct BaseAppchainConfig {
    uint64_t  chain_id;
    Hash      validator_subset_root;   // P-Chain commitment
    Hash      qchain_ceremony_root;
    Hash      zchain_vk_root;
    QuasarMode mode;                   // Nova or Nebula
    uint64_t  block_time_ms;
    uint64_t  gas_limit;
};

Subset selection is deterministic from (P-Chain validator set, chain_id, epoch). Subset size is policy: a tenant may pay for a larger subset (more decentralization) or a smaller one (cheaper).

Failure-domain isolation

Cross-tenant isolation runs at the appchain boundary:

Failure modeBlast radius
Validator equivocationone appchain (signed by the validator's stake share)
GPU node crashone appchain's lane subset on that node
Network partitionpartitioned appchains; others unaffected
Smart-contract bugone appchain's contract space
FHE key compromiseone F-Chain key arena; rotated per the FHE key policy

There is no shared mutable cloud control-plane state across tenants that could fan a single failure across the customer base.

Workload classes

Every workload maps to one or more chains in the canonical chain topology.

Stateful services — database, KV, queues

Native pattern: Base appchains on Quasar.

ConceptMapping
Database table / collectiondomain component of the lane key
Row / recordH("base", chain_id, collection, record_id) lane
Read querylocal read from the owned lane (gateway routes to the owner)
Write / mutationQuasar tx in the QuasarGPU adapter
Transactiondistributed tx via per-lane cert artifacts
Realtime subscriptiontail CertOut for subscribed lanes

Throughput: Tier 2 (~100 M ops/s on a single GPU node). Finality: < 1.1 s strong; commit < 50 ms.

Stateless compute — workers, FaaS

Stateless workloads are C-Chain contracts (GPU-native EVM) deployed inside the customer's appchain. Cold start is zero — no container boot; the EVM fiber executes inside the wave-tick kernel. Function inputs and outputs are tx calldata and emitted events.

Auto-scaling: validator subset size determines compute-side capacity; the customer scales by paying for a larger subset. Read-side scaling is automatic via the gateway's lane-affinity routing.

AI inference

AI inference runs through a drain_ai service that consumes model weights from content-addressed storage and runs inference inside the QuasarGPU wave-tick kernel.

PatternAuthority
Model loading (weight hash)content-addressed; pinned by P-Chain stake
Inference dispatchC-Chain precompile call → AI-chain lane
Result attestation (proof of correct inference)A-Chain attestation
Token-billed meteringper-inference fee charged to the caller's appchain account

The inference cert lane is registered alongside the other lanes (reserved enum slot ≥ 10). Confidential inference — encrypted weights or encrypted inputs — routes through F-Chain (FheCompute service).

DEX engines — precompile-native

The DEX matching engine is a C-Chain precompile, not a contract. Order books live in lanes, match in the wave-tick kernel, and settle on X-Chain. DEX customers get sub-100 µs match latency on the same GPU process that serves their other workloads.

FHE compute — encrypted services

Encrypted workloads run on F-Chain via the drain_fhe service. Customers pay per TFHE gate evaluation plus bootstrap. Use cases: confidential token balances, private cross-chain transfer, encrypted database queries, and encrypted ML inference.

Bootstrap-key material comes from an M-Chain ceremony output into the F-Chain key arena.

Resource economics

Per-appchain markets

Each appchain has its own gas and fee curve. The customer chooses:

KnobEffect
gas_limitper-block compute budget
block_time_mslatency vs cost trade-off
validator_subset_sizeredundancy / decentralization budget
mode (Nova / Nebula)linear order vs DAG fan-out
fee_tokenLUX or appchain-native (must be exchangeable for LUX at the validator level for stake-aligned settlement)

Settlement: per-block fees split between the appchain's validator subset (compute reward) and the P-Chain global treasury (stake reward and slashing pool).

Per-resource pricing

Consumption is metered at the substrate level — there is no host-side metering. Every priced operation is a counter inside the wave-tick kernel:

ResourceCounterSettlement
EVM gasper-tx gas usedper block, in fee token
GPU compute (kernel time)service-tick count per serviceper block, in fee token
Storage (state-trie bytes)trie-node deltas per blockper block, in fee token
Bandwidthbytes egressed via gatewayper billing window
TFHE gatesper-gate counter in drain_fheper block
Bootstrapper-bootstrap counterper block
AI inference tokensper-token counter in the AI laneper inference
DEX matchesper-match in the DEX precompileper match

All counters live in the same per-tx receipt. No external billing service is involved on the hot path.

Marketplace mechanics

Validator nodes advertise their resource availability — GPU model, memory, bandwidth, TEE support — in a P-Chain registry. When a DeployAppchainTx arrives, the subset selector matches the appchain's resource requirements against advertised capacity. Oversubscription resolves via stake-weighted bidding within the selection epoch.

TEE integration

Confidential workloads run inside SGX, SEV-SNP, or TDX with quotes attested to A-Chain:

  1. The tenant deploys a confidential appchain with tee_required: true in BaseAppchainConfig.
  2. The validator subset selector restricts to TEE-capable nodes.
  3. Each node submits a TEE quote on join.
  4. Quotes verify via drain_attest and commit to achain_attestation_root[32] in QuasarRoundDescriptor.
  5. Customer contracts read the attestation root via precompile and gate sensitive operations on it.

TEE and FHE together — encrypted execution inside attested enclaves — provide defence in depth: a TEE compromise alone reveals only ciphertexts; an FHE compromise alone is irrelevant to data inside TEEs.

Hardware trust tiers are classified in lp-5610; the worker-level trust and capability records that a scheduler matches against are in lp-5626.

Migration and portability

Appchain state is portable:

StepAction
1Customer issues SnapshotAppchainTx on their appchain
2The validator subset produces a cert-protected snapshot at the named round
3The snapshot artifact is (state_root, snapshot_blob_hash, quasar_cert), committed under an M-Chain ceremony root or a B-Chain bridge root
4A new deployment — different chain ID, possibly different validator subset, possibly different cluster — imports the snapshot via RestoreAppchainTx, verifying the cert against the source epoch's QuasarRoundDescriptor
5C-Chain contract addresses, Base records, and FHE ciphertexts all preserve identity

This is lift-and-shift portability over a permissionless substrate — a stronger guarantee than typical cloud portability, because the certificate provides cryptographic continuity, not just data continuity.

Reference implementations

  • Hanzo Cloud (hanzoai/cloud) — the AI cloud (RAG, embedding providers, vector search) runs as an appchain. Each tenant gets a Base appchain for collections (knowledge bases, conversations), an AI lane for inference dispatch, and an F-Chain key arena for confidential RAG queries.
  • Lux Cloud (luxfi/cloud) — the reference cloud frontend and dashboard over QuasarGPU engine RPCs. Drives appchain deployment, monitoring, and billing through P-Chain transactions.
  • Cloud operator (luxfi/operator) — validator-node provisioning, GPU driver setup, and KMS sync. All cloud infrastructure deployment runs through the operator and the platform PaaS; developers do not touch the managed Kubernetes control planes directly.

Implementation plan

VersionScope
v0.50chain topology lands (M, F, A, B chains)
v0.51DeployAppchainTx on P-Chain; validator subset selector
v0.52per-appchain fee markets; receipt metering for GPU and storage
v0.53Base appchain template ships in the operator
v0.54F-Chain confidential appchain template
v0.55TEE-required appchain template (A-Chain attested)
v0.56AI inference appchain template
v0.57Snapshot/restore portability flow
v0.58Marketplace registry: GPU / TEE / bandwidth advertisement

Security Considerations

  1. Stake-aligned validation. Every appchain's validator subset has stake at risk via slashing on P-Chain. There is no path where a compromised cloud node profits from misbehavior — slashing exceeds any rational reward.
  2. Tenant isolation by construction. Cross-tenant leakage requires either equivocation by at least 1/3 of an appchain's validator subset (slashed) or a substrate bug (in scope for audit).
  3. Resource-accounting integrity. Counters are part of the receipt, covered by execution_root, certified by Quasar. A node cannot under-report or over-report consumption without producing an invalid execution root.
  4. Confidentiality. F-Chain (FHE) and A-Chain (TEE) provide two independent confidentiality paths. Customers needing both stack them.
  5. Snapshot replay. A snapshot artifact is bound to its QuasarRoundDescriptor; replaying it into a chain with a different pchain_validator_root fails cert verification at restore time.
  6. Bridge surface. Cross-cloud transfers go through B-Chain, which inherits all bridge security properties. There is no privileged "cloud bridge" with elevated permissions.
  7. DoS resistance. Appchains are economically rate-limited by their own gas and fee curves; one appchain saturating its subset has zero effect on other appchains running on the same physical nodes, because scheduling is lane-level.
  8. Data sovereignty. The storage layer is the Quasar state trie itself, committed in state_root — not an external object store. No off-chain data plane, no external availability assumption.

References

ResourceLocation
lp-0110Quasar consensus
lp-0130Chain topology
lp-1000P-Chain staking and validator registry
lp-4650 / lp-4655FHE runtime and GPU kernels
lp-4700Threshold MPC family
lp-5000A-Chain attestation
lp-5075TEE integration
lp-5200AI compute settlement
lp-5610Confidential-compute hardware tiers
lp-5620GPU-native EVM
lp-5622QuasarGPU adapter
lp-5623Quasar-native app stack
lp-6000B-Chain bridge
lp-7325KMS
lp-8000Z-Chain
lp-8200F-Chain FHE
lp-9000DEX engine

Copyright (C) Lux Industries Inc and Hanzo AI Inc. Licensed under the MIT License.