This week I’m highlighting Astrocore from the Evil Martians team! They’ve been featured on Dev Digest before, but this time we are going more in depth.

In short, Astrocore aims to become an alternative, Rust-based implementation of stellar-core, the core component of the Stellar network. Why does the ecosystem need another implementation of Stellar-core? And why Rust? Great questions!

Lucky for us, the team working on Astrocore answers them really well in their README:

Why another implementation?

Stellar itself is a blockchain, decentralized by nature. Having more than one core node implementation is right for decentralization. Also, reimplementing can help to discover possible bugs in the current codebase.

Reference implementation doesn’t have any specification of how it works, so we are going to use the reverse engineering approach and kickstart specification writing process (check out Github wiki). Having one facilitates the creation of other implementations tremendously.

Why Rust?

The Rust language seems perfect for this task because it focuses heavily on performance and reliability. Moreover, Rust code is developer-friendly, and this can help to increase the number of potential contributors.

If you’re interested in the specs, you can find those here: https://github.com/astroband/astrocore/wiki

Talking to the Team

I also got a chance to ask one of the developers, Sergey Nebolsin, about their experiences so far, and about how to get involved. Here’s what he had to say:

I was thinking about your questions and in fact it all comes down to the lack of (semi-)formal specs of pretty much everything except for the data encoding (XDR) and consensus protocol (SCP). There’re a few pieces of documentation here and there, but it’s partial and “decentralized”: docs folder, src/<subsystem>/readme.md files, and just regular comments, like this one. For newer development we usually have a decent spec in the CAPs, but they still describe individual features, and there’s no single place which specifies how it all works as a whole system and defines the rules you have to follow in order to be compatible. The only ultimate specification is the C++ code of the stellar-core itself.

While building Astrocore we started to collect all our findings from different docs, the source code and actual testing against the testnet, and we came up with the (early and incomplete) draft of the Network/P2P layer spec, which you can find here.

The ultimate goal is to move from “The Stellar network is what stellar-core’s C++ code implements” to “This is the specification of the Stellar network. Full implementations: stellar-core (C++). Partial implementations: astrocore (Rust), stellar-core-go (Go), …” :)

We would love to see more involvement from the community into this process of creating the Stellar network specs, and we’re also open to any feedback and suggestions on how to better organize this process: what’s the best place to keep the specs? Stellar-protocol repo? Other independent repo? Public wiki? How do we make sure that new material is being reviewed in a timely manner and doesn’t stuck as a draft forever? etc.