GithubHelp home page GithubHelp logo

my-cloud / ruthenium Goto Github PK

View Code? Open in Web Editor NEW
11.0 2.0 1.0 3.98 MB

Golang implementation of the Ruthenium protocol

License: The Unlicense

Dockerfile 0.14% Go 93.22% HTML 6.65%
blockchain cryptocurrency sustainable proof-of-humanity p2p ecdsa cryptography decay sha256 income

ruthenium's People

Contributors

dependabot[bot] avatar gwenall avatar jeremypansier avatar wendytp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

grantokawa

ruthenium's Issues

Verify neighbors requests

In GitLab by @Styks on Aug 2, 2022, 08:43

  • Don't add in a new block the transactions from a sender wallet which have insufficient amount
  • Make ResolveConflict not accepting a blockchain with transactions which could not have been performed (verify signature and amount)
  • Propagate transactions pool
  • Make ResolveConflict not accepting a blockchain with mining rewards exceeding the consented one
  • Verify mining delay

Proof of Humanity is known using a REST API instead of directly reading smart contract

For a first implementation, we taken the easy way. To know if someone is registered in the Proof of Humanity registry, we are requesting this REST API. This is a vulnerability because the data is centralized. We need to gather the information in a decentralized manner. To do so, we can directly read the isRegistered value from the Proof of Humanity smart contract.

  • Directly read the Proof of Humanity smart contract isRegistered value

๐Ÿ’ก Here is where the REST API is called in our code

๐Ÿ’ก This seems to be a good tutorial to know how to read a smart contract

Add universal basic income

Context
Since the wallet amount is decreasing, people need a basic income to be interested in creating an account.
Since the validators need an incentive to add as much as transactions as possible into the next block, the reward must depend on transaction fees.

Description
The validator reward must be replaced by the transaction fees.
Every wallet must get a basic income.

Tasks

  • Verify the Proof of Humanity for every wallet
  • Give a basic income to every wallet that is registered
  • Replace the actual reward calculation by the transaction fees

Update module name

the go.mod module name points to the gitlab repository. Update it to reflect the github repository.

Fix get amount error when address is empty

In GitLab by @Styks on Jul 27, 2022, 18:44

When the wallet address is empty in a request from wallet side, the blochain side logs error because of a nil pointer dereference.

  • log it on wallet side only
  • handle the case to not get a nil pointer dereference on blockchain side

Limit block size

Context
A hudge transactions count might lead to a blockchain propagation time to out of the validation delay.

Description
The problem might be avoided by limiting the number of transactions to be included into the next block. Higher transactions fees might be applied to ensure a transaction to be in the next block.

Tasks

  • Limit the block size or the number of transactions to be included into the next block.
  • If needed, propose to pay more fees to increase the chance of a transaction to be in the next block.

Store and load the blockchain from a file

Context
Verifying the whole blockchain might take more time as it grows up.

Description
A lot of time can be saved if the blockchain can be stored into a file to be loaded the next time the node is started.

Tasks
Try to split the feature into small tasks.

  • Make it possible to store the blockchain into a file
  • Make it possible to load the blockchain from a file

Improve blockchain reliability

In GitLab by @Styks on Jul 22, 2022, 08:21

  1. Only clear the transaction pool if a new block is validated
  2. Remove DeleteTransactions from the blockchain API
  3. Disallow start mining more than once

Use broadcast messages

  • Use broadcast messages to send to the client:
    • success or failure messages
    • message informing that the wallet amount has changed
    • message informing that the transactions pool has changed
  • Do the appropriated treatment when receiving a message

๐Ÿ’กsee https://pkg.go.dev/context#Context.Done and use it here

Extract configuration variables

Context
Some of the constants defined in the project might have to be changed later on. It is a shame to modify source code to just change a setting.

Description
Most of the constants might be extracted to a configuration file

Tasks

  • Extract constants into a configuration file.

Change release process

We need to create a release branch

  • edit the contributing file
  • edit the docker-publish.yml
  • add LABEL org.opencontainers.image.description DESCRIPTION in the Dockerfile

Add a CI linter

  • add the following job in the quality workflow:
jobs:
  lint:
    name: Lint
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-go@v3
        with:
          go-version: 1.18
      - uses: golangci/golangci-lint-action@v3

Improve neighbors finding

In GitLab by @Styks on Jul 22, 2022, 08:20

  • Fix timeout error (read tcp 192.168.1.90:5000->192.168.1.90:62368: i/o timeout)
  • Find neighbors only when needed
  • Investigate about how is done the neighbor finding for famous blockchains and apply it

Transaction don't have fee

If there is no transaction fee, the blockchain network is vulnerable to transactions spam.

  • Add transaction fee

Update release documentation

When merging with rebase onto main, each commit is added individually, and their revision identifiers seem to differ from those of dev. To avoid conflicts for the next release, the release branch must be merged locally to main.

Limit Outbounds

In GitLab by @Styks on Sep 7, 2022, 12:07

  • Limit Outbound connections to 8
  • Change the validation process:
    • Validate
    • Resolve conflicts every 10 seconds
    • Don't ask for consensus
  • Remove consensus from the API

Validate transaction

In GitLab by @Styks on Aug 2, 2022, 14:37

  • Make the transaction be added to the pool only if the sender address correspond to the public key

Wip packages are publicly visible

  • In the ruthenium/.github/workflows/docker-publish.yml file, remove the dev branch.

Instead of:

on:
  push:
    branches: [ "main", "dev" ]

We want:

on:
  push:
    branches: [ "main" ]

Block can have no reward recipient

Investigate if it can be an issue (i.e. to find the oldest reward recipient) and if so, solve it by adding a rule to always have a single reward recipient

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.