mirror of
https://github.com/luxfi/precompile.git
synced 2026-07-27 03:33:45 +00:00
precompile: fix stale P3Q-as-STARK comments + align chain-slot nibble to genesis registry
P3Q (0x012205) is the rollup-commit PQ verifier (kind-byte dispatch to Pulsar/Corona/Magnetar), NOT a STARK — STARK-FRI is at 0x012220. Correct three stale comments (magnetar, modules/registerer, fhe/dos_audit) that labeled 0x012205 a STARK. Align the registry.go C-nibble doc-comment to the authoritative node/genesis/builder/registry.go: remove phantom M-Chain, add D-Chain at C=3, mark Zoo/Hanzo/SPC as sovereign-L1 EVM. Comments only; no constant or VM logic changed. Builds clean.
This commit is contained in:
+1
-1
@@ -76,7 +76,7 @@ var DoSAuditTable = []DoSAuditRow{
|
||||
{Precompile: "vrf/verify", GasPerOp: 50_000, PerOpMs: 1, SafeAt12M: true},
|
||||
// HQC encapsulate — KEM, fast.
|
||||
{Precompile: "hqc/encapsulate", GasPerOp: 25_000, PerOpMs: 1, SafeAt12M: true},
|
||||
// P3Q verify — STARK, ~1ms on M1 Pro per memory record.
|
||||
// P3Q verify — rollup-commit PQ (ML-DSA) signature verify, ~1ms on M1 Pro per memory record.
|
||||
{Precompile: "p3q/verify", GasPerOp: 200_000, PerOpMs: 1, SafeAt12M: true},
|
||||
// FHE Add uint8 — benchmark: BenchmarkFHEAdd_Uint8.
|
||||
//
|
||||
|
||||
@@ -14,10 +14,12 @@
|
||||
// 0x012202 = ML-DSA (Module-LWE single-party signature, FIPS 204)
|
||||
// 0x012203 = SLH-DSA (hash-based single-party signature, FIPS 205)
|
||||
// 0x012204 = Pulsar (Module-LWE threshold FIPS 204, byte-equal)
|
||||
// 0x012205 = P3Q (strict-PQ STARK)
|
||||
// 0x012205 = P3Q (rollup-commit PQ verifier; kind-byte dispatch
|
||||
// to Pulsar/Corona/Magnetar — see precompile/p3q, LP-218)
|
||||
// 0x012206 = Corona (Ring-LWE threshold signatures)
|
||||
// 0x012207 = Magnetar ← this precompile (hash-based threshold FIPS 205)
|
||||
// 0x012208 = HQC (code-based KEM, family-disjoint backup)
|
||||
// 0x012220 = STARK-FRI (strict-PQ STARK / FRI — see precompile/starkfri, LP-221)
|
||||
//
|
||||
// Why a distinct slot if the verifier is interchangeable with SLH-DSA's?
|
||||
//
|
||||
|
||||
@@ -154,10 +154,12 @@ var (
|
||||
// 0x12202 = ML-DSA (Module-LWE single-sig, FIPS 204)
|
||||
// 0x12203 = SLH-DSA (hash-based signature, FIPS 205)
|
||||
// 0x12204 = Pulsar (Module-LWE threshold, FIPS 204 byte-equal)
|
||||
// 0x12205 = P3Q (strict-PQ STARK)
|
||||
// 0x12205 = P3Q (rollup-commit PQ verifier; kind-byte dispatch
|
||||
// to Pulsar/Corona/Magnetar — LP-218)
|
||||
// 0x12206 = Corona (Ring-LWE threshold)
|
||||
// 0x12207 = Magnetar (hash-based threshold, FIPS 205 byte-equal)
|
||||
// 0x12208 = HQC (code-based KEM, family-disjoint backup)
|
||||
// 0x12220 = STARK-FRI (strict-PQ STARK / FRI verifier — LP-221)
|
||||
{
|
||||
Start: common.HexToAddress("0x0000000000000000000000000000000000012000"),
|
||||
End: common.HexToAddress("0x0000000000000000000000000000000000012fff"),
|
||||
|
||||
+19
-12
@@ -35,18 +35,25 @@ import (
|
||||
// P=7 → LP-7xxx (AI)
|
||||
// P=9 → LP-9xxx (DEX/Markets)
|
||||
//
|
||||
// C nibble = Chain slot:
|
||||
// C=0 → P-Chain
|
||||
// C=1 → X-Chain
|
||||
// C=2 → C-Chain (main EVM)
|
||||
// C=3 → Q-Chain
|
||||
// C=4 → A-Chain
|
||||
// C=5 → B-Chain
|
||||
// C=6 → Z-Chain
|
||||
// C=7 → M-Chain (reserved)
|
||||
// C=8 → Zoo
|
||||
// C=9 → Hanzo
|
||||
// C=A → SPC
|
||||
// C nibble = Chain slot (4-bit address-routing index). The primary-
|
||||
// network chain letters are the authoritative set in
|
||||
// node/genesis/builder/registry.go (P/X/C/D/Q/A/B/T/Z/G/K/I/O/R).
|
||||
// This nibble can only address 16 slots, so it enumerates the chains
|
||||
// that host C-nibble-routed precompiles plus the sovereign-L1 EVM
|
||||
// targets that reuse the C-Chain EVM precompile surface:
|
||||
// C=0 → P-Chain (platform)
|
||||
// C=1 → X-Chain (avm)
|
||||
// C=2 → C-Chain (evm, main EVM)
|
||||
// C=3 → D-Chain (dexvm — DEX/CLOB)
|
||||
// C=4 → A-Chain (aivm — AI / attestation)
|
||||
// C=5 → B-Chain (bridgevm — bridge)
|
||||
// C=6 → Z-Chain (zkvm — zk-rollup / privacy)
|
||||
// C=7 → Q-Chain (quantumvm — PQ consensus signing)
|
||||
// C=8 → Zoo (sovereign L1 EVM, white-label)
|
||||
// C=9 → Hanzo (sovereign L1 EVM, white-label)
|
||||
// C=A → SPC (sovereign L1 EVM, white-label)
|
||||
// T/G/K/I/O/R primary-network chains do not register C-nibble-routed
|
||||
// precompiles; they address by full chain ID, not by this nibble.
|
||||
//
|
||||
// Example: FROST on C-Chain = P=5 (Threshold), C=2 (C-Chain), II=00
|
||||
// Address = 0x0000000000000000000000000000000000005200 (LP-5200)
|
||||
|
||||
Reference in New Issue
Block a user