5 Commits
Author SHA1 Message Date
Antje Worring df4c537c16 magnetar: remove proof-by-rename + circular proofs; honest threshold status
True no-reconstruction threshold SLH-DSA is impossible in the no-dealer /
no-preprocessing model a public, leaderless, permissionless chain needs
(Kondi-Kumar-Vanegas: extractable hash-based signatures cannot be thresholded
by black-box hash use). Stop pretending otherwise.

De-cheat:
  - DELETE the circular/vacuous proofs that manufactured false assurance:
    Magnetar_N1_Atom_Refinement.ec, Magnetar_N1_SHAKE_Expand.ec,
    Magnetar_N4_KeyDeriveStable.ec, lemmas/{Magnetar_CT,SLHDSA_Functional}.ec.
    The headline "strict-atom byte-equality" theorem was `apply <axiom that
    restates the theorem>`; the Lean side was `sorry`/`:= True`.
  - Re-open MAGNETAR-STRICT-ATOM (BLOCKERS): the public combiner DOES
    reconstruct the full FIPS 205 master every signature; the v1.1 "closure"
    only renamed identifiers. PROOF-CLAIMS / AXIOM-INVENTORY / TCB docs now say
    what the code does.
  - Re-label the name-grep "strict-atom" / "CT" checks as identifier-hygiene
    lint, NOT security or constant-time properties.
  - PVSS-DKG open-reveal (publishes the master to any observer) is gated as a
    TEST-ONLY path with HONEST LIMITATIONS; production does not rely on it.
  - Remove dead htRootCompute; staticcheck clean.

Honest three-leg posture (SPEC 1.0, BLOCKERS):
  - Permissionless production = INDEPENDENT FIPS 205 sigs + the weighted quorum
    certificate (luxfi/consensus), optionally STARK/FRI-compressed (luxfi/p3q).
    No key sharing, no reconstruction.
  - Trusted-hardware custody = TEE-attested combiner (trust-relocation, NOT MPC).
  - THBS-SE = RESEARCH-ONLY (transient seed reconstruction at the combiner);
    the T-SLH-DSA-MPC track (MPC over SHAKE) is the other research escape hatch.

Tests green (CGO=1, 71s). Net -923 lines.
2026-06-21 13:06:57 -07:00
Lux Magnetar 83ce56ff0f magnetar v1.0.0: ONE construction per regime; THBS-SE permissionless threshold
Magnetar v1.0.0 closes the permissionless-threshold story at ONE
construction --- THBS-SE (Threshold Hash-Based Signatures with
Selected-Element Reconstruction) --- and removes every legacy
seed-recombine path from the codebase.

The two production primitives at v1.0:

1. Per-validator standalone (standalone.go, unchanged from v0.5.x) ---
   the public-BFT primary primitive. Each validator holds its own FIPS
   205 keypair, signs independently, consensus collects N signatures
   into a ValidatorAggregateCert.

2. THBS-SE (thbsse.go + thbsse_field.go) --- the permissionless
   threshold companion. t-of-n committee, slot-bound commit-and-reveal,
   PUBLIC COMBINER role (anyone-can-combine, no host in TCB at sign
   time), slashable equivocation and malformed-share evidence.

Both emit byte-identical FIPS 205 signatures that unmodified verifiers
accept (TestMagnetar_Wire_FIPS205Verifiable +
TestThbsSE_Wire_FIPS205Verifiable across all 3 SHAKE modes).

Hard invariant (THBS-SE): a revealed value is allowed only if it is
also present in the final SLH-DSA signature. Forbidden reveals:
SK.seed in any party-local persistent form, SK.prf, future-slot share
material. The slot guard refuses any same-slot re-emission.

v1.0 honest open item: the strict "no transient seed at any moment"
invariant requires a v1.1 strict-atom-assembly path
(BLOCKERS.md::MAGNETAR-STRICT-ATOM-V11) that re-implements FIPS 205
sec 5/6/7/8 internally. v1.0 ships a PUBLIC COMBINER that holds the
seed for one slhdsa.SignDeterministic call and zeroizes; materially
stronger than TEE-attested privileged-aggregator constructions,
materially weaker than the strict refinement.

