Documentation
ΒΆ
Overview ΒΆ
Package sdk provides extensions to the Lux SDK for building various VMs This extends the existing Lux SDK at ~/work/lux/sdk
Index ΒΆ
- type AIExtension
- type AIModel
- type AttestationGenerator
- type BFTConfig
- type BFTConsensusEngine
- func (e *BFTConsensusEngine) AdvanceTime(duration time.Duration)
- func (e *BFTConsensusEngine) Config() *BFTConfig
- func (e *BFTConsensusEngine) Epoch() *bft.Epoch
- func (e *BFTConsensusEngine) GetID() ids.ID
- func (e *BFTConsensusEngine) GetMetadata() *bft.ProtocolMetadata
- func (e *BFTConsensusEngine) HandleMessage(msg *bft.Message, from ids.NodeID) error
- func (e *BFTConsensusEngine) Initialize(blockBuilder bft.BlockBuilder, storage bft.Storage, signer bft.Signer, ...) error
- func (e *BFTConsensusEngine) IsRunning() bool
- func (e *BFTConsensusEngine) SetBLSAggregation(enabled bool)
- func (e *BFTConsensusEngine) SetQuantumMode(enabled bool)
- func (e *BFTConsensusEngine) SetVerkleWitnesses(enabled bool)
- func (e *BFTConsensusEngine) Start(ctx context.Context) error
- func (e *BFTConsensusEngine) Stop() error
- type BlockchainParams
- type Clearinghouse
- type ConsensusEngine
- type Context
- type CrossChainBridge
- type DEXExtension
- type DeploymentType
- type EncryptedValue
- type Engine
- type FHEExtension
- type FHEKeyManager
- type FHEScheme
- type FeatureSet
- type FundingEngine
- type HomomorphicComputer
- type InferenceEngine
- type LatticeCrypto
- type LuxSDK
- func (sdk *LuxSDK) Blockchains() *blockchain.Builder
- func (sdk *LuxSDK) CreateAndDeployBlockchain(ctx context.Context, params *BlockchainParams) (*blockchain.Blockchain, error)
- func (sdk *LuxSDK) LaunchNetwork(ctx context.Context, networkType string, numNodes int) (*network.Network, error)
- func (sdk *LuxSDK) Networks() *network.NetworkManager
- type MPCComputer
- type MPCExtension
- type MPCProtocol
- type ModelPerformance
- type ModelRegistry
- type MultisigManager
- type NetworkManager
- type NodeInfo
- type OrderBook
- type Party
- type ProofVerifier
- type QuantumCertificate
- type QuantumExtension
- type QuantumProofSystem
- type RingtailConsensus
- type SecretShare
- type StakingManager
- type StateDB
- type StateHandler
- type TrainingManager
- type VMBuilder
- type VMExtension
- type VaultManager
Constants ΒΆ
This section is empty.
Variables ΒΆ
This section is empty.
Functions ΒΆ
This section is empty.
Types ΒΆ
type AIExtension ΒΆ added in v1.3.0
type AIExtension struct {
ModelRegistry *ModelRegistry
InferenceEngine *InferenceEngine
AttestationGen *AttestationGenerator
ProofVerifier *ProofVerifier
TrainingManager *TrainingManager
}
func (*AIExtension) Initialize ΒΆ added in v1.3.0
func (e *AIExtension) Initialize(builder *VMBuilder) error
func (*AIExtension) Name ΒΆ added in v1.3.0
func (e *AIExtension) Name() string
func (*AIExtension) Stop ΒΆ added in v1.3.0
func (e *AIExtension) Stop() error
type AttestationGenerator ΒΆ added in v1.3.0
type AttestationGenerator struct{}
func NewAttestationGenerator ΒΆ added in v1.3.0
func NewAttestationGenerator() *AttestationGenerator
type BFTConfig ΒΆ added in v1.3.0
type BFTConfig struct {
// Deployment type
DeploymentType DeploymentType
// Network configuration
NetworkID uint32
ChainID ids.ID
NodeID ids.NodeID
// Consensus parameters
MaxProposalWait time.Duration
MaxRebroadcastWait time.Duration
// Quantum-safe mode (for Quasar Protocol)
QuantumSafeMode bool
// BLS signature aggregation
BLSAggregation bool
// Epoch configuration
EpochNumber uint64
StartTime time.Time
// Validator configuration
Validators []ids.NodeID
// Storage
DB database.Database
WAL bft.WriteAheadLog
// Logging
Logger log.Logger
// Enable replication protocol
ReplicationEnabled bool
}
BFTConfig contains configuration for BFT consensus engine
type BFTConsensusEngine ΒΆ added in v1.3.0
type BFTConsensusEngine struct {
// contains filtered or unexported fields
}
BFTConsensusEngine implements ConsensusEngine interface using the BFT package
func NewBFTConsensusEngine ΒΆ added in v1.3.0
func NewBFTConsensusEngine(config *BFTConfig) (*BFTConsensusEngine, error)
NewBFTConsensusEngine creates a new BFT consensus engine
func (*BFTConsensusEngine) AdvanceTime ΒΆ added in v1.3.0
func (e *BFTConsensusEngine) AdvanceTime(duration time.Duration)
AdvanceTime hints to the engine that time has passed
func (*BFTConsensusEngine) Config ΒΆ added in v1.3.0
func (e *BFTConsensusEngine) Config() *BFTConfig
Config returns the engine's configuration
func (*BFTConsensusEngine) Epoch ΒΆ added in v1.3.0
func (e *BFTConsensusEngine) Epoch() *bft.Epoch
Epoch returns the underlying BFT epoch (for advanced use cases)
func (*BFTConsensusEngine) GetID ΒΆ added in v1.3.0
func (e *BFTConsensusEngine) GetID() ids.ID
GetID returns the chain ID
func (*BFTConsensusEngine) GetMetadata ΒΆ added in v1.3.0
func (e *BFTConsensusEngine) GetMetadata() *bft.ProtocolMetadata
GetMetadata returns the current consensus metadata
func (*BFTConsensusEngine) HandleMessage ΒΆ added in v1.3.0
HandleMessage handles incoming consensus messages
func (*BFTConsensusEngine) Initialize ΒΆ added in v1.3.0
func (e *BFTConsensusEngine) Initialize( blockBuilder bft.BlockBuilder, storage bft.Storage, signer bft.Signer, verifier bft.SignatureVerifier, aggregator bft.SignatureAggregator, communication bft.Communication, qcDeserializer bft.QCDeserializer, blockDeserializer bft.BlockDeserializer, ) error
Initialize initializes the BFT epoch with the provided components
func (*BFTConsensusEngine) IsRunning ΒΆ added in v1.3.0
func (e *BFTConsensusEngine) IsRunning() bool
IsRunning returns whether the engine is running
func (*BFTConsensusEngine) SetBLSAggregation ΒΆ added in v1.3.0
func (e *BFTConsensusEngine) SetBLSAggregation(enabled bool)
SetBLSAggregation enables or disables BLS signature aggregation
func (*BFTConsensusEngine) SetQuantumMode ΒΆ added in v1.3.0
func (e *BFTConsensusEngine) SetQuantumMode(enabled bool)
SetQuantumMode enables or disables quantum-safe mode
func (*BFTConsensusEngine) SetVerkleWitnesses ΒΆ added in v1.3.0
func (e *BFTConsensusEngine) SetVerkleWitnesses(enabled bool)
SetVerkleWitnesses enables or disables Verkle tree witnesses
func (*BFTConsensusEngine) Start ΒΆ added in v1.3.0
func (e *BFTConsensusEngine) Start(ctx context.Context) error
Start starts the BFT consensus engine
func (*BFTConsensusEngine) Stop ΒΆ added in v1.3.0
func (e *BFTConsensusEngine) Stop() error
Stop stops the BFT consensus engine
type BlockchainParams ΒΆ
type BlockchainParams struct {
Name string
Type blockchain.BlockchainType
VMType blockchain.VMType
ChainID *big.Int
Genesis []byte
Network *network.Network
}
BlockchainParams defines parameters for creating and deploying a blockchain
type Clearinghouse ΒΆ added in v1.3.0
type Clearinghouse struct{}
func NewClearinghouse ΒΆ added in v1.3.0
func NewClearinghouse() *Clearinghouse
Factory functions for extensions
type ConsensusEngine ΒΆ added in v1.3.0
type ConsensusEngine interface {
Engine
SetQuantumMode(enabled bool)
SetBLSAggregation(enabled bool)
SetVerkleWitnesses(enabled bool)
}
ConsensusEngine interface (extends existing)
type CrossChainBridge ΒΆ added in v1.3.0
type CrossChainBridge struct{}
func NewCrossChainBridge ΒΆ added in v1.3.0
func NewCrossChainBridge() *CrossChainBridge
type DEXExtension ΒΆ added in v1.3.0
type DEXExtension struct {
OrderBooks map[string]*OrderBook
Clearinghouse *Clearinghouse
FundingEngine *FundingEngine
Bridge *CrossChainBridge
Vaults *VaultManager
StakingPools *StakingManager
Multisig *MultisigManager
}
func (*DEXExtension) Initialize ΒΆ added in v1.3.0
func (e *DEXExtension) Initialize(builder *VMBuilder) error
func (*DEXExtension) Name ΒΆ added in v1.3.0
func (e *DEXExtension) Name() string
func (*DEXExtension) Start ΒΆ added in v1.3.0
func (e *DEXExtension) Start(ctx context.Context) error
func (*DEXExtension) Stop ΒΆ added in v1.3.0
func (e *DEXExtension) Stop() error
type DeploymentType ΒΆ added in v1.3.0
type DeploymentType int
DeploymentType indicates where the BFT consensus is deployed
const ( // MainnetDeployment is for Lux mainnet MainnetDeployment DeploymentType = iota // TestnetDeployment is for Lux testnet TestnetDeployment // SovereignL1Deployment is for sovereign quantum-safe L1 chains // secured by Quasar Protocol (Lux Quantum Consensus) SovereignL1Deployment )
func (DeploymentType) String ΒΆ added in v1.3.0
func (dt DeploymentType) String() string
type EncryptedValue ΒΆ added in v1.3.0
type FHEExtension ΒΆ added in v1.3.0
type FHEExtension struct {
Scheme FHEScheme
KeyManager *FHEKeyManager
EncryptedState map[string]*EncryptedValue
Computer *HomomorphicComputer
}
func (*FHEExtension) Initialize ΒΆ added in v1.3.0
func (e *FHEExtension) Initialize(builder *VMBuilder) error
func (*FHEExtension) Name ΒΆ added in v1.3.0
func (e *FHEExtension) Name() string
func (*FHEExtension) Start ΒΆ added in v1.3.0
func (e *FHEExtension) Start(ctx context.Context) error
func (*FHEExtension) Stop ΒΆ added in v1.3.0
func (e *FHEExtension) Stop() error
type FHEKeyManager ΒΆ added in v1.3.0
type FHEKeyManager struct {
PublicKey []byte
EvaluationKey []byte
RelinKey []byte
GaloisKeys map[int][]byte
}
func NewFHEKeyManager ΒΆ added in v1.3.0
func NewFHEKeyManager() *FHEKeyManager
type FeatureSet ΒΆ added in v1.3.0
type FeatureSet struct {
// Consensus features
QuantumResistant bool // Ringtail lattice-based
BLSAggregation bool // BLS signature aggregation
VerkleWitnesses bool // Verkle tree witnesses
FPC bool // Fast Probabilistic Consensus
// Cryptographic features
FHE bool // Fully Homomorphic Encryption
MPC bool // Multi-Party Computation
ZKProofs bool // Zero-Knowledge Proofs
PostQuantum bool // Post-quantum cryptography
// Execution features
GPU bool // GPU acceleration
FPGA bool // FPGA acceleration
DPDK bool // Kernel bypass networking
RDMA bool // Remote Direct Memory Access
// Application features
DEX bool // Decentralized exchange
AI bool // AI/ML capabilities
Oracle bool // Oracle functionality
Privacy bool // Privacy features
Storage bool // Decentralized storage
}
FeatureSet defines features a VM can enable
type FundingEngine ΒΆ added in v1.3.0
type FundingEngine struct{}
func NewFundingEngine ΒΆ added in v1.3.0
func NewFundingEngine() *FundingEngine
type HomomorphicComputer ΒΆ added in v1.3.0
type HomomorphicComputer struct {
// contains filtered or unexported fields
}
func (*HomomorphicComputer) Add ΒΆ added in v1.3.0
func (c *HomomorphicComputer) Add(a, b *EncryptedValue) *EncryptedValue
func (*HomomorphicComputer) Multiply ΒΆ added in v1.3.0
func (c *HomomorphicComputer) Multiply(a, b *EncryptedValue) *EncryptedValue
type InferenceEngine ΒΆ added in v1.3.0
type InferenceEngine struct {
// contains filtered or unexported fields
}
func NewInferenceEngine ΒΆ added in v1.3.0
func NewInferenceEngine() *InferenceEngine
func (*InferenceEngine) EnableGPU ΒΆ added in v1.3.0
func (e *InferenceEngine) EnableGPU()
type LatticeCrypto ΒΆ added in v1.3.0
type LuxSDK ΒΆ
type LuxSDK struct {
// contains filtered or unexported fields
}
LuxSDK is the main SDK interface providing comprehensive blockchain development capabilities
func (*LuxSDK) Blockchains ΒΆ
func (sdk *LuxSDK) Blockchains() *blockchain.Builder
Blockchains returns the blockchain builder for blockchain operations
func (*LuxSDK) CreateAndDeployBlockchain ΒΆ
func (sdk *LuxSDK) CreateAndDeployBlockchain(ctx context.Context, params *BlockchainParams) (*blockchain.Blockchain, error)
CreateAndDeployBlockchain creates and deploys a blockchain
func (*LuxSDK) LaunchNetwork ΒΆ
func (sdk *LuxSDK) LaunchNetwork(ctx context.Context, networkType string, numNodes int) (*network.Network, error)
LaunchNetwork launches a network using the network manager
func (*LuxSDK) Networks ΒΆ
func (sdk *LuxSDK) Networks() *network.NetworkManager
Networks returns the network manager for network operations
type MPCComputer ΒΆ added in v1.3.0
type MPCComputer struct {
// contains filtered or unexported fields
}
type MPCExtension ΒΆ added in v1.3.0
type MPCExtension struct {
Protocol MPCProtocol
Parties map[string]*Party
Computer *MPCComputer
}
func (*MPCExtension) Initialize ΒΆ added in v1.3.0
func (e *MPCExtension) Initialize(builder *VMBuilder) error
func (*MPCExtension) Name ΒΆ added in v1.3.0
func (e *MPCExtension) Name() string
func (*MPCExtension) Start ΒΆ added in v1.3.0
func (e *MPCExtension) Start(ctx context.Context) error
func (*MPCExtension) Stop ΒΆ added in v1.3.0
func (e *MPCExtension) Stop() error
type MPCProtocol ΒΆ added in v1.3.0
type MPCProtocol string
const ( ProtocolGMW MPCProtocol = "gmw" // Goldreich-Micali-Wigderson ProtocolBGW MPCProtocol = "bgw" // Ben-Or-Goldwasser-Wigderson ProtocolSPDZ MPCProtocol = "spdz" // Fast MPC with preprocessing ProtocolABY MPCProtocol = "aby" // Mixed protocol )
type ModelPerformance ΒΆ added in v1.3.0
type ModelRegistry ΒΆ added in v1.3.0
type MultisigManager ΒΆ added in v1.3.0
type MultisigManager struct{}
func NewMultisigManager ΒΆ added in v1.3.0
func NewMultisigManager() *MultisigManager
type NetworkManager ΒΆ added in v1.3.0
type NetworkManager interface {
Send(msg []byte, nodeID ids.NodeID) error
Broadcast(msg []byte) error
EnableDPDK() error
EnableRDMA() error
}
NetworkManager interface (extends existing)
type ProofVerifier ΒΆ added in v1.3.0
type ProofVerifier struct{}
func NewProofVerifier ΒΆ added in v1.3.0
func NewProofVerifier() *ProofVerifier
type QuantumCertificate ΒΆ added in v1.3.0
type QuantumExtension ΒΆ added in v1.3.0
type QuantumExtension struct {
Lattice *LatticeCrypto
Ringtail *RingtailConsensus
QuantumProofs *QuantumProofSystem
}
func (*QuantumExtension) Initialize ΒΆ added in v1.3.0
func (e *QuantumExtension) Initialize(builder *VMBuilder) error
func (*QuantumExtension) Name ΒΆ added in v1.3.0
func (e *QuantumExtension) Name() string
func (*QuantumExtension) Start ΒΆ added in v1.3.0
func (e *QuantumExtension) Start(ctx context.Context) error
func (*QuantumExtension) Stop ΒΆ added in v1.3.0
func (e *QuantumExtension) Stop() error
type QuantumProofSystem ΒΆ added in v1.3.0
type QuantumProofSystem struct {
ProofType string // lattice, code-based, hash-based, multivariate
}
type RingtailConsensus ΒΆ added in v1.3.0
type RingtailConsensus struct {
Rounds int // 2-round consensus
Threshold float64
Certificates map[ids.ID]*QuantumCertificate
}
type SecretShare ΒΆ added in v1.3.0
type SecretShare struct {
}
type StakingManager ΒΆ added in v1.3.0
type StakingManager struct{}
func NewStakingManager ΒΆ added in v1.3.0
func NewStakingManager() *StakingManager
type StateDB ΒΆ added in v1.3.0
type StateDB interface {
Get(key []byte) ([]byte, error)
Put(key []byte, value []byte) error
Delete(key []byte) error
RegisterHandler(prefix string, handler StateHandler) error
}
StateDB interface for state management (extends existing)
type StateHandler ΒΆ added in v1.3.0
type TrainingManager ΒΆ added in v1.3.0
type TrainingManager struct{}
func NewTrainingManager ΒΆ added in v1.3.0
func NewTrainingManager() *TrainingManager
type VMBuilder ΒΆ added in v1.3.0
type VMBuilder struct {
// Core SDK components (existing)
Context *Context
DB database.Database
State StateDB
Consensus ConsensusEngine
Network NetworkManager
// Extended components for various VMs
Extensions map[string]VMExtension
Features *FeatureSet
// contains filtered or unexported fields
}
VMBuilder provides a unified interface for building VMs on Lux This extends the existing SDK with additional capabilities needed for: DEXVM, AIVM, FHEVM, MPCVM, QuantumVM, and more
func NewVMBuilder ΒΆ added in v1.3.0
NewVMBuilder creates a new VM builder
func (*VMBuilder) WithExtension ΒΆ added in v1.3.0
func (b *VMBuilder) WithExtension(ext VMExtension) *VMBuilder
WithExtension adds an extension to the VM
func (*VMBuilder) WithFeatures ΒΆ added in v1.3.0
func (b *VMBuilder) WithFeatures(features *FeatureSet) *VMBuilder
WithFeatures enables features
type VMExtension ΒΆ added in v1.3.0
type VMExtension interface {
Name() string
Initialize(builder *VMBuilder) error
Start(ctx context.Context) error
Stop() error
}
VMExtension represents VM-specific functionality
type VaultManager ΒΆ added in v1.3.0
type VaultManager struct{}
func NewVaultManager ΒΆ added in v1.3.0
func NewVaultManager() *VaultManager
Directories
ΒΆ
| Path | Synopsis |
|---|---|
|
Package crypto provides functionality for interacting with Ed25519 public and private keys.
|
Package crypto provides functionality for interacting with Ed25519 public and private keys. |
|
internal
|
|
|
Package keys provides key derivation and management utilities for LUX.
|
Package keys provides key derivation and management utilities for LUX. |
|
mocks
|
|
|
ethclient
Package mock_ethclient is a generated GoMock package.
|
Package mock_ethclient is a generated GoMock package. |
|
Package netrunner provides integration with the Lux netrunner tool for managing test networks and blockchain deployments.
|
Package netrunner provides integration with the Lux netrunner tool for managing test networks and blockchain deployments. |
|
tools
|
|
|
xfer
command
xfer is a simple tool to transfer LUX from X-Chain to P-Chain Usage: xfer -uri http://127.0.0.1:9630 -key ~/.lux/keys/mainnet-deployer.pk -amount 1000000000 Or set LUX_PRIVATE_KEY env var (hex format) or LUX_MNEMONIC env var (24 words)
|
xfer is a simple tool to transfer LUX from X-Chain to P-Chain Usage: xfer -uri http://127.0.0.1:9630 -key ~/.lux/keys/mainnet-deployer.pk -amount 1000000000 Or set LUX_PRIVATE_KEY env var (hex format) or LUX_MNEMONIC env var (24 words) |
|
// Copyright (C) 2025, Lux Partners Limited All rights reserved See the file LICENSE for licensing terms.
|
// Copyright (C) 2025, Lux Partners Limited All rights reserved See the file LICENSE for licensing terms. |