@aritz-cracker/cryptowasm

ultra-lightweight library for Bitcoin, Bitcoin Cash, and Bitauth

Usage no npm install needed!

<script type="module">
  import aritzCrackerCryptowasm from 'https://cdn.skypack.dev/@aritz-cracker/cryptowasm';
</script>

README

Cryptowasm

An ultra-lightweight JavaScript library exposing several cryptographic primitives commonly used in cryptocurrency

Cryptowasm has no dependencies and works in all JavaScript environments, including Node.js, Deno (probably), and browsers.

Purpose

Cryptowasm is a stripped-down fork of libauth by the very skillful bitjson, only including Secp256k1, sha1, sha256, sha512, and Ripemd160. No other utility tools or bitcoin(cash)-specific feature sets.

Getting Started

To get started, install cryptowasm:

npm install cryptowasm

And import the functionality you need:

import { instantiateSecp256k1 } from 'cryptowasm';
import { msgHash, pubkey, sig } from './somewhere';

(async () => {
  const secp256k1 = await instantiateSecp256k1();
  secp256k1.verifySignatureDERLowS(sig, pubkey, msgHash)
    ? console.log('🚀 Signature valid')
    : console.log('❌ Signature invalid');
})();

Stable API

The following APIs are considered stable, and will only include breaking changes in major version upgrades.

WebAssembly ECDSA & Schnorr

WebAssembly Hashing Functions