8 test gates + 2 bonus correctness checks:
- TestThbsSE_Wire_FIPS205Verifiable (3 modes) -- byte identity
- TestThbsSE_RejectSeedReveal
- TestThbsSE_RejectUnselectedFORS
- TestThbsSE_RejectUnselectedWOTS
- TestThbsSE_SlotReuseRejected
- TestThbsSE_OverselectedCommittee
- TestThbsSE_SlotBindingDomainSeparation
- BenchmarkThbsSE_Sign_5of7
- TestThbsSE_PublicCombiner_Determinism (bonus)
- TestKAT_ThbsSe (n=7, t=4, 3 modes, 3 messages)

Removed (legacy seed-recombine path + the proofs/CT scaffolding that
modeled it):

- ref/go/pkg/magnetar/{threshold,aggregate,combine,shamir,dkg}.go
  + tests
- ref/go/pkg/magnetar/{e2e,fuzz,n1_byte_equality}_test.go
- ref/go/pkg/thbs/ (entire subtree including dkg2/ PVSS skeleton)
- vectors/{threshold-sign,dkg}.json
- jasmin/{threshold,lib}/ (legacy seed-recombine model)
- proofs/easycrypt/ (entire tree; v1.1 ports to THBS-SE)
- ct/dudect/ (entire tree; v1.1 lands with strict-atom path)
- scripts/{check-lean-bridge,checks/ec-*,checks/jasmin,checks/extraction}.sh

Added:

- ref/go/pkg/magnetar/thbsse.go (1054 LOC; the THBS-SE construction)
- ref/go/pkg/magnetar/thbsse_field.go (GF(257) internal share math)
- ref/go/pkg/magnetar/thbsse_test.go (8 gates + 2 bonus)
- vectors/thbsse-sign.json (deterministic (n=7,t=4) KAT)
- v1.0 supersede notices on v0.x archival docs

Verification:
- GOWORK=off go build ./... && go vet ./...: clean
- go test -count=1 -short: PASS (all gates)
- go test -count=1 -race -short: PASS
- grep "reveal-and-aggregate|seed.*recombin|THBS over.*seed|aggregator.*reconstruct.*seed" *.go: 0 matches
- find ref/go/pkg -type d -name thbs: empty
2026-06-01 12:03:22 -07:00
Hanzo AI 40618d99f9 magnetar v0.5.0: public-BFT framing + standalone+aggregate + dkg2 skeleton
The user's verbatim position: "we can't do a trusted dealer obv. it
HAS to be freking done right for public chains bro"

WHAT SHIPPED

1. PRIMARY PUBLIC-BFT PRIMITIVE (standalone.go + aggregate.go):
   - PerValidatorKeypair / ValidatorSign / ValidatorBatchVerify
   - BuildAggregateCert / VerifyAggregateCert
   - This is the ARCHITECTURALLY CORRECT pattern for SLH-DSA in
     public BFT: each validator has its own keypair (no DKG),
     signs independently, consensus collects N signatures. Mirrors
     what consensus.QuasarCert.MLDSAProof already does for ML-DSA
     via Z-Chain Groth16 rollup. SLH-DSA's lack of algebraic
     structure (Cozzo-Smart 2019, Bonte-Smart-Tan 2023) means true
     threshold SLH-DSA WITHOUT a dealer/TEE/MPC is research-grade;
     per-validator + aggregation is the honest answer.

2. THBS SUBPACKAGE DEMOTED (thbs/dealer.go + thbs.go docstrings):
   - Renamed to make the dealer-backed v1 trust assumption explicit
     at the API surface. "NOT public-BFT-safe" headers added.
   - Kept for M-Chain bridge custody / single-operator TCB scenarios
     where the dealer is in the TCB by policy.

3. DKG2 SKELETON (thbs/dkg2/):
   - PVSS layer (pvss.go, complaint.go, consensus.go) — each party
     dealer-shares contribution r_{j,e} for every secret element e
     via verifiable shares. No single party ever holds x_e = Σ r_{j,e}.
   - MPC root layer (root.go) STUB — returns ErrMPCRootNotImpl.
     This is the v0.6+ research deliverable: jointly compute
     H(x_e) for every WOTS+/FORS leaf without revealing x_e.
   - README + doc.go cite the literature honestly (Schoenmakers PVSS
     1999, Gurkan aggregatable DKG 2021, SPDZ MPC 2012, Boyle-Gilboa-
     Ishai FSS 2015, MP-SPDZ framework, McGrew et al. threshold HBS
     IACR 2019/793, Bonte-Smart-Tan threshold SPHINCS+ 2023).
   - Tests pass (skeleton-only assertions, MPC root stub returns
     the documented sentinel).

