← All NIPs

NIP-35

Torrents

DraftEvents

A searchable torrent index on Nostr: kind 2003 lists a torrent's info hash, files, trackers and catalogue ids (IMDb, TMDB…) so anyone can build the magnet link. No torrent files are stored on Nostr.

At a glance

Status
In use and still allowed to change.
Kinds
Tags
  • file
  • i
  • t
  • title
  • tracker
  • x
Last changed
Sep 3, 2024

Try it

Edit the form or the JSON: both stay in sync, the badge says whether the result is valid, and tapping any field explains it.

What to build
Examples
Valid 1 note

Not signed yet · Demo keys only. These personas' secret keys are public on purpose.

Form
Jan 1, 2025, 12:00 AM UTC

Content

A long, pre-formatted description of the torrent.

Tags

  1. title Recommended

    Torrent title.

  2. x Required

    V1 BitTorrent info hash. Required.

  3. file Recommended

    A file inside the torrent.

  4. file Recommended

    A file inside the torrent.

  5. tracker Optional

    A tracker to use for this torrent.

  6. i Optional

    A reference to a catalogue or category.

  7. i Optional

    A reference to a catalogue or category.

  8. i Optional

    A reference to a catalogue or category.

  9. i Optional

    A reference to a catalogue or category.

  10. t Optional

    A general category for browsing.

  11. t Optional

    A general category for browsing.

Add tag

How this NIP works

Step 1 of 5

The info hash is the torrent

The x tag holds the v1 BitTorrent info hash. That is all a client needs to build magnet:?xt=urn:btih:<hash> and start downloading from peers.

In the course

No course chapter covers this NIP yet. The editor above is the quickest way in.

Builds on

See also

Specification

Specification text is quoted in English from the nostr-protocol/nips repository. Our explanations and the interface are translated. Source on GitHub at commit 0046368

Read the spec327 words, quoted from the repository at commit 0046368.

This NIP defined a new kind 2003 which is a Torrent.

kind 2003 is a simple torrent index where there is enough information to search for content and construct the magnet link. No torrent files exist on nostr.

Tags

  • x: V1 BitTorrent Info Hash, as seen in the magnet link magnet:?xt=urn:btih:HASH
  • file: A file entry inside the torrent, including the full path ie. info/example.txt
  • tracker: (Optional) A tracker to use for this torrent

In order to make torrents searchable by general category, you SHOULD include a few tags like movie, tv, HD, UHD etc.

Tag prefixes

Tag prefixes are used to label the content with references, ie. ["i", "imdb:1234"]

  • tcat: A comma separated text category path, ie. ["i", "tcat:video,movie,4k"], this should also match the newznab category in a best effort approach.
  • newznab: The category ID from newznab
  • tmdb: The movie database id.
  • ttvdb: TV database id.
  • imdb: IMDB id.
  • mal: MyAnimeList id.
  • anilist: AniList id.

A second level prefix should be included where the database supports multiple media types.

  • tmdb:movie:693134 maps to themoviedb.org/movie/693134
  • ttvdb:movie:290272 maps to thetvdb.com/movies/dune-part-two
  • mal:anime:9253 maps to myanimelist.net/anime/9253
  • mal:manga:17517 maps to myanimelist.net/manga/17517

In some cases the url mapping isnt direct, mapping the url in general is out of scope for this NIP, the section above is only a guide so that implementers have enough information to succsesfully map the url if they wish.

{
  "kind": 2003,
  "content": "<long-description-pre-formatted>",
  "tags": [
    ["title", "<torrent-title>"],
    ["x", "<bittorrent-info-hash>"],
    ["file", "<file-name>", "<file-size-in-bytes>"],
    ["file", "<file-name>", "<file-size-in-bytes>"],
    ["tracker", "udp://mytacker.com:1337"],
    ["tracker", "http://1337-tracker.net/announce"],
    ["i", "tcat:video,movie,4k"],
    ["i", "newznab:2045"],
    ["i", "imdb:tt15239678"],
    ["i", "tmdb:movie:693134"],
    ["i", "ttvdb:movie:290272"],
    ["t", "movie"],
    ["t", "4k"],
  ]
}

Torrent Comments

A torrent comment is a kind 2004 event which is used to reply to a torrent event.

This event works exactly like a kind 1 and should follow NIP-10 for tagging.

Implementations

  1. dtan.xyz
  2. nostrudel.ninja