Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

๐Ÿ‘พ ๐—ฏ๐—ฎ๐—ฐ๐—ธ-๐—ผ๐—ณ-๐˜๐—ต๐—ฒ-๐—ฒ๐—ป๐˜ƒ๐—ฒ๐—น๐—ผ๐—ฝ๐—ฒ ๐—ณ๐—ผ๐—ฟ ๐—ฎ ๐—ฐ๐—ฟ๐˜†๐—ฝ๐˜๐—ผ ๐—ฐ๐—ผ๐—ถ๐—ป ๐—บ๐—ถ๐˜…๐—ฒ๐—ฟ

Notifications You must be signed in to change notification settings

go-outside-labs/coinmixer-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

11 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Coin Mixer ๐Ÿ๐Ÿ’Ž

A crypto coins are not an anonymous protocol (but a pseudonymous system), our Coin Mixer PoC is an approach to maintaining privacy on our jobcoin network (for a tiny small fee ๐Ÿ˜‰)!

We use Coin Mixer Server API endpoints to deploy our sophisticated mixer algorithm to your coin deposit!

To install our Jobcoin Mixer CLI, follow the instructions below.


Set up your .env file

To follow best practices, we set our variables and secrets into a .env file, which can be copied from .env_sample:

cp .env_sample .env

Set the following variables:

API_ADDRESS_URL = ''
API_TRANSACTIONS_URL = ''
SIGNIFICANT_DIGITS = 17
HOUSE_ADDRESS = 'Jobcoin-House'
FEE_PERCENTAGE = 0.1
WITHDRAW_MAX_VALUE = 1

What is HOUSE_ADDRESS?

The ephemeral hex deposit address moves the coins to this address, where it's then mixed with other coins.

What is SIGNIFICANT_DIGITS?

As Jobcoin Mixer deals with float transactions, this variable sets the desired precision when converting strings to float.

What is FEE_PERCENTAGE?

An integer number representing the percentage fee to be collected for the mixing service. Set to 0 for no fee.

What is MAX_WITHDRAW_VALUE?

Set the value for small withdrawal values for which Jobcoin Mixer will move from the House address to each personal addresses.

Jobcoin Mixer cares about your privacy, so setting this to smaller values makes the transactions more discrete!

If you would like to have Jobcoin Mixer withdrawing all coins in one unique transaction, simply leave this constant empty (None).


Install Jobcoin

You can install Jobcoin either via setup.py or by running it straight from the executable (jobcoin/cli.py).

With setuptools

Install jobcoin 0.0.1 with:

make install

Now you can run:

jobcoin

With cli.py

Install dependencies in a virtual environment

You can use either virtualenv or pipenv.

Using virtualenv

Install virtualenv:

pip install virtualenv

Creating and sourcing the environment:

virtualenv venv
source venv/bin/activate

Install dependencies:

pip install -r requirements.txt

You can always check what is installed in your environment with:

pip freeze

Using pipenv

Install pipenv:

pip install pipenv

Create a new virtual environment using pipenv:

pipenv install

Activate:

pipenv shell

You can always check what is installed in your environment with:

pipenv graph

Remove the prefix jobcoin. from every import at the top of the source files api.py, cli.py, and jobcoin.py.

Then run:

./jobcoin/cli.py

Example of usage

Successful flow

Personal address is not unused

Insufficient funds

Given coin amount is zero


Developer corner

If you are developing Jobcoin Mixer, you have the following resources:

Running a linter

make lint

Running unit tests

make test

Cleaning dist, dev, test, files

make clean

Note: to be able to run tests and linter, install:

pip install -r requirements_test.txt

TODO (some day)

  • Improve unit tests. Add missing tests for test_jobcoin.py, test_cli.py, and test_util.py. Add tests for failures and success, with better mocking and fixtures.
  • Improve private method _is_empty() as it loops over all the transactions address. As the list increases, this will take too long. Maybe we should simply check whether the address has zero coins? Should we think about a cache solution?
  • Deal with the increased size of the list of transactions being pulled from the server every time. Should we think about a cache solution?
  • Convert the code to pure Python 3 (e.g., -> return in the module name, etc.). Make sure the dependencies install Python3 libraries. Make sure the code run in Python3.
  • Adding logging everywhere, with different types of logging levels.
  • Improve rules for linting.

About

๐Ÿ‘พ ๐—ฏ๐—ฎ๐—ฐ๐—ธ-๐—ผ๐—ณ-๐˜๐—ต๐—ฒ-๐—ฒ๐—ป๐˜ƒ๐—ฒ๐—น๐—ผ๐—ฝ๐—ฒ ๐—ณ๐—ผ๐—ฟ ๐—ฎ ๐—ฐ๐—ฟ๐˜†๐—ฝ๐˜๐—ผ ๐—ฐ๐—ผ๐—ถ๐—ป ๐—บ๐—ถ๐˜…๐—ฒ๐—ฟ

Topics

Resources

Stars

Watchers

Forks