LPsLux Proposals
Consensus Systems
LP-5623

Quasar-Native App Stack

Final

Gateway lane-affinity routing, native Base appchains on Quasar consensus, and MPC/KMS as Quasar certificate lanes

LP-5623: Quasar-Native App Stack

Abstract

This LP extends the Quasar architecture across three production surfaces:

  1. Gateway — lane-affinity sticky routing pins users to the validator subset that owns their lanes, eliminating cross-node round trips on the read hot path.
  2. Base — application backends become native Quasar appchains: each Base instance is a Quasar round preset with its own chain_id, validator subset, and per-tenant lanes; realtime subscriptions tail Quasar's CertOut ring.
  3. MPC + KMS — the MPC engine (CGGMP21, FROST, Pulsar-general) and KMS plug in as additional QuasarCertLane variants, sharing the same wave-tick scheduler, GPU verifier, and replay-proof subject binding.

The unifying observation: every cryptographic primitive gets a cert_lane slot. Adding a new primitive — Falcon, SLH-DSA, a novel threshold scheme — costs one enum value plus one verifier function. The wire ABI never breaks, because QuasarCertIngress addresses artifacts by (offset, len) indirection.

Gateway lane-affinity pinning

Routing function

Sticky-session routing extends naturally:

gpu_id        = H(user_lane_id) mod num_gpus
gateway_route = gpu_owner_of(gpu_id)

user_lane_id is the dominant lane key for that user — typically:

user_lane_id = H("acct", user_id)              // balance + nonce dominates
user_lane_id = H("trader", user_id)            // for DEX users
user_lane_id = H("collection", coll_id, owner) // for Base apps

The gateway maintains a route table keyed by lane_id and consults it on every request. Reads from owned lanes are local; writes that span lanes degrade to a distributed transaction via fragment roots.

Properties

  • Consistency: the same user_lane_id always maps to the same node within an epoch.
  • Smooth rotation: an epoch boundary reshuffles ownership per pchain_validator_root; the gateway picks up the new map atomically.
  • Bounded reshuffle: adding or removing a node relocates only 1/n of users — the consistent-hash property.
  • Cross-lane writes: the gateway issues a distributed transaction via the CertLane mechanism; fragment roots aggregate into one certificate.

Where lane affinity belongs

In the gateway, not in Quasar core. Quasar exposes lane_id → gpu_id as a deterministic function; gateway, Base, MPC, and KMS all consume it.

gateway/
  src/lane_affinity.rs       // route table + epoch-rotation hook
  src/quasar_client.rs       // calls into the QuasarGPU engine

Native Base appchains on Quasar

Base is already lane-shaped, per collection and per record. Wiring it onto Quasar:

Base conceptQuasar mapping
Collectiondomain component of the lane key
Record idH("base", chain_id, collection, record_id) lane
Read querylocal read from the owned lane (gateway routes to the owner)
Write / mutationQuasar tx executed in the QuasarGPU adapter
Schema migrationadmin-precompile tx (writes a schema lane)
Realtime subscriptiongateway tails CertOut for the lane keys the user subscribed to
Auth (Hanzo IAM)precompile reads the tenant identity root from QuasarRoundDescriptor.pchain_validator_root

Appchain as a Quasar round preset

Each Base instance is a Quasar chain preset:

struct BaseAppchainConfig {
    uint64_t chain_id;                // unique per tenant
    Hash     validator_subset_root;   // P-Chain commitment to its validators
    Hash     qchain_ceremony_root;    // Q-Chain Pulsar DKG root
    Hash     zchain_vk_root;          // Z-Chain Groth16 verifying-key root
    QuasarMode mode;                  // Nova=0 (typical) / Nebula=1 (high fan-out)
    uint64_t  block_time_ms;
    uint64_t  gas_limit;
};

Cross-chain messages go through the same per-lane certificate infrastructure. The appchain inherits Quasar finality and GPU execution for free.

Three-layer stack

┌──────────────────────────────────────────────────┐
│  Base                                            │
│   collections, queries, realtime subscriptions   │
│   (IAM-native)                                   │
├──────────────────────────────────────────────────┤
│  QuasarGPU adapter                               │
│   exec + Block-STM + roots                       │
├──────────────────────────────────────────────────┤
│  Quasar consensus                                │
│   ordering + cert lanes (BLS / Pulsar / MLDSA-G16)│
└──────────────────────────────────────────────────┘

Realtime subscriptions

Base's realtime subscription system maps to: tail CertOut for the lanes the user subscribed to, push to the user's WebSocket or SSE connection. The gateway already owns the lane → user mapping via sticky routing, so the fan-out is local.

