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

@reddcoinproject/reddcoinjs-lib

v7.0.1

Published

Client-side Reddcoin JavaScript library

Readme

reddcoinjs-lib

Github CI NPM code style: prettier

A client-side Reddcoin JavaScript library for Node.js and browsers. Forked from bitcoinjs-lib v7, adapted for the Reddcoin blockchain with Proof-of-Stake velocity (PoSV) support.

Written in TypeScript, with compiled JS committed for verification.

Released under the terms of the MIT LICENSE.

Should I use this in production?

If you are thinking of using the master branch of this library in production, stop. Master is not stable; it is our development branch, and only tagged releases may be classified as stable.

Can I trust this code?

Don't trust. Verify.

We recommend every user of this library and the reddcoinjs ecosystem audit and verify any underlying code for its validity and suitability, including reviewing any and all of your project's dependencies.

Mistakes and bugs happen, but with your help in resolving and reporting issues, together we can produce open source software that is:

  • Easy to audit and verify,
  • Tested, with test coverage >95%,
  • Advanced and feature rich,
  • Standardized, using prettier and Node Buffer's throughout, and
  • Friendly, with a strong and helpful community, ready to answer questions.

Documentation

Visit our documentation to explore the available resources. We're continually enhancing our documentation with additional features for an enriched experience. If you need further guidance beyond what our examples offer, don't hesitate to ask for help. We're here to assist you.

You can find a Web UI that covers most of the psbt.ts, transaction.ts and p2*.ts APIs here. If you need guidance beyond what the quick start examples offer, don't hesitate to open an issue.

Reddcoin-specific features

  • nTime field in transactions (version > 1) for PoSV consensus
  • Reddcoin network definitions with correct address prefixes (R for mainnet P2PKH)
  • PSBT support with nTime handling
  • Signing hash correctly excludes nTime per Reddcoin Core consensus rules

Transaction format (version > 1)

Reddcoin PoSV transactions include a 4-byte nTime timestamp after nLockTime:

[nVersion: 4] [vin] [vout] [nLockTime: 4] [nTime: 4]

The nTime field is included in the transaction hash (txid) but excluded from the signing hash, matching Reddcoin Core behaviour.

Installation

npm install reddcoinjs-lib
# optionally, install a key derivation library as well
npm install ecpair bip32

Quick start

import { networks, payments } from 'reddcoinjs-lib';

// Generate a Reddcoin P2PKH address from a public key
const { address } = payments.p2pkh({
  pubkey: publicKeyBuffer,
  network: networks.reddcoin,
});
// address starts with 'R'

Building a transaction with PSBT

import { Psbt, networks } from 'reddcoinjs-lib';

const psbt = new Psbt({ network: networks.reddcoin });
psbt.addInput({
  hash: '<previous tx hash>',
  index: 0,
  nonWitnessUtxo: Buffer.from('<raw tx hex>', 'hex'),
});
psbt.addOutput({
  address: 'R...',
  value: 50000n,
});
psbt.nTime = Math.floor(Date.now() / 1000);
psbt.signInput(0, keyPair);
psbt.finalizeAllInputs();

const tx = psbt.extractTransaction();
console.log(tx.toHex());

Networks

| Network | pubKeyHash | scriptHash | WIF | Bech32 | |---------|-----------|-----------|-----|--------| | Reddcoin mainnet | 0x3d (R) | 0x05 | 0xbd | rdd | | Reddcoin testnet | 0x6f (m/n) | 0xc4 | 0xef | trdd |

Usage

Browser

The recommended method of using reddcoinjs-lib in your browser is through a bundler like browserify or a modern build tool:

npm install reddcoinjs-lib browserify
npx browserify --standalone reddcoin -o reddcoinjs-lib.js <<< "module.exports = require('reddcoinjs-lib');"

TypeScript

Type declarations are included. Normal installation should include all needed type information.

ECC library

This library uses a pluggable ECC interface. You must call initEccLib() with a secp256k1 implementation before using Taproot or signing features:

import { initEccLib } from 'reddcoinjs-lib';
import * as ecc from 'tiny-secp256k1';

initEccLib(ecc);

Contributing

See CONTRIBUTING.md.

Running the test suite

npm test
npm run coverage

Upstream

This library is based on bitcoinjs-lib v7.0.1. The upstream complementary libraries (BIP32, BIP39, BIP38, ecpair, etc.) are compatible.

LICENSE MIT