Giter Club home page Giter Club logo

coinmixer's Introduction

Jobcoin mixer

Jobcoin Mixer written in Python

Getting started

Make sure you're using python 3.8

Setup virtual env

virtualenv --python=python3 venv
source venv/bin/activate

Install requirements

pip install -r requirements.txt

Start the CLI

python cli.py

Structure

The app is split into the following folders:

  • Main CLI: /cli.py
  • API Calls: /jobcoin/config.py
  • Main Mixer: /jobcoin/jobcoin.py
  • Other CLI prompts: /jobcoin/prompts.py

How it works

visualization_final

This mixer waits for multiple users (default 2) to send in transactions in order to shuffle its balance and then 'unload' it accordingly. In a real life scenario one could also add a time limit of several days before the house continues to send out all payments over a range of time.

Once a user initiates the mixer they get to specify the amount of addresses they would like to send their balance to. Following that, they have the option to send any amount of coins to the deposit address themselves or do it directly via the cli, after which a unique deposit address gets created. The address is unique to every user as this will allow the House to not need to store any information pertaining to the user's send address, and instead only track the deposit address and the corresponding receiving addresses.

If the user chooses to send the coins automatically via the cli, they will be prompted to enter their send address (equivalent to signing in with a wallet in real life) and the amount they would like to send. If they choose to manually send the jobcoins to the deposit address, the House account will observe any incoming transactions to the given deposit address for a given period of time (60 seconds by default) at specific time intervals (every 5 seconds by default). Once it tracks an incoming transaction, it knows that that's the amount of jobcoins that need to be transferred to the receiving addresses as specified by the user prior.

After the deposit has been made, the balance will be sent to the House account, which is where it gets mixed with all the other incoming deposits (2 by default). The house calculates a maximum amount it will send to every receiving address to make it more difficult to track what balance came from which originating address.

*Example:*
- A sends 10 coins to the House, alongside 2 recipient addresses [C,D]
- B sends 10 coins to the house, alongside 3 recipient addresses [E,F,G]

  then the house will proceed to:
  - send 3 coins to C
  - send 2 coins to C
  - send 3 coins to D
  - send 2 coins to D
  - send 3 coins to E
  - send 3 coins to F
  - send 3 coins to G

As soon as the house has received deposits from the specified number of users it proceeds to unload the splits to all the corresponding receiving addresses.

Improvements going forward

Here are a few thoughts about my current mixer and how it can be improved.

  • First of all, it would be good to add tests for all functions (both unit and integration tests as many of my functions call on other functions).
  • Some improvements to make it harder to track the transactions:
    • Shuffle the order in which the house pays out all payments.
    • Include further time delays during the house payout
    • Add a dynamic house fee within a range (e.g. between 0% to 5% fee per transaction), to add more randomness in the amounts being transferred
    • Randomize the splits instead of splitting everything equally (plus the remainder)

coinmixer's People

Contributors

aletna avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.