[ecash-lib] Add ecash-lib-wasm, a WebAssembly module for ecash-lib
Summary:
Builds a WebAssemby module using Rust for secp256k1 and hashing functions.
This currently uses https://github.com/raipay/secp256k1-abc to get libsecp256k1 to compile to WebAssembly using Rust, but in the future we could use the secp256k1 library within the monorepo to get rid of that external dependency.
ecash-lib in the repo now won't typecheck until the WebAssembly is built, but it seems better to not commit compiled binaries than users having to have to build the .wasm file.
In the future, we might want to check the hash of the built wasm file so we get a deterministic build, maybe even provide a signature like we do for the release of bitcoind.
The wasm can be built using either dockerbuild.sh or build-wasm.sh, the former just requires docker, the latter requires some wasm toolchains to be installed.
Test Plan:
- cd ecash-lib-wasm && ./dockerbuild.sh
- cd ../ecash-lib && npm run test
Reviewers: bytesofman, #bitcoin_abc
Reviewed By: bytesofman, #bitcoin_abc
Differential Revision: https://reviews.bitcoinabc.org/D15931