Re: [Uri-review] Review request for gittorrent: URI scheme

"Roy T. Fielding" <fielding@gbiv.com> Wed, 06 April 2016 22:07 UTC

Return-Path: <fielding@gbiv.com>
X-Original-To: uri-review@ietfa.amsl.com
Delivered-To: uri-review@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C657612D149 for <uri-review@ietfa.amsl.com>; Wed, 6 Apr 2016 15:07:56 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.579
X-Spam-Level:
X-Spam-Status: No, score=-1.579 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, URI_HEX=1.122] autolearn=no autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=gbiv.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1Y3guEq8gY9J for <uri-review@ietfa.amsl.com>; Wed, 6 Apr 2016 15:07:54 -0700 (PDT)
Received: from homiemail-a29.g.dreamhost.com (sub4.mail.dreamhost.com [69.163.253.135]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 50A4B12D0A3 for <uri-review@ietf.org>; Wed, 6 Apr 2016 15:07:54 -0700 (PDT)
Received: from homiemail-a29.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a29.g.dreamhost.com (Postfix) with ESMTP id DE21D6740F9; Wed, 6 Apr 2016 15:07:52 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gbiv.com; h=content-type :mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=gbiv.com; bh=8uZHGjb/QoKmoXVNuBvA/XPuPaw=; b=VA7auwVJm8oaY44Qd//CBFqtoF5u EW6hB6DSLgGqxLckcxta7kKxw8FbsiekODmLyyZek1Db28QRtgGGqzTz7QVjm7BU FoxO+LtW3j0ujNvpvGwv6MH4jhSt7WOWwtsEG0RAv64pTPxOS7tzgNjgcEkDy8vp WxWDvAva8xGcqy4=
Received: from [192.168.1.2] (ip68-228-71-159.oc.oc.cox.net [68.228.71.159]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: fielding@gbiv.com) by homiemail-a29.g.dreamhost.com (Postfix) with ESMTPSA id 38577674070; Wed, 6 Apr 2016 15:07:52 -0700 (PDT)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\))
From: "Roy T. Fielding" <fielding@gbiv.com>
In-Reply-To: <1459917673.611180.570333121.28B1D0E7@webmail.messagingengine.com>
Date: Wed, 06 Apr 2016 15:07:50 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <8B5D1B49-EA98-4957-8BB2-B73C27018B7B@gbiv.com>
References: <1459739409.1809977.567878170.34FFAB67@webmail.messagingengine.com> <1459917673.611180.570333121.28B1D0E7@webmail.messagingengine.com>
To: Chris Rebert <iana.url.schemes.gittorrent@chrisrebert.com>
X-Mailer: Apple Mail (2.2104)
Archived-At: <http://mailarchive.ietf.org/arch/msg/uri-review/CzBStbArDwm1EQo_hGlrk-_9SCY>
Cc: uri-review@ietf.org
Subject: Re: [Uri-review] Review request for gittorrent: URI scheme
X-BeenThere: uri-review@ietf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: Proposed URI Schemes <uri-review.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/uri-review>, <mailto:uri-review-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/uri-review/>
List-Post: <mailto:uri-review@ietf.org>
List-Help: <mailto:uri-review-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/uri-review>, <mailto:uri-review-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 06 Apr 2016 22:07:57 -0000

