This repository is the reference implementation of BCHostTrust, a distributed database of domain name trustworthiness. It uses the concept of blockchain, a growing list of records linked together via cryptographic hashes, in which SHA3-256 is used in BCHostTrust. More detailed information can be found at documents/tech_paper/README.md.
DISCLAIMER: DESPITE USING SIMILAR TECHNOLOGIES, THIS PROJECT IS NOT RELATED TO CRYPTOCURRENCY!
To use BCHostTrust, Python 3.11 is required.
In order to use the command-line tool, it is recommended to install it via pipx, which runs BCHostTrust in an dedicated virtual environment, isolating it from potential dependency problems. pipx is usually provided via your operating system's package repository, after installing it, run the following command:
pipx ensurepath # This ensures pipx is properly configured
pipx install bchosttrust
After that, you can run the following command to verify if the installation is working properly:
$ bcht version
BCHostTrust Reference Implementation, version 0.0.0
To import BCHostTrust into your projects, install the package via pip after activating the virtual environment:
pip install bchosttrust
After that, run the following in a Python console to verify the installation:
>>> import bchosttrust
>>> bchosttrust.__version__
"0.0.0"
Installing BCHostTrust directly user-wide or system-wide is discouraged as it may cause conflicts between versions or system packages.
The API of BCHostTrust is well-documented in their respective docstrings. Take a look before writing your code on top of BCHostTrust.
All parameters passed into the functions are forced to follow the hinted type, thanks to the usage of typeguard. You should run your code in debug mode (the default in most cases) to see if your code is violating any of the type hints. After that, you may run your well-tested code in optimized mode to avoid performance overheads.
We welcome all kinds of contributions to the BCHostTrust project. You may join in the following ways:
- Opening an issue. This can be either requesting for new features or reporting misbehaviors. By sending feedback to us, we can improve the protocol and the application.
- Submiting your codes. If you are keen on working on codes, you can submit your own by opening a pull request. By doing so, the codebase can be improved collectively.
It is recommended to have the following before starting your journey in development:
- Visual Studio Code, an highly customizable code editor with built-in git integration and a broad of extensions.
- Pylint, a static code analyzer that can detect more potential errors and mistakes than other analyzers. It can be integrated into VSCode by the Pylint extension.
- autopep8, an extension of VSCode automatically formats your code to fit the standard as specified in PEP 8. It should be configured properly in accordance with its documentation.
To start, create your own fork to work on. Refer to GitHub's documentation for how to operate with forks.
After that, clone the repository to your local machine:
# Using SSH
git clone ssh://[email protected]/[your username]/bchosttrust
# Using GitHub CLI
gh repo clone [your username]/bchosttrust
After that, create an virtual environment and install BCHostTrust in development mode:
# Go into BCHostTrust directory
cd bchosttrust
# Create and activate a virtual environment
python -m venv .venv
source .venv/bin/activate # or .venv\Scripts\activate on Windows
# Install BCHostTrust in develpoment mode
pip install --editable .
Done! Now you can work on BCHostTrust. Don't forget to push your changes to your fork and file a pull request.
- Prototype
- Blockchain Core
- Basic Proof-of-work Mechanism
- Chain Search and Analysis
- Command-line client
- Configuration file for command-line
- Block exchange protocol
- Browser integration (probably in dedicated repository)