Documentation
¶
Overview ¶
Package light holds the one copy of the public Lux "light" dev mnemonic and the wallet keys derived from it. Local networks only (network ID 1337, EVM chain ID 31337). The seed is public, so it must never back a real network; RefuseOnProduction enforces that. No staker, node ID, or BLS material lives here — validator keys are random per node and kept with each node.
Index ¶
Constants ¶
const LuxCoinType = 9000
LuxCoinType is the BIP44 coin type Lux uses. The full path is m/44'/9000'/0'/0/i, matching genesis and any BIP44 wallet, so one seed yields the same addresses everywhere.
const Mnemonic = "light light light light light light light light light light light energy"
Mnemonic is the public Lux dev seed. Use it as LUX_MNEMONIC (or LIGHT_MNEMONIC) to boot a local network. Reference this const; never copy the literal.
Variables ¶
This section is empty.
Functions ¶
func RefuseOnProduction ¶
RefuseOnProduction returns an error for an empty seed or any seed that is not a known public one; a known public seed returns nil. It mirrors genesis.RefuseLightMnemonicOnProduction without the network coupling: the caller decides where it runs, this decides whether the seed is public.
Types ¶
type Account ¶
type Account struct {
Index int
ECPrivateKey []byte // 32-byte secp256k1 scalar
EVMAddress ids.ShortID // 20-byte C-Chain / EVM
LuxAddress ids.ShortID // 20-byte P/X-Chain
}
Account is one wallet identity from the light mnemonic. Account material only — no staker cert, node ID, or BLS.
func DeriveAccount ¶
DeriveAccount returns the account at index i (m/44'/9000'/0'/0/i) under the light mnemonic.
func DeriveAccounts ¶
DeriveAccounts returns accounts 0..n-1, walking the shared prefix once.
func (Account) ECPrivateKeyHex ¶
ECPrivateKeyHex returns the private key as hex, no 0x.
func (Account) EVMAddressHex ¶
EVMAddressHex returns the C-Chain address as 0x hex.
func (Account) LuxAddressHex ¶
LuxAddressHex returns the P/X-Chain address as 0x hex. Use LuxAddress.String() for cb58.