Marvin-Blockchain-Rust: A Rust-based blockchain implementation, part of the Marvin blockchain project.

Overview

Marvin Blockchain - Rust Implementation

Build Status dependency status Coverage Status Maintenance MIT licensed

Welcome to the Rust implementation of the Marvin Blockchain. This project is part of a comparative study on building the same blockchain in both Go and Rust. Follow along as we explore the development process, performance, and features of a blockchain built in Rust.

Project Overview

Marvin Blockchain is a distributed ledger and EVM Compatible inspired by Bitcoin and Ethereum, implemented in Rust. This project aims to provide a robust and scalable blockchain solution while comparing the nuances of building the same system in Go.

Read the series of posts about it:

Crafting a Blockchain in Go and Rust: A Comparative Journey

Crafting a Blockchain in Go and Rust: A Comparative Journey - Series

Features (WIP)

  • Proof of Work (PoW) Consensus Mechanism (Subject to Change)
  • Peer-to-Peer (P2P) Networking
  • Storage and Persistence
  • Transaction and Block Validation
  • Smart Contract Support via EVM Compatibility
  • JSON-RPC API
  • Comprehensive Unit Tests and Benchmarks

Getting Started

Prerequisites

  • Rust 1.80 or higher
  • Git

Installation

  1. Clone the repository:

    git clone https://github.com/joaoh82/marvin-blockchain-rust.git
    cd marvin-blockchain-rust
  2. Build the project:

    cargo build --release

Running the Blockchain

To start a node on the Marvin Blockchain:

./target/release/marvin-blockchain

Running Tests

To run the unit tests:

cargo test

Project Progress (WIP)

  • Add CLI support for ease of interaction
  • Implemented key pair creation, sign and verify
  • Create key pair with mnemonic seed
  • Add address command to CLI
  • Basic transaction and block data structures and validation
  • Add better error handling
  • Add protobuf encoding/decoding
  • Implement the basic blockchain data structure
  • Added basic application logging with slog crate
  • Peer-to-Peer (P2P) networking implementation (transport layer)

Roadmap (Subject to Change)

  • Proof of Work (PoW) consensus mechanism
  • Peer-to-Peer (P2P) networking implementation (transport layer)
  • Storage and persistence for blockchain data
  • EVM integration for smart contract support
  • JSON-RPC API implementation
  • Advanced transaction handling and validation
  • Enhanced security measures and best practices
  • Performance benchmarking and optimization
  • Comprehensive documentation and examples
  • Implement wallet functionalities
  • Improve EVM compatibility and support
  • Add more consensus mechanisms (e.g., PoS)
  • Implement light client support
  • Improve network protocol for better scalability
  • Develop a robust test suite for security and performance
  • Integration with Ethereum development tools
  • Develop a block explorer
  • Implement governance mechanisms
  • Cross-chain interoperability solutions
  • Improve documentation and developer guides

Project Structure (WIP)

The project is structured as follows:

  • src/: Contains the source code for the blockchain implementation.
  • docs/: Contains the documentation and guides for the project.
  • src/cli/: Contains the CLI implementation for the blockchain.
  • src/core/: Contains the core blockchain data structures and logic.
  • src/network/: Contains the networking implementation.
  • src/transactions/: Contains transaction handling and validation.
  • src/wallet/: Contains the wallet implementation.
  • src/utils/: Contains the utility functions and helpers.
  • src/main.rs: Contains the entry point for the blockchain application.
  • tests/: Contains the unit tests for the blockchain implementation.

Contributing

Pull requests are warmly welcome!!!

For major changes, please open an issue first and let's talk about it. We are all ears!

If you'd like to contribute, please fork the repository and make changes as you'd like and shoot a Pull Request our way!

Please make sure to update tests as appropriate.

If you feel like you need it go check the GitHub documentation on creating a pull request.

Code of Conduct

Contribution to the project is organized under the terms of the Contributor Covenant, the maintainer of Marvin Blockchain, @joaoh82, promises to intervene to uphold that code of conduct.

License

This project is licensed under the MIT License. See the LICENSE file for more information.

Contact

For any inquiries or support, please open an issue on Github or contact me at Joao Henrique Machado Silva [email protected].

You might also like...
Rust implementation of the Inter-Blockchain Communication (IBC) protocol.

ibc-rs Rust implementation of the Inter-Blockchain Communication (IBC) protocol. This project hosts the ibc rust crate which defines the main data str

Node implementation for aleph blockchain built with Substrate framework
Node implementation for aleph blockchain built with Substrate framework

This repository contains the Rust implementation of Aleph Zero blockchain node based on the Substrate framework. Aleph Zero is an open-source layer 1

A Secure Capability-Based Runtime for JavaScript Based on Deno
A Secure Capability-Based Runtime for JavaScript Based on Deno

Secure Runtime secure-runtime, as the name implies, is a secure runtime for JavaScript, designed for the multi-tenant serverless environment. It is an

Next-generation implementation of Ethereum protocol (
Next-generation implementation of Ethereum protocol ("client") written in Rust, based on Erigon architecture.

🧬 Martinez 🧬 Next-generation implementation of Ethereum protocol ("client") written in Rust, based on Erigon architecture. Why run Martinez? Look at

A pairing-based threshold cryptosystem for collaborative decryption and signatures used in HoneybadgerBFT implementation

threshold_crypto A pairing-based threshold cryptosystem for collaborative decryption and signatures. The threshold_crypto crate provides cryptographic

Rust project for working with ETH - Ethereum transactions with Rust on Ganache and also deploy smart contracts :)

