Coder Social home page Coder Social logo

manishmeganathan / weave Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 1.0 479 KB

An implementation of a cryptocurrency blockchain network that implements P2P networking, local persistence, transaction merkle trees, memory pooling and a proof-of-work consensus layer. [WIP]

License: MIT License

Go 98.40% Makefile 1.60%
blockchain golang proof-of-work badgerdb libp2p consensus blockchain-network memory-pool cryptocurrency

weave's Introduction

Weave

An implementation of a blockchain network that implements P2P networking, local persistence, transaction merkle trees, memory pooling and a proof-of-work consensus layer.

weave's People

Contributors

manishmeganathan avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

ehtesham599

weave's Issues

Add a ConsensusHeader interface

  • Define an interface for the POW data of the BlockHeader
  • This is an extra layer of abstraction at first glance but represents the interface for all future consensus models that may be integrated into the package
  • Define it as part of the blockheader file

Add a database structure

  • Add a struct that holds the badgerDB client but also a mutex object that will allow the client the database to have thread-safety when multiple goroutines try to access it
  • Integrate the DB open and close functionality as methods of this structure
  • While the package is currently not using any goroutines for optimizations, the integration of a network module and future optimizations will potentially cause issues. Better safe than sorry.

Refactor wallet module and address generation

  • Refactor the wallet module utilities to be more general and integrate them into the utils package
  • Refactor the address generation mechanism to be compliant with the structure as detailed below. (Current model uses a deviation that probably isn't safe)
  • Keep the transition from RIPEMD160 to a truncated SHA256 intact
  • Add hash helpers to the utils library while modifying the wallet utilities

image

Implement memory pool persistence

  • Implement a module for a memory pool of transactions
  • Pool should be key addressable and have a size limit
  • Pool should support get, put, remove and pop operation constrained within pool size
  • Pool should support resizing
  • Pool should support an event handler for pool state changes

Build primitives package

  • Refactor Block, Transaction and TXI, TXO structs to a new package within \src.
  • Add a module within the primitives package to handle gob serialization and deserialization.

Add BlockHeader struct

  • Add a struct BlockHeader to store the information considered when generating the block hash
  • This is in line with development convention and the structure of traditional blockchains
  • It would allow for the isolation of components such as the block height and full transaction data away from the content that is considered for the block hash

Repurpose the core animus chain functionality

  • Break down the core animus functionality from the BlockChain structure into
    • a separate iterator module that also includes common database transactions
    • an optimized set of UTXO handler functions
    • other modules to support other functionality

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.