The library of BBc-1 transaction data structure definition
Project description
py-bbclib
The library that defines BBc-1 transaction data structure is decoupled from the bbc1 repository.
BBc-1 is a Python-based reference implementation of BBc-1, a trustable system of record keeping beyond blockchains. The transaction data structure definition is the most important part of BBc-1.
The design paper (white paper) and the analysis paper are available here and here. BBc-1 is inspired from blockchain technologies like Bitcoin, Ethereum, Hyperledger projects, and so on. BBc-1 is a simple but reliable distributed ledger system in contrast with huge and complicated existing blockchain platforms. The heart of BBc-1 is the transaction data structure and the relationship among transactions, which forms a graph topology. A transaction should be signed by the players who are the stake holders of the deal. BBc-1 achieves data integrity and data transparency by the topology of transaction relationship and signatures on transactions. Simply put, BBc-1 does not have blocks, and therefore, requires neither mining nor native cryptocurrency. BBc-1 can be applied to both private/enterprise use and public use. BBc-1 has a concept of domain for determining a region of data management. Any networking implementation (like Kademlia for P2P topology management) can be applied for each domain. Although there are many TODOs in BBc-1, this reference implementation includes most of the concept of BBc-1 and would work in private/enterprise systems. When sophisticated P2P algorithms are ready, BBc-1 will be able to support public use cases.
For the details, please read documents in docs/ directory or the bbc1 repository. Not only documents but slide decks (PDF) explain the design of the BBc-1 and its implementation.
API doc is ready at readthedocs.org.
libbbcsig becomes optional at v1.5.3
Before v1.5.2, libbbcsig module was required by py-bbclib. So, building libbbcsig at pip install took very long time, and sometimes it leads to cache problem. py-bbclib v1.5.3 newly includes cryptograpy module for crypto-related procedures. KeyPairPy class in bbclib_keypair.py includes the new feature and KeyPairFast class in bbclib_keypair_fast.py is the same script as bbclib_keypair.py in the older version. bbclib_keypair.py automatically checks whether libbbcsig is installed or not, and if not installed, bbclib_keypair.py fallbacks to use cryptography module based class.
Just run,
pip install py-bbclib
You will find that the module is installed more quickly than before.
The drawback of using fallback mode (cryptograpy module) is slower transaction speed. Concretely, sign/verify speed is about half as fast as that of libbbcsig based mode.
The sign/verify performance comparison on MacBookPro 2016 (2.7 GHz Quad core Intel Core i7 with 16GB RAM) is shown below.
Mode | time to complete 20,000 times sign and verify |
---|---|
use libbbcsig | about 8 seconds |
use cryptograpy module | about 15 seconds |
bbclib-go | about 4 seconds |
condition: The test code creates a BBcTransaction object with 2 signatures and verify this transaction object. This unit os sign/verify process is iterated 10,000 times.
Namespace is changed at v1.4.1
Before v1.4.1, the namesapce of py-bbclib module was "bbc1". However, This conflicts with that of bbc1 module. Therefore, the namespace of py-bbclib has been changed to "bbclib" since v1.4.1. Be careful when using py-bbclib module solely.
Environment
-
Python
- Python 3.5.0 or later
- virtualenv is recommended
python -mvenv venv
-
tools for macOS by Homebrew
xcode-select --install brew install libtool automake python3 openssl pip3 install virtualenv
-
tools for Linux (Ubuntu 16.04 LTS, 18.04 LTS)
sudo apt-get update sudo apt-get install -y git tzdata openssh-server python3 python3-dev python3-pip python3-venv libffi-dev net-tools autoconf automake libtool libssl-dev make
Install
python -mvenv venv
source venv/bin/activate
pip install py-bbclib
install libbbcsig (optional)
An external library, libbbcsig makes sign/verify of transaction data faster. After pip install, two utilities are installed in your venv/bin.
"install_libbbcsig" command downloads the libbbcsig repository, builds libbbcsig and installs the dynamic link library in your venv. Just run as follows:
install_libbbcsig
install_libbbcsig command builds the library in /tmp/tmp.libbbcsig.xxxxx directory (xxxxx part is the process number). If you want to reuse the module, you can use "copy_libbbcsig" command to copy library from the repository directory that includes the built library as follows:
copy_libbbcsig /tmp/tmp.libbbcsig.xxxxx
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file py-bbclib-1.6.1.tar.gz
.
File metadata
- Download URL: py-bbclib-1.6.1.tar.gz
- Upload date:
- Size: 43.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3a9d462b3c156013a4a1e6bd3ec8e47e39b83e8efbe3af2e60524741021df7f |
|
MD5 | 0fb38bb9fc6fef5dc0d1c3f74aeda942 |
|
BLAKE2b-256 | 88d1ab0205ad6e722bb4cb382d27f93489246212ad71cd9300a812fb99271c5c |
File details
Details for the file py_bbclib-1.6.1-py3-none-any.whl
.
File metadata
- Download URL: py_bbclib-1.6.1-py3-none-any.whl
- Upload date:
- Size: 54.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c9bb6dd171a9864732c542750c8c7d1f4800d4e86f943bc640c3e9276b6267d |
|
MD5 | 57cbd73074982cbf824252fca7fd1851 |
|
BLAKE2b-256 | 8c9d166594e093df188e2307fd8a09db35c9642bbe463d60e1c223e45aaf19a5 |