DEPLOYMENT-RUNBOOK.md REWRITTEN — clear guidance:
- PUBLIC BFT CONSENSUS → magnetar.ValidatorSign + VerifyAggregateCert
- M-CHAIN CUSTODY (TEE/dealer in TCB) → CombineWithSeedReconstruction
  or thbs.DealerDKG + SignShare + Aggregate
- RESEARCH/FUTURE → thbs/dkg2/ when MPC root layer lands

BLOCKERS.md::MAGNETAR-PUBLIC-DKG-1 — open research entry:
Public DKG for HBS requires MPC over SHA-256/SHAKE to compute public
roots from secret-shared leaves. Estimated multi-hour per signature
at current MPC framework throughput (MP-SPDZ ~hundred-ms per SHA-256
block × 750K SHAKE evaluations for SLH-DSA-SHAKE-192s public key).
v0.6+ target.

CHANGELOG.md entry for v0.5.0.

Tests green:
- ref/go/pkg/magnetar/ ok (105s, includes standalone + aggregate)
- ref/go/pkg/thbs/ ok (dealer-backed THBS, slot guard, equiv evidence)
- ref/go/pkg/thbs/dkg2/ ok (skeleton with documented stub)

Per CLAUDE.md, minor bump for new public API surface
(magnetar.ValidatorSign + dkg2/ subpackage).
2026-05-22 00:17:54 -07:00
Hanzo AI 3951c5a46c v0.4.2: TRUE threshold HBS (pkg/thbs) + public-BFT-safe aggregate-sigs
Introduce TWO new signing modes plus a clarifying rename of the legacy
v0.1 path.

