Skip to content

MatufA/blockchain-blocks-analyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

blockchain-blocks-analyzer

blockchain blocks analyzer, is an open source tool for analyze Bitcoin wallet address transaction. The main purpose of the tool is to track suspicious addresses transaction from income to to outcome and keep track the next wallet, which received money from the suspicious address. Moreover, we create a Graph database, Neo4j, which represent a flow graph which starts with the income of the suspicious addresses until the last "interesting" wallet. The meaning of graph flow is to connect between other wallet to the suspicious wallet, Type of money laundering.

image

Prerequisites

Python

Python 3.* download here

Neo4j

Graph database platform. (Official site)
Download:

  • For PC (Windows, linux or MAC): Here
  • Docker: DockerHub
    or run:
    []~$ docker run -d --publish=7474:7474 --publish=7687:7687 --volume=$HOME/neo4j/data:/data neo4j

Blockchain API

Use Blockchain API according the term of service and request limits.

Requirements

  • pandas
  • py2neo
  • requests

Usage

Environment variables

NEO4J_USER and NEO4J_PASS must being configure.

  • Windows - (make sure you Run as administrator so you're able to add a system environment variable).
    setx -m NEO4J_USER "<user_name>"
    setx -m NEO4J_PASS "<password>"
    
  • Linux or MAC - (recommended to add to ~/.bash_profile)
    $ export NEO4J_USER=<user_name>
    $ export NEO4J_PASS=<password>
    

Cli

Setup instruction:

  • Install Cli:
    $ python3 -m pip install https://github.com/MatufA/blockchain-blocks-analyzer.git
    
  • Print help:
    $ btc-analyzer --help
    
  • Track wallet transaction:
    $ btc-analyzer -tr "<wallet_hash>"
    

Project Structure

Clone and setup requirements:

$ git clone https://github.com/MatufA/blockchain-blocks-analyzer.git  
$ cd blockchain-blocks-analyzer  
$ python3 -m pip install -r requirements.txt  

Classes

Main classes and function description:

  • Config.py - a configuration file with common function.
    • conf_logger - a function to configure a logger.
    • print_json_to_file - a function to print output json beautify.
  • node_builder.py - a class which responsible to link all the project.
    • create_node - a function to keep track suspicious wallet.
    • nodes_builder - a function to analyze suspicious wallet and draw a money flow.
  • neo4j_handler.py - a handler function to communicate with Neo4j database.
    • connect_db - a function to create a connection to db.
    • generate_graph - a function to generate a graph database from json file.
  • blockchain_track - a handler function to track a money flow of a wallet.
    • get_single_address - a function to fetch all transactions information of a wallet.
    • generate_record - a function to generate a record of wallet transaction.

Authors

Licence

GNU General Public License v3.0

Releases

No releases published

Packages

No packages published

Languages