This repository contains the seminar project "AI Chatbot as a Blockchain Explorer", developed by Ilija Jazvić and Ivana Ribičić as part of the Blockchain Technology and Cryptocurrencies course at the Faculty of Electrical Engineering, Computer Science and Information Technology Osijek (FERIT Osijek), academic year 2024/2025.
The goal of this project is to demonstrate the integration of blockchain technology and chatbot-based user interaction through a command-line tool that enables intuitive exploration of the Bitcoin blockchain using natural text commands.
Traditional blockchain explorers offer detailed insights into blockchain data (blocks, transactions, and addresses), but they often require technical knowledge.
This project aims to make blockchain exploration simpler and more intuitive by creating a command-line chatbot that interacts with users via text-based input.
The chatbot interprets user commands and fetches relevant data from the Blockstream.info API, returning it in a structured and human-readable format.
This approach bridges the gap between blockchain transparency and user accessibility.
| Component | Purpose |
|---|---|
| Python | Core programming language |
| Blockstream.info API | Source of Bitcoin blockchain data |
| requests | HTTP communication with the API |
| datetime | Time parsing and conversion |
| Command Line Interface (CLI) | User interaction medium |
The system follows a simple three-layer architecture: User ⇄ Chatbot ⇄ Blockstream API
Workflow:
- The user types a command (e.g.,
tx <hash>). - The chatbot interprets the command and calls the corresponding function.
- The function sends an HTTP request to the Blockstream API.
- The JSON response is parsed and displayed in an easy-to-read format.
-
Fetch latest block:
latest block→ Returns the height and hash of the most recent Bitcoin block. -
Block details:
block <block_hash>orblock listtx <block_hash>→ Displays height, hash, transaction count, and creation time. -
Transaction details:
tx <transaction_hash>→ Shows transaction size, number of inputs and outputs, and transaction hash. -
Address information:
address <address>→ Displays total transactions and balance of a Bitcoin address. -
List all addresses in a block:
addresses in block <block_hash>→ Lists all sender and receiver addresses within a block. -
Count transactions before a given time:
count transactions before <block_hash> <timestamp>
Accepts UNIX timestamps orYYYY-MM-DD HH:MM:SSformat.
- Developed entirely in Python, with modular functions for each feature.
- Error handling ensures stability even with invalid inputs or failed API responses.
- Pagination implemented for blocks with more than 25 transactions (API limit).
- Basic timestamp parsing for user-friendly date input.
- Lightweight and self-contained — no external dependencies besides standard libraries and
requests.