> On Apr 5, 2016, at 9:41 PM, Chris Rebert <iana.url.schemes.gittorrent@chrisrebert.com> wrote:
> 
> On Sun, Apr 3, 2016, at 08:10 PM, Chris Rebert wrote:
>> Hello,
>> 
>> Per the advice of RFC 7595, I hereby present the following proposed
>> registration of the "gittorrent" provisional URI scheme for review.
>> Any feedback is greatly appreciated. Thanks.
> 
> Here's a revised draft based on the feedback thus far.
> 
> Cheers,
> Chris
> ****
> http://chrisrebert.com
> Browser 🐛 of the day:
> https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/7124038/
> 
> ********
> 
> Scheme name:  gittorrent
> 
> Status:  Provisional
> 
> Applications/protocols that use this scheme name:
>  GitTorrent ("A decentralization of GitHub using BitTorrent and
>  Bitcoin")
> 
> Contact:
>  Scheme creator:
>    Chris Ball <http://printf.net/>
>  Registering party:
>    Chris Rebert <iana.url.schemes.gittorrent@chrisrebert.com>
> 
> Change controller:
>  Either the scheme creator or the registering party.
> 
> References:
>  Ball, C., "Announcing GitTorrent: A Decentralized GitHub", 29 May
>  2015,
>      <http://blog.printf.net/articles/2015/05/29/announcing-gittorrent-a-decentralized-github/>.
>  Ball, C., "GitTorrent", 2016, <http://gittorrent.org/>.
>  Ball, C., "GitTorrent", 2016, <https://github.com/cjb/GitTorrent>.
>  Bernstein, D. J., Duif, N., Lange, T., Schwabe, P., and B. Yang,
>      "Ed25519: high-speed high-security signatures", 27 September 2011,
>      <https://ed25519.cr.yp.to/>.
>  Bitcoin Project, "Bitcoin - Open source P2P money", 2016,
>      <https://bitcoin.org/en/>.
>  Bray, T., Ed., "The JavaScript Object Notation (JSON) Data Interchange
>      Format", RFC 7159, March 2014.
>  Cohen, B., "BEP 3: The BitTorrent Protocol Specification", 11 October
>  2013,
>      <http://www.bittorrent.org/beps/bep_0003.html>.
>  Eastlake 3rd, D. and P. Jones, "US Secure Hash Algorithm 1 (SHA1)",
>  RFC 3174,
>      September 2001.
>  "Git", 2016, <https://git-scm.com/>.
> 
> Scheme syntax:
>  This scheme uses a profile of the RFC 3986 generic URI syntax.
> 
>  At the time of writing this registration, a gittorrent URI comes in
>  one of
>  three forms:
> 
>    0. Where the "authority" component is a domain name
>      Example:  gittorrent://github.com/cjb/recursers
>      The "path" and "query" components have no extra restrictions.
> 
>    1. Where the "authority" component is a 40-byte hexadecimal number
>    (the
>       conventional representation of a SHA-1 hash digest)
>      Example: 
>      gittorrent://81e24205d4bac8496d3e13282c90ead5045f09ea/recursers
>      In this case, the "query" component is not permitted, and
>      the "path" component consists of exactly one segment (the Git
>      repository
>      name).
> 
>    2. Where the "authority" is a username
>      Example:  gittorrent://cjb/foo
>      In this case, the "query" component is not permitted, and
>      the "path" component consists of exactly one segment (the Git
>      repository
>      name).
> 
>  There may be further restrictions on the format of usernames and
>  repository
>  names.
> 
>  Given the youth of the GitTorrent project, additional gittorrent: URI
>  forms
>  might be defined in the future, and the interpretation of the existing
>  forms
>  could potentially be changed.  Implementors SHOULD consult the
>  GitTorrent
>  project for the most up-to-date information on gittorrent: URIs, as
>  there is
>  currently no de jure standard for them.  This third-party URI scheme
>  registration is based on the GitTorrent reference implementation's
>  documentation at the time of writing.
> 
> Scheme semantics:
>  gittorrent URIs represent Git repositories and specify the metadata
>  necessary
>  to clone a repository, to read the repository's commits, and, with the
>  necessary cryptographic key, to write commits to the repository.
> 
>  See the GitTorrent project for full details.
>  The following is a summary of read-only usage when cloning the
>  repository:
> 
>  In URIs of type (0), the SHA-1 hash identifier of the latest commit of
>  the
>  primary branch is fetched via the git protocol, as if this had been a
>  git:
>  URI.  The actual data for that commit (and its ancestors, if
>  necessary) is
>  then downloaded via BitTorrent.

I think that is unnecessary and confusing.  Just use the git URI for identification
of this resource and something else (markup, configuration, command-line, ... another URI)
to indicate that BitTorrent is the protocol used to retrieve it.  This is no different
from the various schemes that can be proxied over HTTP by defining environment variables
or other config properties.

>  In URIs of type (1), the SHA-1 hash in the "authority" component is
>  used as a
>  key for a lookup in a BitTorrent DHT (distributed hash table).  The
>  value
>  obtained from the lookup is a JSON object representing a GitTorrent
>  user
>  profile, which includes the names of that user's repositories, the
>  names of
>  those repositories' git refs, and the SHA-1 hash identifiers of the
>  commits
>  that those refs currently point to.  The "path" component is the name
>  of the
>  repository, and is used to look up the corresponding SHA-1 hash commit
>  identifier of the primary branch of the repository in the user
>  profile.  The
>  actual data for that commit (and its ancestors, if necessary) is then
>  downloaded via BitTorrent.

The authority component is for identification of name-based authorities,
as in (0).  Using it two different ways for the same scheme would be a
very bad idea. Likewise, restricting the path to one name means it isn't
hierarchical, so there is no reason for it to be a path.  Just use

    gittorrent:81e24205d4bac8496d3e13282c90ead5045f09ea?recursers

to be distinct from other URI forms, or see below for a single format.

>  In URIs of type (2), the username in the "authority" component is used
>  for an
>  OP_RETURN transaction lookup in Bitcoin's blockchain.  If successful,
>  this
>  lookup yields a SHA-1 hash which is then used as a key for a lookup in
>  a
>  BitTorrent DHT (distributed hash table).  The value obtained from the
>  lookup
>  is a JSON object representing a GitTorrent user profile (as described
>  in the
>  previous paragraph).  The "path" component is the name of the
>  repository, and
>  is used to look up the corresponding SHA-1 hash commit identifier for
>  the
>  primary branch of the repository in the user profile.  The actual data
>  for
>  that commit (and its ancestors, if necessary) is then downloaded via
>  BitTorrent.

There is no need for this to be a separate type of URI.  Just do

    gittorrent:cjb?foo

and it is type (1) with a mechanical distinction (usernames are not hashes).

Alternatively, you can merge all three forms into a singular format that
is consistent with the generic URI syntax, as in

    "gittorrent:" [ "//" [ username "@" ] [ authority ] ] path [ "?" sha1 ]

and just exclude the parts that aren't needed for a given identifier.
 

Note that the above are just comments based on the registration.  IMO, the
system reflects a misunderstanding of how URIs ought to be used as identifiers,
and how representations (or redirections, if available) ought to refer to
other resources.  IOW, what you really should have is a media type definition
of the "JSON object representing a GitTorrent user profile" and then define various
ways of accessing such a representation in the form of schemes for torrent,
http(s), blockchain, etc.  In that case, a fragment can be used for the types
of indirection used above.

....Roy