BBQ: A Post-Quantum Custody and Launch Layer for BNB Chain
Zero-ECC Native Account Abstraction, Goldilocks FRI-STARK batching, 4D post-quantum gas metering, and a non-pausable BNB Chain L1 forced exit.
Table of Contents 00 — 06
Abstract
BBQ is a post-quantum Layer 2 asset custody and launch network on BNB Chain. The BBQ token deploys and launches on partner launchpad gang.fun (BNB Chain L1); holders can then migrate BBQ tokens and L1 assets to BBQ L2 for quantum-resistant custody and execution.
BBQ enforces a strict Zero-ECC invariant: 32-byte Native Account Abstraction addresses decouple identity from NIST FIPS 204 (ML-DSA-65) and FIPS 205 (SLH-DSA-SHA2-128s) keys, while transparent Goldilocks Fp/Fp² BBQ-STARK batches prove arithmetic conservation and range bounds in Stage 1 toward full recursive signature aggregation (-80.8% modeled gas under BBQ 4D Gas).
For Stage 2 L1 settlement, BBQBridgeEscrow.sol specifies BNB and BEP-20 custody on BNB Chain L1 with historical-root Merkle forced withdrawals and timelocked governance.
Index Terms: ML-DSA-65, SLH-DSA-SHA2-128s, Native AA, BBQ-STARK, Goldilocks Field, BBQ 4D Gas, BNB Chain L2, L1 Forced Exit.
Positioning & System Model
Base-layer post-quantum upgrades take years while L1 treasuries already expose secp256k1 keys. BBQ pairs partner L1 token distribution with an independent post-quantum Layer 2:
gang.fun(Partner Launchpad · BNB Chain L1): Partner launchpad where the BBQ token deploys and launches on BNB Chain L1.- BBQ L2 (Post-Quantum L2): Independent PQ-EVM Layer 2 for migrated BBQ tokens and L1 assets, providing quantum-resistant signing, dual-assumption vaults, and STARK execution.
- L1 Exit Guarantee (Stage 2 Spec): Reserves stay escrowed in
BBQBridgeEscrow.sol; users can withdraw directly on L1 against any committed historical STARK state root without sequencer cooperation.
gang.fun Launch
BBQ token launches on partner launchpad gang.fun (L1).
Migrate to BBQ L2
Bridge BBQ tokens or BNB to a 32-byte bbq0x... address.
PQ Custody
Operate under ML-DSA-65, SLH-DSA-128s, and Track 1 STARKs.
L1 Forced Exit
Withdraw via L2 or prove a Merkle leaf on L1 (7-day window).
gang.fun (L1), migrates via BBQBridgeEscrow.sol to BBQ L2, and retains trustless L1 forced exit.
Threat Model & Zero-ECC Invariant
- Shor's Algorithm (CRQC): Breaks
secp256k1,Ed25519,BLS12-381,KZG, andECVRFin polynomial time; exposed keys and mempool broadcasts become directly forgeable. - AI-Accelerated Cryptanalysis: Heuristic search improves lattice reduction (BKZ/sieving) and side-channel discovery, requiring orthogonal lattice (
ML-DSA-65) + pure-hash (SLH-DSA-128s) redundancy. - Grover, BHT & HNDL: Grover halves symmetric bit-security; BHT degrades 160-bit addresses to ~53–80 bits; HNDL adversaries record classical P2P handshakes for deferred decryption.
Protocol Invariant — Zero-ECC & 256-Bit Floor
Zero elliptic-curve dependencies across accounts, signatures, proofs, consensus, or HD derivation. Every address, hash, key, and seed root enforces ≥ 256-bit width (≥ 128-bit PQ security).
| Surface | Legacy ECC | Failure Mode | BBQ Replacement |
|---|---|---|---|
| Account Auth | ECDSA / Ed25519 |
Shor key recovery & mempool hijack | ML-DSA-65 + SLH-DSA-128s + Hybrid |
| Addresses | 160-bit (20 B) |
BHT collision & static key lock-in | 32-byte (256-bit) Native AA bbq0x... |
| Proofs | Groth16 / KZG |
Pairing group break & trusted setup | Transparent Goldilocks DEEP-FRI STARK |
| Consensus / VRF | BLS12-381 / ECVRF |
Forged QCs & leader grinding | Hash-XMSS STARK QC + Hash-VDF |
| HD Wallets | ECC HD |
Homomorphic point math broken | 24-word PQ-HD hardened KMAC256 |
| P2P Transport | X25519 / Ed25519 |
HNDL capture & PeerID spoofing | X25519MLKEM768 + ML-DSA-65 PeerID |
L1 Boundary: Until BNB Chain L1 activates native PQ opcodes, single-shot L1 deposit and exit broadcasts rely on L1 accounts; all custody execution runs Zero-ECC on BBQ-L2 and L1 ISTARKVerifier uses pure-hash Keccak-256 FRI (zero BN254 wrappers).
Cryptography & Native Account Abstraction
Built on PQ-EVM and BBQ-PQ v1, every BBQ account is a protocol-native 32-byte AA policy commitment decoupled from any single signature scheme.
3.1BBQ-PQ v1 & Stage 1 Parameters
BBQ-PQ v1 Wire Sizes & Precompiles (bbq-crypto / bbq-node)
Chain ID 20481
| Algorithm | AlgID | Precompile | Standard & Assumption | PK (B) | Sig (B) | Verify Gas | Genesis |
|---|---|---|---|---|---|---|---|
| ML-DSA-65 | 0x01 | 0x0100 | FIPS 204 · Module-LWE/SIS (Cat. 3) | 1,952 | 3,309 | 12,000 | ACTIVE · Track 1 |
| SLH-DSA-SHA2-128s | 0x02 | 0x0102 | FIPS 205 · Pure SHA-2 Hash (Cat. 1) | 32 | 7,856 | 65,000 | ACTIVE · Vault |
| Hybrid ML+SLH | 0x03 | 0x0107 | FIPS 204+205 · Hybrid | 1,984 | 11,165 | 78,000 | ACTIVE · Tier 2 |
| FN-DSA-512 | 0x07 | 0x0104 | FIPS 206 Draft · NTRU | 897 | 666 | 6,000 | PROPOSED / REJECTED |
ML-DSA-65 satisfies NIST Category 3 (~AES-192) with pure-integer NTT (<16 KB RAM, ~45–70 μs AVX2 verify). SLH-DSA-SHA2-128s beats 128f in both wire size (-54%: 7,856 B vs 17,088 B) and verification speed (~0.5–1.5 ms) with zero algebraic assumptions. FN-DSA-512 stays PROPOSED (rejected at genesis) due to 53-bit floating-point FFT side-channel risks. Hybrid 0x03 cross-binds both sub-signatures over M_bind with distinct contexts to block stripping or downgrade.
3.232-Byte Native AA & PQ-HD (KMAC256)
PQ-HD replaces legacy ECC HD derivation with mandatory 24-word BIP-39 entropy (256-bit; 12-word rejected) and NIST SP 800-185 KMAC256 hardened tree derivation:
Tiers isolate roles deterministically: 0' primary auth, 1' vault co-sign, 2' hidden SLH-DSA-128s recovery_commit, 3' ML-KEM-768 scan key, and 4' algorithm-independent migration_secret. Key rotation never changes Address32; 20-byte low-bit views are display-only and forbidden for vault or bridge authorization.
3.30x010E Pubkey Registry (-37.0% Calldata)
0x010E PQ_PUBKEY_REGISTRY registers each public key once under a refundable deposit (0.10 BBQ / 20,000 deposit units) indexed by pk_id = SHA3-256(alg_id_be || pubkey). Subsequent Type 0x05 envelopes set pk_mode = 0x01 (REF_BY_ACCOUNT) (0 inline PK bytes), shrinking ML-DSA-65 wire envelopes from 5,269 B to 3,317 B — saving 1,952 B (37.0%) per transaction.
3.40x010F AlgorithmRegistry & 1-Block Circuit Breaker
0x010F AlgorithmRegistry tracks every AlgID through five states (PROPOSED → ACTIVE → DEPRECATED_NEW_ONLY → FREEZE_DIRECT_SPEND → REVOKED) with a permissionless proof-of-breakage circuit breaker:
- Anti-Hijack Governance: No stake majority can trip the breaker without a valid forgery against the genesis challenge key (2-block Commit-Reveal handles existential forgeries). A 7-of-11
SLH-DSA-192sSecurity Council holds at most a 72-hour rate-limit shield, never freeze or seizure rights. - Zero Dormant Confiscation: Under
FREEZE_DIRECT_SPEND, primary-key veto expires automatically; balances are never burned. Accounts migrate via Tier 2SLH-DSA-128srecovery or offline Tier 4migration_secretSTARK proof (0x0106+VK_SEED_RECOVERY, ~1–3 s local proving).
Execution, FRI-STARK Proving & 4D Gas
4.1Dual-Track Execution
- Track 1 — STARK Aggregated (95%–98% Default): In Stage 1, the sequencer verifies
ML-DSA-65signatures before batching and commits witness digests into the FRI-STARK proof (418 B/tx, -80.8% modeled gas). Stage 2 / Mainnet moves fullML-DSA-65verification and Merkle state transitions in-circuit via recursiveBBQ-STARK. - Track 2 — Direct Fallback (5%–15% Reserved): Direct precompile verification (
0x0100/0x0102/0x0107) at full32 Gas/Banti-DoS witness pricing. Guarantees censorship resistance andSLH-DSA-128srecovery even if all provers halt.
4.2Goldilocks DEEP-FRI Parameters (bbq-stark)
Stage 1 (bbq-stark) is a pure-Rust, zero-ECC FRI-STARK engine proving arithmetic balance conservation, algebraic base-4 range bounds ([0, 2^60), eliminating modulo-p wraparound), monotonic nonces, and sequencer-attested SHA3-256 PQ witness commitments over Goldilocks Fp trace + quadratic extension Fp² (u² = 7, 128-bit) FRI/OOD challenges. Stage 2 / Mainnet adds in-circuit Merkle state-root verification, recursive signature verification, and an on-chain EVM ISTARKVerifier.
bbq-stark) & Mainnet Target
Transparent STARK
| Parameter | Stage 1 Testnet (bbq-stark) |
Mainnet Target (BBQ-STARK) |
|---|---|---|
| Prime Field | Goldilocks Fp (p = 2^64 - 2^32 + 1) + Fp² (u² = 7) |
Goldilocks F_p/F_p2 + Recursive BBQ-STARK |
| AIR Geometry | 162 cols (15 core + 147 limb) · 172 constraints · deg 4 |
In-circuit Merkle + ML-DSA-65 + Hash-XMSS AIR |
| Coset LDE | Generator g = 7 · 8× blowup · Fp² OOD & FRI |
Disjoint coset · 8×–16× blowup · Fp² FRI |
| FRI Queries | 34 queries · 64-tx: 20.6 ms prove / 2.6 ms verify |
64-tx micro-batch (1.5–2.2 s) · <10 ms verify |
| PQ Soundness | 102-bit (min(34×3, 128-(2 log2 N + 2))) · SHA3-256 |
100–128 bit · BBQ-STARK Hash / Keccak-256 L1 |
4.3BBQ 4D Gas Metering
BBQ meters four independent BBQ 4D dynamic fee dimensions so witness bandwidth, STARK proving, and public-key state never distort execution pricing:
ML-DSA-65, bbq-node/src/gas.rs)
-80.8% Track 1
| Dimension | Track 2 Direct | Track 1 STARK | Basis |
|---|---|---|---|
| 1. Compute | 21,000 | 21,000 | Base transfer execution |
| 2. Witness DA | 113,888 | 2,688 | T2: 3,559 B × 32 · T1: 168 B × 16 |
| 3a. PQ Verify | 12,000 | 0 | 0x0100 skipped inside Track 1 batch |
| 3b. STARK Prove | 0 | 4,500 | Amortized FRI-STARK proving gas |
| Total Gas | 146,888 | 28,188 | 80.8% reduction (118,700 Gas saved; mainnet 75%–90%) |
Fee Split: Track 1 proving fees allocate 85% Provers / 10% Validators / 5% BBQ Security Bounty; Track 2 verify fees burn 70% and pay 30% to validators.
0x010E pubkey resolution, Track 1 Goldilocks FRI-STARK witness stripping (-80.8% gas), and Track 2 direct precompile fallback.
BNB Chain L1 Bridge & Forced Exit
5.1Stage 2 Escrow Custody & Sequential STARK Settlement
- Deposits (
BBQBridgeEscrow.sol· Stage 2 Spec):depositBNBanddepositTokentarget non-zero 32-bytebbqRecipient32addresses, revert bare BNB transfers, and use balance-delta accounting for fee-on-transfer BEP-20s. - Sequential Roots & Cross-Layer Alignment:
commitStarkBatchenforcesbatchId == latestBatchId + 1andprevStateRoot == latestStateRootvia zero-ECCISTARKVerifier(unit-tested withMockSTARKVerifier; production EVM Keccak-256 FRI verifier and unified L1/L2 state-tree codec land in Stage 2).
5.2Non-Pausable Trustless L1 Forced Exit
requestForcedExit and finalizeForcedExit omit whenDepositsNotPaused and accept any historical committed knownStateRoots[stateRoot]: neither a halted sequencer, rapid batching, nor setDepositsPaused(true) can block L1 exits.
BBQBridgeEscrow.sol Stage 2 L1 Forced-Exit Security Invariants
Stage 2 Spec
| Invariant | Contract Mechanism | Attack Blocked |
|---|---|---|
| Exit Window | MAINNET_EXIT_WINDOW = 7 days ([1h, 30d]) |
Allows L2 challenge without trapping users |
| Non-Pausable | depositsPaused gates deposits & batches only |
Sequencer censorship or exit freeze |
| Historical Roots | knownStateRoots[root] + stateRootBatchId ≥ nextMinExitBatchId |
Rapid-batch forced-exit proof invalidation |
| Binding & Nonce | 0x00 leaf binds msg.sender, chainid, bridge & exitNonce |
Hijack, replay & post-challenge bricking |
| Anti-Replay | usedExitLeaves (on finalize) + activeExitId + challengedRootLeaves |
Same-batch, repeat or challenged replays |
| Gov Timelock | 2-step schedule/execute verifier & sequencer (exitWindow + 2d) |
Instant malicious verifier or sequencer swap |
| Solvency & Proof | totalReservedForExits ≤ totalEscrowed + verifyExitChallenge |
Over-subscription & arbitrary exit cancellation |
Once block.timestamp >= unlockAt, any caller may trigger finalizeForcedExit(exitId) (CEI + ReentrancyGuard); funds release exclusively to req.recipient.
Three-Stage Rollout
BBQ Testnet (BBQ-Testnet)
Pure-Rust bbq-node (Chain ID 20481) implementing real ML-DSA-65, SLH-DSA-128s, and Hybrid signing, Goldilocks Fp/Fp² range-checked FRI-STARK batch proving, 0x010E pubkey registry, 0x010F circuit breaker, and 4D Gas. Public testnet coming soon at /testnet.
BNB Chain Testnet Bridge
Unify the cross-layer L1/L2 Merkle state-tree codec, move state-root proofs in-circuit, and deploy BBQBridgeEscrow.sol (historical roots, exitNonce, exitWindow + 2d governance timelock) with a production EVM Keccak-256 ISTARKVerifier on BNB Chain Testnet.
Native Launchpad on BBQ L2
Mainnet with 7-day L1 exit window, permissionless multi-GPU BBQ-STARK prover market (Phase 1: 500 TPS / 2 s blocks; Phase 2: 2,000 TPS), BBQ Security Bounty vault, and native bonding-curve and fair-launch infrastructure directly on BBQ L2.