Lux Teleport - Zero-Knowledge MPC Cross-Chain Bridge
Documentation for Lux Teleport - Zero-Knowledge MPC Cross-Chain Bridge
Overview
Lux Teleport is a cross-chain bridge protocol using Multi-Party Compute (MPC) nodes for decentralized oracle operations and threshold signature-based asset transfers. It features zero-knowledge privacy -- signers do not know details about assets being teleported. Built as a pnpm monorepo with Solidity contracts, TypeScript API/MPC services, and a frontend app.
Quick reference
| Item | Value |
|---|---|
| Repo | github.com/luxfi/teleport |
| Language | TypeScript, Solidity |
| Package Manager | pnpm 8+ |
| Node.js | 18+ |
| Default Branch | main |
| License | Apache 2.0 |
| MPC Library | multi-party-ecdsa (Rust, GG18/GG20 submodule) |
Hard requirements
- ALWAYS use
github.com/luxfi/*references -- NEVERgo-ethereumorluxfi - Use EIP-712 typed data signing for all bridge signatures
- Derive all claim fields from on-chain logs -- NEVER from request parameters
- Use
spawn()for MPC process invocation -- NEVERexec()(shell injection risk)
Architecture
teleport/
├── contracts/ # Solidity smart contracts
│ └── contracts/
│ ├── Bridge.sol # Main bridge (EIP-712, role-based)
│ ├── ERC20B.sol # Bridgeable token
│ └── IBridgeToken.sol # Token interface
├── api/ # Bridge API service (TypeScript)
│ └── src/
│ └── bridge.ts # POST endpoints, event parsing
├── mpc/ # MPC signing service (TypeScript)
│ └── src/
│ └── teleporter.ts # Secure MPC signing
├── app/ # Frontend UI
├── multi-party-ecdsa/ # Rust MPC library (git submodule, GG18/GG20)
├── package.json # Root workspace config
└── pnpm-workspace.yaml # Workspace: app, api, mpc, contractsSmart Contracts
Bridge.sol
Main bridge contract with EIP-712 domain TeleportBridge version 1:
- Roles:
ADMIN_ROLE(token whitelist, oracle management),ORACLE_ROLE(MPC signers),PAUSER_ROLE(emergency) - Replay protection:
claimId = keccak256(abi.encode(...all claim fields...))-- NOT signature bytes - Token whitelisting: Only admin-approved tokens can be bridged
- Fee caps: Maximum 10% fee rate
// Burn tokens with committed destination (all data in event)
function bridgeBurn(
address token, uint256 amount,
uint256 toChainId, address recipient, bool vault
) external returns (bytes32 burnId);
// Mint tokens with EIP-712 signature verification
function bridgeMint(
ClaimData calldata claim, bytes calldata signature
) external returns (bytes32 claimId);ERC20B.sol
Bridgeable ERC20 token with BRIDGE_ROLE for mint/burn access, Pausable for emergency freeze.
API Service
TypeScript service at api/src/bridge.ts:
| Endpoint | Method | Purpose |
|---|---|---|
/api/signature | POST | Request claim signature from MPC |
/api/claim/:claimId | GET | Get claim status |
/health | GET | Health check |
Security: POST-only for sensitive data, rate limiting (100 req/15 min/IP), Helmet headers, strict hex validation.
MPC Service
TypeScript service at mpc/src/teleporter.ts:
- Invokes Rust
multi-party-ecdsabinaries viaspawn()(not exec) - GG18/GG20 keygen via
gg18_keygen_clientbinary - Strict hex validation:
/^[0-9a-f]\{64\}$/i - Bounded retries with exponential backoff (max 3)
- Graceful SIGTERM shutdown
Keygen Setup
cd ./target/release/examples/
./gg20_sm_manager # Start signing manager on port 8000
# Each party in separate terminal:
./gg18_keygen_client http://yourIP:port keys1.store
./gg18_keygen_client http://yourIP:port keys2.store
./gg18_keygen_client http://yourIP:port keys3.storeOne-file quickstart
Build
git clone https://github.com/luxfi/teleport.git
cd teleport
# Contracts
cd contracts && pnpm install && pnpm build
# API
cd api && pnpm install && pnpm build
# MPC
cd mpc && pnpm install && pnpm buildRun
# Start MPC node
npm run node
# Requires: MongoDB, Rust (for multi-party-ecdsa), Node.js 18+Test
cd contracts && pnpm test # 36 passing tests
cd api && pnpm test
cd mpc && pnpm testConfiguration
api/settings.json
{
"RPC": { "<chainId>": "<rpc_url>" },
"Bridges": { "<chainName>": "<address>" },
"AllowedTokens": { "<token>": { "<chain>": "<address>" } },
"DB": "<mongodb_password>",
"SigningManagers": { "0": "<url>" },
"KeyStore": { "0": "<filename>" }
}mpc/settings.json
{
"RPC": { "<chainId>": "<rpc_url>" },
"Teleporter": { "<chainName>": "<address>" },
"MPCPeers": { "0": "<host>, <ip>" },
"KeyStore": { "0": "<filename>" },
"SMTimeout": "1"
}Security Model
| Feature | Implementation |
|---|---|
| Signature format | EIP-712 typed data (not string concat) |
| Replay protection | claimId from keccak256 of all fields |
| Malleability defense | claimId-based, not signature-based |
| Token security | Admin whitelist only |
| Role separation | ADMIN, ORACLE, PAUSER roles |
| Reentrancy | ReentrancyGuard on external functions |
| Oracle trust | 2-of-3 threshold (majority honest) |
| Input validation | SafeERC20, zero address checks, fee caps |
Privacy Layer (v1.2.0+)
Extends Teleport with fully private bridging:
- FHE encrypted amounts: Pedersen commitments + FHE via
luxfi/fhe - Bulletproof range proofs: Verify amounts without revealing values (BN254 precompiles)
- ZNote: UTXO-style shielded notes for X-Chain integration
- Z-Chain AMM: Homomorphic private swaps (encrypted reserves, encrypted orders)
- Dark pools: MEV-resistant hidden order matching
Privacy Contracts
| Contract | Purpose |
|---|---|
| PrivateBridge | FHE deposits + Bulletproof withdrawals |
| ZNote | X-Chain UTXO to shielded note conversion |
| ZChainAMM | FHE-encrypted private AMM pools |
| BulletproofVerifier | BN254-based range proof verification |
EVM Precompiles
Bridge uses BN254 precompiles (EIP-1108) for ZK verification, active from genesis on Lux:
| Address | Precompile | Gas |
|---|---|---|
| 0x06 | ECADD | 150 |
| 0x07 | ECMUL | 6,000 |
| 0x08 | ECPAIRING | 45,000 + 34,000/pair |
BLS12-381 (EIP-2537) available via Prague upgrade for Quasar consensus proofs.
Roadmap
| Phase | Feature | Trust Model |
|---|---|---|
| v1.1.0 | MPC Oracles (current) | 2-of-3 honest |
| v1.2.0 | Light Client verification | Cryptographic |
| v1.3.0 | Receipt/storage proofs | Trustless |
| v1.4.0 | ZK-SNARK proofs | Trustless + Fast |
| v1.5.0 | Range proofs (private) | Private + Trustless |
Troubleshooting
| Issue | Cause | Solution |
|---|---|---|
| Signature mismatch | String concat signatures | Use EIP-712 typed data |
| Replay attack | Tracking by signature bytes | Track by claimId hash |
| Shell injection | Using exec() for MPC | Use spawn() always |
| Oracle spoofing | Trusting request params | Derive all claims from on-chain logs |
| MongoDB auth error | Misconfigured user | Ensure readWrite role on bridge db |
Related Skills
lux/lux-mpc.md-- Go-based MPC daemon (newer, production)lux/lux-threshold.md-- Threshold signature librarylux/lux-bridge.md-- Bridge infrastructurelux/lux-fhe.md-- FHE primitives for privacy layer