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

@shieldedpools/contracts

v0.2.0

Published

The Shielded Pool protocol contract and release artifacts.

Readme

Shielded Pool Contract

A 1:1 shielded wrapper for Midnight's native unshielded tokens. Lock a token, receive a private version of it, and redeem the original. For NIGHT, that private version is sNIGHT.

Features

  • 1:1 backing: every mint and return is paired with a transfer of the same token and amount in the same circuit.
  • Immutable: npm run deploy gives the contract no maintenance authority, an empty committee with a threshold of 1 that no signature can meet. It is impossible to change the circuits or pause the contract after deployment.
  • Any ledger token: one contract wraps NIGHT and any other token that uses the ledger's unshielded coins.
  • Private transfers: wrapped tokens are ordinary shielded coins, which hide the sender, recipient, amount and token. A transfer's fee and time stay public.
  • Public entry and exit: shield shows the depositor, token and amount, and unshield shows the recipient, token and amount. Matching amounts can link the two.

Circuits

shield

Locks amount of token in the contract and mints the same amount of its wrapped token to the caller's coin key. The depositor, token and amount are public. The new coin's key stays private, which needs a fresh secret nonce for each call.

export circuit shield(token: Bytes<32>, amount: Uint<64>, nonce: Bytes<32>): ShieldedCoinInfo {
  const underlying = disclose(token);
  const value = disclose(amount);

  receiveUnshielded(underlying, value);
  return mintShieldedToken(
    underlying,
    value,
    disclose(nonce),
    left<ZswapCoinPublicKey, ContractAddress>(ownPublicKey())
  );
}

unshield

Takes a wrapped coin the caller pays in, checks that it wraps token, and releases the same amount of token to recipient. The recipient, token and amount are public, but whose funds paid for it stays private. The wallet funds the coin from the wrapped coins it holds and keeps the change, so amounts don't have to match an earlier shield.

export circuit unshield(token: Bytes<32>, coin: ShieldedCoinInfo, recipient: UserAddress): [] {
  const underlying = disclose(token);
  const paid = disclose(coin);
  const to = disclose(recipient);
  // Only this contract's wrapped form of `token` may release its backing.
  assert(paid.color == tokenType(underlying, kernel.self()), "shielded-pools: wrong token");
  assert(to != default<UserAddress>, "shielded-pools: zero recipient");

  receiveShielded(paid);
  sendUnshielded(underlying, paid.value, right<ContractAddress, UserAddress>(to));
}

Deploying

npm ci
npm run build
export MIDNIGHT_SEED=0000000000000000000000000000000000000000000000000000000000000001
npm run -s deploy

This pays the fee from the wallet with that seed, using a proof server on 127.0.0.1:6300, and fails unless the chain shows that nobody can change the contract. No maintenance key is ever created. MIDNIGHT_NETWORK picks the network, which defaults to the local one. Public networks use the deploy workflow.

License

Copyright 2026 The Shielded Pool Authors. Apache-2.0: see LICENSE. Contributions are made under the same license.

The license doesn't cover the Shielded Pool names or logos. Don't imply that your project is official or endorsed, and give a modified version its own name.