Skip to content

ijazvic/AI-Chatbot-Blockchain-Explorer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

AI Chatbot as a Blockchain Explorer

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.

Project Overview

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.

Technologies Used

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

System Architecture

The system follows a simple three-layer architecture: User ⇄ Chatbot ⇄ Blockstream API

Workflow:

  1. The user types a command (e.g., tx <hash>).
  2. The chatbot interprets the command and calls the corresponding function.
  3. The function sends an HTTP request to the Blockstream API.
  4. The JSON response is parsed and displayed in an easy-to-read format.

Key Features

  • Fetch latest block:
    latest block → Returns the height and hash of the most recent Bitcoin block.

  • Block details:
    block <block_hash> or block 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 or YYYY-MM-DD HH:MM:SS format.

Implementation Details

  • 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.

Example Usage

image

About

Seminar project — Python-based chatbot for exploring the Bitcoin blockchain using Blockstream API.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages