Skip to content

Antrikshgwal/Ratchet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ratchet

Blaxingly fast Bitcoin block and transaction analyzer written in Rust.

Overview

This tool parses raw Bitcoin block files (blk*.dat) and transactions (in JSON format), extracting and analyzing blockchain data including block headers, transactions, inputs, outputs, and metadata.

Features

  • Block Analysis — Parse blk*.dat, rev*.dat, and undo*.dat files from Bitcoin Core
  • Transaction Analysis — Decode and analyze individual transactions from JSON fixtures
  • Multiple Formats — Support for legacy and SegWit transactions
  • JSON Output — Structured output for easy integration with other tools

Installation

cargo build --release

Usage

Analyze a Transaction Fixture

cargo run path/to/fixture.json

Fixture format:

{
  "raw_tx": "hex-encoded-transaction",
  "prevouts": [
    {
      "scriptPubKey": "hex",
      "value": 100000
    }
  ]
}

Analyze Blocks

cargo run -- --block path/to/blk00000.dat path/to/rev00000.dat path/to/undo.dat

Processes Bitcoin Core block files along with their corresponding reversal and undo data.

Output

All output is in JSON format to stdout, with structured error reporting:

{
  "ok": true,
  "txid": "...",
  "analysis": {
    ...
  }
}

Requirements

  • Rust 2024 edition or later
  • Bitcoin Core data files (for block mode)

License

MIT

About

🔧Blaxingly fast bitcoin block and transaction analyser.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages