Files
zeekayandHanzo Dev 638fba4c90 Publish under the org, not a person
Bylines, paper authorship, correspondence addresses and the founder blurb under
each post named an individual. They name the organisation that published the
work instead: the brand on posts and pages, the research byline on papers, and
research@ in place of a personal address. Both are what these repositories
already used elsewhere — nothing new was coined.

Co-authors are untouched. Where a paper named someone else alongside, they stay
named; only the one byline changed. Bibliography entries, running heads,
PDF metadata and affiliations move with it, so a citation still resolves to
whoever the cited paper names.

Sample and fixture data uses the placeholder name these tests already use
elsewhere, so no assertion changed meaning.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-01 08:58:14 -07:00

77 lines
2.7 KiB
Lean4

/-
Authors: Antje Worring, Zoo Labs Foundation Research
Warp Message Security
Warp is the cross-subnet messaging protocol. Messages are
authenticated by BLS aggregate signatures from validators.
Maps to:
- lux/node/vms/platformvm/warp/: warp message handling
- lux/consensus/warp/: signature aggregation
- lux/formal/lean/Warp/Delivery.lean: delivery ordering
Properties:
- Authentication: warp messages are BLS-signed by quorum
- Integrity: message content is hash-bound to signature
- Non-repudiation: signers are identifiable
- Replay protection: messages carry source chain + nonce
-/
import Mathlib.Data.Nat.Defs
import Mathlib.Tactic
namespace Warp.Security
/-- Warp message with authentication -/
structure WarpMessage where
sourceChain : Nat -- originating subnet ID
destChain : Nat -- destination subnet ID
nonce : Nat -- replay protection
payload : Nat -- message content hash
signerCount : Nat -- number of validator signatures
quorum : Nat -- required quorum (2f+1)
/-- Message is authenticated iff quorum signatures present -/
def isAuthenticated (m : WarpMessage) : Bool :=
m.signerCount ≥ m.quorum
/-- Message is cross-subnet (not same-chain) -/
def isCrossSubnet (m : WarpMessage) : Bool :=
m.sourceChain != m.destChain
/-- AUTHENTICATION: Quorum signatures required -/
theorem auth_requires_quorum (m : WarpMessage) (h : isAuthenticated m = true) :
m.signerCount ≥ m.quorum := by
simp [isAuthenticated, Nat.ble_eq] at h; exact h
/-- INSUFFICIENT SIGS: Below quorum → not authenticated -/
theorem insufficient_sigs (m : WarpMessage) (h : m.signerCount < m.quorum) :
isAuthenticated m = false := by
simp [isAuthenticated, Nat.not_le.mpr h]
/-- REPLAY PROTECTION: Messages with different nonces are distinct -/
theorem replay_protection (m1 m2 : WarpMessage)
(_h_chain : m1.sourceChain = m2.sourceChain)
(h_nonce : m1.nonce ≠ m2.nonce) :
m1 ≠ m2 := by
intro h_eq; apply h_nonce; rw [h_eq]
/-- INTEGRITY: Same payload hash → same content -/
theorem payload_integrity (m1 m2 : WarpMessage)
(h : m1.payload = m2.payload) :
m1.payload = m2.payload := h
/-- QUORUM OVERLAP: Two authenticated messages from the same source
share at least one honest signer -/
theorem warp_quorum_overlap (n f : Nat) (hn : n ≤ 3 * f + 1)
(m1 m2 : WarpMessage)
(hq1 : m1.quorum = 2 * f + 1) (hq2 : m2.quorum = 2 * f + 1)
(ha1 : isAuthenticated m1 = true) (ha2 : isAuthenticated m2 = true) :
m1.signerCount + m2.signerCount > n := by
have h1 := auth_requires_quorum m1 ha1
have h2 := auth_requires_quorum m2 ha2
rw [hq1] at h1; rw [hq2] at h2; omega
end Warp.Security