mirror of
https://github.com/luxfi/precompile.git
synced 2026-09-24 00:26:21 +00:00
Corona is the Ring-LWE threshold signature scheme (lattice flavor:
Ring-LWE, vs Pulsar's Module-LWE / ML-DSA). The pre-rename library
name was Corona. Sweep eliminates every Corona reference across
the precompile tree and gives the Ring-LWE threshold its own slot
in the LP-4200 PQCrypto block:
0x012201 = ML-KEM (Module-LWE KEM, FIPS 203)
0x012202 = ML-DSA (Module-LWE single-sig, FIPS 204)
0x012203 = SLH-DSA (hash-based signature, FIPS 205)
0x012204 = Pulsar (Module-LWE threshold, FIPS 204 byte-equal)
0x012205 = P3Q (strict-PQ STARK)
0x012206 = Corona (Ring-LWE threshold)
Pulsar previously squatted 0x012204 alone; Corona/Corona also
claimed 0x012204 — direct slot collision. Fixed by moving Corona
to its own slot 0x012206 since they're distinct primitives
(different lattice flavors).
- Directory: corona/ → corona/
- Package: coronathreshold → coronathreshold
- Type: coronaThresholdPrecompile → coronaThresholdPrecompile
- Var: CoronaThresholdPrecompile → CoronaThresholdPrecompile
- Address: 0x012204 → 0x012206
- Library: luxfi/corona/sign → luxfi/corona/sign
luxfi/corona/threshold → luxfi/corona/threshold
- Interface: ICoronaThreshold.sol → ICoronaThreshold.sol
- Registry: CoronaCChain → CoronaCChain, CORONA → CORONA
- Quasar: Corona* identifiers in quasar/contract.go renamed
- Bridge: docstring sweep
All affected packages build clean. All 5/6 PQ precompile tests pass
(one flaky on first run, green on retry). Bridge has a pre-existing
unrelated build break (ErrChainNameTooLong undefined).
luxprecompile-sys
FFI bindings to libluxprecompile — every Lux EVM precompile (PQ verify, Quasar,
Blake3, FROST, dex, AI, ZK, …) reachable via one Go-built shared library, one
stable C ABI, one Rust crate.
System dependency
This crate links against libluxprecompile.{dylib,so,a} which is built from
the Go sources at https://github.com/luxfi/precompile. The library is not
vendored in this crate because it exceeds the crates.io 10 MiB tarball limit.
Install the shared library before depending on this crate:
# Clone and build the Go library
git clone https://github.com/luxfi/precompile
cd precompile
make dist # produces dist/libluxprecompile.{dylib,a,h}
# Install into a standard system location (one of):
sudo cp dist/libluxprecompile.dylib /usr/local/lib/ # macOS
sudo cp dist/libluxprecompile.so /usr/local/lib/ # Linux
sudo ldconfig # Linux
The build.rs searches for the library in this order:
$LUX_PRECOMPILE_LIB_DIR(explicit override)~/work/lux/precompile/dist/(in-tree dev default)/usr/local/lib(standard install)- System default library path
Usage
use luxprecompile_sys::{run, list, required_gas};
// List all registered precompiles
let precompiles = list().unwrap();
for pc in &precompiles {
println!("{}: {}", pc.address, pc.name);
}
// Run blake3 Hash256: op = 0x01, data = b"hello"
let addr = "0x0500000000000000000000000000000000000004";
let mut input = vec![0x01u8];
input.extend_from_slice(b"hello");
let result = run(addr, &input, 1_000_000).unwrap();
assert_eq!(result.output.len(), 32);
License
Lux Ecosystem License 1.2 — see the LICENSE file.