Open lovvtide opened 1 year ago
Looks solid :+1:
I'd suggest to specify a recommended host after a hash kind since a recommended host should be optional.
{
"created_at": 1679552101,
"content": "",
"kind": 2001,
"tags": [
[
"x",
"a19a70552cc801415a6071993c04b3ab21572438",
"torrent",
"https://media.satellite.earth/torrent"
],
[
"x",
"bafybeia7fsunya52qm2ov3wqtrv2andjjk3nqo273a3clpm76roypqgefq",
"ipfs",
"https://ipfs.io/ipfs"
],
[
"m",
"video/mp4"
],
[
"name",
"Watts.mp4"
],
[
"size",
"26685219"
]
],
"pubkey": "fbd992dbccdd4186f4ef25b7d72ea47387a59227493f8569b17963afae4e4d33",
"id": "faea2a5dbe12c877c1201e91ec909e3161a1ba8714fdca4d3077f6d4b0780191",
"sig": "10c0d634ea0b9ae085205c3951367da784268a0cdf4a18b969aba7c06b1a59abf96b7f5f4e2d3791389dff71ff5527c33e3405e8decad9b3e4419406124dc46a"
}
I'd suggest to specify a recommended host after a hash kind since a recommended host should be optional.
This was my first thought as well. The only reason I suggested making the order ["x", <hash>, <host>, <marker>]
instead of ["x", <hash>, <marker>, <host>]
was to parallel the way that markers are used to describe e
tags according to NIP-10 (https://github.com/nostr-protocol/nips/blob/master/10.md), e.g. ["e", <event-id>, <relay-url>, "reply"]
. I do agree that it would be more efficient to place the recommended host as the final element so that it could be optionally omitted, but I wonder, do you think it's worth it to tolerate having an empty string sometimes to remain consistent with this pattern?
do you think it's worth it to tolerate having an empty string sometimes to remain consistent with this pattern?
Let's raise that question after submitting a NIP and leave that up to community to decide.
Alright. When submitting the NIP let's go with host last as you suggest, and we can refer to this issue.
Note: The following is premised on the existence of a standalone event kind for file metadata. (See https://github.com/lovvtide/nostr-torrent/issues/2) Also note that kind
9
to denote a media event in the following examples has been replaced by kind2001
(See See https://github.com/lovvtide/nostr-torrent/issues/1)Currently
Here's an example of a media event in the current proposal:
In the above example, we have four tags:
i
tag that contains the torrent infohash of the file along with a recommended host for the client to download itm
tag that contains the file's mime typename
tag that contains the filenamesize
tag that contains the file's length in bytesProposed Restructuring
It would be nice if the event could support multiple content-addressing schemes. Here's how that could work — basically each hash has its own tag, and the tag includes a marker to indicate what kind of hash it is, i.e. how the client should handle it.
What's changed?
1) The
i
tag has been renamed tox
to reflect that the tag doesn't necessarily refer to a torrent "infohash" but rather a "hash" more generally. 2) There are now twox
tags, one with the torrent infohash of the file and another with the ipfs hash of the file. It should be noted that including an ipfs hash (or any other hash) is entirely optional and is just used as an example. The goal is to support optional additional content-addressing schemes to increase redundancy and therefore censorship resistance. There can be any number of different hashes of the same file, each with its ownx
tag and recommended host. 3) A marker referring to the content addressing scheme (i.e.torrent
oripfs
) is included as the fourth element of eachx
tag so the client knows what to do with the value of the tag. (this ordering of values intentionally imitates the way that markers are used to discriminate between e tags as described by NIP-10). We can start with justtorrent
andipfs
but it would be a good idea to have a canonical list of markers in the NIP and continue updating that list if/when consensus forms around new content-addressing protocols.