@asoltys/blech32

Blech32 encoding / decoding

Usage no npm install needed!

<script type="module">
  import asoltysBlech32 from 'https://cdn.skypack.dev/@asoltys/blech32';
</script>

README

Blech32.js

build status

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