fix(docs): sanitize 74 reference pages and restore to build

- Strip JSX imports, <Cards>/<Card>/<Steps>/<Callout>/<Tabs> components
- Escape bare < > { } outside code fences (MDX-safe)
- Fix YAML frontmatter (nested quotes, truncate long descriptions)
- 356 pages total, clean build
This commit is contained in:
2026-03-02 16:45:12 -08:00
parent 93c6a205d9
commit da2d4626df
76 changed files with 97 additions and 175 deletions
+4 -2
View File
@@ -15,6 +15,8 @@
"---Cloud---",
"cloud",
"---Governance---",
"governance"
"governance",
"---Reference---",
"reference"
]
}
}
@@ -50,7 +50,7 @@ LuxCPP is a **multi-repo C++ monorepo** providing GPU-accelerated compute for bl
- All repos use `github.com/luxcpp/*` remotes (NOT `github.com/luxfi/*` for the C++ repos)
- Public C API header is `<lux/gpu.h>` -- stable ABI, never break it
- Backend plugins export exactly one symbol: `lux_gpu_backend_init`
- Plugin naming: `libluxgpu_backend_<name>.{so,dylib,dll}`
- Plugin naming: `libluxgpu_backend_<name>.\{so,dylib,dll\}`
- Backend ABI version must match: `LUX_GPU_BACKEND_ABI_VERSION` (currently 2)
## Quick reference
@@ -155,7 +155,6 @@ curl -X POST http://localhost:8080/frequency/check \
### Zero-Knowledge Auctions
```go
import "github.com/luxfi/adx/pkg/auction"
a := auction.NewAuction(auctionID, reserve, duration, logger)
bid := &auction.SealedBid{
@@ -170,7 +169,6 @@ outcome, _ := a.RunAuction(decryptionKey)
### HPKE Encryption (RFC 9180)
```go
import "github.com/luxfi/adx/pkg/crypto"
hpke := crypto.NewHPKE()
pub, priv, _ := hpke.GenerateKeyPair()
@@ -1,6 +1,6 @@
---
title: "Lux AI - Decentralized AI Inference and Mining"
description: "AI proofs generated on the network can mint tokens on any teleport-supported network (Lux, Hanzo, Zoo)."
description: "AI proofs generated on the network can mint tokens on any teleport-supported network Lux, Hanzo, Zoo."
---
## Overview
@@ -79,7 +79,6 @@ bitcoin/
Content is structured as an array of `@hanzo/ui` Block types, exported from `src/content/index.ts`:
```typescript
import { type Block } from '@hanzo/ui/blocks'
export default [
poweringTheFuture,
@@ -179,7 +178,6 @@ SEO metadata:
### `src/site-def.ts`
```typescript
import { footer, mainNav, type SiteDef } from '@luxfi/ui/site-def'
export default {
currentAs: 'https://luxbitco.in',
@@ -196,7 +194,7 @@ Overrides anchor tags in MDX with `MDXLink` from `@hanzo/ui/primitives` for cons
`next.config.js`:
- `output: 'export'` -- static site, no server
- `images: { unoptimized: true }` -- required for static export
- `images: \{ unoptimized: true \}` -- required for static export
- `typescript.ignoreBuildErrors: true`
- `eslint.ignoreDuringBuilds: true`
- `transpilePackages`: `@hanzo/ui`, `@hanzo/auth`, `@hanzo/commerce`, `@luxfi/ui`, `@luxfi/data`, `@luxfi/menu-icons`
@@ -206,7 +204,6 @@ Overrides anchor tags in MDX with `MDXLink` from `@hanzo/ui/primitives` for cons
Uses the `@luxfi/ui` Tailwind preset:
```typescript
import { preset } from '@luxfi/ui/tailwind'
export default {
presets: [preset],
@@ -43,12 +43,6 @@ brand/
## Exports
```typescript
import { colors, typography, tokens, logos, themes } from '@luxfi/brand'
import { LuxLogo, LuxLogoSVG, LuxFavicon } from '@luxfi/brand'
import { applyTheme, useTheme, getCurrentTheme } from '@luxfi/brand'
import { brandConfig } from '@luxfi/brand'
import { luxDocsTheme, applyDocsTheme } from '@luxfi/brand'
import '@luxfi/brand/styles/docs.css'
```
## Color Palette
@@ -88,12 +82,11 @@ CSS variables generated with `--lux-` prefix via `getCSSVariables('lux')`.
```
Logo asset paths follow the pattern:
`/assets/logo/lux-{variant}-{theme}.{svg,png}`
`/assets/logo/lux-\{variant\}-\{theme\}.\{svg,png\}`
## Theme Management
```typescript
import { applyTheme, useTheme } from '@luxfi/brand'
// Apply directly
applyTheme('dark') // Sets CSS vars + data-theme attribute + localStorage
@@ -110,7 +103,6 @@ Auto-initializes on import in browser (detects `prefers-color-scheme`).
Pure black/white minimalist theme for docs sites:
```typescript
import { luxDocsTheme, applyDocsTheme } from '@luxfi/brand'
// Get CSS string for injection
const css = luxDocsTheme.css
@@ -346,7 +346,7 @@ Namespace: `lux-bridge`
Production MPC: 5 nodes, 3-of-5 threshold (vs. dev: 3 nodes, 2-of-3).
Secrets managed via KMS (`kms.hanzo.ai`):
- `mpc-identity-keys`: `MPC_NODE{0..4}_PRIVATE_KEY`, `MPC_INITIATOR_KEY`
- `mpc-identity-keys`: `MPC_NODE\{0..4\}_PRIVATE_KEY`, `MPC_INITIATOR_KEY`
- `bridge-secrets`: `BRIDGE_DATABASE_URL`, `BRIDGE_DB_PASSWORD`, `MPC_DB_PASSWORD`, `mpc-api-token`, `mpc-wallet-id`, `fee-collector-address`
Network policies isolate MPC nodes: only `bridge-server` pods can reach MPC HTTP API (8080/8081). MPC nodes communicate with each other on ZAP p2p port 9651.
@@ -1,6 +1,6 @@
---
title: "Lux Build - Builders Hub & Developer Portal"
description: "Documentation for Lux Build - Builders Hub description: "## Quick reference" Developer Portal"
description: "Documentation for Lux Build - Builders Hub description: '## Quick reference' Developer Portal"
---
## Overview
@@ -432,7 +432,6 @@ All consensus messages use QZMQ (Quantum-Secure ZeroMQ):
### Library: Single-Import API
```go
import "github.com/luxfi/consensus"
// Create chain with default config
chain := consensus.NewChain(consensus.DefaultConfig())
@@ -451,7 +450,6 @@ if err := chain.Add(ctx, block); err != nil {
### Library: Quasar Engine
```go
import "github.com/luxfi/consensus/protocol/quasar"
cfg := quasar.Config{QThreshold: 3, QuasarTimeout: 30}
engine, err := quasar.NewEngine(cfg)
@@ -472,7 +470,6 @@ for block := range engine.Finalized() {
### Node: Quasar with Hybrid Finality
```go
import "github.com/luxfi/node/consensus/quasar"
q, err := quasar.NewQuasar(logger, threshold, quorumNum, quorumDen)
q.ConnectPChain(pChainProvider)
@@ -490,7 +487,6 @@ for finality := range q.Subscribe() {
### Node: ZAP Bridge
```go
import "github.com/luxfi/node/consensus/zap"
bridge := zap.NewBridge(logger, zap.DefaultBridgeConfig())
bridge.Initialize(coronaCoordinator)
@@ -531,7 +527,7 @@ go test ./consensus/zap/...
| Phase II timeout | Corona computation slow | Check hardware; consider grouped signing for large sets |
| Epoch rotation rejected | Rate limited | Wait for MinEpochDuration (10 min) between rotations |
| Grouped signing failure | Insufficient group quorum | Ensure 2/3 of groups have threshold signers available |
| DID validation error | Malformed DID | Verify format: `did:method:id` with method in {lux,key,web} |
| DID validation error | Malformed DID | Verify format: `did:method:id` with method in \{lux,key,web\} |
| Alpha validation error | Threshold too low | Alpha must be &gt;= 0.68 (69% BFT threshold) |
## Related Skills
@@ -1,6 +1,6 @@
---
title: "Lux Corona - Post-Quantum Threshold Signatures"
description: "Corona is the post-quantum signature primitive for Lux consensus. It enables t-of-n threshold signing without relying on classical assumptions (RSA, ECDSA) that are vulnerable to quantum..."
description: "Corona is the post-quantum signature primitive for Lux consensus. It enables t-of-n threshold signing without relying on classical assumptions R..."
---
## Overview
@@ -90,7 +90,6 @@ luxfi/corona/
**High-level** (`threshold` package): Clean GenerateKeys/Signer/Verify API with proper error handling. Preferred for integration.
```go
import "github.com/luxfi/corona/threshold"
// Generate 2-of-3 threshold keys
shares, groupKey, err := threshold.GenerateKeys(2, 3, nil)
@@ -1,6 +1,6 @@
---
title: "Lux C++ - High-Performance C++ Libraries for Blockchain & AI"
description: "Documentation for Lux C++ - High-Performance C++ Libraries for Blockchain description: "### Why LuxCPP?" AI"
description: "Documentation for Lux C++ - High-Performance C++ Libraries for Blockchain description: '### Why LuxCPP?' AI"
---
## Overview
@@ -172,7 +172,7 @@ The GPU library auto-selects the best available backend at compile time, with ru
All libraries follow a canonical install layout:
- Headers: `include/lux/<pkg>/*.h`
- Libraries: `lib/liblux<pkg>.{dylib,so,a}`
- Libraries: `lib/liblux<pkg>.\{dylib,so,a\}`
- CMake config: `lib/cmake/lux-<pkg>/`
- pkg-config: `lib/pkgconfig/lux-<pkg>.pc`
@@ -195,7 +195,6 @@ DKG protocol: up to 3 rounds (`Round1` -> broadcast -> `Round2` -> broadcast ->
### BLS Signatures
```go
import "github.com/luxfi/crypto/bls"
sk, _ := bls.NewSecretKey()
pk := sk.PublicKey()
@@ -208,7 +207,6 @@ valid := bls.Verify(pk, msg, sig)
### ML-DSA (Post-Quantum Signatures)
```go
import (
"crypto/rand"
"github.com/luxfi/crypto/mldsa"
)
@@ -226,7 +224,6 @@ sk2, _ := mldsa.PrivateKeyFromBytes(mldsa.MLDSA87, skBytes)
### SLH-DSA (Stateless Hash-Based Signatures)
```go
import "github.com/luxfi/crypto/slhdsa"
// 256-bit security, small signatures
sk, _ := slhdsa.GenerateKey(rand.Reader, slhdsa.SHA2_256s)
@@ -237,7 +234,6 @@ valid := sk.PublicKey.VerifySignature(message, sig)
### ML-KEM (Post-Quantum Key Exchange)
```go
import "github.com/luxfi/crypto/kem"
k, _ := kem.GetKEM(kem.HybridKEM) // X25519 + ML-KEM-768
pk, sk, _ := k.GenerateKeyPair()
@@ -249,7 +245,6 @@ recovered, _ := k.Decapsulate(sk, ct)
### Ring Signatures (Q-Chain Privacy)
```go
import "github.com/luxfi/crypto/ring"
// LSAG: linkable anonymous group signature
// LatticeLSAG: post-quantum ring signature
@@ -259,7 +254,6 @@ import "github.com/luxfi/crypto/ring"
### Threshold Signatures
```go
import "github.com/luxfi/crypto/threshold"
scheme, _ := threshold.GetScheme(threshold.SchemeFROST)
dkg := scheme.NewDKG(threshold.DKGConfig{
@@ -273,7 +267,6 @@ dkg := scheme.NewDKG(threshold.DKGConfig{
### secp256k1 (EVM)
```go
import "github.com/luxfi/crypto/secp256k1"
pk, _ := secp256k1.GenerateKey()
sig, _ := secp256k1.Sign(hash, pk)
@@ -1,6 +1,6 @@
---
title: "Lux DAO - Governor Contracts & Governance Platform"
description: "Documentation for Lux DAO - Governor Contracts description: "## Quick reference" Governance Platform"
description: "Documentation for Lux DAO - Governor Contracts description: '## Quick reference' Governance Platform"
---
## Overview
@@ -203,7 +203,7 @@ LUX_MNEMONIC="word1 word2 ..." ./deploy-subnets \
### How It Works
1. Derives secp256k1 keys from BIP39 mnemonic (indices 1-4, skip 0 which is staked)
2. Key derivation path: `m/44'/60'/0'/0/{index}`
2. Key derivation path: `m/44'/60'/0'/0/\{index\}`
3. Creates P-chain wallet via `github.com/luxfi/sdk/wallet/primary`
4. For each chain:
- Reads genesis JSON from state directory
@@ -75,8 +75,8 @@ Electron Main Process (src/main/)
### Installer artifacts
- macOS: DMG (`lux-wallet-desktop-installer-{arch}-{version}.dmg`)
- Windows: NSIS (`lux-wallet-desktop-installer-{arch}-{version}.exe`)
- macOS: DMG (`lux-wallet-desktop-installer-\{arch\}-\{version\}.dmg`)
- Windows: NSIS (`lux-wallet-desktop-installer-\{arch\}-\{version\}.exe`)
- Linux: AppImage
## One-file quickstart
@@ -68,14 +68,8 @@ All `coreth` imports become `evm` imports. The API is identical.
```go
// OLD (deprecated):
import "github.com/luxfi/coreth/ethclient"
import "github.com/luxfi/coreth/core"
import "github.com/luxfi/coreth/params"
// NEW (correct):
import "github.com/luxfi/evm/ethclient"
import "github.com/luxfi/evm/core"
import "github.com/luxfi/evm/params"
```
## Two Operating Modes
@@ -131,7 +125,6 @@ curl -X POST http://localhost:9630/ext/bc/C/rpc \
### Go Client
```go
import "github.com/luxfi/evm/ethclient"
client, err := ethclient.Dial("http://localhost:9630/ext/bc/C/rpc")
if err != nil {
@@ -146,7 +139,6 @@ chainID, _ := client.ChainID(ctx)
### Custom Precompile
```go
import (
"github.com/luxfi/evm/precompile/contract"
"github.com/luxfi/evm/precompile/modules"
"github.com/luxfi/geth/common"
@@ -347,10 +347,6 @@ Positions are NFTs managed by the NonfungiblePositionManager:
### 8. SDK Usage (@luxfi/exchange)
```typescript
import { useSwap, useSwapQuote, usePools, usePositions } from '@luxfi/exchange'
import { useSwapStore } from '@luxfi/exchange'
import { getContracts, getTokensForChain } from '@luxfi/exchange'
import { createPoolKey, computePoolId } from '@luxfi/exchange'
// Get swap quote from V3 QuoterV2
const { data: quote } = useSwapQuote({
@@ -386,7 +382,6 @@ const { data: positions } = usePositions(userAddress, 96369)
Standard cross-chain minting:
```typescript
import { useCrossChainMint } from '@luxfi/exchange/bridge'
const { mint } = useCrossChainMint()
await mint({
@@ -426,7 +421,6 @@ Contract addresses:
Teleport states: `INITIATED(0)` -> `SHIELDED(1)` -> `SWAP_COMPLETE(2)` -> `EXPORTED(3)` -> `COMPLETED(4)`
```typescript
import { usePrivateTeleport } from '@luxfi/exchange/bridge'
const { teleport, executeSwap, exportToDestination } = usePrivateTeleport()
@@ -458,7 +452,6 @@ The `@hanzo/matching-engine` package provides a full order book implementation:
- **Precision**: `decimal.js` for all price/quantity calculations
```typescript
import { Book, Order, OrderSide, OrderType, Candle, CandleAVL } from '@hanzo/matching-engine'
const book = new Book('LUX/USDC')
book.addOrder(new Order('ext-1', OrderSide.BID, OrderType.LIMIT, 100, '42.50'))
@@ -1,6 +1,6 @@
---
title: "Lux Faucet - Testnet Token Distribution"
description: "Lux Faucet distributes testnet tokens for Lux Network development. It is a TypeScript application with an Express API server backend and a Next.js frontend. Supports multiple EVM chains and subnets..."
description: "Lux Faucet distributes testnet tokens for Lux Network development. It is a TypeScript application with an Express API server backend and a Next.js ..."
---
## Overview
@@ -1,6 +1,6 @@
---
title: "Lux FHE Coprocessor"
description: "The coprocessor is a Go service with three binaries: gateway (blockchain event listener), scheduler (worker coordination), and tfhe-worker (FHE compute). Jobs flow through a Redis queue. Ciphertext..."
description: "The coprocessor is a Go service with three binaries: gateway blockchain event listener, scheduler worker coordination, and tfhe-worker FHE com..."
---
## Overview
@@ -72,7 +72,7 @@ Blockchain Events
### Three Binaries
**gateway** -- Listens to blockchain events (FHE compute, store, decrypt). Converts events to jobs and pushes them onto the Redis queue. Exposes `/health`, `/status` (last processed block), and `/job/{id}` HTTP endpoints. Uses a `BlockchainClient` interface (currently a mock; real implementation connects to Lux EVM RPC).
**gateway** -- Listens to blockchain events (FHE compute, store, decrypt). Converts events to jobs and pushes them onto the Redis queue. Exposes `/health`, `/status` (last processed block), and `/job/\{id\}` HTTP endpoints. Uses a `BlockchainClient` interface (currently a mock; real implementation connects to Lux EVM RPC).
**scheduler** -- Coordinates workers via HTTP registration (`POST /workers`), heartbeat (`POST /heartbeat`), and stale cleanup (configurable period/timeout). Provides `/submit` for manual job submission and `/status` for cluster capacity. Does not perform FHE computation itself.
@@ -85,7 +85,6 @@ Pure-Go implementation built on `github.com/luxfi/lattice` (fork of Lattigo latt
```go
package main
import (
"fmt"
"github.com/luxfi/fhe"
)
@@ -326,7 +325,6 @@ fhed reshare --input ./keys --new-t 3 --new-n 5 --output ./reshared
Canonical FHE contracts live in `@luxfi/contracts` (at `~/work/lux/standard/contracts/fhe/`). Development happens in `luxfhe/contracts/` with `pnpm sync` to copy to the standard location.
```solidity
import "@luxfhe/contracts/FHE.sol";
contract ConfidentialToken {
mapping(address => euint32) private _balances;
@@ -363,7 +361,6 @@ bool result = FHE.reveal(encryptedValue); // Reverts if not ready
### JavaScript SDK Usage
```typescript
import { createFheClient } from '@luxfhe/v2-sdk'
const client = await createFheClient({
provider: window.ethereum,
@@ -93,7 +93,6 @@ All operations work on encrypted integers up to 256 bits:
```solidity
// Write confidential smart contracts in standard Solidity
import "fhevm/lib/TFHE.sol";
contract ConfidentialToken {
mapping(address => euint64) private balances;
@@ -48,7 +48,7 @@ fx/
| Endpoint | Description |
|----------|-------------|
| `GET /health` | Health check (JSON status + time) |
| `GET /price/{token_id}?currency=usd` | Single token price with market data |
| `GET /price/\{token_id\}?currency=usd` | Single token price with market data |
| `GET /prices?ids=bitcoin,ethereum&currency=usd` | Multiple token prices in one request |
| `GET /simple/price?ids=bitcoin&vs_currencies=usd,eur` | CoinGecko-compatible simple format |
@@ -156,14 +156,13 @@ The `configs` package supports runtime P-Chain allocation overrides without modi
1. `LUX_PCHAIN_ALLOCS` environment variable (JSON string)
2. `LUX_PCHAIN_ALLOCS_FILE` environment variable (path to JSON file)
3. `~/.lux/genesis/{network}/pchain.json` file system override
3. `~/.lux/genesis/\{network\}/pchain.json` file system override
C-Chain genesis remains embedded and immutable.
### Programmatic usage
```go
import "github.com/luxfi/genesis/configs"
// Load genesis for mainnet
genesisBytes, err := configs.GetGenesis(configs.MainnetID)
@@ -156,13 +156,10 @@ Currently 350+ proposals in the repository.
```typescript
// From @luxfi/contracts (DAO apps)
import { GovernorAbi, StrategyAbi, abis, addresses } from '@luxfi/contracts';
// From @luxfi/standard directly (general use)
import { GovernorAbi, StrategyAbi } from '@luxfi/standard';
// Wallet SDK
import { LuxWalletProvider, ConnectButton } from '@luxfi/wallet';
```
## Directory Structure
@@ -40,7 +40,6 @@ Lux GPU provides **Go bindings for GPU-accelerated operations** with switchable
### Session Management
```go
import "github.com/luxfi/lux/gpu"
// Auto-detect best backend
sess, err := gpu.DefaultSession()
@@ -100,7 +100,6 @@ SEO metadata configuration:
Site definition for the shared Lux navigation chrome:
```typescript
import { footer, mainNav, type SiteDef } from '@luxfi/ui/site-def'
export default {
currentAs: 'https://lux.id',
@@ -116,7 +115,6 @@ The `currentAs` property highlights the current site in the shared ecosystem nav
Overrides MDX link rendering to use `MDXLink` from `@hanzo/ui/primitives`:
```typescript
import { MDXLink } from '@hanzo/ui/primitives'
export function useMDXComponents(components: MDXComponents): MDXComponents {
return { a: (props) => <MDXLink {...props}/>, ...components }
}
@@ -126,7 +124,7 @@ export function useMDXComponents(components: MDXComponents): MDXComponents {
`next.config.js` settings:
- `output: 'export'` -- static site generation, no server required
- `images: { unoptimized: true }` -- required for static export
- `images: \{ unoptimized: true \}` -- required for static export
- `typescript.ignoreBuildErrors: true` -- WIP, build proceeds despite TS errors
- `eslint.ignoreDuringBuilds: true` -- WIP, build proceeds despite lint errors
- `transpilePackages`: `@hanzo/ui`, `@hanzo/auth`, `@hanzo/commerce`, `@luxfi/ui`, `@luxfi/data`, `@luxfi/menu-icons`
@@ -135,8 +133,8 @@ export function useMDXComponents(components: MDXComponents): MDXComponents {
Uses the `@luxfi/ui` Tailwind preset with content scanning across:
- `src/**/*.tsx` (local components)
- `./node_modules/@luxfi/ui/**/*.{ts,tsx}` (Lux UI library)
- `./node_modules/@hanzo/**/*.{ts,tsx}` (Hanzo UI library)
- `./node_modules/@luxfi/ui/**/*.\{ts,tsx\}` (Lux UI library)
- `./node_modules/@hanzo/**/*.\{ts,tsx\}` (Hanzo UI library)
## Commands
@@ -118,7 +118,7 @@ The `multichain` package and `cmd/multichain` binary provide a universal indexer
DeFi protocol indexing per chain (Uniswap, Aave, Compound, GMX, Curve, PancakeSwap, Jupiter, Raydium, etc.).
HTTP endpoints: `/stats`, `/health`, `/chains`, `/chain/{id}`, `/metrics` (Prometheus).
HTTP endpoints: `/stats`, `/health`, `/chains`, `/chain/\{id\}`, `/metrics` (Prometheus).
## Core Concepts
@@ -124,14 +124,14 @@ Backend API (Node.js / Fastify / TypeScript)
|--------|------|---------|
| POST | `/api/v1/kms/keys` | Create new key |
| GET | `/api/v1/kms/keys` | List keys |
| GET | `/api/v1/kms/keys/{keyId}` | Get key metadata |
| PATCH | `/api/v1/kms/keys/{keyId}` | Update key |
| DELETE | `/api/v1/kms/keys/{keyId}` | Delete key |
| POST | `/api/v1/kms/keys/{keyId}/encrypt` | Encrypt data |
| POST | `/api/v1/kms/keys/{keyId}/decrypt` | Decrypt data |
| POST | `/api/v1/kms/keys/{keyId}/sign` | Sign data |
| POST | `/api/v1/kms/keys/{keyId}/verify` | Verify signature |
| POST | `/api/v1/kms/keys/{keyId}/generate-data-key` | Generate data encryption key |
| GET | `/api/v1/kms/keys/\{keyId\}` | Get key metadata |
| PATCH | `/api/v1/kms/keys/\{keyId\}` | Update key |
| DELETE | `/api/v1/kms/keys/\{keyId\}` | Delete key |
| POST | `/api/v1/kms/keys/\{keyId\}/encrypt` | Encrypt data |
| POST | `/api/v1/kms/keys/\{keyId\}/decrypt` | Decrypt data |
| POST | `/api/v1/kms/keys/\{keyId\}/sign` | Sign data |
| POST | `/api/v1/kms/keys/\{keyId\}/verify` | Verify signature |
| POST | `/api/v1/kms/keys/\{keyId\}/generate-data-key` | Generate data encryption key |
| POST | `/api/v1/kmip` | KMIP 2.0+ protocol endpoint |
### Directory structure
@@ -71,8 +71,8 @@ login/
### Direct Password Login (`/`)
1. User submits email + password on the login page
2. Client POSTs to `/api/login` with `{ email, password }`
3. Server-side route handler proxies to IAM: `POST ${IAM_URL}/api/login`
2. Client POSTs to `/api/login` with `\{ email, password \}`
3. Server-side route handler proxies to IAM: `POST $\{IAM_URL\}/api/login`
4. Payload sent to IAM:
```json
{
@@ -83,15 +83,15 @@ login/
"type": "login"
}
```
5. IAM returns `{ status: "ok", data: "<token>" }` on success
6. API route returns `{ redirect: REDIRECT_URL, token: data.data }`
5. IAM returns `\{ status: "ok", data: "<token>" \}` on success
6. API route returns `\{ redirect: REDIRECT_URL, token: data.data \}`
7. Client redirects to `REDIRECT_URL` (default: `cloud.lux.network`)
### User Registration (`/signup`)
1. User submits name + email + password (min 8 chars)
2. Client POSTs to `/api/signup` with `{ name, email, password }`
3. Server proxies to IAM: `POST ${IAM_URL}/api/signup`
2. Client POSTs to `/api/signup` with `\{ name, email, password \}`
3. Server proxies to IAM: `POST $\{IAM_URL\}/api/signup`
4. Payload:
```json
{
@@ -109,10 +109,10 @@ login/
### Password Reset (`/forgot`)
1. User submits email
2. Client POSTs to `/api/forgot` with `{ email }`
3. Server proxies to IAM: `POST ${IAM_URL}/api/send-verification-code`
4. Payload: `{ application: "app-lux", organization: "lux", dest: email, type: "reset" }`
5. **Always returns success** (`{ ok: true }`) regardless of whether the email exists, to prevent email enumeration
2. Client POSTs to `/api/forgot` with `\{ email \}`
3. Server proxies to IAM: `POST $\{IAM_URL\}/api/send-verification-code`
4. Payload: `\{ application: "app-lux", organization: "lux", dest: email, type: "reset" \}`
5. **Always returns success** (`\{ ok: true \}`) regardless of whether the email exists, to prevent email enumeration
### OAuth2 Authorization Code Flow
@@ -151,7 +151,7 @@ login/
| `NEXT_PUBLIC_REDIRECT_URL` | `https://cloud.lux.network` | Post-auth redirect target |
| `NEXT_PUBLIC_IAM_ORG` | `lux` | Casdoor organization name |
The callback URL is derived at runtime: `${window.location.origin}/callback`.
The callback URL is derived at runtime: `$\{window.location.origin\}/callback`.
## OAuth2 Helper (`lib/oauth.ts`)
@@ -160,7 +160,7 @@ Exports 5 functions:
| Function | Purpose |
|----------|---------|
| `getOAuthAuthorizeUrl(state?)` | Constructs authorize URL with client_id, response_type=code, redirect_uri, scope, state |
| `exchangeCodeForToken(code)` | POSTs to token endpoint, returns `{ access_token, token_type, expires_in, refresh_token? }` |
| `exchangeCodeForToken(code)` | POSTs to token endpoint, returns `\{ access_token, token_type, expires_in, refresh_token? \}` |
| `getRedirectUrl()` | Returns `NEXT_PUBLIC_REDIRECT_URL` |
| `getIamOrg()` | Returns `NEXT_PUBLIC_IAM_ORG` |
| `getIamClientId()` | Returns `NEXT_PUBLIC_IAM_CLIENT_ID` |
@@ -168,7 +168,7 @@ Evaluated every **30s**:
| Alert | Expression | For | Severity |
|-------|-----------|-----|----------|
| `LuxNodeDown` | `up{job="luxd"} == 0` | 5m | critical |
| `LuxNodeDown` | `up\{job="luxd"\} == 0` | 5m | critical |
| `CChainNotSyncing` | `rate(avalanche_C_last_accepted_height[5m]) == 0` | 10m | warning |
| `CChainHighRejectionRate` | rejection > 10% of accepted | 5m | warning |
| `PChainNotSyncing` | `rate(avalanche_P_last_accepted_height[5m]) == 0` | 10m | warning |
@@ -176,7 +176,7 @@ Evaluated every **30s**:
| `LowPeerCount` | `avalanche_network_peers < 5` | 10m | warning |
| `HighCPUUsage` | `process_cpu_seconds_total > 80%` | 10m | warning |
| `HighMemoryUsage` | `MemAvailable < 10%` | 10m | critical |
| `PostgresDown` | `up{job="postgres"} == 0` | 5m | critical |
| `PostgresDown` | `up\{job="postgres"\} == 0` | 5m | critical |
### DEX Alerts (`prometheus/dex-rules.yml`)
@@ -128,7 +128,6 @@ backup_dir: backups
### Go client
```go
import (
"github.com/luxfi/mpc/pkg/client"
"github.com/nats-io/nats.go"
)
@@ -108,7 +108,6 @@ message StartRequest {
## Client SDK
```go
import "github.com/luxfi/netrunner/client"
cli, _ := client.New(client.Config{
Endpoint: "localhost:8080",
@@ -270,9 +269,9 @@ Snapshots use native BadgerDB incremental backup with zstd compression.
| Incremental | Yes, tracks `db_version` per node |
| Hot snapshot | Supported (no network stop) |
| Admin API | `admin.snapshot` / `admin.load` |
| Storage | `~/.netrunner/snapshots/lux-snapshot-{name}/` |
| Storage | `~/.netrunner/snapshots/lux-snapshot-\{name\}/` |
Snapshot contents: `network.json` (full config), `state.json` (elastic chain mapping), `{nodeName}.backup.zst` (per-node compressed backup), `manifest.json`.
Snapshot contents: `network.json` (full config), `state.json` (elastic chain mapping), `\{nodeName\}.backup.zst` (per-node compressed backup), `manifest.json`.
## Local Network (local/)
@@ -178,7 +178,6 @@ curl -X POST http://localhost:9630/ext/bc/X \
### Go SDK client
```go
import "github.com/luxfi/sdk/client"
c := client.New("http://localhost:9630")
@@ -152,9 +152,9 @@ docker build --platform linux/amd64 -t ghcr.io/luxfi/operator:v0.3.12 .
## Environment Manifests
Pre-configured manifests for mainnet/testnet/devnet:
- `k8s/indexers-{mainnet,testnet,devnet}.yaml`
- `k8s/explorer-{mainnet,testnet,devnet}.yaml`
- `k8s/gateway-{mainnet,testnet,devnet}.yaml`
- `k8s/indexers-\{mainnet,testnet,devnet\}.yaml`
- `k8s/explorer-\{mainnet,testnet,devnet\}.yaml`
- `k8s/gateway-\{mainnet,testnet,devnet\}.yaml`
- `k8s/exchange-backend-mainnet.yaml`
- `k8s/explorer-microservices-mainnet.yaml`
@@ -1,6 +1,6 @@
---
title: "Lux Oracle - Optimistic Oracle Protocol"
description: "Lux Oracle is an optimistic oracle for on-chain price feeds and arbitrary data verification. Fork of UMA Protocol, adapted for Lux C-Chain. It is a Yarn/Lerna monorepo containing Solidity smart con..."
description: "Lux Oracle is an optimistic oracle for on-chain price feeds and arbitrary data verification. Fork of UMA Protocol, adapted for Lux C-Chain. It is a..."
---
## Overview
@@ -181,7 +181,6 @@ github.com/luxfi/p2p/
`Network` is the top-level coordinator. It tracks connected peers, routes messages, and creates protocol-specific clients.
```go
import "github.com/luxfi/p2p"
// Create network with metrics
net, err := p2p.NewNetwork(logger, sender, registerer, "myvm")
@@ -346,15 +345,15 @@ Builders for inbound, outbound, and internal messages with creator pattern.
## Metrics
Both modules expose Prometheus metrics:
- `{namespace}_msg_time` (gauge vec): Handler message processing time in nanoseconds
- `{namespace}_msg_count` (counter vec): Handler message count
- `{namespace}_num_tracked_peers` (gauge): PeerTracker tracked count
- `{namespace}_num_responsive_peers` (gauge): PeerTracker responsive count
- `{namespace}_average_bandwidth` (gauge): PeerTracker average bandwidth
- `{namespace}_gossip_count` (counter vec): Gossip message count by io/type
- `{namespace}_gossip_bytes` (counter vec): Gossip bytes by io/type
- `{namespace}_gossip_tracking` (gauge vec): Currently tracked gossipables
- `{namespace}_bloom_*` (gauge/counter): Bloom filter statistics
- `\{namespace\}_msg_time` (gauge vec): Handler message processing time in nanoseconds
- `\{namespace\}_msg_count` (counter vec): Handler message count
- `\{namespace\}_num_tracked_peers` (gauge): PeerTracker tracked count
- `\{namespace\}_num_responsive_peers` (gauge): PeerTracker responsive count
- `\{namespace\}_average_bandwidth` (gauge): PeerTracker average bandwidth
- `\{namespace\}_gossip_count` (counter vec): Gossip message count by io/type
- `\{namespace\}_gossip_bytes` (counter vec): Gossip bytes by io/type
- `\{namespace\}_gossip_tracking` (gauge vec): Currently tracked gossipables
- `\{namespace\}_bloom_*` (gauge/counter): Bloom filter statistics
## Testing
@@ -251,7 +251,6 @@ Registered via `registry/registry.go` force-imports in `init()`:
```go
// registry/registry.go
import (
_ "github.com/luxfi/precompile/mldsa" // ML-DSA (FIPS 204)
_ "github.com/luxfi/precompile/mlkem" // ML-KEM (FIPS 203)
_ "github.com/luxfi/precompile/pqcrypto" // Unified PQ crypto
@@ -173,8 +173,6 @@ Lux SDK is the **official Go SDK** for building and managing Lux networks. It pr
### Initialize SDK
```go
import "github.com/luxfi/sdk"
import "github.com/luxfi/sdk/config"
cfg := config.Default()
s, err := sdk.New(cfg)
@@ -203,7 +201,6 @@ bc, err := s.CreateAndDeployBlockchain(ctx, &sdk.BlockchainParams{
### P-Chain Client
```go
import "github.com/luxfi/sdk/platformvm"
client := platformvm.NewClientWithNetworkID("http://localhost:9630", 1)
height, err := client.GetHeight(ctx)
@@ -214,8 +211,6 @@ balance, err := client.GetBalance(ctx, addrs)
### Wallet Operations
```go
import "github.com/luxfi/sdk/wallet"
import "github.com/luxfi/sdk/key"
w := wallet.New(networkID, chainID)
addr, err := w.ImportKey(privateKey)
@@ -224,7 +219,6 @@ addr, err := w.ImportKey(privateKey)
### Key Management
```go
import "github.com/luxfi/sdk/key"
kc := key.NewKeychain()
err := kc.Add(privateKey)
@@ -234,7 +228,6 @@ sig, err := kc.Sign(message, address)
### Smart Contract Deployment
```go
import "github.com/luxfi/sdk/contract"
// Contract interaction uses luxfi/evm/accounts/abi/bind
// and luxfi/geth types for EVM compatibility
@@ -243,7 +236,6 @@ import "github.com/luxfi/sdk/contract"
### Validator Manager (L1)
```go
import "github.com/luxfi/sdk/validatormanager"
// Deploys embedded PoA/PoS validator manager contracts
// Handles registration, removal, weight updates via Warp
@@ -1,6 +1,6 @@
---
title: "Lux Session - Private Permissionless Session Execution Layer"
description: "1. SessionVM () -- A pluggable Lux VM that manages encrypted messaging sessions with post-quantum cryptography (ML-KEM-768, ML-DSA-65, XChaCha20-Poly1305)."
description: "1. SessionVM -- A pluggable Lux VM that manages encrypted messaging sessions with post-quantum cryptography ML-KEM-768, ML-DSA-65, XChaCha20-Po..."
---
## Overview
@@ -69,7 +69,6 @@ The `core/` package defines the canonical session model shared by both: epoch-sc
```go
package main
import (
"fmt"
"log"
@@ -119,7 +118,6 @@ func main() {
```go
package main
import (
"context"
"fmt"
"log"
@@ -42,12 +42,12 @@ A "space" is an owned namespace. Only the owner (authenticated via EIP-712 signa
| Type | Fields | Purpose |
|------|--------|---------|
| `ClaimTx` | `{space}` | Reserve a space (associates address) |
| `SetTx` | `{space, key, value}` | Set key-value pair in a space |
| `DeleteTx` | `{space, key}` | Remove a key from a space |
| `LifelineTx` | `{space, units}` | Extend space lifetime with SPC |
| `MoveTx` | `{space, to}` | Transfer space ownership |
| `TransferTx` | `{to, units}` | Send SPC to another address |
| `ClaimTx` | `\{space\}` | Reserve a space (associates address) |
| `SetTx` | `\{space, key, value\}` | Set key-value pair in a space |
| `DeleteTx` | `\{space, key\}` | Remove a key from a space |
| `LifelineTx` | `\{space, units\}` | Extend space lifetime with SPC |
| `MoveTx` | `\{space, to\}` | Transfer space ownership |
| `TransferTx` | `\{to, units\}` | Send SPC to another address |
### State Expiry
Spaces automatically expire based on storage usage. More storage = faster expiry. Use `LifelineTx` to extend. Expired spaces are deleted entirely.
@@ -167,7 +167,6 @@ curl -X POST <endpoint>/public -d '{"jsonrpc":"2.0","method":"spacesvm.recentAct
## Go SDK Client
```go
import "github.com/luxfi/spacesvm/client"
c := client.New("<endpoint>/public")
@@ -39,7 +39,6 @@ go test -race ./...
### Package API
```go
import "github.com/luxfi/staking"
// Parse a raw ASN.1 certificate (extracts public key only)
cert, err := staking.ParseCertificate(rawBytes)
@@ -141,7 +141,6 @@ forge install luxfi/standard
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import "@luxfi/contracts/tokens/LRC20.sol";
/// @title MyToken - A simple LRC20 token on Lux
contract MyToken is LRC20 {
@@ -277,8 +276,6 @@ FHE contracts run on the Lux T-Chain (Threshold Chain) powered by ThresholdVM. T
```solidity
// Example: Confidential LRC20 token
import "@luxfi/contracts/fhe/token/LRC20/ConfidentialLRC20.sol";
import "@luxfi/contracts/fhe/FHE.sol";
contract PrivateToken is ConfidentialLRC20 {
constructor() ConfidentialLRC20("Private Token", "PRIV") {
@@ -320,7 +317,6 @@ contract PrivateToken is ConfidentialLRC20 {
**DAO Framework** (`contracts/dao/`): Full LIP-7001 compliant DAO with Safe integration, Hats Protocol roles, freeze guards, freeze voting, sub-DAO hierarchy (FractalModule), account abstraction paymaster, KYC verification, public sale, autonomous admin, and countersign modules.
```solidity
import "@luxfi/contracts/governance/DAO.sol";
// Create and vote on proposals
dao.propose(targets, values, calldatas, "Upgrade treasury");
@@ -345,7 +341,6 @@ dao.castVote(proposalId, 1); // 1 = For
**Yield-Bearing Bridge Tokens** (`contracts/bridge/yield/`): 20+ DeFi strategies (Aave V3, Compound V3, Lido, EigenLayer, Morpho, Pendle, Curve, Convex, Ethena, Euler V2, MakerDAO, Maple, Spark, Frax, Yearn V3, Babylon, RocketPool, plus L2/Solana/TON strategies)
```solidity
import "@luxfi/contracts/bridge/Teleport.sol";
// Teleport tokens cross-chain
teleport.send(destChainId, recipient, token, amount);
@@ -367,7 +362,6 @@ Master yield vault and liquid staking with xLUX shares:
**L-Tokens** (bridged assets): LETH, LBTC, LUSD, LSOL, LTON, LBNB, LPOL, LAVAX, LADA, LZOO, LPARS, and 30+ more
```solidity
import "@luxfi/contracts/liquid/LiquidLUX.sol";
LiquidLUX vault = LiquidLUX(LIQUID_LUX_ADDRESS);
// Deposit WLUX, receive xLUX shares
@@ -401,7 +395,6 @@ EVM precompile interfaces for quantum-resistant signatures (`contracts/precompil
| DEX | `IDEX.sol` | DEX precompile with pool manager |
```solidity
import "@luxfi/contracts/precompile/interfaces/IMLDSA.sol";
// Verify post-quantum ML-DSA signature
bool valid = IMLDSA.verify(publicKey, message, signature);
@@ -93,7 +93,7 @@ TypeScript service at `mpc/src/teleporter.ts`:
- Invokes Rust `multi-party-ecdsa` binaries via `spawn()` (not exec)
- GG18/GG20 keygen via `gg18_keygen_client` binary
- Strict hex validation: `/^[0-9a-f]{64}$/i`
- Strict hex validation: `/^[0-9a-f]\{64\}$/i`
- Bounded retries with exponential backoff (max 3)
- Graceful SIGTERM shutdown
@@ -87,7 +87,6 @@ go get github.com/luxfi/[email protected]
### Basic usage
```go
import (
"github.com/luxfi/threshold/protocols/cmp"
"github.com/luxfi/threshold/protocols/adapters"
)
@@ -121,7 +121,7 @@ docker compose --profile bank up -d # Add Lux Bank (lux.financial)
- Network: `lux-network` (172.30.0.0/16)
- Static IPs: 172.30.0.10-14
- Bootstrap: Node 1 (172.30.0.10) is the bootstrap node
- Keys: Mounted from `~/.lux/keys/node{0-4}/`
- Keys: Mounted from `~/.lux/keys/node\{0-4\}/`
- Genesis: Mounted from `~/work/lux/genesis/configs/mainnet/`
- Health checks: `curl http://localhost:9630/ext/health` every 30s
@@ -85,7 +85,6 @@ type Config struct {
## Usage
```go
import "github.com/luxfi/upgrade"
// Get config by network ID
cfg := upgrade.GetConfig(upgrade.MainnetID)
@@ -104,7 +103,6 @@ if err := cfg.Validate(); err != nil {
## Test Helpers (`upgradetest` package)
```go
import "github.com/luxfi/upgrade/upgradetest"
// Get config with all forks up to Etna activated, rest unscheduled
cfg := upgradetest.GetConfig(upgradetest.Etna)
@@ -111,25 +111,25 @@ Per-chain address generation
| Chain | Default Template | Coin Type | Address Encoding |
|-------|-----------------|-----------|-----------------|
| **BTC Nested SegWit** | `m/49'/0'/{i}'/0/0` | 0 | P2SH_P2WPKH |
| **BTC Taproot** | `m/86'/0'/{i}'/0/0` | 0 | P2TR |
| **BTC Native SegWit** | `m/84'/0'/{i}'/0/0` | 0 | P2WPKH |
| **BTC Legacy** | `m/44'/0'/{i}'/0/0` | 0 | P2PKH |
| **EVM (standard)** | `m/44'/60'/0'/0/{i}` | 60 | keccak256 |
| **EVM (Ledger Live)** | `m/44'/60'/{i}'/0/0` | 60 | keccak256 |
| **SOL (standard)** | `m/44'/501'/{i}'/0'` | 501 | ed25519 pubkey |
| **SOL (Ledger Live)** | `m/44'/501'/{i}'` | 501 | ed25519 pubkey |
| **Cosmos** | `m/44'/118'/0'/0/{i}` | 118 | bech32 |
| **Cardano** | `m/1852'/1815'/{i}'` | 1815 | bech32 |
| **Polkadot** | `m/44'/354'/0'/0/{i}` | 354 | SS58 |
| **Tron** | `m/44'/195'/0'/0/{i}` | 195 | base58check |
| **XRP** | `m/44'/144'/0'/0/{i}` | 144 | base58 |
| **Aptos** | `m/44'/637'/{i}'` | 637 | hex |
| **SUI** | `m/44'/784'/{i}'/0'/0'` | 784 | hex |
| **NEAR** | `m/44'/397'/{i}'` | 397 | implicit/named |
| **Filecoin** | `m/44'/461'/0'/0/{i}` | 461 | f1/f3 |
| **Kaspa** | `m/44'/111111'/{i}'` | 111111 | bech32 |
| **Lightning** | `m/44'/81297820149147'/0'/0/{i}` | 81297820149147 | invoice |
| **BTC Nested SegWit** | `m/49'/0'/\{i\}'/0/0` | 0 | P2SH_P2WPKH |
| **BTC Taproot** | `m/86'/0'/\{i\}'/0/0` | 0 | P2TR |
| **BTC Native SegWit** | `m/84'/0'/\{i\}'/0/0` | 0 | P2WPKH |
| **BTC Legacy** | `m/44'/0'/\{i\}'/0/0` | 0 | P2PKH |
| **EVM (standard)** | `m/44'/60'/0'/0/\{i\}` | 60 | keccak256 |
| **EVM (Ledger Live)** | `m/44'/60'/\{i\}'/0/0` | 60 | keccak256 |
| **SOL (standard)** | `m/44'/501'/\{i\}'/0'` | 501 | ed25519 pubkey |
| **SOL (Ledger Live)** | `m/44'/501'/\{i\}'` | 501 | ed25519 pubkey |
| **Cosmos** | `m/44'/118'/0'/0/\{i\}` | 118 | bech32 |
| **Cardano** | `m/1852'/1815'/\{i\}'` | 1815 | bech32 |
| **Polkadot** | `m/44'/354'/0'/0/\{i\}` | 354 | SS58 |
| **Tron** | `m/44'/195'/0'/0/\{i\}` | 195 | base58check |
| **XRP** | `m/44'/144'/0'/0/\{i\}` | 144 | base58 |
| **Aptos** | `m/44'/637'/\{i\}'` | 637 | hex |
| **SUI** | `m/44'/784'/\{i\}'/0'/0'` | 784 | hex |
| **NEAR** | `m/44'/397'/\{i\}'` | 397 | implicit/named |
| **Filecoin** | `m/44'/461'/0'/0/\{i\}` | 461 | f1/f3 |
| **Kaspa** | `m/44'/111111'/\{i\}'` | 111111 | bech32 |
| **Lightning** | `m/44'/81297820149147'/0'/0/\{i\}` | 81297820149147 | invoice |
### Supported Chains (27 Families)
@@ -182,8 +182,8 @@ Storage: salt(32) || iv(16) || ciphertext
**Password encoding**: Passwords are never passed as raw strings in non-production builds. A `SENSITIVE_ENCODE` prefix mechanism encrypts passwords with a per-session random key (UUID-based) so they cannot be read from debugger breakpoints.
**Credential types:**
- `|RP|` prefix: HD credential (recovery phrase -- encrypted `{entropyWithLangPrefixed, seed}` JSON)
- `|PK|` prefix: Imported credential (encrypted `{privateKey}` JSON)
- `|RP|` prefix: HD credential (recovery phrase -- encrypted `\{entropyWithLangPrefixed, seed\}` JSON)
- `|PK|` prefix: Imported credential (encrypted `\{privateKey\}` JSON)
- `|VS|` prefix: Verify string (encrypted known plaintext for password verification)
**Additional encryptors:**
@@ -225,10 +225,10 @@ Hardware support via `@onekeyfe/hd-core` v1.0.3 SDK:
**Hardware signing flow** (EVM example):
1. `KeyringHardware.signTransaction()` gets SDK instance and account path
2. Encodes transaction as `EVMTransaction` or `EVMTransactionEIP1559`
3. Calls `sdk.evmSignTransaction(connectId, deviceId, {path, transaction})`
4. Receives `{v, r, s}` signature from device
3. Calls `sdk.evmSignTransaction(connectId, deviceId, \{path, transaction\})`
4. Receives `\{v, r, s\}` signature from device
5. `buildSignedTxFromSignatureEvm()` assembles and serializes the signed tx
6. Returns `{txid, rawTx, encodedTx}`
6. Returns `\{txid, rawTx, encodedTx\}`
### Transaction Building
@@ -112,7 +112,6 @@ github.com/luxfi/warp
### Create and sign a message
```go
import "github.com/luxfi/warp"
// Create unsigned message
msg, err := warp.NewUnsignedMessage(networkID, sourceChainID, payload)
@@ -74,7 +74,6 @@ luxfi/zapdb/
### Basic usage
```go
import badger "github.com/luxfi/zapdb/v4"
// Open database
opts := badger.DefaultOptions("/tmp/zapdb")