BlockchainSQL is an SQL database, indexer, and explorer for Bitcoin-based blockchains. Easily build your analytics and BI platform without ever worrying about protocols again.
This repository contains the source code for the BlockchainSQL application.
Blockchain data is stored in complex binary formats and requires specialized knowledge to parse and query. BlockchainSQL solves this by:
- SQL Access: Query blockchain data using standard SQL syntax you already know
- Real-Time Sync: Keep your database synchronized with the blockchain as new blocks arrive
- Analytics Ready: Build dashboards, reports, and BI solutions on top of relational data
- Protocol Abstraction: No need to understand low-level blockchain protocols
Based on the product description on https://sphere10.com/products/blockchainsql:
- Blockchain as SQL Database: Access all blockchain data through standard SQL queries
- Block Explorer: Built-in web interface for exploring blocks, transactions, and addresses
- Custom SQL Queries: Write and save custom queries for your specific analytics needs
- Real-Time Synchronization: Automatically sync with the blockchain as new blocks are mined
- Multiple Database Support: Works with SQL Server and other database backends
- Web Interface: Browser-based UI for querying and exploring blockchain data
- Address Tracking: Track balances and transaction history for any address
- Script Analysis: Analyze transaction scripts and smart contract data
Sphere10 provides additional end-user documentation and resources:
- Windows (Windows Forms UI components require Windows)
- .NET SDK 8.0+
- Visual Studio 2022+ (recommended)
- SQL Server (for the blockchain database)
Note: This repository includes projects targeting .NET 8. Install the .NET 8 SDK to build the full solution.
From the repository root:
# Restore dependencies
dotnet restore
# Debug build
dotnet build -c Debug
# Release build
dotnet build -c Release- Open the solution (
BlockchainSQL.sln) in Visual Studio. - Set
BlockchainSQL.Serveras the startup project. - Build with Build > Build Solution.
- Run with Debug > Start Without Debugging.
The solution contains the following projects:
| Project | Description |
|---|---|
| BlockchainSQL.Server | Main Windows application with GUI and service |
| BlockchainSQL.Web | ASP.NET Core web interface for querying and exploring |
| BlockchainSQL.Processing | Blockchain parsing and synchronization logic |
| BlockchainSQL.DataAccess | Database access layer |
| BlockchainSQL.DataAccess.NHibernate | NHibernate ORM mappings |
| BlockchainSQL.DataObjects | Domain objects and data models |
| BlockchainSQL.Web.DataAccess | Web-specific data access |
| BlockchainSQL.Web.DataObjects | Web-specific data models |
| BlockchainSQL.NUnit | Unit tests |
BlockchainSQL consists of several components:
- Block Stream: Reads blockchain data from block files or network nodes
- Block Processor: Parses blocks and transactions into relational format
- Database Layer: Stores processed data in SQL Server
- Web Interface: Provides query and exploration capabilities
- Service: Runs as a Windows service for continuous synchronization
- Database connection errors: Verify SQL Server is running and connection string is correct.
- Sync issues: Check that block files are accessible and not corrupted.
- Build failures: Verify SDK install with
dotnet --info, then rundotnet restoreanddotnet build. - Performance issues: Ensure database indexes are enabled after initial sync.
Contributions are welcome!
- Keep changes small and focused.
- Follow formatting rules from
.editorconfig. - Add/update tests where applicable.
See CONTRIBUTING.md for more details.
This project is licensed under the GNU GPL v3.0 (or later).
Author: Herman Schoenfeld (herman@sphere10.com)
Website: https://sphere10.com/products/localnotion
Copyright: © Herman Schoenfeld 2018 - Present. All rights reserved.

