@bitcoin-js/tiny-secp256k1-asmjs 2.2.2 → 2.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # tiny-secp256k1-asmjs
1
+ # @bitcoin-js/tiny-secp256k1-asmjs
2
2
 
3
- [![NPM](https://img.shields.io/npm/v/tiny-secp256k1-asmjs.svg)](https://www.npmjs.org/package/tiny-secp256k1-asmjs)
3
+ [![NPM](https://img.shields.io/npm/v/@bitcoin-js/tiny-secp256k1-asmjs.svg)](https://www.npmjs.org/package/@bitcoin-js/tiny-secp256k1-asmjs)
4
4
 
5
5
  This library is under development, and, like the [secp256k1](https://github.com/bitcoin-core/secp256k1) C library (through [secp256k1-sys](https://github.com/rust-bitcoin/rust-secp256k1/) Rust crate) it depends on, this is a research effort to determine an optimal API for end-users of the bitcoinjs ecosystem.
6
6
 
@@ -9,13 +9,13 @@ This library is under development, and, like the [secp256k1](https://github.com/
9
9
  ### npm
10
10
 
11
11
  ```bash
12
- npm install tiny-secp256k1-asmjs
12
+ npm install @bitcoin-js/tiny-secp256k1-asmjs
13
13
  ```
14
14
 
15
15
  ### yarn
16
16
 
17
17
  ```bash
18
- yarn add tiny-secp256k1-asmjs
18
+ yarn add @bitcoin-js/tiny-secp256k1-asmjs
19
19
  ```
20
20
 
21
21
  ## WebAssembly and Node.js version
@@ -24,6 +24,15 @@ Previous version of `tiny-secp256k1` implement [C++ addon](https://nodejs.org/ap
24
24
 
25
25
  Current version use Rust crate (which use C library) compiled to [WebAssembly](https://developer.mozilla.org/en-US/docs/WebAssembly). With Wasm same code executed in any environment. Wasm is faster than `elliptic` but slower than node bindings ([results in PR](https://github.com/bitcoinjs/tiny-secp256k1/pull/53#issuecomment-801844450) or you can run own benchmark in `benches` directory).
26
26
 
27
+ Tools like webpack, environments like React Native, and a large part of the JavaScript/TypeScript ecosystem has support for WASM based libraries. However, it usually involves special config settings which might be difficult to figure out. We have examples in the examples folder that uses webpack to create a demo website.
28
+
29
+ However, there are also **alternative implementations** of the interface of this library.
30
+
31
+ ## Alternatives
32
+
33
+ 1. [`@bitcoinjs-lib/tiny-secp256k1-asmjs`](https://www.npmjs.com/package/@bitcoin-js/tiny-secp256k1-asmjs) - This library uses wasm2js to convert this library into pure JS. It is about 10x ~ 20x slower than WASM and 3x ~ 10x slower than our old v1 JS implementation.
34
+ 2. [`@bitcoinerlab/secp256k1`](https://www.npmjs.com/package/@bitcoinerlab/secp256k1) - This library uses noble/secp256k1, and therefore it uses JS native `BigInt`. If you can support `BigInt` it is much faster than ASM.JS, however, this is not maintained by this library's maintainers, so there's no guarantee that they will keep up with any interface changes in the future. Please check before using. It is about 1.5x ~ 5x slower than WASM.
35
+
27
36
  ## Building
28
37
 
29
38
  For building locally you need C/C++ toolchain, Rust version >=1.50.0 and `wasm-opt` from [binaryen](https://github.com/WebAssembly/binaryen).