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

@terlos/stacks-wallet

v0.5.0

Published

Stacks Shield wallet core: keys, shielded receiving addresses, HPKE note encryption, scanning, coin selection, fresh withdraw addresses

Readme

@terlos/stacks-wallet

npm License: Apache-2.0 Status

Part of Terlos: private payments on Stacks with ZK-STARKs verified on chain. Architecture · Integration guide · Security

The wallet core of Terlos:

  • keys and shielded addresses;
  • encrypted note memos;
  • note scanning, coin selection and operation planning;
  • relayed submission with automatic re-proving.

It is framework-free and holds no network state. @terlos/stacks-client builds the full wallet experience (storage, sync, relayers) on top of it.

Status: 0.x, testnet, unaudited.

npm install @terlos/stacks-wallet

Keys and addresses

| Item | How it is made | | --- | --- | | Backup | One BIP-39 mnemonic (24 words) per wallet | | Spending key | 4 Goldilocks limbs from HKDF-SHA256 (label spend); the owner key is pk = RPO(KEY, sk), hash-based | | View key | X25519, from HKDF (label view). It only decrypts incoming memos, so it can be shared with an auditor without spend power | | Addresses | zst1… (testnet) / zsp1… (mainnet), bech32m with a checksum. KeyRing derives any number of unlinkable receiving addresses per account. | | Network separation | Keys are derived per network: mainnet uses its own HKDF salt (stacks-shield/wallet/v1/mainnet), testnet the original one (stacks-shield/wallet/v1). The same words give unrelated keys on each network, so testnet and mainnet addresses can't be linked. A wallet refuses keys derived for another network. |

import { KeyRing, ShieldedWallet, newMnemonic } from "@terlos/stacks-wallet";

const ring = KeyRing.fromMnemonic(newMnemonic(), { network: "testnet" }); // or "mainnet"
const wallet = new ShieldedWallet(ring, "testnet");                        // must match
wallet.address;                    // primary address
const fresh = wallet.newAddress(); // a new address for one counterparty
wallet.watchKey(fresh.index);      // view-only access to that address (for @terlos/stacks-pay)

Notes and memos

Each new note carries a 98-byte memo: its opening (amount, blinding, asset) encrypted with HPKE (RFC 9180), using DHKEM(X25519, HKDF-SHA256) and ChaCha20-Poly1305, with the note commitment as AAD. A decrypted note is only accepted if it recomputes to the on-chain commitment, so a forged memo can never create a balance.

Planning and submitting

  • wallet.ingest(events, tree): scans events, but only for leaves the root-checked tree confirms.
  • balances() / notes(asset): spendable notes and totals, from that scan.
  • Planning: planShield, planPayment(to, amount, asset, relay) (merges and splits as needed), planWithdraw, planSendNote, planSplit, planMerge.
  • wallet.request(action, tree, deployer): turns a plan into a proof request plus memos, for @terlos/stacks-sdk.
  • submitWithReprove: sync, prove, submit and wait. It retries automatically when another transaction moved the root first.

License: Apache-2.0.