Lodestar’s next chapter: Blending Zig and JavaScript for a high-performance Ethereum client

Lodestar’s future: transitioning from a pure JavaScript client focused on browser compatibility to a performance-first, hybrid JavaScript and Zig architecture.

Lodestar’s next chapter: Blending Zig and JavaScript for a high-performance Ethereum client

Written by Cayman Nava.

Thanks to Matthew Keil for feedback.

TLDR: Lodestar is rewriting core modules in Zig and switching to Bun as the primary runtime.

Since 2019, the Lodestar team has been an active contributor in the Ethereum R&D ecosystem. Over the years, we’ve built a robust production-grade beacon node and validator in TypeScript, which now powers a notable portion of the Ethereum network, especially among solo stakers.

As Ethereum’s protocol has evolved, so has our client. Quietly, we’ve begun replacing performance bottlenecks in JavaScript with native code. Today, we're excited to publicly share our vision for Lodestar’s future: transitioning from a pure JavaScript client focused on browser compatibility to a performance-first, hybrid JavaScript and Zig architecture. Don’t worry, browser support for key libraries the community depends on isn’t going anywhere.

Our JavaScript journey

In the early days-before the Beacon Chain launched (remember the Eth2 meme?)-we anticipated strong demand for Ethereum tooling in the browser. Naturally, we chose TypeScript.

But what we’ve learned is that Ethereum browser tooling is a niche-important, but not where a client team has the most impact. The biggest value we provide is running performant infrastructure that supports mainnet. Our true contributions are the EIPs we write, the opinions we share, and the consensus we support. That’s where Lodestar has influence in the ecosystem.

The challenge? JavaScript is not designed for high-performance applications. You can’t control memory layout. You can’t share structured data across threads. And the runtimes have deep, often unpredictable performance quirks.

But that didn't stop us. Despite those hurdles, we built a production-grade beacon node. Our client is now consistently a top performer: our Lido validators routinely operate within 0.1% effectiveness of the best-performing validators on mainnet.

These hard-won victories shaped the skills and mindset now driving our next leap forward.

Tradeoffs in the bouncy house

Trivia time:

Q: How many bytes does a 32-byte Uint8Array take in Node.js?
A: 217 bytes. 😭
Q: What’s the fastest way to iterate through the bits of a BigInt in Node.js?
A: Convert it to a base-2 string and iterate over the characters. 🤪

These are the kinds of realities we’ve had to work around. JavaScript is bound—gloriously and painfully—to its runtime.

Every language poses unique challenges when building a robust client. In JavaScript’s case, those challenges pushed us to get clever: squeezing every last drop of performance out of a leaky abstraction.

Over the past year, the biggest wins have come from moving bottlenecked workloads into native code-C, Rust, and now Zig. That strategy has shaped our roadmap. We’re confident that doubling down will continue to raise Lodestar’s reliability, efficiency, and long-term maintainability.

Zig: Control and clarity

We’ve been experimenting with Zig for over a year and we've grown to love its laser focus. Zig is designed to be the simplest tool for writing optimal low-level software without surprises or hidden costs.

Its combination of simplicity, control, and performance makes it a perfect fit for building robust Ethereum infrastructure.

Zig’s ecosystem is promising, but still young. The library landscape isn’t yet battle-tested. We’re helping improve that-by contributing upstream, building Ethereum-specific tooling, and integrating with C libraries.

We see our participation in the Zig ecosystem as a long-term investment. We're already collaborating with teams like Zeneth and Zeam, and we’re excited to help shape a vibrant, reliable Zig-powered stack for Ethereum infra.

Active Zig projects we’re working on:

  • ssz-z – feature-rich SSZ toolkit
  • zbuild – Zig build configuration using zon
  • snappy – Zig bindings for Google’s Snappy
  • hashtree – Zig binding for hashtree
  • blst-z – Zig binding for blst
  • zig-discv5 – Zig implementation of discv5 (in progress)
  • bun-ffi-z – Utility to build/publish Zig FFI modules for Bun

Bun: Performance edge & integrated tooling

Bun is a modern JavaScript runtime, written in Zig and built for speed. It’s a compelling alternative to Node.js, offering:

  • Lower latency
  • Higher throughput (via JavaScriptCore)
  • A tight and fast FFI
  • First-class tooling (bundler, test runner, etc.)

For Lodestar, this means less overhead and faster execution, especially for CPU-bound tasks like cryptographic operations and serialization. In our benchmarks, Bun outperforms Node.js by up to 20% on these workloads.

While Node's N-API is a solid tool for native integration, Bun's leaner FFI unlocks tighter, more efficient interoperability with our native Zig code.

And for those of you relying on our browser tooling: nothing’s changing. We’ll continue supporting our TypeScript libraries and shipping WASM builds for critical modules.

Lodestar: Ship of Theseus

If a ship has all its parts replaced, is it still the same ship?

The architecture of Lodestar is solid. But JavaScript’s inherent limits aren’t going away. Rather than contorting around them, we’re choosing to transcend them.

Bit by bit, module by module, we’re rebuilding Lodestar-starting with cryptography, hashing, SSZ types, and the state transition-in Zig.

This unlocks architectural improvements we’ve long wanted but couldn’t justify. Many performance bottlenecks will simply disappear.

In the near term, we’ll release Lodestar 2.0, which targets Bun and includes several breaking changes.

Longer term, we plan to integrate a native networking stack. Eventually, we might leave JavaScript behind entirely-but only if it helps us build the best possible Ethereum client.

Our north star is not any particular language or runtime, it’s impact. It’s doing what needs to be done to build infrastructure that Ethereum can depend on.

What does this mean for you?

  • Lodestar 2.0 will "just work™" in Docker and binary releases.
    • For source installs: just swap Node.js for Bun.
  • Browser builds live on. WASM+TypeScript tooling stays, but it no longer leads the roadmap.
  • Cold-start times and first-slot performance are dramatically improved.
  • New ways to contribute:If you know Zig, we need you.Curious about Bun FFI, we need you.Want to benchmark or fuzz, we need you.

Conclusion: building for impact

Six years. Hundreds of thousands of lines of code. Thousands of mainnet epochs. And a few gray hairs.

What we’ve learned is this: the best way to meet Ethereum’s evolving challenges is by aggressively optimizing our hottest code paths with the best tools available.

Zig gives us precision, predictability, and fearless concurrency. Bun gives us developer experience we can love-without compromising speed.

Together, they allow Lodestar to shine brighter than ever.

This isn’t about chasing hype. It’s about building the leanest, most trustworthy Ethereum consensus client we can imagine.

If that mission resonates with you, jump into our Discord, open an issue, or fire off a PR. Whether you cheer us on or tell us why we’re wrong, you’re helping steer the ship.

Onward to Lodestar 2.0 - lighter, sharper, and ready for the next 10 million slots.