Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

An ultra-lightweight, zero-dependency TypeScript library for Bitcoin Cash, Bitcoin, and Bitauth applications.

License

NotificationsYou must be signed in to change notification settings

bitauth/libauth

Repository files navigation

Libauth logo

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

Docs: Getting Started →

API Reference

NPM versionCodecovCIFollow Libauth on TwitterJoin Chat on Telegramnpm downloadsGitHub stars

Libauth

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

Libauth hasno dependencies and works in all JavaScript environments, includingNode.js,Deno, and browsers.

Purpose

Libauth is designed to beflexible,lightweight, andeasily 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 (viadead-code elimination).
  • Better auditability – Beyond having no dependencies of its own, Libauth'sfunctional 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).

Quick Start

To get started, install@bitauth/libauth:

npm install @bitauth/libauth# ORyarn 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');

SeeInstallation for more guidance on getting set up.

Guides

These guides introduce some of the high-level concepts and functionality provided by Libauth.

More Examples

In addition to the usage examples in these guides, note thatLibauth includes comprehensive tests that can help demonstrate usage of all functionality.

For example, utilities related to hexadecimal-encoded strings are defined inhex.ts; for thorough usage examples, see the co-locatedhex.spec.ts. You can also use GitHub search to see how a particular utility is used throughout the library, e.g.splitEvery.

API Overview

Below is a partial selection of functionality provided by Libauth.If you're looking for something else, be sure to search theAPI Reference.

High-level utilities are composed from lower-level utilities which are also exported, so it's often possible to remix behavior in your own codebase with relatively little duplication or maintenance burden. See theDefined in ... link on each utility's API reference page to review and copy the implementation.

Table of Contents

Address Formats

Base58 Addresses

Bech32

CashAddress

CashAddress-like Formats

Crypto

Formats

Base-N Conversion

Base64

Binary Strings (e.g.00101010)

Hex (Hexadecimal-Encoded Strings)

Logging

Numbers

CompactUint (A.K.A. "VarInt" or "CompactSize")
Satoshi Values
VM Numbers (A.K.A. "ScriptNum")

Miscellaneous

Time

UTF8

Keys

BIP32 Hierarchical Deterministic (HD) Keys

BIP39 Mnemonic Phrases

Wallet Import Format (WIF)

Key Utilities

P2P Messages

Decoding Utilities

Transactions

Outputs

Dust Calculation

Virtual Machines

Built-In VMs

Debugging

Combinators

Wallet Engine

Bitcoin Cash Metadata Registries (BCMRs)

CashAssembly Language & Compiler

Multi-Party Compilation

P2PKH Utilities

Wallet Templates

VMB Tests

Libauth's test suite includes a set of cross-implementation Virtual Machine Bytecode (VMB) test vectors for each supported VM. SeeLibauth VMB Tests for details.

CashAssembly

CashAssembly is the assembly language used by Libauth'sWallet Templates. To learn more about CashAssembly, read theBitauth IDE Guide.

Contributing

Pull Requests welcome! Please seeCONTRIBUTING.md for details.


[8]ページ先頭

©2009-2025 Movatter.jp