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

nzcore

v1.0.0

Published

Personal autonomous Root of Trust - deterministic identity and cryptographic document chain. RFC 8785, Ed25519, BIP-39, logical time, fork detection.

Readme

nzcore 🔐

npm version License: MIT License: Apache 2.0 Node.js Version TypeScript

Personal autonomous Root of Trust - deterministic identity and cryptographic document chain. Built on RFC 8785 (Canonical JSON), Ed25519, BIP-39, logical time, and fork detection.

📋 Table of Contents

✨ Features

  • 🔑 Deterministic Identity - Identity derived solely from BIP-39 mnemonic
  • 📝 Canonical JSON - RFC 8785 compliant for deterministic signatures
  • ⏰ Logical Time - Monotonic counters, no wall-clock dependencies
  • 🔍 Fork Detection - Automatic detection, manual resolution required
  • 🛡️ Memory Safety - Secure zeroization of sensitive data
  • 🔐 Multi-layer Trust - Structural → Cryptographic → Policy validation
  • 🌐 Cross-platform - Works in Node.js and browsers
  • 📦 Zero Dependencies - Only cryptographic libraries

🚀 Installation

From npm

npm install nzcore

From GitHub

git clone https://github.com/NewZoneProject/nzcore.git
cd nzcore
npm install
npm run build

Requirements

  • Node.js 18.0.0 or higher
  • npm 7.0.0 or higher

🏃 Quick Start

1. Create a new identity

import { generateIdentity, NewZoneCore } from 'nzcore';

// Generate random identity (24-word BIP-39 mnemonic)
const { mnemonic, core } = await generateIdentity();
console.log('Mnemonic:', mnemonic); // ⚠️ Store securely!
console.log('Public key:', core.getPublicKeyHex());
console.log('Chain ID:', core.getChainId());

2. Create and sign a document

// Create a document
const doc = await core.createDocument('profile', {
  name: 'Alice',
  email: '[email protected]'
});

console.log('Document ID:', doc.id);
console.log('Signature:', doc.signature);

3. Verify document

const result = await core.verifyDocument(doc);
console.log('Valid:', result.final); // true if valid

4. Export and import state

// Export current chain state
const state = core.exportState();

// Create new instance and import state
const newCore = await NewZoneCore.create(mnemonic);
newCore.importState(state);

// Continue from where you left off
const nextDoc = await newCore.createDocument('profile', {
  name: 'Alice',
  updated: true
});

5. Detect forks

const forks = core.detectFork();
if (forks.length > 0) {
  console.log('⚠️ Fork detected:', forks);
  // Core never resolves forks automatically
}

6. Clean up

// Securely zeroize private key
core.destroy();

📚 API Overview

Core Classes

| Class | Description | | ----- | ----------- | | NewZoneCore | Main entry point for all operations | | Mnemonic | BIP-39 mnemonic generation and validation | | IdentityDerivation | Deterministic key derivation | | DocumentBuilder | Fluent API for document creation | | DocumentValidator | Three-layer validation | | ChainStateManager | Chain state management | | LogicalClock | Monotonic logical time | | ForkDetector | Fork detection utilities |

Key Methods

NewZoneCore.create(mnemonic: string, options?: Options): Promise<NewZoneCore>

Create a new instance from mnemonic.

createDocument(type: string, payload?: object): Promise<Document>

Create and sign a new document.

verifyDocument(document: Document): Promise<ValidationResult>

Verify document through all trust layers.

getChainState(): ChainState

Get current chain state snapshot.

detectFork(): ForkInfo[]

Detect any forks in the chain.

exportState(): Uint8Array

Export chain state for persistence.

importState(state: Uint8Array): void

Import previously exported state.

destroy(): void

Securely zeroize sensitive data.

🛡️ Security

Security Features

  • Deterministic Identity: Identity is a pure function of mnemonic only
  • No External Dependencies: No wall-clock time used for security decisions
  • Memory Zeroization: All sensitive data is overwritten before garbage collection
  • Constant-time Operations: Comparison operations are constant-time
  • Fork Detection: Automatic detection, manual resolution only

Best Practices

  1. Store mnemonic offline: Never store in code or environment variables
  2. Regular backups: Export chain state regularly
  3. Manual fork resolution: Never automate fork resolution
  4. Destroy instances: Always call destroy() when done

📖 Documentation

Generate documentation locally

# Install TypeDoc
npm install --save-dev typedoc

# Generate docs
npm run docs

# Serve docs locally
npx serve docs

🧪 Testing

# Run all tests
npm test

# Run specific test
node --test dist/test/debug.test.js
node --test dist/test/integration.test.js
node --test dist/test/mnemonic-debug.test.js

Test Structure

  • Unit tests: Test individual components
  • Integration tests: Test full workflows
  • Security tests: Verify security properties

🤝 Contributing

We welcome contributions! Please see CONTRIBUTING.md

Development Setup

# Clone repository
git clone https://github.com/NewZoneProject/nzcore.git
cd nzcore

# Install dependencies
npm install

# Build project
npm run build

# Run tests
npm test

# Run linter
npm run lint

Pull Request Process

  1. Fork the repository
  2. Create a feature branch
  3. Write tests for new features
  4. Ensure all tests pass
  5. Update documentation
  6. Submit pull request

📄 License

Dual-licensed under either:

  • MIT License
  • Apache License 2.0

at your option.

🙏 Acknowledgments

📞 Support

Issues: GitHub Issues