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

@tananetwork/auth

v0.1.1

Published

JWT authentication utilities for Tana using Ed25519 signatures

Readme

tana-auth

Authentication and JWT utilities for Tana with Ed25519 signatures.

Status: ✅ TypeScript implementation complete (8/8 tests passing) | ⚙️ Rust implementation ready for WASM compilation

Features

  • User-signed JWTs - Unlike traditional JWTs signed by servers, Tana JWTs are signed by users with their private keys
  • Ed25519 signatures - Same crypto as Tana transactions, compatible with existing key infrastructure
  • Blockchain verification - JWTs are verified against public keys stored on the blockchain (trustless)
  • Dual implementation - Available for both Rust (native) and TypeScript/Bun (WASM)

Architecture

Traditional JWTs use server secrets (HS256) or server keypairs (RS256). Tana uses a different model:

┌─────────────┐                    ┌──────────────┐
│   User      │                    │  Blockchain  │
│             │                    │   (Ledger)   │
│ Private Key │──┐                 │              │
│ Public Key  │  │                 │  Public Key  │
└─────────────┘  │                 └──────────────┘
                 │                        ▲
                 │ Sign JWT               │ Verify
                 │ with private key       │ against public key
                 ▼                        │
        ┌────────────────┐                │
        │      JWT       │────────────────┘
        │  (self-signed) │
        └────────────────┘

This creates a git-like trust model where:

  • Users sign their own credentials
  • The blockchain is the source of truth for identity
  • No central authority can forge JWTs

Installation

Rust

[dependencies]
tana-auth = "0.1"

TypeScript/Bun

npm install @tananetwork/auth
# or
bun add @tananetwork/auth

Usage

TypeScript/Bun

import { create_jwt, verify_jwt } from '@tananetwork/auth'

// Create JWT signed by user's private key
const jwt = create_jwt(
  "ed25519_a1b2c3...",  // user's private key
  "@alice",              // username
  90                     // days until expiration
)

// Verify JWT against user's public key from blockchain
const result = verify_jwt(jwt, "ed25519_d4e5f6...")

if (result.valid) {
  console.log(`JWT valid for user: ${result.username}`)
  console.log(`Expires: ${new Date(result.expires_at * 1000)}`)
} else {
  console.error(`JWT invalid: ${result.error}`)
}

Rust

use tana_auth::{create_jwt, verify_jwt};

// Create JWT signed by user's private key
let jwt = create_jwt(
    "ed25519_a1b2c3...",
    "@alice",
    90
)?;

// Verify JWT
let result = verify_jwt(&jwt, "ed25519_d4e5f6...")?;

if result.valid {
    println!("JWT valid for user: {}", result.username.unwrap());
} else {
    println!("JWT invalid: {}", result.error.unwrap());
}

Integration with Tana CLI

The Tana CLI manages user keys in ~/.config/tana/users/:

# Show current user
tana whoami

# Switch active user
tana use @alice

# Generate JWT for git authentication
tana auth login   # Creates JWT, saves to ~/.config/tana/jwt

The CLI reads the active user's private key from config and creates a JWT that lasts 90 days. This JWT is then used for:

  • Git push/pull authentication
  • API access
  • Build triggers
  • Other automated workflows

JWT Format

Tana JWTs follow standard JWT format with EdDSA algorithm:

{header}.{payload}.{signature}

Header:

{
  "alg": "EdDSA",
  "typ": "JWT"
}

Payload:

{
  "sub": "@alice",      // username
  "iat": 1234567890,    // issued at (Unix timestamp)
  "exp": 1242343890,    // expiration (Unix timestamp)
  "iss": "self"         // always self-signed
}

Signature:

  • Ed25519 signature of SHA-256 hash of {header}.{payload}
  • Signed with user's private key
  • Verified against user's public key from blockchain

Building from Source

Build Rust library

cargo build --release

Build WASM for Node.js/Bun

npm run build
# or
bun run build

Build WASM for browsers

npm run build:web
# or
bun run build:web

Run tests

# Rust tests
cargo test

# WASM tests
bun run test

Publishing

Publish Rust crate

cargo publish

Publish NPM package

npm run build
npm publish

License

Dual-licensed under MIT OR Apache-2.0