Mintlayer started not as a startup but as a specification. A Bitcoin-anchored Layer-2 with programmable UTXO outputs, native tokens, a DEX, and Proof-of-Stake consensus, all written in Rust, all open-source from day one. RBB wrote the first commits and built the engineering foundation that carried it to mainnet.
The codebase that exists today is 358,000 lines of Rust across 83 workspace crates, with 10,568 commits and 2,000+ test functions. It did not arrive that way. It was designed to grow into it.
The brief
The challenge was not just technical. We were starting from a whitepaper, assembling a distributed team, and building toward a deadline shaped by audit windows, exchange listings, and a public community watching every PR. Everything had to be designed for the day someone else would maintain it, because that day was always the goal.
The build
The architecture is a set of independently testable subsystems wired together by a lightweight actor framework: each component runs in its own Tokio task, communicating via typed channel primitives. Chainstate, mempool, p2p, block production, and the wallet stack never share memory directly; they pass closures and wait for results. This made the codebase auditable, subsystem by subsystem, without requiring auditors to hold the whole system in their heads at once.
Every PR was public, every design decision argued in the open. That was not just process; it was the product. An open-source protocol is only as trustworthy as the history of decisions that produced it.
Consensus as boring code
The most interesting part of a consensus implementation is making it uninteresting to read. The PoS consensus uses a VRF-based slot lottery: a staking pool proves slot eligibility without revealing the private key, then assembles and signs the block. The finalization path is twelve lines, one error type, every failure mode named. The code below is roughly what landed, and it has not meaningfully changed since.
pub fn finalize_block( chain: &mut Chain, block: Block, ) -> Result<BlockId, ConsensusError> { block.verify_signatures()?; chain.check_continuity(&block)?; let id = chain.commit(block)?; emit(Event::Finalized { id }); Ok(id) }
On the systems where being wrong is unrecoverable, we have not found a better engineering trade than Rust.
Engineering notes
A few things we are proud of from three years of work on the protocol:
- 2,000+ test functions across 289 files: unit, integration, property-based (proptest), parameterised (rstest), and concurrency model-checking (Loom). The storage layer has a dedicated fault-injection backend that wraps any implementation with configurable failure modes.
- 83 workspace crates, each with a single clear responsibility. The chainstate crate alone is 87,000 lines; the wallet stack is 69,000. Neither knows the other exists except through typed channel handles.
- Four separate append-only delta ledgers (PoS pools, tokens, DEX orders, base accounting) that chainstate commits atomically. Rolling back a block is a single operation against all four.
- WASM bindings exposing transaction building, address encoding, and cryptographic operations for browser-based wallets; the protocol is usable from a web page without a trusted server.
- Hardware wallet support (Ledger, Trezor) behind a common signing interface shared by the CLI and GUI wallet.
- Zero production panics on the mainnet validators we operated across the entire trailing year of active operation.
The result
Mintlayer launched mainnet on time, ran its audits without surprises, and continues to operate today with 10,568 commits and around 20 contributors. The wallet CLI, the node daemon, and the WASM bindings we shipped are used by third-party developers and validators who never spoke to us directly. That is the point of building in the open.
Hand-off, the open-source way
Hand-off in an open-source context is something quieter than in a SaaS engagement. There is no ceremony; the repo is the artifact. What we built toward, from the first commit, was a codebase where every subsystem could be understood independently, every decision was argued in the open, and any capable Rust engineer could pick up the next issue without asking us how anything worked. The commit history is the documentation.