Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@bitauth/libauth
Advanced tools
ultra-lightweight library for Bitcoin Cash, Bitcoin, and Bitauth
An ultra-lightweight JavaScript library for Bitcoin Cash, Bitcoin, and Bitauth
applications.
Explore API Reference »
An ultra-lightweight JavaScript library for Bitcoin Cash, Bitcoin, and Bitauth applications.
Libauth has no dependencies and works in all JavaScript environments, including Node.js, Deno, and browsers.
Libauth is designed to be flexible, lightweight, and easily auditable. Rather than providing a single, overarching, object-oriented API, all functionality is composed from simple functions. This has several benefits:
To get started, install @bitauth/libauth
:
npm install @bitauth/libauth
# OR
yarn add @bitauth/libauth
And import the functionality you need:
import { secp256k1 } from '@bitauth/libauth';
import { msgHash, pubkey, sig } from './somewhere';
secp256k1.verifySignatureDERLowS(sig, pubkey, msgHash)
? console.log('🚀 Signature valid')
: console.log('❌ Signature invalid');
Note, Libauth is a pure ESM package, so Node.js v12 or higher is required (or Deno), and using ESM is recommended.
For web projects, a bundler with dead-code elimination (A.K.A. "tree shaking") is strongly recommended – Libauth is designed to minimize application code size, and dead-code elimination will improve load performance in nearly all applications.
Consider Vite, Parcel, Rollup, Webpack, or a bundler designed for your web framework.
Deno is a great runtime for working with Libauth. You can import the library from unpkg.com
:
import { hexToBin } from 'https://unpkg.com/@bitauth/libauth/build/index.js';
console.log(hexToBin('beef'));
Libauth uses BigInt
, WebAssembly
, and es2017
features for some functionality. To type-check this library in you application (without skipLibCheck
), your tsconfig.json
will need a minimum target
of es2020
or lib
must include es2017
and esnext.bigint
. If your application is not already importing types for WebAssembly
, you may also need to add dom
to lib
.
Pull Requests welcome! Please see CONTRIBUTING.md
for details.
This library requires Yarn for development. With Node.js
installed, the yarn
package manager can be installed by running corepack enable
. Once yarn
is installed:
# note the use of --recursive to clone submodules
git clone --recursive https://github.com/bitauth/libauth.git
cd libauth
yarn
Libauth uses Yarn's Zero-Installs strategy – all of Libauth's dependencies are tracked in an independent git repository, and the dependency repo is automatically shallow-cloned into the .yarn
directory.
Try running the test suite:
yarn test
You can also run the benchmarks (this will take a while):
yarn bench
During development, you may find it helpful to use the watch
tasks:
# rebuild everything on save:
yarn watch
# run a subset of tests:
yarn watch:test --match='*encode*' --match='*decode*' --match='!*[script_tests]*' --match='!*[vmb_tests]*'
FAQs
ultra-lightweight library for Bitcoin Cash, Bitcoin, and Bitauth
The npm package @bitauth/libauth receives a total of 48,668 weekly downloads. As such, @bitauth/libauth popularity was classified as popular.
We found that @bitauth/libauth demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.