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

nostr-over-bt

v1.0.3

Published

High-performance hybrid transport layer for Nostr using BitTorrent for heavy content and DHT for decentralized discovery.

Readme

Nostr-over-BT Header

⚡️ Nostr-over-BT

nostr-over-bt is a high-performance Node.js library that bridges the Nostr protocol with the BitTorrent network. It enables a hybrid transport layer where standard Nostr metadata lives on relays, while heavy content and long-term event storage are offloaded to a decentralized P2P swarm.

🚀 Key Features

  • Hybrid Delivery: Seamlessly fallback between Nostr Relays and BitTorrent Swarms.
  • Infinite Scalability: Offload 99%+ of relay bandwidth to the swarm. Perfect for large media, long-form content, and viral posts.
  • Zero-Relay Discovery: Uses BitTorrent DHT (BEP-44) to find user feeds purely via their public key—no relay connection required for bootstrapping.
  • P2P Web of Trust (WoT): Automatically crawls and discovers events from "friends-of-friends" by traversing the social graph through the DHT.
  • Deterministic Identity: Derive your P2P seeding address directly from your Nostr secret key.
  • Relay Optimized: Includes a reference relay that acts as a "Seeding Bridge," automatically backing up every incoming event to the global BitTorrent DHT.

🎯 What it Achieves

The goal of this library is to solve the two biggest scaling challenges in the Nostr ecosystem:

  1. The Bandwidth Bottleneck: Standard relays are expensive to run because they bear the full cost of data delivery. nostr-over-bt transforms the relay into a notifier, leaving the heavy lifting to the peers who are actually consuming the content.
  2. Relay Silos: In standard Nostr, if a publisher and a follower are on different relays, they cannot see each other. nostr-over-bt creates a Global P2P Index via the DHT, ensuring that as long as you have a user's pubkey, you can find their content anywhere in the world.

📦 Installation

npm install nostr-over-bt

📖 Documentation

🛠 Quick Start (Client)

import { TransportManager, IdentityManager, HybridTransport, NostrTransport, BitTorrentTransport } from 'nostr-over-bt';

// 1. Setup Identity
const id = IdentityManager.fromNostrSecretKey(MY_SECRET_KEY);

// 2. Initialize Transports
const bt = new BitTorrentTransport({ dht: true });
const nostr = new NostrTransport(['wss://relay.damus.io']);
const manager = new TransportManager(new HybridTransport(nostr, bt));

// 3. Publish Hybrid Event
const event = { kind: 1, content: "Hello decentralized world!", ... };
const result = await manager.publish(event); 
// Result contains { magnetUri, relayStatus }

🖥 Relay Integration

Relay operators can use the library to become "Seeding Nodes," ensuring that all events passing through their relay are permanently archived in the BitTorrent network. See examples/relay-server/server.js for a full implementation.

📊 Performance

| Mode | Relay Bandwidth | Reach | Scalability | | :--- | :--- | :--- | :--- | | Standard Nostr | Linear $O(N)$ | Relay-dependent | Medium | | BT-Nostr | Constant $O(1)$ | Universal (DHT) | Infinite |

📜 License

LGPL-2.1