-
Notifications
You must be signed in to change notification settings - Fork 602
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NIP-35: Torrents #1175
NIP-35: Torrents #1175
Conversation
This looks great. however It could be worth mentioning k:2004 events that dtan and noStrudel use for comments on torrents since I think they could be useful for other clients wanting to implement this nip The comment events are similar to kind 1 and follow NIP-10 |
Great NIP! |
looks good, I like the addition of the comments 👍 |
FYI this PR uses Could make sense for |
what about v2? |
v2 is a lot more interesting that v1: merkle torrents so you can incrementally update a torrent file over time while sharing parts, etc. the same file can share seeders across many different torrents. I having been looking at v2 for notedeck file sharing, but it looks like this is hardcoded to v1. |
Is anyone using v2? |
they should be, but it is not widely adopted yet no. |
This comment was marked as spam.
This comment was marked as spam.
it would be useful if the torrent Then nostr clients could open the note as a torrent, allowing you to download individual files from bittorrent or even blossom nodes by looking at file hashes. v2 aligns nicely with blossom because it switches to SHA256 |
Hmm started diving into the spec and the pieces root may not be the same has the file hash, so this may foil my plan to have it compatible with blossom. darn... |
Regardless of that I like the idea of having the metainfo inside the event. |
although one interesting observation is by breaking a file into 16KiB blocks you can always reconstruct the corresponding bittorrent v2 file so a smart blossom seeder that wanted to help seed v2 torrents would:
Notice because of a branching factor of 2, the fact that piece sizes must be powers of 2, and fixed 16KiB block sizes, the root merkle hash never changes, even if the piece size changes. Let's say the client is only missing the 2nd block from the torrent file, we can make a range request against the blossom server for the second block:
Where Then we can hash the response and match it against our torrent metadata Alternatively the blossom node can become a bittorrent peer. Anything uploaded to the blossom server could serve pieces to v2 swarms. bittorrent v1 has the concept of web seeds, so maybe this idea is just extending that to v2 This is getting a bit off topic, but just wanted to put this out for consideration when it comes to torrents + nostr. |
Not a huge fan of Blossom, there is a lot of overlap with NIP96, it would have been nicer to reuse that spec and expand.
Sounds good to me, i can add this to the spec if you still think its a good idea? |
Finally someone said it! Never got people praising blossom. It is a NIP-96 rip-off hurting interop. Blossom spec is exactly the same as NIP-96 but with small changes that bring incompatiblity like Blossom only additions that could be simply added to NIP-96: a route to list uploaded items of a pubkey, a HEAD one to check for an item existence. |
blossom, nip-96, blobstr, it's all the same, the only relevant thing to my proposal above is and endpoint for fetching data in a CAS-way. blobstr is the most minimal that is needed to support this: |
Fair enough, ive been building a Blossom/NIP-96 server over here: https://git.v0l.io/Kieran/void-cat-rs would be cool to trial the bittorrent compat with this. One thing im not sure of is how you get the hash of each file from the torrent, since we're only storing the root hash, do we also need to store the hash of each file? because we have the And once we have a way to link these torrent files which servers would you lookup? |
I think the embedded torrent file should maybe be an optional thing, because some torrent files can be quite large. yeah I think the sha256 hash would be nice to have, bonus points for the v2 file hash (16KiB block sha2 merkle tree with branch factor 2) maybe disregard my crazy idea alltogether, I realize v2 implementations are still far off so probably won't be relevant for awhile, and v1 torrent metadata format is horrible. |
## 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Save the planetnostr, guys! Support #1233 with a 👍? =D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not read through the entirety of #1233 but I think there is merit in having a specific kind for torrent comments and using a simple schema like NIP-10 for marking replies and threads
It seems reasonable that a NIP would define its primary event kind (in this case 2003
) and a comment / reply kind that is specifically used for it. It seems like a better solution then using k
tags as a "meta" kind
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thread roots should be defined by the NIP. Replies can be generalized.
Otherwise, should we have reactions, zap, labels, and report kinds for each NIP as well? Replies are no different than reactions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable, but im not sold on the new tag structure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going to merge anyway, we can always change it later once your PR is merged, nobody is really using comments on torrents yet. I only see 24 comments so far.
Making a NIP for torrents with a few updates
read: https://github.com/nostr-protocol/nips/blob/feat/nip35/35.md