All Projects → bitauth → Libauth

bitauth / Libauth

Licence: mit
An ultra-lightweight, zero-dependency JavaScript library for Bitcoin, Bitcoin Cash, and Bitauth applications.

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to Libauth

Blazorboilerplate
Blazor Boilerplate / Starter Template with MatBlazor
Stars: ✭ 1,258 (+513.66%)
Mutual labels:  webassembly, authentication
Django Graphql Auth
Django registration and authentication with GraphQL.
Stars: ✭ 200 (-2.44%)
Mutual labels:  authentication
Firmware
❄️ Firmware and simulator for Coldcard Hardware Wallet
Stars: ✭ 198 (-3.41%)
Mutual labels:  bitcoin
Golden Wallet React Native
Golden - Best Wallet Ever
Stars: ✭ 201 (-1.95%)
Mutual labels:  bitcoin
Python Trezor
🐍 Don't use this repo, use the new monorepo instead:
Stars: ✭ 198 (-3.41%)
Mutual labels:  bitcoin
Spec
WebAssembly specification, reference interpreter, and test suite.
Stars: ✭ 2,458 (+1099.02%)
Mutual labels:  webassembly
Factomd
Factom Daemon
Stars: ✭ 197 (-3.9%)
Mutual labels:  bitcoin
Adamant Im
ADAMANT Decentralized Messenger. Progressive Web Application (PWA)
Stars: ✭ 202 (-1.46%)
Mutual labels:  bitcoin
Binaryen.js
A buildbot for binaryen.js, a port of Binaryen to the Web, with TypeScript support.
Stars: ✭ 201 (-1.95%)
Mutual labels:  webassembly
Coinquantitave
Digital currency quantitative trading
Stars: ✭ 201 (-1.95%)
Mutual labels:  bitcoin
Expo Firebase Starter
🔥⚛️📱 Expo + Firebase Starter Kit
Stars: ✭ 199 (-2.93%)
Mutual labels:  authentication
Opentimestamps Client
OpenTimestamps client
Stars: ✭ 197 (-3.9%)
Mutual labels:  bitcoin
Libreauth
LibreAuth is a collection of tools for user authentication.
Stars: ✭ 201 (-1.95%)
Mutual labels:  authentication
Go Quote
Yahoo finance/Google finance/Coinbase/Bittrex/Binance/Tiingo historical quote downloader library and cli written in golang
Stars: ✭ 198 (-3.41%)
Mutual labels:  bitcoin
Lndhub
Wrapper for Lightning Network Daemon. It provides separate accounts and trust minimization for end users
Stars: ✭ 203 (-0.98%)
Mutual labels:  bitcoin
Angular 8 Registration Login Example
Angular 8 User Registration and Login Example
Stars: ✭ 198 (-3.41%)
Mutual labels:  authentication
Bitcoin On Nodejs
《Node.js区块链开发》,注:新版代码已开源!请star支持哦-^-:
Stars: ✭ 2,321 (+1032.2%)
Mutual labels:  bitcoin
Express Graphql Boilerplate
Express GraphQL API with JWT Authentication and support for sqlite, mysql, and postgresql
Stars: ✭ 201 (-1.95%)
Mutual labels:  authentication
Rufus
The Reliable USB Formatting Utility
Stars: ✭ 16,917 (+8152.2%)
Mutual labels:  sha256
Gekko Backtesttool
Batch backtest, import and strategy params optimalization for Gekko Trading Bot. With one command you will run any number of backtests.
Stars: ✭ 203 (-0.98%)
Mutual labels:  bitcoin

Libauth logo

An ultra-lightweight JavaScript library for Bitcoin, Bitcoin Cash, and Bitauth applications.

Explore API Reference »

NPM version Codecov CircleCI GitHub stars

Libauth

An ultra-lightweight JavaScript library for Bitcoin, Bitcoin Cash, and Bitauth applications.

Libauth has no dependencies and works in all JavaScript environments, including Node.js, Deno, and browsers.

Purpose

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:

  • Flexibility – Even highly-complex functionality is built-up from simpler functions. These lower-level functions can be used to experiment, tweak, and remix your own higher-level methods without maintaining a fork of the library.
  • Smaller application bundles – Applications can import only the methods they need, eliminating the unused code (via dead-code elimination).
  • Better auditability – Beyond having no dependencies of its own, Libauth's functional programming approach makes auditing critical code easier: smaller bundles, smaller functions, and less churn between versions (fewer cascading changes to object-oriented interfaces).
  • Fully-portable – No platform-specific APIs are ever used, so the same code paths are used across all JavaScript environments (reducing the auditable "surface area" and simplifying library development).

Getting Started

To get started, install @bitauth/libauth:

npm install @bitauth/libauth
# OR
yarn add @bitauth/libauth

And import the functionality you need:

import { instantiateSecp256k1 } from '@bitauth/libauth';
import { msgHash, pubkey, sig } from './somewhere';

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

Typescript Types

Note: @bitauth/libauth uses BigInt, WebAssembly, and es2017 features for some functionality. While support is required to use this functionality (Node.js v10 LTS or later), other parts of the library will continue to work in older environments. To include the necessary TypeScript library files in you application, add "lib": ["es2017", "esnext.bigint", "dom"] to your tsconfig.json.

Using with Deno

Deno is a great runtime for quickly working with Libauth. You can import from the latest module build:

import { hexToBin } from 'https://unpkg.com/@bitauth/libauth/build/module/index.js';

console.log(hexToBin('beef'));

Stable API

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

WebAssembly ECDSA & Schnorr

WebAssembly Hashing Functions

Unstable APIs

Libauth also exports new, potentially unstable APIs. As these APIs stabilize, they will be included in the above reference.

Full API Documentation →


Contributing

Pull Requests welcome! Please see CONTRIBUTING.md for details.

This library requires Yarn for development. If you don't have Yarn, make sure you have Node.js installed (which ships with npm), then run npm install -g yarn. Once Yarn is installed:

# use --recursive to clone the secp256k1 submodule
git clone --recursive https://github.com/bitauth/libauth.git && cd libauth

Install the development dependencies:

yarn

Then 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 testing watch tasks:

yarn watch # rebuild everything on save
yarn watch:test # run only the fast tests
yarn watch:test-slow # test everything

For more information about the available package scripts, run:

yarn run info
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].