/qrllib

QRL core library

Primary LanguageC++MIT LicenseMIT

PyPI version npm version Build Status CircleCI Codacy Badge MIT licensed

QRL Core Library

WARNING: This is work in progress, changes might not be backward compatible.

This library currently exposes the following functionality:

  • XMSS, XMSS_fast
  • Shake128, Shake256, SHA2_256
  • Hashchain seeds, etc.
  • Helpers: seed generation, address generation, mnemonics

Platform support

Linux OSX
10.12
Windows
10
Python 3
Webassembly (JS)
Golang 🌱 - -
Java - - -

Installing

Ubuntu

sudo apt -y install swig3.0 python3-dev build-essential cmake ninja-build pkg-config
pip3 install pyqrllib

OSX

If you dont have brew yet, we think you should :) Install brew following the instructions here: https://brew.sh/

Now install some dependencies

brew install cmake python3 swig
pip3 install pyqrllib

Windows

TBD

Raspbian

sudo apt -y install swig3.0 python3-dev build-essential cmake ninja-build
sudo pip3 install -U setuptools
sudo pip3 install -U pyqrllib

Miscellaneous

Golang and Java wrappers are currently experimental (By default they are disabled in cmake)

brew install go --cross-compile-common

Building from Source

Windows

For the purposes of these instructions Build Tools for Visual Studio 2017, CMake 3.10.2, Ninja 1.8.2, Python 3.6 and SWIG 3.0.12 were used, also c:\src was used for source files and c:\opt for other dependencies, adjust accordingly if choosing differently.

Note: You can use Microsoft MSBuild instead of Ninja Build by setting environment variable CMAKE_VS_GENERATOR=Visual Studio 15 2017 Win64, however if you choose to install the pyqrllib package Python setuptools currently will not install it correctly.

Prerequisites:

  • Install Build Tools for Visual Studio selecting the 'Visual C++ build tools' option, or install Visual Studio Community Edition selecting the 'Desktop Development for C++ workload'. Make sure install the English Language pack.
  • Install Git for Windows keeping the default option to use git from the command prompt.
  • Install the latest stable CMake x64 for Windows, selecting to add CMake to system or user PATH.
  • Install Python 3 Windows x86-64 selecting the option to 'Add Python 3.x to PATH'. Optionally change the install location to c:\python36, install the debugging symbols/binaries, and disable the path length limit.
  • Download SWIG (download swigwin) and extract archive to c:\opt
  • Download Ninja Build and extract ninja.exe to c:\opt\bin

Build Qrllib:

git clone https://github.com/theQRL/qrllib.git c:\src\qrllib
cd \src\qrllib
set PATH=c:\opt\bin;c:\opt\swigwin-3.0.12;%PATH%
set CC=cl.exe
set CXX=cl.exe

python setup.py build

If the build succeeded you can perform further steps, issue the command python setup.py --help-commands to see other options, e.g.:

python setup.py test
python setup.py install

Development

Emscripten

In order to compile the webassembly and run node.js tests you first need to install CircleCI CLI:

https://circleci.com/docs/2.0/local-cli/#installing-the-circleci-local-cli-on-macos-and-linux-distros

Then run the following command

circleci build --job build_emscripten

This will compile and test the webassembly. Output files will be copied over to tests/js/tmp

You can then run node.js locally using npm.

License

This library is distributed under the MIT software license, see the accompanying file LICENSE or http://www.opensource.org/licenses/mit-license.php.

Some of the code is based on the xmss-reference implementation that has been released in the public domain by their respective authors.

Most of third party code has been included as git submodules for future reference.