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

@dotprotocol/wrapper

v0.3.0

Published

Wrap any binary protocol (HTTPS, WebSocket, JSON, raw bytes) as a signed, compressed DOT chain.

Readme

@dotprotocol/wrapper

Wrap any binary data as a DOT chain. Legacy bridge for existing binary formats.

npm

Install

npm install @dotprotocol/wrapper

Quick start

import { wrap, unwrap } from '@dotprotocol/wrapper';
import { createKeypair } from '@dotprotocol/core';

const keypair = await createKeypair();

// Wrap a file as a DOT chain
const fileBytes = fs.readFileSync('document.pdf');
const chain     = await wrap(keypair, fileBytes);

// chain is DOT[] — 153-byte DOTs containing the full file
console.log(`${fileBytes.length} bytes → ${chain.length} DOTs`);

// Reconstruct original bytes
const recovered = await unwrap(chain);

How it works

wrap() chunks input bytes into 16-byte payload slices. Each chunk becomes one DOT, cryptographically chained to the previous. The full chain is the original data plus provenance.

[file bytes] → chunks of 16 → [DOT 1] → [DOT 2] → ... → [DOT N]
                                   ↑          ↑               ↑
                              chain hash  chain hash      chain hash

unwrap() reads payloads in order, verifies every link, and reconstructs the original bytes.

API

wrap(keypair, data, options?)

const chain = await wrap(keypair, data, {
  chunkSize: 16,      // bytes per DOT payload (default 16 = max)
  type:      0x00,    // DOT type for all wrapped DOTs
});
// Returns: DOT[]

unwrap(chain)

const bytes = await unwrap(chain);
// Verifies all signatures and chain hashes before returning
// Throws if any DOT is invalid or chain is broken

wrapStream(keypair, readableStream)

import { wrapStream } from '@dotprotocol/wrapper';

const dots = [];
for await (const dot of wrapStream(keypair, fs.createReadStream('big-file.bin'))) {
  dots.push(dot);
}

Use cases

  • Make existing binary files verifiable (who created it, when, has it changed?)
  • Archive files with cryptographic provenance
  • Stream media with tamper detection on every 16-byte chunk
  • Bridge non-DOT-native data into DOT-compatible systems

Storage efficiency

Each 16 bytes of data requires 153 bytes of DOT — a 9.6× overhead. For large files, store the file externally (IPFS, S3) and use a single DOT as an attestation instead:

import { createDOT } from '@dotprotocol/core';
import { sha256 } from '@dotprotocol/core';

const hash    = await sha256(fileBytes);
const pointer = hash.slice(0, 16);        // first 16 bytes of hash
const dot     = await createDOT({ keypair, payload: pointer });
// One DOT = proof of who created the file and when

Use wrap() only when you need the data itself to be chain-verifiable and DOT-portable.

License

MIT