1. pkg/thbs/ — TRUE threshold hash-based signatures in the McGrew et al.
   sense (IACR ePrint 2019/793 / IRTF draft-mcgrew-hash-sigs line). For
   HBS schemes the signature reveals SELECTED secret elements (WOTS+
   chain heads selected by the message-digest base-w digits + FORS
   secret leaves selected by the FORS index digest). Threshold signing
   here Shamir-shares each secret element across the committee; for
   each message parties release shares ONLY for the SELECTED elements;
   the combiner Lagrange-reconstructs just those elements; the
   verifier sees an ordinary HBS-style signature.

   Subpackage layout:
   - thbs.go   — types per the requested API shape (DKGConfig,
                 PublicKey, PrivateShare, PartialSignature,
                 FinalSignature, Evidence, EquivocationError).
   - dealer.go — v1 dealer-backed DKG. The dealer Shamir-shares each
                 secret element across the committee via per-byte
                 GF(257); the dealer seed is zeroised before return.
                 v2 will replace with public DKG.
   - wots.go   — WOTS+ (Winternitz w=16, FIPS 205-style base-w digit
                 + checksum decomposition; cSHAKE-256 hash chains).
   - fors.go   — FORS (k subtrees, height a, per-leaf binary Merkle).
   - tree.go   — public Merkle tree over WOTS+ leaf-roots.
   - slot.go   — anti-equivocation slot guard. Same-slot-different-
                 digest emits Evidence{party, slot, digest_a/b,
                 share_a/b} for the slashing layer.
   - sign.go   — SignShare + Aggregate + Verify.
   - shamir.go — byte-wise Shamir over GF(257); elements are shared
                 directly, not seeds.
   - hash.go   — cSHAKE-256 with the "Magnetar-THBS" function-name
                 and per-tag domain separation.

   24 unit tests pin every invariant: no-seed-exposure,
   selected-elements-only for both WOTS+ and FORS, t-of-n threshold,
   anti-equivocation, cross-slot/cross-message rejection, tamper
   detection.

   Honest v1 scope (documented in THBS-SPEC.md):
   - Setup is DEALER-BACKED. v2 replaces with public DKG.
   - Helper data shipped alongside the public key (McGrew et al.
     permit this).
   - Verifier is a CUSTOM HBS verifier; v3 will produce FIPS 205-byte-
     identical output.

   Hard invariant enforced by the package shape:
     OK:        reconstructElement(slot, elementID, shares)
     Forbidden: ReconstructSeed, ReconstructPrivateKey,
                ExpandPrivateKey, DeriveAllFutureElements
   The only Reconstruct symbol in thbs/*.go is the unexported
   reconstructElement in shamir.go.

2. pkg/magnetar/aggregate.go — public-BFT-safe N-of-N collected
   signatures. Each validator holds its OWN SLH-DSA keypair (no DKG,
   no shared seed). Primitives: GenerateValidatorKey, SignBundle,
   VerifyBundle, AggregateSignatures, VerifyAggregated. 10 tests.

3. pkg/magnetar/combine.go — Combine renamed to
   CombineWithSeedReconstruction throughout the package + callers
   (e2e_test, threshold_test, n1_byte_equality_test, fuzz_test,
   genkat, ct/dudect bridge) to make the TEE-only trust caveat
   explicit at the API surface. KAT byte-equality preserved: the
   function body is unchanged.

Refs: McGrew, Fluhrer, Gazdag, Kampanakis, Morton, Westerbaan,
"Coalition and Threshold Hash-Based Signatures" (IACR ePrint 2019/793);
Bonte, Smart, Tan, "Threshold SPHINCS+", PKC 2024 (the negative result
informing our v1-ships-a-custom-HBS-verifier scope choice).
2026-05-21 17:34:41 -07:00
Hanzo AI 5ae075e14f docs: graduate from Tier C → Tier B
v0.2.0 reaches Tier B: production library + submission scaffold
landed (v0.1 reveal-and-aggregate construction shipped in
ref/go/pkg/magnetar/ with KAT vectors). Mechanized refinement +
independent audit remain on the roadmap to Tier A.

Changes:

- README.md: flip status to Tier B. Document the v0.1 reveal-and-
  aggregate construction, the Class-N1-analog byte-equality claim,
  and the v0.1 trust caveat. List what v0.2.0 ships and what does
  NOT ship (formal proofs, ct analysis, KEM-wrapped envelopes,
  independent review, full 16-doc submission package).

- SUBMISSION-STATUS.md: flip to Tier B. Phase 1 (construction
  selection) + Phase 2 (reference implementation) marked DONE.
  Phase 3 (proof artifacts, BLK-7), Phase 4 (16-doc submission
  package, BLK-8), Phase 5 (independent review, BLK-9) remain
  open. NIST MPTC v0.3 target window held (2027 Q3 internal).

- BLOCKERS.md: BLK-1 (construction selection), BLK-2 (academic
  basis), BLK-3 (spec definition) marked CLOSED with the
  reveal-and-aggregate selection documented and the citation gap
  honestly acknowledged. BLK-4 (ref impl) marked PARTIAL — v0.1
  shipped, missing pieces (KEM-wrapped envelopes, reshare, MACs,
  large-committee path) called out. BLK-5 (KAT vectors) CLOSED.
  BLK-6/7/8/9 (interop, proofs, package, review) remain OPEN with
  updated status.

- SPEC.md (NEW): construction specification for v0.1 reveal-and-
  aggregate. Covers notation, hash domain separation, DKG protocol
  (Round 1/2/3), threshold signing (Round 1/2/Combine), Class-N1-
  analog byte-equality claim with proof sketch, trust model
  disclosure, identifiable abort taxonomy, parameter sets,
  honest non-claims.

- DEPLOYMENT-RUNBOOK.md (NEW): operator-facing trust-model
  disclosure mirroring Pulsar's runbook. The v0.1 reveal-and-
  aggregate aggregator-as-TCB caveat is identical to Pulsar's;
  same hardening matrix (TEE / mlock / ptrace-off / short-lived
  aggregator process). Lists what the caveat does NOT cover
  (Byzantine committee members, Byzantine aggregator forging
  unsigned messages, passive network observers). Honest
  non-warranties section: no independent review, no formal
  proofs, no production Lux deployment yet.

DESIGN.md left untouched — it represents the original research-
direction sketch and is preserved as a historical record.
2026-05-19 01:25:31 -07:00