Alexandria Dev Update #1

This is the first in what I hope to be a regularly cadenced quick update on the development of the Alexandria network.

First, a quick introduction

Alexandria is a new protocol under development for the Ethereum ecosystem.  The goal is to provide a new peer-to-peer network that exposes the chain history for the Ethereum blockchain.  If successful, this will have two major benefits for our community.

  1. Ethereum clients like Geth/Nethermind/Besu/TurboGeth/Etc will have an alternate source for retrieving this data which hopefully leads to those clients exposing options for not retaining all of that data locally, which could reduce the hard drive requirements for nodes by as much as 100-200GB.
  2. The on-demand nature of the Alexandria network forms the foundation for differently shaped light clients that "just work" (more on this in a separate post).

The first iteration of the network is targeted at storing the header chain as well as an index mapping block number to canonical header hash.

So, without further delay, here's what we've been up to.

Overlay Network (complete)

The Alexandria network builts on top of the Discovery V5 DHT.  We leverage the TALKREQ and TALKRESP commands that make the protocol extensible to build out an overlay network containing only the peers that support the Alexandria sub-protocol.

SSZ Partials (complete)

Since Alexandria uses UDP we have to fit everything into 1.2kb or less.  That means that when we transmit things likes block bodies which are larger than the individual packet size we need to break them up into smaller pieces for transmission.  In order to do this without exposing ourselves to various attacks we want each of these pieces to be provable, and to do this we use Merkle proofs.  An astute reader will recognize this as being very similary to how bittorrent works.

We decided to use SSZ since it provides a well defined spec for the merkle tree, and built out an optimized implementation for constructing proofs, extracting partial proofs, and serializing them for transmission.  The result is a very nice system that allows us to do efficient concurrent retrieval of content across multiple peers.

Advertisements (in progress)

Advertisements are the mechanism through which nodes in the Alexandria network find which other nodes have the content they want.  The advertisement system is still actively being designed but is beginning to stablize.

Further Reading

If you'd like to read more:

  • The in-progress spec document can be found here
Alexandria - HackMD
  • The actual codebase is here
ethereum/ddht
Python implementation of Discovery V5 Protocol. Contribute to ethereum/ddht development by creating an account on GitHub.

And you can find me in the #state-network channel within the EthResearch discord if you want to chat with me directly.