# bcloop
A Bitcoin-like blockchain parser for local nodes, written in pure Rust. It parses raw blockchain `.dat` files and produces UTXO dumps in CSV format for analysis. Compatible with Bitcoin, Litecoin, Bitcoin Cash, and similar blockchains.
## Features
- Pure Rust implementation with no LevelDB dependency
- Memory-efficient design that works on machines where UTXO HashMaps can't fit into RAM
- Parallel processing for faster data extraction
- Direct parsing of blockchain `.dat` files (ordered blocks)
- CSV output format for easy integration with analysis tools
- Multi-blockchain support
## CLI usage
```sh
cargo install bcloop
```
### UTXO dump
```sh
bcloop utxodump /path/to/blockchain/blocks output.csv
```
## Library usage
```sh
cargo add bcloop
```
```rs
use bcloop::{BcWalker, AddrType};
// Initialize the blockchain walker
let walker = BcWalker::from_dir("/path/to/blockchain/blocks")?;
let chan = walker.get_chan();
while let Ok((blk, blk_size)) = chan.recv() {
println!("Block {} have {} txs", block.height, block.txs.len());
for tx in blk.txs.iter() {
for txo in tx.outputs.iter() { /* Process txo data... */ }
for txi in tx.inputs.iter() { /* Process txi data... */ }
}
}
```
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
## License
This project is licensed under the MIT License - see the LICENSE file for details.