Introduction

This library is essentially intended to create various web versions of the Semux light HD Wallet. They can be used both to replace the standard wallet developed by the creators of the Semux core project, as well as for various specialized applications (dApps) based on the Semux ecosystem.

A wallet is a tool for creating asymmetric key pairs and digital signatures for transactions in the Semux network. It should have the following main features:

  • Random mnemonic phrase generation;
  • Creation or recovery an HD Account based on a mnemonic phrase;
  • Import a private key;
  • Generating a random key pair (Address);
  • Deriving a sequence of key pairs (HD Addresses) for the HD Account;
  • Finding derived HD Addresses in HD Account;
  • Finding non-HD Addresses (imported or genearated);
  • Generating a message for a transaction;
  • Signing transaction messages.

In fact, a fully functional wallet must be able to perform many other functions. Such as, for example, communication with a network node through its API to obtain information necessary for the transaction, or storing wallet data between user sessions in a browser. The implementation of such advanced features is beyond the scope of this lightweight library, designed to perform basic Semux-specific cryptographic operations in the JavaScript environment.

The specificity of Semux algorithms is that they use cryptography on elliptic curves Ed25519, and this is why you can’t use standard Web Crypto API present in modern browsers. Fairly well-known libSodium library is most suitable for implementing the algorithms used in Semux. This project makes heavy use of the libSodium.

You can read more about the HD Wallets at the following links:

Installation

To build the project, QMake and EMSCRIPTEN compiler are used. The build process is quite complicated, so the compiled files are laid out in the assets at the release section.

Download an archive uno_semux_light_core.tar.gz from assets on release page of this project. Then unpack the archive into your project folder.

For use it in the browser project you have to import UnoSemuxLightCoreWasm.js into your HTML page:

<script src="UnoSemuxLightCoreWasm.js"></script>