tinychain

module
v0.0.0-...-77b6ffe Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2020 License: MIT

README

Tinychain

This project is working in progress. A tiny blockchain

Features

Consensus

In consensus module, we design and implements different consensus algorithm, and make them pluggable.

please read document

Network

We use go-libp2p to implements network layer, including:

  • peers discovering
  • peers communication
    • blocks transferring
    • transactions transferring
    • consensus information transferring
Cryptography

We decide to use Ed25519 cryptographic algorithm to identify peers and produce signature.

Ed25519 is a public-key signature system with several attractive features:

  • Fast single-signature verification
  • Even faster batch verification
  • Very fast signing
  • Fast key generation
  • High security level
  • Collision resilience
  • so on...
Smart Contract
Virtual machine

The VM module is designed as pluggable modules.

At step 1, we will support EVM. And in the future version, we'll implement the below virtual machine step by step:

Contract language

At this EVM version, developers are coding with solidity, which is widely used to develop Dapps.

After implementing the virtual machine based on WebAssembly, you can use any languages to write contracts.

Database

LevelDB

Merkle tree

In tinychain, we use Bucket tree to induce transactions and world state.

Bucket tree is a variant merkle tree with several features that are different from the common merkle tree:

  1. fix height of tree when initialize and will not be changed by the amount of transactions.
  2. low-cost to recompute the root hash when add or remove a kv pair to/from tree.
  3. customizable capacity and aggreation.
Event Hub

Eventhub in tinychain is extended from TypeMux and feed in Ethereum. We combine them and re-implement a new event hub to achieve a better performance and readability, and make the processing flow clearer.

Directories

Path Synopsis
cmd
net
Package common contains various helper functions.
Package common contains various helper functions.
cache
Package cache provides interface and implementation of a cache algorithms.
Package cache provides interface and implementation of a cache algorithms.
pow
bmt
Bucket merkle tree implementaion
Bucket merkle tree implementaion
vm
vm/evm/abi
Package abi implements the Ethereum ABI (Application Binary Interface).
Package abi implements the Ethereum ABI (Application Binary Interface).
vm/evm/crypto/bn256
Package bn256 implements the Optimal Ate pairing over a 256-bit Barreto-Naehrig curve.
Package bn256 implements the Optimal Ate pairing over a 256-bit Barreto-Naehrig curve.
vm/evm/crypto/bn256/cloudflare
Package bn256 implements a particular bilinear group at the 128-bit security level.
Package bn256 implements a particular bilinear group at the 128-bit security level.
vm/evm/crypto/bn256/google
Package bn256 implements a particular bilinear group.
Package bn256 implements a particular bilinear group.
vm/evm/crypto/secp256k1
Package secp256k1 wraps the bitcoin secp256k1 C library.
Package secp256k1 wraps the bitcoin secp256k1 C library.
vm/evm/crypto/sha3
Package sha3 implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length hash functions defined by FIPS-202.
Package sha3 implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length hash functions defined by FIPS-202.
vm/evm/hexutil
Package hexutil implements hex encoding with 0x prefix.
Package hexutil implements hex encoding with 0x prefix.
vm/evm/math
Package math provides integer math utilities.
Package math provides integer math utilities.
vm/evm/runtime
Package runtime provides a basic execution model for executing EVM code.
Package runtime provides a basic execution model for executing EVM code.
p2p
pb
rpc
api

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL