@asoltys/blech32
v1.0.4
Published
Blech32 encoding / decoding
Downloads
19
Maintainers
Readme
Blech32.js
A Elements extended BIP173 compatible Blech32 encoding/decoding library.
Example
Check out tests that also demonstrate how to serialize a pubkey and a witness program for generating a confidential address.
Installation
Install dependencies:
$ npm install
Build (with Emscripten installed via emsdk
):
$ source path/to/emsdk_env.sh
$ emcc src/blech32.c -o src/blech32.js -O3 -s WASM=0 -s EXTRA_EXPORTED_RUNTIME_METHODS='["ccall", "cwrap", "getValue", "setValue", "allocate", "intArrayFromString", "ALLOC_NORMAL"]' -s EXPORT_ALL=1 -s LINKABLE=1 -s NO_EXIT_RUNTIME=1
Build (with Docker)
$ git submodule update --init
$ docker build -t blech32-js .
$ npm run compile
Bundle
$ browserify lib/index.js --standalone blech32 > bundle.js
Test
$ npm run test
Credits
- ElementsProject for the reference C implementation of blech32.