light

package module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2026 License: BSD-3-Clause Imports: 9 Imported by: 0

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

View Source
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.

View Source
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 IsLight

func IsLight(s string) bool

IsLight reports whether s is the light Mnemonic, in constant time.

func RefuseOnProduction

func RefuseOnProduction(mnemonic string) error

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

func DeriveAccount(i int) (Account, error)

DeriveAccount returns the account at index i (m/44'/9000'/0'/0/i) under the light mnemonic.

func DeriveAccounts

func DeriveAccounts(n int) ([]Account, error)

DeriveAccounts returns accounts 0..n-1, walking the shared prefix once.

func (Account) ECPrivateKeyHex

func (a Account) ECPrivateKeyHex() string

ECPrivateKeyHex returns the private key as hex, no 0x.

func (Account) EVMAddressHex

func (a Account) EVMAddressHex() string

EVMAddressHex returns the C-Chain address as 0x hex.

func (Account) LuxAddressHex

func (a Account) LuxAddressHex() string

LuxAddressHex returns the P/X-Chain address as 0x hex. Use LuxAddress.String() for cb58.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL