Lux Skills Reference
Lux SDK Official Go SDK
Lux SDK is the official Go SDK for building and managing Lux networks. It provides a unified interface for network lifecycle management, blockchain creation and deployment (L1/L2/L3), multi-chain wallet operations, validator management, smart contract interaction, and cross-chain messaging via Warp. The SDK wraps CLI, netrunner, and direct node APIs into a single coherent library.
Item Value Module github.com/luxfi/sdkGo 1.26.1 Entry point sdk.go (LuxSDK struct)Main API sdk.New(cfg) returns *LuxSDK
Dependency Version Purpose github.com/luxfi/consensusv1.22.63 Snow consensus engine github.com/luxfi/evmv0.8.35 C-Chain EVM github.com/luxfi/nodev1.23.4 Lux node implementation github.com/luxfi/netrunnerv1.15.11 Network testing orchestrator github.com/luxfi/genesisv1.6.1 Genesis configuration github.com/luxfi/warpv1.18.5 Cross-chain Warp messaging github.com/luxfi/ledgerv1.1.6 Hardware wallet support github.com/luxfi/lpmv1.9.4 Lux Plugin Manager github.com/luxfi/cryptov1.17.40 Cryptographic primitives github.com/luxfi/gethv1.16.75 Go-Ethereum fork (EVM) github.com/luxfi/idsv1.2.9 ID types (ID, ShortID, NodeID) github.com/luxfi/protocolv0.0.3 P-Chain protocol types github.com/luxfi/rpcv1.0.0 JSON-RPC client github.com/luxfi/utxov0.2.4 UTXO management github.com/luxfi/vmv1.0.33 Virtual machine interfaces github.com/luxfi/validatorsv1.0.0 Validator types github.com/luxfi/constantsv1.4.4 Network constants github.com/luxfi/databasev1.17.40 Storage layer github.com/luxfi/codecv1.1.4 Serialization codec github.com/luxfi/formattingv1.0.1 Encoding utilities github.com/luxfi/keychainv1.0.2 Key management github.com/luxfi/addressv1.0.1 Bech32 address formatting github.com/luxfi/apiv1.0.1 API types github.com/luxfi/bftv0.1.5 BFT consensus github.com/luxfi/go-bip32v1.0.2 BIP-32 HD keys github.com/luxfi/go-bip39v1.1.2 BIP-39 mnemonics github.com/luxfi/runtimev1.0.1 VM runtime github.com/luxfi/upgradev1.0.0 Upgrade management github.com/luxfi/tlsv1.0.3 TLS certificate utilities github.com/luxfi/netv0.0.2 Network utilities github.com/luxfi/mathv1.2.3 Math utilities github.com/luxfi/utilsv1.1.4 General utilities github.com/luxfi/p2pv1.19.2-zap P2P networking
Package Import Purpose sdkgithub.com/luxfi/sdkLuxSDK struct -- entry point with New(cfg), Networks(), Blockchains(), LaunchNetwork(), CreateAndDeployBlockchain()config.../sdk/configConfig struct with Default() factoryconstants.../sdk/constantsSDK-level constants
Package Import Purpose network.../sdk/networkNetworkManager -- create/start/stop networks. Types: NetworkType (mainnet/testnet/local/custom), NetworkStatus, NodeType (validator/api/full/light), NetworkParamsnetwork (legacy).../sdk/networkLegacyNetwork with predefined MainnetNetwork (api.lux.network), TestnetNetwork (api-test.lux.network), LocalNetwork (127.0.0.1:9630)netrunner.../sdk/netrunnerWraps github.com/luxfi/netrunner for test network orchestration connect.../sdk/connectNode connection utilities
Package Import Purpose blockchain.../sdk/blockchainBuilder -- CreateBlockchain(), Deploy(). Types: BlockchainType (L1/L2/L3), VMType (evm/wasm/custom/tokenvm/morpheusvm), Blockchain, Net, GenesisAccount, GenesisValidatorchainconfig.../sdk/chainconfigChain config and genesis generation/parsing configspec.../sdk/configspecConfiguration specification utilities fees.../sdk/feesFee configuration
Package Import Purpose platformvm.../sdk/platformvmP-Chain client: GetHeight(), GetBalance(), GetUTXOs(), GetCurrentValidators(), GetNet(), GetNets(), GetStakingAssetID(), GetL1Validator() exchangevm.../sdk/exchangevmX-Chain client: Client, WalletClient, StaticClient -- UTXO transfers, asset creation evm.../sdk/evmC-Chain EVM utilities health.../sdk/healthNode health client with Health(ctx) admin.../sdk/adminAdmin API client info.../sdk/infoNode info client indexer.../sdk/indexerTransaction indexer client
Package Import Purpose wallet.../sdk/walletWallet struct -- multi-chain wallet with ImportKey(), BLS key support for validator ops, UTXO trackingwallet/primary.../sdk/wallet/primaryPrimary network wallet operations wallet/chain.../sdk/wallet/chainPer-chain wallet backends wallet/crypto.../sdk/wallet/cryptoWallet cryptographic operations wallet/keychain.../sdk/wallet/keychainWallet keychain management key.../sdk/keyKey struct (ed25519/bls/secp256k1), Keychain with Add(), Sign(), Get(), Addresses()keychain.../sdk/keychainExtended keychain utilities ledger.../sdk/ledgerLedger hardware wallet integration crypto.../sdk/cryptoEd25519 key operations multisig.../sdk/multisigMulti-signature transaction support
Package Import Purpose validator.../sdk/validatorValidator configuration and context validatormanager.../sdk/validatormanagerL1 validator lifecycle: PoA and PoS manager contracts, registration, removal, weight updates, uptime tracking. Embeds deployed contract bytecodes (ValidatorMessages, PoAValidatorManager, PoSValidatorManager, TransparentUpgradeableProxy) validatormanager/txs.../sdk/validatormanager/txsValidator manager transaction types validatormanager/warp.../sdk/validatormanager/warpWarp message handling for validator ops
Package Import Purpose contract.../sdk/contractSmart contract interaction: Deploy(), Chain(), ABI parsing, receipt status handling, allocation management. Uses github.com/luxfi/evm/accounts/abi/bind contract/contracts.../sdk/contract/contractsPrecompiled contract interfaces contracts/bin.../sdk/contracts/binCompiled contract binaries
Package Import Purpose warp.../sdk/warpWarp cross-chain messaging utilities
Package Import Purpose lpm.../sdk/lpmLux Plugin Manager -- VM plugin installation models.../sdk/modelsData models: Network, Sidecar, L2, Host, ClustersConfig, BootstrapValidator, NodeConfig, VM, Cloud, Docker publicarchive.../sdk/publicarchivePublic archive downloader for chain data profiles.../sdk/profilesNode configuration profiles trace.../sdk/traceOpenTelemetry tracing utils.../sdk/utilsGeneral utilities utils/fs.../sdk/utils/fsFilesystem utilities ux.../sdk/uxUser experience helpers (output formatting) prompts.../sdk/promptsInteractive prompt utilities flags.../sdk/flagsCLI flag mutex support assets.../sdk/assetsEmbedded asset files chain.../sdk/chainChain type definitions
Chain Type SDK Package Operations P-Chain Platform platformvmStaking, validators, L1/net creation, UTXOs, balance X-Chain Exchange exchangevmUTXO transfers, asset creation/minting C-Chain Contract evmEVM transactions, contract deployment Q-Chain Quantum (via node API) PQ-specific operations M-Chain MPC (via node API) Multi-party custody
Network ID Endpoint Mainnet constants.MainnetIDhttps://api.lux.networkTestnet constants.TestnetIDhttps://api-test.lux.networkLocal constants.LocalIDhttp://127.0.0.1:9630Devnet custom custom
cfg := config. Default ()
s, err := sdk. New (cfg)
// s.Networks() -> *network.NetworkManager
// s.Blockchains() -> *blockchain.Builder
net, err := s. LaunchNetwork (ctx, "local" , 5 )
bc, err := s. CreateAndDeployBlockchain (ctx, & sdk . BlockchainParams {
Name: "my-chain" ,
Type: blockchain.TypeL1,
VMType: blockchain.VMTypeEVM,
ChainID: big. NewInt ( 43114 ),
Network: net,
})
client := platformvm. NewClientWithNetworkID ( "http://localhost:9630" , 1 )
height, err := client. GetHeight (ctx)
validators, err := client. GetCurrentValidators (ctx, chainID, nil )
balance, err := client. GetBalance (ctx, addrs)
w := wallet. New (networkID, chainID)
addr, err := w. ImportKey (privateKey)
kc := key. NewKeychain ()
err := kc. Add (privateKey)
sig, err := kc. Sign (message, address)
// Contract interaction uses luxfi/evm/accounts/abi/bind
// and luxfi/geth types for EVM compatibility
// Deploys embedded PoA/PoS validator manager contracts
// Handles registration, removal, weight updates via Warp
VM Constant Description EVM VMTypeEVMEthereum Virtual Machine (via luxfi/evm) WASM VMTypeWASMWebAssembly VM Custom VMTypeCustomUser-provided VM TokenVM VMTypeTokenVMHyperSDK token VM MorpheusVM VMTypeMorpheusVMHyperSDK general VM
lux/lux-node.md -- Node that SDK connects to
lux/lux-cli.md -- CLI tool (SDK wraps CLI)
lux/lux-netrunner.md -- Network testing (SDK wraps netrunner)
lux/lux-crypto.md -- Cryptographic primitives used by SDK
lux/lux-evm.md -- EVM implementation