Realizing the Mina vision in Rust

Announcing a new grant from the Mina Foundation

Kingsman Ventures
4 min readMay 11, 2021

ChainSafe is proud to announce we have been awarded a grant by the Mina Foundation to build an additional implementation on Mina Protocol to improve the network’s resilience and accessibility. The grant will serve as an extension to our already existent work with O(1) Labs by auditing and optimizing Mina’s network layer.

This new implementation will be written in Rust and then compiled into wasm (WebAssembly) to enable in-browser environments. Wasm bytecode is compatible with most browsers (desktop or mobile) and develops high-performance apps over web pages. The team decided on Rust as it is a multifaceted language with secure memory safety and high performance that is Wasm compatible. After this, the team will ensure that the required networking is supported in-browser.

After completing the alternative Rust implementation, Mina will be more accessible than ever before. ChainSafe is looking forward to contributing to the re-implementation of the protocol and expanding the network!

But what is Mina?

Mina is the world’s lightest blockchain that creates a private gateway between the real world and crypto. Mina does not rely on expensive hardware like many larger blockchains; instead, it uses an advanced cryptographic technique called recursive zk-SNARKs (Zero-Knowledge Succinct Non-Interactive Argument of Knowledge) to ensure scalability and privacy.

zk-SNARKS prove that the information exists without actually having to reveal the information. Every time Mina produces a block, it also generates a SNARK proof. The proof, which confirms the block’s validity, is then the only thing stored by the nodes.

How the Mina protocol stays 22 kb

SNARKS provide the users with anonymity, and since only proof of the data is necessary to store on chain, the storage requirements are minimal. At 22 kb, Mina is the world’s lightest blockchain. For scale, both the Bitcoin and Ethereum blockchains are 300+ GB in size. The size of the typical blockchain prevents most users from becoming full nodes that store the entire historical network state. This issue is nonexistent with Mina.

Mina aims to provide a robust and accessible blockchain that anyone can access anywhere, including on smartphones, laptops, and in-browser. Standing apart from the data-heavy blockchains, Mina provides a global, scalable ecosystem by creating “a vibrant decentralized network and open, programmable currency — so we can all participate, build, exchange and thrive.”

The Mina Networking Stack

Mina uses go-libp2p to implement its networking stack. libp2p is “a modular system of protocols, specifications and libraries that enable the development of peer-to-peer network applications.” On a basic level, libp2p provides tools and infrastructure to construct trust-less systems. Mina’s reference implementation is written in OCaml, while the networking helper is in Go. The daemon sends encoded messages to the libp2p helper detailing what it wants the helper to do. The helper can also send messages back to the daemon using upcalls. Through these processes, the network’s OCaml and Go side can communicate with each other.

Our Other Work on Mina

Initially, the ChainSafe team was focused on auditing and improving the go-libp2p network stack. The team was then able to identify opportunities for optimization and further development relating to the usage of go-libp2p and communication between nodes.

Soon, ChainSafe will help upgrade the network to use Bitswap. Bitswap will further improve the networking capacity of Mina, improving the speed at which peers can request and receive information.

The Road to Mina

Moving forward the team has set out 4 overarching milestones to be completed for the new Mina implementation.

1. Serialization and block verification.

This will involve implementing the serialization primitives used in the current protocol with the ability to extend the functionality for custom types. During this process, the team will also implement the block verification and the associated proof that comes with each block.

2. Block selection logic.

The team will then introduce logic to the rust implementation to choose the canonical, most valid block, based on chain strength. This is so we can follow and track the best block on the chain.

3. Ledgers and additional state.

After that, the team will enact the ability to store and update the account database so that all the data can be stored effectively and securely.

4. Libp2p support

Finally, in the last milestone, the team will implement a JavaScript component to request and receive blocks from all other nodes on the Mina network, using libp2p-js. The next step will be to support the submission of transactions via a gossip system, in order to increase communication efficiency and range. The last step involving libp2p will be to validate and support compatibility with browser environments so that Mina can be accessed from virtually anywhere.

Get to know more

To learn more about Mina, be sure to visit their website!

Want to work with ChainSafe? COME JOIN US!!! Check out the new Careers section of our website and our open positions, and get in touch with us at careers@chainsafe.io if you are interested!

Also, be sure to check out and follow ChainSafe’s Twitter and YouTube Channel! If you would like to get in contact with one of the Mina implementation team members from ChainSafe, feel free to drop by on our Discord.

Finally, follow closely on our website and Github for the latest updates!

Source: ChainSafe

Follow Kingsman Ventures Media!

Medium | Telegram | Twitter | Website | Bitclout | Facebook

--

--

Kingsman Ventures
Kingsman Ventures

Written by Kingsman Ventures

Kingsman Ventures is a venture focused on strategies related to growth hacking projects. We incubate, advise, fund, and support blockchain projects with all our

No responses yet