Grant approved! Advanced CKB mining infrastructure with Insight

Nervos Network
Oct 30, 2020 · 4 min read
Insight and Nervos logos

The Nervos Foundation is pleased to announce that the blockchain R&D wing of Insight, comprised of top alumni from their decentralized consensus fellowship and other professional training programs, has received approval for a mining infrastructure grant!

There are two key components to this grant: support for next-generation mining communication protocol Stratum V2 and the automation of mining pool software deployment. More details about the grant can be found in the grant proposal post on Nervos Talk.

A decentralized mining ecosystem has been a goal of the Nervos project and drove the development of the Eaglesong hash function. This grant will contribute to this goal with automated pool deployment, reductions in mining pool operational (bandwidth) costs, and the potential to mitigate transaction censorship by mining pools with Stratum V2.

We enjoyed hosting the Rust in Blockchain day with Insight during San Francisco Blockchain Week 2019 and are excited to further our collaboration. Insight’s accomplished crypto R&D team is a valuable addition to the Nervos ecosystem. They are dedicated to building infrastructure and software to tackle high-impact blockchain challenges and in the last 6 months have executed projects funded by the Zcash Foundation, Web3 Foundation, ICON Foundation, Harmony Grants, and Monero CCS.

What’s Stratum v2 and why is it important?

Stratum (V1) is the standard communication protocol that connects mining rigs to mining pools. Stratum V2 offers significant improvements over V1 in terms of infrastructure efficiency, pool security, and miner privacy with new features and optimizations including reduced data loads, hashrate hijacking prevention, and more.

Efficiency is increased in Stratum V2 by enabling a mining pool to communicate data related to the next block before the current block is found, allowing miners to plan ahead and begin mining the next block as soon as they receive the latest block hash. Further efficiency is gained by using a binary rather than JSON encoding, which significantly reduces message size.

Stratum V2 is also more flexible than V1. The specification includes protocols that give miners the ability to choose their own valid transaction set. (Alternatively mining devices can operate in a simplified but more efficient mode via header-only mining.) It also adds extensive support for proxies and highly efficient communication channels to maximize resource utilization while still maintaining compatibility.

Miners’ security and privacy are enhanced by implementing AEAD (authenticated encryption with associated data) to hinder network-level surveillance and prevent hashrate hijacking.

What’s being built

Insight will build up an automated, Stratum V2-compliant mining pool software deployment over the course of approximately 3.5 months, which will empower a larger base of users and operators to get state of the art mining pool systems running and build them out further to suit their priorities.

In order to empower development and facilitate adoption of the stack, Insight will begin by developing infrastructure provisioning and automated deployments utilizing the CKB blockchain within the BTCPool infrastructure.

Development will focus on a VM-based approach, configured with Ansible and deploying all the dependencies on a single host environment for both cloud and on-premise. Packaging will initially be done with docker-compose to facilitate development, though efforts will be made to expose the interfaces that will allow users to be able to quickly adopt the necessary infrastructure components to run the stack independently.

Insight will then implement a ckb-miner-compatible Stratum V1 <-> V2 proxy compatible with BTCPool’s BTCAgent protocol agent through a CKB subclass for BTCPool Stratum servers (similar to existing Bitcoin and Ethereum implementations), implement the data structures and network/messaging flows required by the Stratum V2 application protocol (more information can be found in specification), and implement, test, and optimize the V1 -> V2 proxy for CKB.

Insight will then implement the Stratum V2 binary message format and all required Mining Protocol methods in BTCAgent with connecting code contributed as needed in BTCPool.

These fundamental components will be connected and made performant by leveraging the gRPC framework, which maps well to the current JSON RPC framework and allows for binary message formats. Protobufs for GRPC will be derived directly from the Stratum V2 protocol spec and will be uploaded to the Kafka schema registry. A 10x message transfer performance improvement is expected over the current JSON format.

This is an important step in the development of the CKB mining ecosystem. Through the implementation of important, state of the art optimizations, this grant demonstrates the project’s commitment to innovation and the advancement of public, decentralized blockchain networks.

We’ll take a deep dive into the grant proposal during our fireside chat with Mitchell Krawiec-Thayer, Ph.D. and Head of Research, Developers in Residence at Insight. Stay tuned for more information and follow Nervos on Twitter to stay in the know about AMAs, fireside chats, and more.

To stay updated on all things Nervos:

Join our community: DiscordGithubNervos Talk ForumTwitter

For discussions or questions join the conversation on Discord or check out one of our community Telegram channels: English, Korean, Russian, Japanese, Spanish, Vietnamese and Chinese

Nervos Network

The Nervos Network is a public blockchain ecosystem and…