Bitcoin
$6,470.09 -0.15%
BTC · 19w

Just released: a WebAssembly version of Bitcoin's Secp256k1 (10x faster than Javascript)

Just released: WebAssembly version of Secp256k1 (10x faster than Javascript)

Bitcoin, Bitcoin Cash, and most other cryptocurrencies use the Elliptic Curve Digital Signature Algorithm (ECDSA) to authenticate transactions. ECDSA can be used with a number of different elliptic curves, and Bitcoin’s creator chose the Koblitz curve Secp256k1 for Bitcoin’s digital signature system.

Secp256k1 is used by most cryptocurrency software

Most software packages which interact with these systems require Secp256k1 support. Mining software must be able to validate that transactions are properly signed before being included in the blockchain. Cryptocurrency wallets must be able to both verify incoming transactions and sign transactions to spend funds.

Many of the most popular cryptocurrency wallets and services are written in JavaScript. For these applications, Secp256k1 signing and validation can be complicated to package, use, and audit – often requiring different build and code paths for the browsers than those required for Node.js – and relatively slow (especially in browser applications).

Get the library on GitHub or NPM

A WebAssembly version of libsecp256k1 is now available on GitHub and via the Node.js package manager, NPM:

npm install --save bitcoin-ts

The API is purely-functional, fully-typed and documented with TypeScript, and accepts and returns native ES2015 typed arrays. Here’s a short example of Low-S signature verification using the library:

The library is written in TypeScript and documented inline, so capable editors will show documentation as you type:

For more usage information, review the code, the tests, or check out the Secp256k1 Interface in the TypeDocs.

Thoroughly tested against existing implementations

Along with standard test vectors and 100% code coverage, the library uses property-based testing to randomly generate thousands of test cases each run, including comparisons of ...

Continue on blog.bitjson.com
Recent news
BTC -0.15% · theonion.com · 6h

The guide to Bitcoin for uninitiated

Blockchain technology forms the foundation for cryptocurrencies such as Bitcoin, Dogecoin, and Ethereum, but it can be difficult to understand how it actually works. The Onion answers common questions...
BTC -0.15% · shitcoinoffering.com · 8h

Lifehack: How to detect scam project

25 simple points which will help you avoid shitty scam projects.   Martin Luther King had a dream for all people to be free. I also have a dream that people finally develop a BS detector when it comes...
BTC -0.15% · instagram.com · 8h

Friday fun fact

700 Likes, 36 Comments - Coin Inside | Blockchain world (@coin.inside) on Instagram: “Are you still HODL? share in the comments👇 #altcoins #ico #hodlgang #blockchain #bitcoin…”