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

did-jis

v0.1.1

Published

JIS (JTel Identity Standard) - Bilateral consent and intent verification with TIBET provenance trails

Readme

did-jis

npm version IETF Draft IETF Draft License: MIT

JIS (JTel Identity Standard) - Bilateral consent and intent verification with TIBET provenance trails.

"Other DIDs prove who you are. did:jis proves both parties agreed to what happened."

Features

  • Bilateral Consent - Both parties must agree; cryptographic proof for each
  • TIBET Provenance - Full audit trail: WHAT, WITH, WHERE, WHY (WWWw)
  • Intent Verification - Not just identity, but why this action
  • W3C/IETF Compatible - Works with Verifiable Credentials ecosystem
  • Browser & Node.js - ESM and CommonJS builds included
  • Zero Dependencies - Lightweight, secure, auditable

Installation

npm install did-jis
yarn add did-jis
pnpm add did-jis

Quick Start

Bilateral Consent Flow

import { createBilateralConsent, createDID } from 'did-jis';

// Create DIDs for both parties
const aliceDid = createDID('alice');
const bobDid = createDID('bob');

// Alice proposes sharing data with Bob
const { proposal, accept, reject } = await createBilateralConsent({
  from: aliceDid,
  to: bobDid,
  action: 'share-health-records',
  purpose: 'Medical consultation'
});

console.log('Proposal token:', proposal.token.tokenId);

// Bob accepts - both now have cryptographic proof
const response = await accept();
console.log('Consent accepted:', response.token);

TIBET Provenance Tokens

import { TIBET } from 'did-jis';

const tibet = new TIBET('did:jis:myapp');

// Create a token with full WWWw provenance
const token = await tibet.createToken({
  type: 'audit',
  what: 'User logged in',
  with: ['did:jis:user123', 'did:jis:auth-service'],
  where: { ip: '192.168.1.1', device: 'mobile' },
  why: 'Session initialization'
});

// Verify the token
const result = await tibet.verify(token.tokenId);
console.log('Valid:', result.valid);
console.log('Trust score:', result.trustScore);

// Get full provenance chain
const chain = tibet.getChain(token.tokenId);
console.log('Chain length:', chain?.length);

DID Document Builder

import { DIDDocumentBuilder, createDID } from 'did-jis';

const did = createDID('company', 'employee', '42');

const doc = new DIDDocumentBuilder(did)
  .addVerificationMethod({
    id: `${did}#key-1`,
    type: 'JsonWebKey2020',
    controller: did,
    publicKeyJwk: { /* your JWK */ }
  })
  .addConsentService('https://api.company.com/consent')
  .addTibetService('https://api.company.com/tibet')
  .build();

console.log(JSON.stringify(doc, null, 2));

WWWw Provenance Model

TIBET uses the WWWw model for complete provenance:

| Term | Dutch | English | Description | |------|-------|---------|-------------| | WHAT | ERIN | Within | What's inside - the content/action itself | | WITH | ERAAN | Attached | What's linked - dependencies, references | | WHERE | EROMHEEN | Around | Context - environment, circumstances | | WHY | ERACHTER | Behind | Intent - purpose, reason |

// Every TIBET token captures all four dimensions
const token = await tibet.createToken({
  type: 'bilateral_consent',
  what: 'Share medical records',        // WHAT is happening
  with: ['did:jis:patient', 'did:jis:doctor'], // WITH whom
  where: { hospital: 'General', dept: 'Cardiology' }, // WHERE/context
  why: 'Treatment planning for cardiac procedure'     // WHY
});

API Reference

TIBET Class

const tibet = new TIBET(actorDid?: string);

// Create token
await tibet.createToken({ type, what, with?, where?, why, ... });

// Verify token
await tibet.verify(tokenOrId);

// Get provenance chain
tibet.getChain(tokenId);

// Update state
tibet.updateState(tokenId, newState);

// List tokens
tibet.listTokens({ type?, state?, actor? });

BilateralConsentManager

const manager = new BilateralConsentManager(actorDid?: string);

// Propose consent
await manager.propose({ from, to, action, purpose, context?, expiresIn? });

// Accept proposal
await manager.accept(proposalId, acceptorDid);

// Reject proposal
await manager.reject(proposalId, rejectorDid, reason?);

// Verify consent
await manager.verifyConsent(tokenId);

DID Utilities

// Create a DID
createDID('alice');                    // 'did:jis:alice'
createDID('org', 'dept', '123');       // 'did:jis:org:dept:123'

// Parse a DID
parseDID('did:jis:alice');             // { method: 'jis', id: 'alice' }

// Validate a DID
isValidDID('did:jis:alice');           // true
isValidDID('invalid');                 // false

Use Cases

Cookie Consent with Audit Trail

const { proposal, accept } = await createBilateralConsent({
  from: 'did:jis:website',
  to: 'did:jis:visitor-' + visitorId,
  action: 'set-analytics-cookies',
  purpose: 'Website analytics for improving user experience'
});

// Store proposal token as proof of consent request
// When user clicks "Accept", call accept()

API Authentication with Intent

const token = await tibet.createToken({
  type: 'verification',
  what: { endpoint: '/api/user/data', method: 'GET' },
  with: ['did:jis:client-app', 'did:jis:api-server'],
  where: { timestamp: Date.now(), requestId: uuid() },
  why: 'Fetch user profile for dashboard display'
});

// Include token in API request headers
headers['X-TIBET-Token'] = token.tokenId;

GDPR-Compliant Data Sharing

const consent = await createBilateralConsent({
  from: 'did:jis:data-controller',
  to: 'did:jis:user-' + userId,
  action: 'share-with-third-party',
  purpose: 'Share anonymized data with research partner',
  context: {
    dataCategories: ['usage-statistics'],
    recipient: 'Research University',
    retention: '24 months'
  }
});

IETF Specifications

This library implements:

Related

License

MIT - see LICENSE

Authors


Built with bilateral consent by Humotica

One love, one fAmIly