1 of 18

eth-p2p-z: QUIC + Gossipsub in Zig

From transport plumbing to gossip mesh: building Ethereum’s p2p stack in Zig

Kai Chen (grapebaba)

EPF6 Fellow

Cayman(wemeetagain)�Mentor, Lodestar

2 of 18

Project Overview

Section 1

3 of 18

Why QUIC + Gossipsub in Zig?

  • Close the gap in Ethereum’s networking stack by offering a native Zig p2p implementation.
  • Let Zig based clients stay pure Zig—no more Go/Rust bindings to reach critical p2p features.
  • Line up with Ethereum’s move from TCP to QUIC so consensus clients can adopt the new transport without language detours.

4 of 18

Goal: Production-ready Zig native Ethereum p2p stack.

Zig native QUIC + Gossipsub now gives Ethereum clients a production-ready networking spine without leaving the Zig ecosystem.

  • Shipped QUIC transport, multistream-select, and the full Gossipsub router as a cohesive Zig only p2p spine.
  • Kept the API surface faithful to libp2p conventions so consensus clients can swap in Zig without rewriting protocol glue.

5 of 18

Architecture

  • QUIC engine (lsquic FFI) feeds a thread event loop that drives the transport.
  • Switch orchestrates multistream-select, protocol handlers, and connection lifecycle.
  • PubSub service hosts the Gossipsub router, event emitter, and topic caches.

6 of 18

QUIC Transport

Section 2

7 of 18

QUIC engine & TLS security

Combines lsquic’s battle-tested QUIC engine with a libxev thread event loop for predictable latency and tight memory control.

  • Battle-tested QUIC implementation: reuse proven congestion control and handshake logic instead of rebuilding it in Zig.
  • Event-loop agnostic design lets us drive lsquic entirely from our libxev thread loop, keeping all callbacks on one Zig thread.

Implements the full libp2p TLS spec on top of BoringSSL: one RTT handshake, self-signed peer certificates, and post-handshake identity verification.

8 of 18

Interop harness walkthrough

Dockerised transport interop harness (Redis-coordinated) exercises QUIC against go/rust/jvm libp2p.

9 of 18

Gossipsub v1.0

Section 3

10 of 18

Semiduplex stream management

Decouple stream management from the Gossipsub protocol.

Data is exchanged between peers using two separately negotiated streams, one inbound, one outbound. These streams are treated as unidirectional streams.

11 of 18

All the Gossipsub v1.0 features implemented

Feature-complete Gossipsub v1.0

  • Core Peering State management including mesh, fanout, peers
  • Message Cache
  • Topic Membership
  • Message Processing
  • Control Message Piggybacking
  • Heartbeat

12 of 18

Impact & Next Steps

Section 4

13 of 18

Milestones timeline

August

October

Nov

Finished lsquic lib integration, fully implemented libp2p TLS spec, QUIC transport feature completed.

Fully implemented libp2p Gossipsub v1.0 spec

Passed libp2p QUIC transport interop test against Go/Rust/Jvm implementation.

14 of 18

Zig native Ethereum p2p stack ready to integrate and extend

It compensates for the absence of p2p stack in the Ethereum Zig ecosystem.

Both QUIC transport and Gossipsub v1.0 are fully implemented, along with a common protocol handler interface for extending other protocol implementations. Help the Zig client team get rid of network stack binding.

15 of 18

Extend and integrate eth-p2p-z

Make eth-p2p-z production-ready

  • Implement Ethereum p2p req/resp protocol
  • Implement libp2p Gossipsub v1.1/v1.2/v1.3
  • Integrate eth-p2p-z into Zeam and Lodestar
  • Adapter Zig new async IO and make more friendly API
  • Pass libp2p Gossipsub interop test
  • Try libp2p perf test

16 of 18

Interop Demo

17 of 18

Thank you!

Kai Chen

EPF6 fellow�281165273grape@gmail.com

@grapebaba

18 of 18

Appendix