client.subscribe("collection/users", filter)
  ↓ gateway pins user
gateway.subscribe(lane = H("collection", chain, "users"))
  ↓ tails QuasarRoundResult / CertOut for that lane
client receives lane events as they finalize

The user gets sub-100 ms latency on local reads and strong Quasar finality on writes — the audit guarantee a regulated venue needs.

MPC and KMS as Quasar certificate lanes

MPC (M-Chain in the chain topology)

The MPC engine runs CGGMP21, FROST, Corona-general, and TFHE ceremonies. Each ceremony round maps to a Quasar round:

MPC conceptQuasar mapping
Ceremony participantsvalidator subset (per pchain_validator_root)
Ceremony roundQuasar wave tick
Partial signature shareQuasarCertIngress artifact, cert_lane = MPCShare
Aggregate outputQuasarCert emitted on CertOut
Round graph (interactive ceremonies)Nebula DAG mode

Each ceremony type registers its verifier as a new QuasarCertLane variant. The enum is open-ended:

enum class QuasarCertLane : uint8_t {
    BLS              = 0,
    Pulsar           = 1,
    MLDSAGroth16     = 2,
    CGGMP21Share     = 3,
    FROSTShare       = 4,
    CoronaGeneral    = 5,
    TFHEKeyShare     = 6,
};

The verifier reads the artifact via (artifact_offset, artifact_len) and runs the ceremony-specific check. Ceremony semantics are defined in lp-4700 and lp-7100; this LP adds the GPU lane-verifier wiring.

KMS

KMS operations — key generation, rotate, derive, sign — become Quasar transactions executed via the QuasarGPU adapter:

KMS operationQuasar transaction shape
kms_keygentx that mints a key into a tenant-scoped lane
kms_rotatetx that bumps the version on the key lane
kms_deriveread-only tx (no MVCC version bump)
kms_signtx that calls a precompile and emits a CertLane artifact
kms_revoketx that flips a status bit on the key lane

Key material lives in lanes scoped by tenant:

key_lane = H("kms", tenant_id, key_id)

Access control runs as a precompile that reads the IAM identity root from QuasarRoundDescriptor.pchain_validator_root. The KMS gets:

  • Quasar finality on every key state change — no race conditions.
  • Audit root binding key history to the chain.
  • GPU-batched signature verification through drain_cert_lane.
  • PQ safety via the Quasar triple certificate when KMS sign requests cross-validate against post-quantum lanes.

Unified API surface

All three layers consume one Quasar API:

namespace quasar::gpu {

// execution
class QuasarGPUEngine { ... };

// lane affinity (gateway)
struct LaneRoute {
    Hash     lane_id;
    uint32_t gpu_id;
    NodeId   owner_node;
};
LaneRoute lookup_lane_route(Hash lane_id, Hash pchain_validator_root);

// cert lane registration (MPC, KMS, custom primitives)
using LaneVerifier = bool (*)(const QuasarCertIngress&, const uint8_t* artifact);
void register_cert_lane(QuasarCertLane lane, LaneVerifier verifier);

}  // namespace quasar::gpu

Performance characteristics

SurfaceLatency targetThroughput target
Gateway lane-affinity read< 10 ms (local)bounded by network I/O
Base mutation< 50 ms commit, < 1.1 s strong finalityTier 2 (100 M/s)
Base realtime subscription< 100 ms fan-outTier 1 (1 B events/s aggregate)
MPC ceremony round< 500 ms per roundper ceremony
KMS sign< 50 ms commitTier 3 (1–10 M/s)

Tiers are the throughput ladder in lp-5622.

Implementation plan

VersionScope
v0.50Gateway lane-affinity routing
v0.51Base → Quasar adapter
v0.52MPC cert-lane verifiers (CGGMP21, FROST, Corona-general)
v0.53KMS as a Quasar precompile + key-material lanes
v0.54TFHE key-share lane (lattice ceremony output)
v0.55Cross-chain message routing via per-lane cert artifacts

References

ResourceLocation
Gatewaygithub.com/hanzoai/gateway
Basegithub.com/hanzoai/base
MPCgithub.com/hanzoai/mpc
KMSgithub.com/hanzoai/kms
IAMgithub.com/hanzoai/iam
lp-0110Quasar consensus
lp-0130Chain topology (M-Chain, F-Chain roles)
lp-4700Threshold MPC family
lp-5622QuasarGPU execution adapter
lp-7100M-Chain MPC ceremonies
lp-7325KMS / HSM integration

Copyright (C) Lux Industries Inc and Hanzo AI Inc. All rights reserved.