npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@qbtc/bitcoinjs-lib

v8.0.0

Published

Bitcoin and QBitcoin transaction, address, and signing utilities

Readme

@qbtc/bitcoinjs-lib

CI npm

A fork of bitcoinjs-lib with QBitcoin address, WIF, transaction serialization, and signing utilities. The Bitcoin APIs remain available. This package has its own version sequence; version 8.0.0 is the first public release under the @qbtc scope.

Installation

npm install @qbtc/bitcoinjs-lib

For an application that keeps existing bitcoinjs-lib imports, pin an npm alias:

{
  "dependencies": {
    "bitcoinjs-lib": "npm:@qbtc/[email protected]"
  }
}

The package supports Node.js 18 and newer, CommonJS, and ES modules. TypeScript declarations are included (TypeScript 5.3 or newer). Build and release tooling uses Node.js 22. Consumers that need key management can install @qbtc/ecpair separately; the library does not require it at runtime.

import { qbitcoinAddress, qbitcoinNetworks } from '@qbtc/bitcoinjs-lib';
// CommonJS: const { qbitcoinAddress, qbitcoinNetworks } = require('@qbtc/bitcoinjs-lib');

const publicKey = Uint8Array.from(Buffer.from(
  '0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798',
  'hex',
));
const address = qbitcoinAddress.fromPublicKey(publicKey, qbitcoinNetworks.qbitcoin);
// bqQHJ8dsKokoFj58jCHKSSpzk6oiAYKvzZT

QBitcoin APIs

  • qbitcoinNetworks: mainnet and testnet parameters; callers can supply their own network object.
  • qbitcoinAddress: address encoding and decoding, script hashes, and P2PK scripts for ECDSA, Schnorr, and Falcon-512 public keys.
  • qbitcoinWif: QBitcoin private-key payload encoding and decoding.
  • qbitcoinTransaction: serialization, transaction IDs, and SIGHASH_ALL for standard QBitcoin transactions.
  • qbitcoinSigner: P2PK signing with a caller-provided ECDSA function or externally computed signatures, including Falcon-512.

QBitcoin uses a separate transaction format. The Bitcoin Transaction and Psbt classes do not build QBitcoin transactions. The signing module does not implement Falcon-512 key generation or signing internally.

Only TX_TYPE_STANDARD is supported. Token transactions are rejected during serialization, hashing, and signing, including objects containing the former tokenHash field. Token constants and encodeTokenTransfer are not exported. The general output data field remains available for standard transactions.

Use qbitcoinAddress.toScriptHash(address, network) for a QBitcoin transaction output. address.toOutputScript rejects QBitcoin networks: a script hash cannot reconstruct the original script. When the public key is known, qbitcoinAddress.p2pkScript(publicKey) builds the P2PK script.

payments.p2qbitcoin supports 33/65-byte ECDSA public keys. An input alone provides its signature, but cannot provide a public key, address, hash, or output script. Supply a public key or output script when those fields are needed.

Development

Use Node.js 22 and npm with the committed lockfile:

npm ci
npm test
npm run lint:tests
npm run gitdiff:ci
npm run pack:check
npm run doc

TypeScript sources live in ts_src/. npm run build regenerates the committed CommonJS/ESM files and declarations in src/; edit the sources first. prepack also builds the package. Unit coverage measures all ESM implementation files. pack:check installs the actual npm archive with public runtime dependencies and checks CommonJS, ESM, subpath exports, and TypeScript consumers.

The lint commands account for two exact inherited diagnostics in src/esm/payments/bip341.js and test/payments.spec.ts. Other diagnostics still fail the check; the inherited source lines remain unchanged.

Bitcoin integration tests require a regtest service:

APIURL=http://127.0.0.1:8080/1 npm run integration

CI starts the pinned regtest image automatically. The optional external blockchain.info example is skipped unless RUN_EXTERNAL_TESTS=1 is set. TypeDoc builds in CI. Publishing documentation to GitHub Pages is a separate, manually started workflow and requires Pages to be configured in the repository.

Releases

The public repository is qbitcoin-project/bitcoinjs-lib. Release tags use bitcoinjs-lib-vX.Y.Z and must match the version in both package.json and package-lock.json. For 8.0.0 the tag is bitcoinjs-lib-v8.0.0.

CI publishes to npm only for a matching tag in that repository, after unit, coverage, lint, build, package, runtime, and regtest checks pass. Publication uses the checked npm archive, public access, and provenance. Configure the repository's NPM_TOKEN secret with permission to publish @qbtc/bitcoinjs-lib.

Only the cleaned main branch and selected release tags belong in the public repository. A private development remote can remain configured separately.

Upstream and license

The fork retains the upstream project history and MIT license. See LICENSE for attribution and CHANGELOG.md for the public fork release and retained upstream release notes. Bitcoin examples remain under test/integration/; the upstream documentation describes the original Bitcoin APIs.

Report fork-specific issues in the public issue tracker.