Code Monkey home page Code Monkey logo

spycblock's Introduction

GitHub Matrix

๐ŸŽ“ SpyCBlock ๐Ÿ”ฌ

SpyCBlock is an accademics software that analyses the blk file of Bitcoin blockchain Mainet. This is an explerimental version and it wants to demostrate that it is possible to work with only file blk.

SpyCBlock is a simple parser bitcoin blk file, with this parser it is possible to do some serialization, like:

  • Serialization Transaction Graph (:heavy_check_mark:);
  • Serialization complete Blockchain to JSON (:heavy_check_mark:);
  • Serialization Address Graph (:warning:).

To reduce the space of serialization Transaction graph, it is possible to use the library ZLib to compress the information; with this code it is possible to uncompress the data.

void decompressFileWithZLib()
{
    std::string filename = "YOUR_PATH/blkXXXXX.dat";
    gzFile inFileZ = gzopen(filename.c_str(), "rb");

    if(inFileZ == NULL){
        printf("Error: Failed to gzopen %s\n", filename.c_str());
        exit(0);
    }
    unsigned char unzipBuffer[8192];
    unsigned int unzippedBytes;
    std::vector<unsigned char> unzippedData;
    while (true)
    {
        unzippedBytes = gzread(inFileZ, unzipBuffer, 8192);
        if(unzippedBytes > 0) {
            unzippedData.insert(unzippedData.end(), unzipBuffer, unzipBuffer + unzippedBytes);
        }else{
            break;
        }
    }

    for(auto &character : unzippedData)
    {
        if(character == '.'){
            std::cout << "\n";
        }else{
            std::cout << character;
        }
    }
}

It Is possible to execute the parser with the library OpenMP for execution data with multi-core and this is a simple velocity benchmark.

PS: at the moment the parser uses all core of the CPU is the multicore propriety is enabled.

benchmark_image

The graph of transactions form is describe here and this is an example to visualise this with Web app, this is a simple demo.

The screenshot of transaction graph

transaction_graph

The screenshot of address graph subdivise to class (with luvain algorithm)

address_graph

โญ JSON version Bitcoin Blockchain :octocat:

Having the version of Bitcoin blockchain to JSON is powerful because it is possible to work on the JSON format, With this is possible to create easy analysis on Bitcoin network.

An example: I created a simple analysis with AnalytcsPyBlock to get informations from type of script used in the Bitcoin blockchain; this is the result and here is avaible the web version.

analisis_script

๐Ÿ’ฅ Build SpyCBlock :octocat:

Follow this guide

๐Ÿƒ Configure SpyCBlock :octocat:

Follow this guide

๐Ÿ’ฌ IRC channels :octocat:

  • IRC dev channel: #spycblock-dev :neckbeard:

PS: The IRC channel is deprecated in favor of the matrix channel.

Cite

You can use the research work in any way you want but please cite us!

@software{Palazzo_A_simple_Bitcoin_2021,
    author = {Palazzo, Vincenzo and Carlo, Sartiani},
    month = {12},
    title = {{A simple Bitcoin parser to parse the raw data files, and decode them into differents format}},
    url = {https://github.com/vincenzopalazzo/SpyCBlock},
    version = {1.0.0},
    year = {2021}
}

๐Ÿบ Buy me a beer ๐Ÿบ

๐Ÿบ 39juEyTGSNfD9JHCZdQKAjkzC3yiudce7b ๐Ÿบ

spycblock's People

Contributors

vincenzopalazzo avatar

Watchers

 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.