#blockchain #block #merkle

blockchain-base

Implementation of a generic block of a Blockchain with minimal dependencies

1 unstable release

0.1.0 Nov 28, 2019

#67 in #merkle

AGPL-3.0-only

13KB
173 lines

blockchain-base

Crates.io

blockchain-base provides a customizable base for a blockchain implementation.

The purpose of this crate is to build your own Blockchain with as few dependencies as possible. This means that when possible, the library uses the standard Rust structures and functions.

It is in the process of being part of blockchain-satellite project for implementing an original idea of a blockchain over a Low-Orbit satellite. The idea is described on the paper:

Blockchain and radio communications over suborbital spaceflights: Watchtowers and Mystics

Usage

Add blockchain-base to your project's Cargo.toml. For more details, consult the Cargo guide.

Example:

extern crate blockchainblock;
use crate::blockchainblock::*;

let prev  : Option<BlockHash> = None;
let nonce : u64 = 3;
let timestamp : u64 = 4;
let data : [i32; 1] = [5];
let block : BlockchainBlock<i32> = BlockchainBlock::new(prev, &data, timestamp, nonce);
println!("\n{:?}\n", &block);

For more examples, consult the documentation.

Release Notes

Acknowledgements

This crate was inspired by blockchain-rust.

blockchain-base is copyrighted under the terms of the AGPL-3.0 license. See LICENSE for details.

Dependencies

~46–590KB