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

@midnight-ntwrk/midnight-did-contract

v0.6.0

Published

Compact smart-contract implementation for Midnight DID ledger state.

Readme

@midnight-ntwrk/midnight-did-contract

Compact smart-contract implementation for Midnight DID ledger state.

Responsibilities

  • Store DID state on-ledger (methods, relations, services, aliases, metadata)
  • Enforce on-chain invariants and authorization checks
  • Expose circuits for DID lifecycle operations

Architecture

graph TD
  API[API]
  Contract[did.compact circuits]
  Ledger[(On-chain DID state)]

  API --> Contract
  Contract --> Ledger

Circuit Flow (example: set verification method)

sequenceDiagram
  participant Caller
  participant Circuit as setVerificationMethod
  participant Ledger

  Caller->>Circuit: VerificationMethod input + MapMutation + controller signature
  Circuit->>Circuit: verify controller signature over contract id + version + operation + args
  Circuit->>Circuit: key type/curve constraints
  Circuit->>Circuit: duplicate/non-existence checks
  Circuit->>Ledger: insert/update state
  Circuit->>Ledger: increment version + operationCount

On-ledger State Lifecycle

stateDiagram-v2
  [*] --> Active
  Active --> Active : add/update/remove methods, relations, services, aliases
  Active --> Deactivated : deactivate()
  Deactivated --> [*]

Build & Test

  • Compile compact artifacts only: pnpm --filter ./packages/contract contract
  • Build prepared package outputs: pnpm --filter ./packages/contract build:prepared
  • Tests: pnpm --filter ./packages/contract test -- --pool=threads
  • Coverage: pnpm --filter ./packages/contract coverage

Notes

  • Contract-level checks focus on enforceable on-chain invariants.
  • Some full DID conformance checks are intentionally handled at SDK/domain layers.
  • Controller public keys can be derived locally with deriveControllerPublicKey(secretKey) as Jubjub points. Controller-gated circuits verify wallet-local signatures over a domain-separated digest containing the DID contract id, current version, operation name, and operation arguments.
  • Set/update circuits use explicit MapMutation and SetMutation enums so the exported circuit surface stays small without boolean intent flags.
  • Jubjub signing helpers and reusable Schnorr transcript logic live in @midnight-ntwrk/midnight-did-jubjub-schnorr.
  • The DID contract exposes one ledger-bound SchnorrJubjub verification circuit. It accepts a verification method id, looks up the native JubjubPoint stored in schnorrJubjubVerificationMethods, and verifies against that ledger key rather than a caller-supplied public key.
  • Circuit k, rows, and managed artifact byte sizes are documented in docs-site/compact/index.md.