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

@straiforos/traiforce-sdk

v0.1.0

Published

TypeScript SDK for the Traiforce Protocol ATproto lexicons

Readme

Traiforce-Lexicon

The Trinity of data access and privacy 🔏

Traiforce-Lexicon is the official repository of ATproto lexicon definitions for the Traiforce Protocol — a decentralized layer for private, gated content built on top of the AT Protocol and IPFS (via Pinata).


What is the Traiforce Protocol?

Traiforce enables creators to publish encrypted, subscriber-only content on the open AT Protocol network. It uses a three-layer architecture to separate public discovery metadata, private encrypted content, and access coordination:

| Layer | Technology | Responsibility | |---|---|---| | Public Layer | ATproto PDS | Social metadata, discovery pointers, grant records | | Encrypted / Gated Layer | IPFS via Pinata | Encrypted content blobs, private profile vaults | | Coordination Layer | Gatekeeper | Validates grants, signs identities, issues JWT URLs |

graph LR
    PL["**Public Layer**\n(ATproto PDS)\n\nSocial meta · Discovery\nGrant records"]
    EL["**Encrypted / Gated Layer**\n(IPFS / Pinata)\n\nHigh-bandwidth media\nPrivate profile data"]
    CL["**Coordination Layer**\n(Gatekeeper)\n\nValidates grants\nIssues JWT URLs"]
    Client(["Client Application"])

    PL -->|"metadata & grants"| Client
    EL -->|"encrypted content"| Client
    CL -->|"JWT access URL"| Client

Lexicon Definitions

This repository defines three ATproto lexicon records in the net.traiforce namespace.

net.traiforce.actor.profile

Defines a user's presence on the Traiforce network.

| Field | Type | Description | |---|---|---| | displayName | string | Public-facing teaser name visible to all ATproto users | | vaultCid | string | IPFS CID pointing to the user's encrypted full profile JSON blob | | gatewayUrl | uri | Address of the user's dedicated Pinata Gateway |

net.traiforce.feed.item

A gated content pointer with a safe public preview.

| Field | Type | Description | |---|---|---| | contentCid | string | IPFS hash of the encrypted content (requires authorization to access) | | blurHash | string | BlurHash representation for safe, low-fidelity public previews | | gatekeeperDid | did | DID of the Gatekeeper service clients must contact to obtain access |

net.traiforce.actor.grant

An Access Control List (ACL) entry that authorizes a specific user to access gated content.

| Field | Type | Description | |---|---|---| | subjectDid | did | DID of the user being granted access | | issuerDid | did | DID of the content creator issuing the grant | | signature | string | Cryptographic signature from issuerDid verifying the grant | | expiry | datetime? | Optional expiration timestamp; enforced by the Gatekeeper on every handshake |


Access Workflow

The following is a high-level summary of how a subscriber accesses gated content.

sequenceDiagram
    actor Bob as Bob's Client
    participant Relay as ATproto Relay
    participant GK as Gatekeeper
    participant Pinata as Pinata Gateway

    Bob->>Relay: Fetch feed
    Relay-->>Bob: feed.item (contentCid, blurHash, gatekeeperDid)
    Bob->>GK: Request access challenge
    GK-->>Bob: T_timestamp challenge
    Bob->>GK: Submit signed challenge
    GK-->>Bob: Submarined JWT URL
    Bob->>Pinata: Fetch content via JWT URL
    Pinata-->>Bob: Encrypted content blob

See docs/architecture/03-access-workflow.md for the full step-by-step sequence.


Repository Structure

Traiforce-Lexicon/
├── lexicons/
│   └── net/
│       └── traiforce/
│           ├── actor/
│           │   ├── profile.json     # net.traiforce.actor.profile
│           │   └── grant.json       # net.traiforce.actor.grant
│           └── feed/
│               └── item.json        # net.traiforce.feed.item
└── docs/
    └── architecture/
        ├── 01-protocol-architecture.md
        ├── 02-lexicon-specifications.md
        ├── 03-access-workflow.md
        ├── 04-security-privacy.md
        └── 05-system-overview.md

Documentation

Full architecture documentation is available in docs/architecture/:


Installation

This package is published to the GitHub NPM Registry. Add the following to your project's .npmrc to tell npm where to resolve @straiforos packages:

@straiforos:registry=https://npm.pkg.github.com

Then install the SDK:

npm install @straiforos/traiforce-sdk

Usage

Importing generated lexicon types

import {
  NetTraiforceActorProfile,
  NetTraiforceActorGrant,
  NetTraiforceFeedItem,
} from '@straiforos/traiforce-sdk'

// Use the generated record types
const profile: NetTraiforceActorProfile.Record = {
  displayName: 'Alice',
  vaultCid: 'bafybeiabc123',
  gatewayUrl: 'https://alice.mypinata.cloud',
}

const feedItem: NetTraiforceFeedItem.Record = {
  contentCid: 'bafybeixyz456',
  blurHash: 'LEHV6nWB2yk8pyo0adR*.7kCMdnj',
  gatekeeperDid: 'did:plc:gatekeeper',
}

const grant: NetTraiforceActorGrant.Record = {
  subjectDid: 'did:plc:bob',
  issuerDid: 'did:plc:alice',
  signature: '<cryptographic-signature>',
}

Blinded hash for private likes

import { getBlindedHash } from '@straiforos/traiforce-sdk'

// Compute HMAC-SHA256(creatorDid, contentUri) before storing the engagement
// record on the public ATproto PDS so observers cannot infer subscriptions.
const blindedHash = getBlindedHash('did:plc:alice', 'ipfs://bafybeiabc123')
// Store `blindedHash` instead of the raw contentUri

Contributing

Contributions are welcome! Please read CONTRIBUTING.md for guidelines on how to propose changes, report issues, and submit pull requests.


License

This project is licensed under the MIT License.