Spotbit
Self-Sovereign cryptocurrency price discovery tool leveraging Tor.
Install / Use
/learn @BlockchainCommons/SpotbitREADME
Blockchain Commons Spotbit
by Christian Murray and Christopher Allen with Jo
- <img src="https://github.com/BlockchainCommons/Gordian/blob/master/Images/logos/gordian-icon.png" width=16 valign="bottom"> part of the gordian technology family
- <img src="https://raw.githubusercontent.com/BlockchainCommons/torgap/master/images/logos/torgap.png" width=30 valign="bottom"> uses torgap technology

Price feeds for Bitcoin can be a privacy hole when wallets, users, or automated tools access them without using Tor or a secure proxy. If a user's wallets or tools access a preconfigured price feed, the user is potentially vulnerable to Sybil attacks. Spotbit's purpose is to allow users to access price feeds in a customisable way that preserves privacy and mitigate the reliance on a single source of data.
Spotbit is a portable API for Bitcoin price data and candles. It can aggregate data from over 100 exchanges and serve them from a single URL or using Tor as an onion hidden service. It is configurable so that the user can decide which base currencies to use (USDT, USD, EUR etc), and which exchanges to use for price data.
Users may choose to run their own local Spotbit server, or to connect to a hosted Spotbit service.
Why Use Spotbit?
- Privacy. Spotbit can work as a Tor hidden service.
- Reliability. Spotbit aggregrates information using the exchanges/sources you configure, making your pricing data more trustworthy.
- Self-sovereignty. Spotbit can run from your server.
Features
- Fetch Bitcoin prices from a set of exchanges.(See the API documentation here)
- Produce a beancount report of the transactions associated with a Bitcoin descriptor.
- Web front-end with price data visualisation.
Additional Information
- Spotbit depends on the CCXT which provides an abstraction for API access to cryptocurrency exchanges.
Test Server
A spotbit instance is currently running at http://r5sru63gzyrnaayaua2ydo32f4hf6vd33bq6qmtktx3wjoib2cwi2gqd.onion. This instance is on a dedicated Blockchain Commons server.
Related Projects
Spotbit is intended for integration with the Gordian system, which consists of Tor-gapped components such as Gordian Wallet and a Gordian Server or other server installed by Bitcoin Standup scripts.
Gordian Principles
Spotbit is a microservice intended to help realise the Gordian Principles underpinning Blockchain Commons' Gordian technology stack and the Gordian Architecture. These principles are:
- Independence. Users can choose which applications to use within an open ecosystem.
- Privacy. Airgaps provide data with strong protection, while torgaps do the same for networked interactions.
- Resilience. The paritioned design minimizes Single Points of Compromise.
- Openness. Airgaps and torgaps are connected via standard specifications such as URs, which allow anyone to add apps to the ecosystem.
Blockchain Commons apps do not phone home and do not run ads. Some are available through various app stores; all are available in our code repositories for your usage.
Status - Late Alpha
Spotbit is currently under active development and in the late alpha testing phase. It should not be used for production tasks until it has had further testing and auditing.
Roadmap
- [ ] Beancount reporting improvements
- Ref. https://github.com/BlockchainCommons/spotbit/issues/61
- [ ] Spotbit should process transaction records as CSVs from:
- [ ] Sparrow Wallet
- [ ] BTCPay
- [ ] Fee estimation API
- Ref. https://github.com/BlockchainCommons/Community/issues/22#issuecomment-1169442462)
- Spotbit should connect to an Esplora in order to obtain fee estimates
- [ ] Connect via Tor-gap to Esplora/Core
- [ ] Add a configuration option that specifies Tor proxy URL and port .
- [ ] Test that Tor client is installed on the server.
- [ ] Modify requests to use a Tor proxy.
- [ ] Add a configuration option that specifies Tor proxy URL and port .
- [ ] Front-end improvements
- Ref. https://github.com/BlockchainCommons/spotbit/issues/59
- The front-end should visualize useful data from the API and allow the user to query the API.
- Show the current configuration of the Spotbit instance.
- [ ] Migrate front-end to current API.
- [ ] Show current prices from configured exchanges.
- [ ] Display relevant (to be determined by what is useful) data from existing API endpoints.
- [ ] Improve releases and builds.
Development setup
Requirements
- Python3.10+
- Nodejs
Create a virtual environment
python -m venv env/
Activate virtual environment
source env/bin/activate
Install dependencies
python -m pip install -r requirements.txt
Run
python app.py
Installation Instructions
Spotbit includes a script called installSpotbit.sh which installs Spotbit and configures Tor on a Debian-based linux system.
$ git clone https://github.com/BlockchainCommons/spotbit.git
$ cd spotbit
$ chmod +x installSpotbit.sh
$ sudo -s source ./installSpotbit.sh
The installer will:
- Install and setup tor on your system,
- Create a user named
spotbitin aspotbitgroup that controls the hidden service directory location at/var/lib/tor/spotbit. - Copy Spotbit sourcecode to
/home/spotbit/source- The user should update the default
spotbit.configwith their desired configuration.
- The user should update the default
- Create a
systemdservice unit file in/etc/systemd/system. - Set up a Tor hidden service for Spotbit.
Usage Instructions
To run the server, run sudo systemctl start spotbit.
You can check on a spotbit's status at any time by running sudo systemctl status spotbit, or take a look at the log file in /home/spotbit/source/spotbit.log.
The Spotbit API schema can be found by browsing to: http://localhost:5000/docs
Origin, Authors, Copyright & Licenses
Unless otherwise noted (either in this /README.md or in the file's header comments) the contents of this repository are Copyright © 2020 by Blockchain Commons, LLC, and are licensed under the spdx:BSD-2-Clause Plus Patent License.
In most cases, the authors, copyright, and license for each file reside in header comments in the source code. When it does not, we have attempted to attribute it accurately in the table below.
This table below also establishes provenance (repository of origin, permalink, and commit id) for files included from repositories that are outside of this repo. Contributors to these files are listed in the commit history for each repository, first with changes found in the commit history of this repo, then in changes in the commit history of their repo of their origin.
| File | From | Commit | Authors & Copyright (c) | License | | --------- | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------ | ----------------------------------------------------------- | | exception-to-the-rule.c or exception-folder | https://github.com/community/repo-name/PERMALINK | https://github.com/community/repo-name/commit/COMMITHASH | 2020 Exception Author | MIT |
Dependencies
To use Spotbit you'll need to use the following tools:
- Python3.8 or higher (some libraries don't work as needed on older versions of Python)
- Pip
- Flask
- CCXT -
All of these Python libraries can be installed via pip and Python3.8 can be installed for you in the install script.
Motivation
Spotbit aims to provide an easy option for aggregating exchange data that does not require the use of a third party data website like Coinmarketcap. These data can be used inside of other apps or for personal use / analysis. Acquiring data across many exchanges can be a pain because normally one would need write slightly different code in order to interact with each API.
Derived from…
This Spotbit project is either derived from or was inspired by the need of Fully Noded 2 to display realtime price info in-app:
- FullyNoded 2 — The mobile app for managing a BTC node via Tor, by Fonta1n3.
Financial Support
Spotbit is a project of Blockchain Commons. We are proudly a "not-f
