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

stealthpayjs

v1.0.0

Published

library to calculate values sending and receiving Ethereum stealth payments

Readme

JavaScript library to calculate values for sending and receiving "stealth" payments on the Ethereum platform

stealthpayjs helps the caller to receive and send Ethereum payments in a way that decouples the sender's and receiver's personal addresses.

See: Ethereum Stealth Payments (YouTube)

Installation

npm install stealthpayjs

Quick start

const STEALTHPAY = require( 'stealthpayjs' )


// OPTIONAL: set if using functions that interact with Ethereum blockchain
// NOTE: if using Ethereum blockchain then this module can't be used in the
//       browser, because the browser can only talk to the web server
STEALTHPAY.setWeb3( "ws://127.0.0.69:8546" ) // RPC_URL


// =========================================================================
// NOTES:
// - addresses are expressed in hexstring format '0x...'
//
// - public keys produced by this module are expressed in compressed
//   form: 33 bytes and starting with a "02" or "03")
//
// - wherever this module accepts a public key as input, it can be in either
//   compressed ("0x02..." or "0x03...") or uncompressed form ("0x04...")
//
// - some OPTIONAL functions use our own, free Ephemeral Public Key Registry
//   smart contract on Ethereum L1. Tips to this smart contract are welcome.
// =========================================================================


// A payment receiver has a stealth public keypair (M,m) and shares M publicly
//
// WARN: receiver must retain the private key m securely to get the payment(s)
//       Losing m means losing the funds sent to you!

let stealthreceivekey = STEALTHPAY.createKeyPair() // { pub: M, prv: m }


// A payment sender uses the receiver's M and a new, temporary keypair to
// calculate the ephemeral key R to post in the registry and the address A to
// receivine payment
//
// WARN: do not discard r unless payment has been sent

let stealthsend = STEALTHPAY.createStealthSend( M )
// returns { pub: R, prv: r, addr: A }


// =========================================================================
// Remaining functions are OPTIONAL and if used then RPC_URL must be a valid
// Ethereum full node with a websocket connector available.
// =========================================================================

// Creates two unsigned transaction objects:
//  1. the unsigned transaction to register R in our EPKR
//  2. the unsigned transaction that sends some wei to address A
//
// the caller must then get the sending account's nonce, sign, calculate r,s,v
// and attach the values to the objects separately, then broadcast the
// signed transactions somehow else because:
//
// - the ephemeral account at (R,r) has no funds so the sender may fund it
//   separately then send to address A from (R,r), but this is two transactions
// - the sender may send to A from some other account the sender controls
// - we don't want to know private keys for the sender if we can help it
//
// returns array: [ unsignedregistertx, unsignedsendtxn ]

let senderutxns = STEALTHPAY.senderUnsignedTxns( R, A, weitopay )


// sender assigns nonces and current gas price, signs and broadcasts them
// the funds go to address A ... time passes ...


// The payment receiver scans our well-known, public Ephemeral Key Registry
// smart contract to check for balances and calculates receiving private key(s)
//
// Returns an array of objects [{bal: n, a: pvtkeyhex, A: addresshex},...]

let receipts = STEALTHPAY.scanForFunds( m )