Skip to content

This project enables rusty-blockparser user to manufacture the csv files into a ML dataset.

License

Notifications You must be signed in to change notification settings

flo1166/bitcoin_blockchain

Repository files navigation

bitcoin_blockchain

This project is part of the master thesis "Detection of illicit Transactions on the Bitcoin-Blockchain - A machine learning approach"

What it does:

With the code basis you are able to rework CSV generated files from the encrypted bitcoin blockchain. The CSV generated files are generated by rusty-blockparser.

The goal was to first generate a tx_in and tx_out files which contains all informations about a transaction and their incoming hashes and outcoming hashes. All is saved as parquet file. Then you can generate the features and build the final dataset to do a machine learn task.

Structure:

  • csv_to_parquet.py In this file you generate from CSV-files the parquet files. Output is a tx_in and a tx_out file with all necessariy data points. For not computing all data (as a machine learning project this big would outrun my setup) I first compute all legal and illegal addresses. Then I sample the legal addresses. After that I generate a list with all txid's I have to work through. Finaly, I compute the tx_in and tx_out file.
  • create_dataset.py Here I compute from the generated tx_in and tx_out all features and the final data set.
  • data_exploration.ipynb After that the data I generated is explored (to understand null values, sanity check, describe and understand the data.
  • modeling.py Is for shortlisting ML algorithms and do the hyperparametertuning.
  • evaluation.py Here the evaluation models and the final ensemble-stacking-model is build and test data is obtained.

Install and Run this Project

Please install the environment2.yml file as follows:

conda env create -n ENVIRONMENTNAME -f environment2.yml

It is important to do the steps in the order of the structure (see above)

License

bitcoin_blockchain © 2023 by Florian Korn is licensed under CC BY-NC-SA 4.0