Just a test project to work with Ethereum but using Rust. I'm using plain Rust here, not Foundry. In future we will use Foundry. Hope you're already f

A Rust port of the password primitives used in Django Project.

Rust DjangoHashers A Rust port of the password primitives used in Django Project. Django's django.contrib.auth.models.User class has a few methods to

A prototype project integrating jni rust into Kotlin and using protobuf to make them work together

KotlinRustProto a prototype project integrating jni rust into Kotlin and using protobuf to make them work together How to start add a RPC call in Droi

A Rust port of the password primitives used in Django Project.

Rust DjangoHashers A Rust port of the password primitives used in Django Project. Django's django.contrib.auth.models.User class has a few methods to

Comments
  • Use libp2p or gRPC for the networking layer?

    Use libp2p or gRPC for the networking layer?

    I am currently researching the best option to go with for the networking layer. I understand that gRPC was not initially made for P2P communication but instead for a Client/Server model, but I have seen recently a couple of project trying different implementations of it, so I am wondering if we should go with a more straight forward approach and use something like libp2p, despite the complexity. Or try something new and use gRPC. here are some of the pros and cons I compiled so far:

    Libp2p Networking Stack

    Advantages:

    Designed for P2P: Libp2p is specifically designed for peer-to-peer networking, making it an excellent choice for decentralized applications like blockchains. It handles peer discovery, connection management, multiplexing, encryption, and more.

    Modularity: Libp2p is highly modular, allowing you to customize and optimize your networking stack according to your needs. You can choose different transport protocols, discovery mechanisms, and security layers.

    Decentralized Friendly: Libp2p is built with decentralization in mind, enabling you to build a truly distributed system where nodes can join or leave the network dynamically without relying on central servers.

    Used by Major Projects: Libp2p is used by large, well-known decentralized projects like IPFS, Filecoin, and Ethereum 2.0. This means it has been tested in real-world, large-scale decentralized environments.

    Considerations:

    Complexity: Libp2p can be more complex to set up and use, especially if you are new to P2P networking or if your project does not require the full suite of features it offers.

    Learning Curve: Due to its flexibility and modularity, there is a steeper learning curve associated with understanding and effectively implementing libp2p.

    gRPC and Protobufs

    Advantages:

    Ease of Use: gRPC is easier to use and implement, particularly if you're already familiar with Remote Procedure Calls (RPC) and protocol buffers. It provides a straightforward way to define services and data structures using protobufs.

    Performance: gRPC is highly performant, supporting HTTP/2 by default, which allows for efficient use of network resources, multiplexing, and lower latency.

    Language Support: gRPC and protobufs are supported in many programming languages, making it easier to build cross-language services.

    Interoperability: gRPC is an excellent choice if you need to interoperate with other services, especially in microservices architectures or when communicating between different systems.

    Considerations:

    Not P2P Specific: gRPC is not designed specifically for P2P networks. It assumes a client-server model, so additional work is required to adapt it to a decentralized or distributed architecture.

    Lack of Native P2P Features: While you can implement P2P features on top of gRPC, such as peer discovery and connection management, it doesn’t come with these out-of-the-box like libp2p does.

    discussion 
    opened by joaoh82 1
Owner
João Henrique Machado Silva
I do server stuff...
João Henrique Machado Silva
Implement Quicktime screen sharing part protocol.

Quicktime Screen sharing for iOS devices implement Quicktime part protocol. take screen record from iOS devices. Thank's for quicktime_video_hack full

Anonymous 6 Aug 17, 2022
HyperCube is a free and open source blockchain project for everyone to use.

XPZ Public Chain HyperCube is a free and open source blockchain project for everyone to use. 日本語 简体中文 正體中文 HyperCube Wiki Wha is HyperCube HyperCube i

null 949 Dec 31, 2022
This is the Repo used to learn blockchain development in conjusction with the CyberGen NFT Project.

Environment Setup Install Rust from https://rustup.rs/ Install Solana from https://docs.solana.com/cli/install-solana-cli-tools#use-solanas-install-to

null 1 Nov 3, 2021
A Rust-based CustomVM for the Avalanche blockchain network

A rust-based Custom VM for Avalanche Subnets Curious about how to run Rust-based smart contracts, or just custom VMs for Avalanche blockchain? You're

Archis 11 Dec 29, 2022
Polkadex - An Orderbook-based Decentralized Exchange using the Substrate Blockchain Framework.

What is Polkadex? ?? Polkadex is a Open Source, Decentralized Exchange Platform made using Substrate Blockchain Framework that provides traders with t

Polkadex 243 Dec 16, 2022
xx network Substrate based blockchain node

xx network Substrate based blockchain node Rust Setup First, complete the basic Rust setup instructions. MacOS users: setup to compile for Linux Befor

xx network 11 Dec 20, 2022
The Data Highway Substrate-based blockchain node.

DataHighway-Parachain, a parachain on the Polkadot network. Planned features include a decentralized LPWAN roaming hub for LoRaWAN IoT devices and network operator roaming agreements, participative mining, an inter-chain data market, and DAO governance.

DataHighway 11 Dec 2, 2022
Selendra is a multichains interoperable nominated Proof-of-Stake network for developing and running Substrate-based and EVM compatible blockchain applications.

Selendra An interoperable nominated Proof-of-Stake network for developing and running Substrate-based and EVM compatible blockchain applications. Read

Selendra 16 Nov 29, 2022
Rust implementation of Namada, a sovereign proof-of-stake blockchain that enables asset-agnostic private transfers

Namada Overview Namada is a sovereign proof-of-stake blockchain, using Tendermint BFT consensus, that enables multi-asset private transfers for any na

anoma 144 Jan 2, 2023