Lux Skills Reference
Lux Warp - Cross-Chain Messaging Protocol V2 Documentation for Lux Warp - Cross-Chain Messaging Protocol V2
Lux Warp (github.com/luxfi/warp) is the cross-chain messaging (XCM) protocol for Lux Network. It defines a message format and cryptographic standard for secure inter-blockchain communication using BLS signature aggregation. V2 adds post-quantum safety via ringtail validation and optional private messaging via Z-chain FHE.
Item Value Module github.com/luxfi/warpGo 1.26.1 Protocol Version 2.0 Max Message Size 256 KiB Codec Version 0 CLI Binary warpDocker Image luxfi/warp:latestLicense Elastic-2.0
type UnsignedMessage struct {
NetworkID uint32 // Network identifier
SourceChainID ids . ID // 32-byte originating chain
Payload [] byte // Application-specific content
}
type Message struct {
UnsignedMessage * UnsignedMessage
Signature Signature // BitSetSignature with BLS aggregation
}
type BitSetSignature struct {
Signers Bits // Bitmap of signing validators
Signature [ bls . SignatureLen ] byte // 96-byte aggregated BLS signature
}
Type Purpose AddressedCallCross-VM contract calls HashSimple 32-byte hash payload AtomicSwapCross-chain atomic swap L1ValidatorRegistrationValidator registration status RegisterL1ValidatorAdd validator to subnet SubnetToL1ConversionSubnet conversion message L1ValidatorWeightValidator weight update
github.com/luxfi/warp
├── message.go # UnsignedMessage, Message, parsing, verification
├── signature.go # Signature interface, BitSetSignature, BLS ops
├── signature_aggregator.go # Signature aggregation from multiple validators
├── signature_request.go # Signature request/response protocol
├── validator.go # Validator, CanonicalValidatorSet, ValidatorState
├── verifier.go # Verifier interface
├── handler.go # P2P handler interface
├── sender.go # Message sender interface
├── codec.go # Message codec (version 0)
├── bitset.go # Bit set for signer tracking
├── chainipc.go # Chain IPC communication
├── eventsocket.go # Event socket for message notifications
├── error.go # Error definitions
├── utils.go # Utility functions (hash, overflow checks)
├── payload/ # Payload types
│ ├── payload.go # AddressedCall, Hash, L1 payloads
│ ├── atomic_swap.go # Cross-chain atomic swap payload
│ └── atomic_swap_test.go
├── backend/ # Backend interface for message storage
├── signer/ # Signer implementations (local, remote)
├── signature-aggregator/ # Signature aggregation API service
├── relayer/ # Message relaying
│ └── config/ # Relayer configuration
├── bridge/ # Bridge integration
├── precompile/ # EVM precompile integration
├── protocol/ # Protocol definitions (protobuf)
├── crypto/ # Cryptographic utilities (BLS, hash)
├── config/ # Configuration
├── validators/ # Validator set management
├── messages/ # Message types
├── types/ # Type definitions
├── socket/ # Socket communication
├── cmd/
│ ├── warpcli/ # Standalone CLI tool
│ └── plugin/ # Lux CLI plugin
├── docs/ # Fumadocs documentation site (Next.js)
├── example/ # Usage examples
├── Dockerfile # Container build
└── Makefile # Build targets
// Create unsigned message
msg, err := warp. NewUnsignedMessage (networkID, sourceChainID, payload)
// Sign with multiple validators
signed, err := warp. SignMessage (msg, signerKeys, validators)
// Parse from bytes
parsed, err := warp. ParseMessage (rawBytes)
err := warp. VerifyMessage (
msg, // *Message
networkID, // uint32
validatorState, // ValidatorState interface
quorumNum, // e.g., 67
quorumDen, // e.g., 100
)
// Sign
sig, err := warp. Sign (msgBytes, secretKey)
// Aggregate multiple signatures
aggSig, err := warp. AggregateSignatures (signatures)
// Verify with BitSetSignature
err := bitSetSig. Verify (msgBytes, validators)
// Get signed weight
weight, err := bitSetSig. GetSignedWeight (validators)
# Build
make build-cli
# Create cross-chain message
warp create --source 0xAA --dest 0xBB --payload "Hello from chain A"
# Sign a message
warp sign --message < he x > --key ~/.lux/staking/signer.key
# Verify a signature
warp verify --message < he x > --signature < he x >
# Run relay server
warp serve --port 9650 --dev
# As Lux CLI plugin
lux warp create --source 96369 --dest 200200 --payload "Bridge LUX to ZOO"
lux warp sign --message < he x > --key ~/.lux/staking/signer.key
lux warp relay
Post-Quantum Safety : Random ringtail validation resists quantum attacks
Enhanced Privacy : Ring signatures for validator anonymity
Private Messaging : Z-chain FHE for private cross-chain messages (optional)
Dynamic Validator Selection : Random subset validation
Forward Secrecy : Ephemeral keys for message encryption
Zero-Knowledge Proofs : Optional ZK proofs for message validity
github.com/luxfi/crypto@v1.17.40 — BLS12-381 signatures
github.com/luxfi/geth@v1.16.73 — EVM types (RLP encoding)
github.com/luxfi/ids@v1.2.9 — Chain/node ID types
github.com/luxfi/p2p@v1.18.9 — P2P networking
github.com/luxfi/codec@v1.1.4 — Message serialization
github.com/luxfi/vm@v1.0.27 — VM integration
github.com/luxfi/precompile@v0.4.5 — EVM precompile
github.com/spf13/cobra@v1.10.2 — CLI framework
Variable Purpose WARP_RPC_URLRPC endpoint for blockchain connection WARP_KEY_PATHPath to signing key WARP_LOG_LEVELLogging level (debug, info, warn, error)
rpc :
url : http://localhost:9650/ext/bc/C/rpc
timeout : 30s
signing :
key_path : ~/.lux/staking/signer.key
relay :
port : 9650
chains :
- id : 96369
name : lux-mainnet
- id : 200200
name : zoo-mainnet
Target Method EVM Chains Precompile at well-known address Non-EVM Chains Native module or system contract Bridge Services RPC/gRPC API Off-Chain Message relay service Lux CLI Plugin integration (cmd/plugin/)
# Build
make docker-build
# Run relay
docker run -d -p 9650:9650 luxfi/warp:latest serve
# Create message
docker run --rm luxfi/warp:latest create --source 0xAA --dest 0xBB --payload "Hello"
go test -v ./...
make test
make lint # golangci-lint
make ci # Full CI pipeline
lux/lux-node.md -- Node that processes warp messages
lux/lux-crypto.md -- BLS signatures used by warp
lux/lux-bridge.md -- Bridge that uses warp for cross-chain
lux/lux-evm.md -- EVM precompile for warp verification
lux/lux-precompile.md -- Precompile integration details