Coder Social home page Coder Social logo

moneropaper's Introduction

Overview

This repository contains source code underlying our empirical analysis of traceability in the Monero blockchain.

Reproducing the deducibility analysis involves the following steps:

  1. Export blockchain data from a fully synchronized Monero node
  2. Import the data into a Neo4j database using the Neo4j batch importer
  3. Create database indices and run the Sudoku algorithm
  4. Querying the database

This repository does not contain the simulation of the different mixin-sampling procedures. It can be found at kvnl33/monero-simulations instead.

1. Monero Blockchain Data Export

  • Install the Monero software, start the daemon and wait for the node to synchronize
  • Install the requests python library: pip install requests
  • Run the monero-to-csv.py script (i.e., python monero-to-csv.py)

2. Neo4j Import

  • Download and/or install the Neo4j graph database v3.4.5
  • You should now have a folder structure similar to this:
    • ./csv/: the Monero blockchain export (CSV files)
    • ./csv-headers/: the CSV header files
  • Use the following import script to use the neo4j-import tool for a quick import (you'll need to modify the --into <DIRECTORY> directory to match the location of your Neo4j installation)
neo4j-import --into <DIRECTORY> --nodes:Block "csv-headers/blocks.csv,csv/blocks.csv" --relationships:PREV_BLOCK "csv-headers/blocks-rels.csv,csv/blocks-rels.csv" --nodes:Transaction "csv-headers/transactions.csv,csv/transactions.csv" --relationships:IN_BLOCK "csv-headers/tx-blocks.csv,csv/tx-blocks.csv" --nodes:Output "csv-headers/outputs.csv,csv/outputs.csv" --relationships:TX_OUTPUT "csv-headers/output-rels.csv,csv/output-rels.csv" --nodes:Input "csv-headers/inputs.csv,csv/inputs.csv" --relationships:TX_INPUT "csv-headers/input-rels.csv,csv/input-rels.csv" --relationships:REFERENCES "csv-headers/input-output-refs.csv,csv/input-output-refs.csv"
  • Afterwards, you should see a message similar to the following:
IMPORT DONE in 5m 41s 347ms.
Imported:
  45169429 nodes
  84119631 relationships
  109326559 properties
Peak memory usage: 1.51 GB

3. Database Indexes and Mixin Sudoku

  • Compile the Neo4j plugin in the neo4j-plugin folder: mvn package
  • Put the resulting mixinsudoku.jar into the plugins folder of your Neo4j installation
  • Download the APOC plugin and also put it into the plugins folder
  • Allow unrestricted access by adding dbms.security.procedures.unrestricted=mixinsudoku.*,apoc.* to your Neo4j config
  • Start the database
  • Run the following cypher commands (through the web interface or the command line interface)
    • CALL mixinsudoku.schema(): creates all necessary indexes (you can check the status with :SCHEMA)
    • CALL mixinsudoku.coinbase(): adds labels for coinbase transactions
  • Run the mixin sudoku in two steps (run the second query only after the first one has finished):
    1. CALL mixinsudoku.zeromixin(): labels all outputs spent by 0-mixin transactions
    2. CALL mixinsudoku.sudoku(): iteratively labels further deducable outputs
  • Run CALL mixinsudoku.checkdb() as a sanity check at the end

4. Jupyter notebook

  • Install the following Python modules:
    • pip install jupyter
    • pip install pandas
    • pip install seaborn
    • pip install py2neo
  • Launch the notebook server: jupyter notebook &
  • Open Monero Analysis.ipynb in the notebook interface

moneropaper's People

Contributors

maltemoeser avatar

Watchers

James Cloos 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.