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

@atcute/did-plc

v0.3.2

Published

validations, type definitions and schemas for did:plc operations

Readme

@atcute/did-plc

validate, sign, and interact with did:plc operations.

npm install @atcute/did-plc

did:plc is a self-certifying DID method where the audit log serves as the source of truth. this package validates that operations are properly signed and chained, and provides utilities for creating and submitting new operations.

usage

using the client

import { PlcClient } from '@atcute/did-plc';

const client = new PlcClient();

// fetch DID document
const doc = await client.getDocument('did:plc:ragtjsm2j2vknwkz3zp4oxrd');

// fetch current identity state
const state = await client.getState('did:plc:ragtjsm2j2vknwkz3zp4oxrd');

// fetch operation log
const log = await client.getOperationLog('did:plc:ragtjsm2j2vknwkz3zp4oxrd');

// fetch last operation
const lastOp = await client.getLastOperation('did:plc:ragtjsm2j2vknwkz3zp4oxrd');

// submit a signed operation
await client.submitOperation('did:plc:ragtjsm2j2vknwkz3zp4oxrd', signedOperation);

signing operations

import { signOperation, signTombstone, deriveDidFromGenesisOp } from '@atcute/did-plc';

// sign an unsigned operation
const signedOp = await signOperation(unsignedOp, rotationKey);

// sign a tombstone
const signedTombstone = await signTombstone(unsignedTombstone, rotationKey);

// derive did:plc from genesis operation
const did = await deriveDidFromGenesisOp(signedGenesisOp);

validating audit logs

import { defs, processIndexedEntryLog } from '@atcute/did-plc';

const did = 'did:plc:ragtjsm2j2vknwkz3zp4oxrd';

const response = await fetch(`https://plc.directory/${did}/log/audit`);
const json = await response.json();

const logs = defs.indexedEntryLog.parse(json);
const { canonical, nullified } = await processIndexedEntryLog(did, logs);

validating new operations

before submitting a new operation to plc.directory:

import { validateIncomingOp } from '@atcute/did-plc';

// throws if operation exceeds size limits or has invalid structure
validateIncomingOp(operation);

checking dispute windows

import { isDisputePeriodActive, getDisputeCandidates } from '@atcute/did-plc';

// assuming `canonical` from processIndexedEntryLog result above

// find operations that a rotation key can dispute
const candidates = getDisputeCandidates(canonical, 'did:key:z...');

// check if a specific operation can still be disputed (72-hour window)
const entry = canonical.at(-1);
if (entry && isDisputePeriodActive(entry)) {
	// entry is still within the dispute window
}