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

snap-solana-sdk

v0.1.1

Published

Shielded agent-to-agent payments on Solana using ZK proofs

Downloads

274

Readme

snap-solana-sdk

Shielded agent-to-agent payments on Solana with automatic Groth16 proof generation.

Status: snap-solana-sdk is for the SNAP limited release. It is not audited production software.

Quick Start

SNAP is live on Solana mainnet. Install and try it:

npm install snap-solana-sdk @solana/web3.js @coral-xyz/anchor
import { SNAPClient } from "snap-solana-sdk";
import { Connection, Keypair, PublicKey } from "@solana/web3.js";

const connection = new Connection("https://api.mainnet-beta.solana.com");
const wallet = Keypair.generate();

const snap = new SNAPClient(connection, wallet);

// Deposit into the shielded pool
const POOL = new PublicKey("B8SyffZKt8LABKogWjH9rZcjY5PV2hyYRCbTxxbcrpFf");
const note = await snap.deposit(POOL);

// Share `note` with the recipient off-chain
const serialized = SNAPClient.serializeNote(note);

// Recipient withdraws with ZK proof
const restored = SNAPClient.deserializeNote(serialized);
const recipientKeypair = Keypair.generate();
const recipientSnap = new SNAPClient(connection, recipientKeypair);
const tx = await recipientSnap.withdraw(POOL, restored, recipientKeypair);

Mainnet Details

| Field | Value | |-------|-------| | Program ID | 9uePoqdgaXpqFLQM2ED1GGQrwSEiqe3r6tW1AfsnrrbS | | 0.1 SOL pool | B8SyffZKt8LABKogWjH9rZcjY5PV2hyYRCbTxxbcrpFf | | 1 USDC pool | 5LeuHrPBgHNhgbCy996MEjcsBk5gNHhVj6AiuuCHZ8od | | 10 USDC pool | ECuHf8kgiWfmL3Q6id4WGBQWvuukhzqvF5vsxuPAKZBv | | Network | Solana Mainnet | | Explorer | View Program |

Public API

import { SNAPClient } from "snap-solana-sdk";

const snap = new SNAPClient(connection, wallet);

const note = await snap.deposit(poolAddress, 0.1);
const txSig = await snap.withdraw(poolAddress, note, recipientKeypair);

Notes

  • deposit() always uses the pool's fixed denomination. If you pass amount, it must match the pool denomination.
  • withdraw() rebuilds the Poseidon Merkle tree, generates the witness, produces the Groth16 proof, formats it for Solana, and submits the transaction.
  • withdrawViaRelayer() signs the relayer request with a one-time Ed25519 session key derived from the agent spending key or a Keypair-backed wallet seed. That signature is only the transport envelope: the relayer also verifies the proof off-chain and binds the signed request to the exact proof/root/nullifier/recipient/fee/timestamp tuple before it submits anything.
  • maxDepositDelayMs and maxWithdrawDelayMs add cryptographically random timing jitter with crypto.getRandomValues() to reduce simple timing-correlation attacks.
  • serializeNote() returns a JSON-safe string. Anyone with the note can withdraw the funds, so it must stay off-chain and private.

Security Model

Bearer Notes

Anyone with the note can withdraw the funds. A note contains the secret and nullifier that generate the ZK proof. There is no additional key-based authorization on-chain. Protect notes like private keys.

Viewing Keys

The viewing key can decrypt an agent's note history for audit purposes. It cannot spend funds or recover the spending key. This supports the selective-disclosure compliance model described in docs/COMPLIANCE.md.

Spending Keys

The spending key seeds the agent's Solana wallet and signs relayer request payloads. It does NOT control on-chain withdrawals. The note controls that. This is a transport credential, not a protocol authorization key.

Assets

The package ships the proving artifacts in assets/:

  • withdraw.wasm
  • withdraw_final.zkey

They are loaded at runtime from the installed package directory.