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

@vanar/veil-keys-from-wallet

v0.1.0

Published

Deterministic VeilCapsule X25519 keypair derivation from an EVM wallet signature. The user's wallet seed phrase is the only secret; the keypair is re-derived on demand.

Readme

@vanar/veil-keys-from-wallet

Deterministic VeilCapsule X25519 keypair derivation from an EVM wallet signature. The user's wallet seed phrase is the only secret; the keypair is re-derived on demand from a fixed signed message.

Why this exists

Most "audit dashboard" products either:

  • Ask the user to remember an extra password / passphrase, or
  • Hold the encryption key on the server, defeating the point of end-to-end encryption

This package side-steps both. Users sign a fixed message in their wallet (Vanar VeilCapsule key derivation v1); the SHA-256 of that signature becomes the X25519 secret key. No extra secrets to remember, no operator-held key, full backup via the existing wallet seed phrase.

Install

npm i @vanar/veil-keys-from-wallet

Usage

Browser (Reown / WalletConnect / wagmi / viem)

import { deriveFromWallet } from "@vanar/veil-keys-from-wallet";

// `walletClient` is any object exposing { signMessage({message}) → hex string }.
// Works with viem WalletClient, ethers.js Signer (via small adapter), wagmi, etc.
const veilKeys = await deriveFromWallet({
  signMessage: ({ message }) => walletClient.signMessage({ account, message }),
});

// veilKeys = { publicKey: 'dB9BSY...=', secretKey: 'o7nmZM...=' }
//
// SAFE TO SEND TO YOUR SERVER:
//   - veilKeys.publicKey
// MUST NEVER LEAVE THE BROWSER:
//   - veilKeys.secretKey

Server-side (re-derive for migrations / re-encryption)

import { deriveVeilKeyPairFromSignature } from "@vanar/veil-keys-from-wallet";

// Only call this with a signature the user has provided in real time.
// The server should normally NEVER see the user's secret key.
const keys = await deriveVeilKeyPairFromSignature(signatureHex);

How it works

  1. User signs the fixed message in their wallet (signMessage)
  2. Wallet returns a 65-byte ECDSA signature (RFC 6979 deterministic for all major EVM wallets - same (message, key) always yields same bytes)
  3. SHA-256 of those bytes → 32 deterministic bytes
  4. nacl.box.keyPair.fromSecretKey(seed) → X25519 keypair
  5. Returns base64-encoded for parity with @vanar/veil-capsule's VeilKeyPair type

Properties

  • Deterministic - same wallet + same message → same keypair
  • Backup is implicit - if you have your wallet seed phrase, you have your VeilCapsule key
  • Revocable via versioning - bump the message version (v2) to rotate; old capsules stay encrypted under v1
  • No password fatigue - no extra secret to remember
  • Works on every major EVM wallet - MetaMask, Rainbow, Coinbase Wallet, Trust Wallet, Ledger, etc

Versioning

The current derivation message is Vanar VeilCapsule key derivation v1. Bumping the version is intentional - it produces a fresh keypair, so all old capsules become unreadable except by the original wallet re-deriving with the old message. This is the rotation primitive.

import { DERIVATION_MESSAGE_V1, CURRENT_DERIVATION_MESSAGE } from "@vanar/veil-keys-from-wallet";
// DERIVATION_MESSAGE_V1 stays exported forever for migration purposes

Trust assumption

The wallet's signing algorithm (secp256k1 ECDSA) must be deterministic when used per RFC 6979. All major EVM wallets implement this. If a wallet returned a non-deterministic signature, the user's keypair would change every derivation and everything would break.

Security caveat

The derived keypair is only as private as the wallet seed phrase. If the wallet seed is compromised, so is every capsule encrypted to that keypair. This is the same trust model as the wallet's funds - by design.

Related

Companion to @vanar/veil-capsule. Use this package to derive a per-user X25519 keypair from the user's wallet so each user's audit capsules are encrypted to keys only their wallet can re-derive. Works standalone or with the rest of Vanar's open protocols. See veil.org for the protocol overview.