/monero_fingerprinting_pipeline

[WIP] Python tooling to label monero transactions with uniformity defects

Primary LanguageJupyter Notebook

monero_fingerprinting_pipeline

[WIP] Tooling for label monero transactions with uniformity defects, especially those that would not be generated by wallet2. The pipeline starts with collector.py, which extracts and flattens metadata components that Noncesense Research Lab has identified as useful for fingerprinting and transaction tree analysis, such as:

  • unlock_time
  • txn_fee_atomic
  • rct_type
  • extra
  • num_inputs
  • num_outputs

Notes

This is a light python library that must be pointed at a Monero node to pull the data

Suggested workflow: create a virtual environment, activate it, then pip install -r requirements.txt

Example code for interacting with the node from python is available in collector.py

There is much work still underway, such as modularizing the ETL and adding the analysis logic.

Example collector.py call:

Input

python3 collector.py --url http://XXX.XXX.xxx.xxx --port YYYYY --verbose

If the URL is not specified, defaults to http://127.0.0.1

If the port is not specified, defaults to 18081

Output

2023-03-24 21:03:44.285 | INFO     | __main__:<module>:195 - Hello! Syntax hint: python collector.py --url http://your-node-url --port 18081 --verbose
2023-03-24 21:03:44.286 | INFO     | __main__:main:162 - ... About to instantiate JSON-RPC client with URL http://192.168.XXX.XXX
2023-03-24 21:03:44.286 | INFO     | __main__:__init__:15 - Initializing JSON-RPC client with URL http://192.168.XXX.XXX and port 12345
2023-03-24 21:03:44.287 | INFO     | __main__:main:167 - ... About to get the latest block height
2023-03-24 21:03:44.287 | INFO     | __main__:call:44 - Sending request: get_block_count with params {}
2023-03-24 21:03:44.293 | INFO     | __main__:main:172 - ... About to retrieve the transaction hashes
2023-03-24 21:03:44.293 | INFO     | __main__:call:44 - Sending request: get_block with params {'height': 2849221}
2023-03-24 21:03:44.296 | INFO     | __main__:main:177 - ... About to retrieve transactions for the latest block (height: 2849221)
2023-03-24 21:03:44.308 | INFO     | __main__:main:190 - Extracted data from 45 transactions.
2023-03-24 21:03:44.310 | INFO     | __main__:main:191 - 
[
    {
        "tx_hash": "26e2eed9265530a7216fd11ada87f8ed893244f2f5b577bb1ca3bf76e2204a26",
        "block_height": 2849221,
        "block_timestamp": 1679691620,
        "version": 2,
        "unlock_time": 0,
        "num_inputs": 1,
        "num_outputs": 2,
        "txn_fee_atomic": 6116000000,
        "rct_type": 6,
        "extra": [
            1,
            93,
            250,
           ...
        ]
    },
    {
        "tx_hash": "ee16e97197a633e486403a374494b7f06b78b69d4589696d1515844ab7fccdfb",
        "block_height": 2849221,
        "block_timestamp": 1679691620,
        "version": 2,
        "unlock_time": 0,
        "num_inputs": 1,
        "num_outputs": 2,
        "txn_fee_atomic": 492480000,
        "rct_type": 6,
        "extra": [
            1,
            164,
            254,
            53,
            172,
           ...
        ]
    },
    {
        "tx_hash": "62522651ac7ae25e4eeb07edc3df47f60c0787f4c730a21f2b0364cf1f6bbc48",
        "block_height": 2849221,
        "block_timestamp": 1679691620,
        "version": 2,
        "unlock_time": 0,
        "num_inputs": 1,
        "num_outputs": 2,
        "txn_fee_atomic": 240600000,
        "rct_type": 6,
        "extra": [
            1,
            0,
            34,
            221,
            ...
        ]
    },
    ...
}