Development

Mintlayer Node - May 2022 Progress Report

Tuesday, May 3, 2022

Since beginning work on our new codebase in November of last year, Mintlayer has made significant progress towards our next testnet. A substantial amount of time has been devoted to the architecture and design of our node. In particular, we have examined implementations of several other blockchains in order to determine what we can learn from them and where we can improve on what has already been done. In laying the foundations for our node, the key focus has been on making Mintlayer as maintainable, secure, and efficient as possible in the long run.

In this article, we give an overview of the progress achieved thus far on the various components of the Mintlayer node.

Node Architecture

Blockchains are inherently complex systems, consisting of several components that interact with one another: p2p networking, block production, database storage, transaction memory pool, RPC server, and others. Often in existing blockchains, communication between the different subsystems is achieved via synchronization primitives, which render the code both more complex as well as error-prone. In Mintlayer, each subsystem will operate independently, on its own thread, and subsystems will communicate over channels. Built on top of the cutting-edge infrastructure provided by the Rust programming language ecosystem, our choice of architecture reflects Mintlayer’s commitment to correctness, simplicity, and maintainability.

RPC

Blockchain applications generally communicate with nodes via Remote Procedure Calls, or RPCs. RPCs provide a way for code running on one machine to invoke code running on another machine. A proof of concept for our node’s RPC server is underway.

Mempool

When a node receives a transaction from the network, it must store that transaction in memory, until it is selected for a block. The data structure responsible for storing pending transactions is called the transaction memory pool, or mempool for short.

Mintlayer’s mempool has been primarily inspired by Bitcoin Core’s implementation, with a view towards improvements in code quality and maintainability. A substantial part of transaction validation has been implemented, in addition to indispensable features like Opt-in Full Replace-by-Fee (BIP 125). Our versatile unit test framework enables us to efficiently test new functionality as development progresses.

Consensus

To ease and expedite development, a provisional Proof-of-Work consensus has been implemented. This will allow us to temporarily get a running node working, which will enable us to build the rest of the node without worrying about the difficulties and challenges of correctly implementing the DSAv0, Proof-of-Stake, consensus protocol which will exist before the public testnet release later this year.

In the background, the Mintlayer team has made significant headway in the research and design of its planned full DSA consensus system.

Database Storage

The database storage layer has been implemented, leveraging Rust’s powerful type system to enforce the database structure. An abstraction over possible database backends allows us to support various storage backends in the future. Currently, in-memory database storage is supported.

P2P Networking

The architecture of the p2p networking layer has been determined. Our design includes an abstraction layer over the network interface, allowing us to easily test code in isolation via a mock interface. Peer discovery and connectivity, block and transaction announcements, and syncing from the network have all been successfully implemented. Swarm maintenance is currently under development.

Crypto Primitives

At the very heart of every cryptocurrency is the crypto subsystem providing the foundations for a large portion of the rest of the blockchain. As it stands, we have integrated interfaces for both cryptographic hash functions and randomness, and we have an initial version of the public key cryptography support we will offer. An implementation of Schnorr has been merged into the current codebase, and BLS support will be added shortly as it currently exists in a separate project.

You can help

Mintlayer is an open-source project. If you are interested in contributing, you are welcome to look through our list of good first issues.

Looking for work?

Mintlayer currently has several open positions. Why not check to see if there’s a role that matches your skills?