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

@odatano/contract-m402-vault

v0.1.0

Published

m402 payment vault Compact contract: NIGHT pooled against a shielded credit, services paid in private, receipts checked in the public ledger.

Readme

@odatano/contract-m402-vault

A payment vault: NIGHT goes in, a shielded credit of the same amount comes out, and services are paid with that credit in private. A merchant checks a payment by looking up its receipt hash in the public ledger.

  • deposit(amount, nonceSeed): unshielded NIGHT into the vault, a shielded credit coin of the same amount to the caller's key.
  • pay(serviceId, credit, receiptSecret): one credit coin of exactly the service's price; the merchant's balance grows, the receipt hash is recorded.
  • redeem(recipient, credit): a credit coin back to NIGHT at recipient.
  • registerService(salt, price, owner), withdraw(serviceId, amount): the merchant's side.
  • Pure: creditColor(self), deriveReceipt(secret, serviceId), deriveServiceId(owner, salt, price).

Coins and secrets are circuit parameters (private inputs), not witnesses: a caller passes the credit coin and the secrets as call arguments.

import { Contract, ledger, pureCircuits } from '@odatano/contract-m402-vault';

const receipt = pureCircuits.deriveReceipt(receiptSecret, serviceId);
const paid = ledger(contractState.data).receipts.member(receipt);

A known deployment on preprod: 8113b23150f65353ab2ceae97946ec7520ff1464e0f4e9458872d5042855fdea (deploy transaction 00dc31895e4e302bf4848ccd5b996f0bdf80627de9f74146cd6d68033c76b7eca3, credit colour c91b888af4ad582f522816101795788d8322bc9ffa476b7612021868e2fd2aa5). Its verifier keys are the ones this package ships; a recompile with another compiler or runtime is a new verifier-key set and a new deployment.

Prover keys are not in the package: keys/manifest.json pins their bytes, contract.json#zkAssetUrl names the release assets.

Peer dependency: @midnight-ntwrk/compact-runtime at the exact version in contract.json#compactRuntime.

Based on m402 by julianariel (https://github.com/julianariel/m402, Apache-2.0), modified: coins and secrets are circuit parameters instead of witnesses. See NOTICE.

Repository: https://github.com/ODATANO/NIGHTGATE-CONTRACTS. License: Apache-2.0.