Return-Path: Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 7EA44E93 for ; Sat, 29 Aug 2015 17:19:22 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from resqmta-ch2-06v.sys.comcast.net (resqmta-ch2-06v.sys.comcast.net [69.252.207.38]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id B3BEA103 for ; Sat, 29 Aug 2015 17:19:21 +0000 (UTC) Received: from resomta-ch2-01v.sys.comcast.net ([69.252.207.97]) by resqmta-ch2-06v.sys.comcast.net with comcast id AhKL1r00726dK1R01hKLQP; Sat, 29 Aug 2015 17:19:20 +0000 Received: from crushinator.localnet ([IPv6:2601:186:c000:825e:e9f4:8901:87c7:24a0]) by resomta-ch2-01v.sys.comcast.net with comcast id AhKJ1r0094eLRLv01hKLca; Sat, 29 Aug 2015 17:19:20 +0000 From: Matt Whitlock To: bitcoin-dev@lists.linuxfoundation.org, Richard Moore Date: Sat, 29 Aug 2015 13:19:17 -0400 Message-ID: <205843673.xtKUGbbkqt@crushinator> User-Agent: KMail/4.14.10 (Linux/4.0.5-gentoo; KDE/4.14.11; x86_64; ; ) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1440868760; bh=XQOYIWa6FqIgpO7eRoD4Ijl4PZi2QUDJpji5arQ/9tM=; h=Received:Received:From:To:Subject:Date:Message-ID:MIME-Version: Content-Type; b=r0SlbB75qfGgbW2891ufIN12edu1mA412mAKPcncO2h1GufMPJc0JpRTwMnNdG3YQ 4o6viHSFOPdxBFg4YHzMDxdlw8NeY5bilYO7kOZO1g0F8LCazztqeMeeIQiEJEbPi+ NILkqeG2MuztgFUs79Z91qOZc3and/i9pAbtCzx+RsNjCJss2my7HtGXtN0SrQ4aL5 WbM3ZtYq16FLIhEU/5xYYoiDWLP8c+pyN56YfpC8bzyHybP7AMd/Haq/CNq21B4z1o 0kylRIwoTiU/8Lx4fiGfA7mnqAcIYNQ0Kg2rzqURk7YnC3rTSSerg/oLCc5IJtFujg l9ptNsgLxKKjg== X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: Re: [bitcoin-dev] RFC - BIP: URI scheme for Blockchain exploration X-BeenThere: bitcoin-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Bitcoin Development Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Aug 2015 17:19:22 -0000 bitcoin:12345 *is* a "real" URI. It's just not an absolute, hierarchical URI (a.k.a. a URL); rather, it's an opaque URI. And your suggestion is actually in violation of the URI spec, since "blockhash", "txid", "block", and "address" are not host names. More correct would be: blockchain:?blockhash=00000000000000001003e880d500968d51157f210c632e08a652af3576600198 blockchain:?txid=3b95a766d7a99b87188d6875c8484cb2b310b78459b7816d4dfc3f0f7e04281a blockchain:?block=189000 blockchain:?address=1RicMooMWxqKczuRCa5D2dnJaUEn9ZJyn You should read the URI syntax RFC: https://tools.ietf.org/html/rfc3986 On Saturday, 29 August 2015, at 12:31 pm, Richard Moore via bitcoin-dev wrote: > I like the idea of having a standard for this, that all explorers (and even core, eventually) would understand. > > I would recommend 2 changes though. First, using a real URI scheme, blockchain:// so that we can just use normal URL parsing libraries. The bitcoin: thing leads to additional code to mutate it into a proper URI before passing it to URL parsing. And I think it would be fine to include the type looking up. For example: > > blockchain://blockhash/00000000000000001003e880d500968d51157f210c632e08a652af3576600198 > blockchain://txid/3b95a766d7a99b87188d6875c8484cb2b310b78459b7816d4dfc3f0f7e04281a > blockchain://block/189000 > blockchain://address/1RicMooMWxqKczuRCa5D2dnJaUEn9ZJyn > > I think this would help the URI be more human understandable as well as give the explorers the ability to optimize a bit what they are looking for when hitting various databases. > > A possible future path could also include blockchain://tx/123000/4 for block height, tx index... Another possibility could be blockchain://version which would return a list of supported paths, version of the BIP supported, etc. > > The BIP should also specify little endian searching. I'm not sure, but would it also make sense for this BIP to include what the return results should look like? Maybe another, related BIP. > > > On Aug 29, 2015, at 7:48 AM, Marco Pontello via bitcoin-dev wrote: > > > > Hi! > > My first post here, hope I'm following the right conventions. > > I had this humble idea for a while, so I thought to go ahead and propose > > it. > > > > BIP: XX > > Title: URI scheme for Blockchain exploration > > Author: Marco Pontello > > Status: Draft > > Type: Standards Track > > Created: 29 August 2015 > > > > Abstract > > ======== > > This BIP propose a simple URI scheme for looking up blocks, transactions, > > addresses on a Blockchain explorer. > > > > Motivation > > ========== > > The purpose of this URI scheme is to enable users to handle all the > > requests for details about blocks, transactions, etc. with their preferred > > tool (being that a web service or a local application). > > > > Currently a Bitcoin client usually point to an arbitrary blockchain > > explorer when the user look for the details of a transaction (es. Bitcoin > > Wallet use BitEasy, Mycelium or Electrum use Blockchain.info, etc.). > > Other times resorting to cut&paste is needed. > > The same happens with posts and messages that reference some particular > > txs or blocks, if they provide links at all. > > > > Specification > > ============= > > The URI follow this simple form: > > > > blockchain: > > > > Examples: > > > > blockchain:00000000000000001003e880d500968d51157f210c632e08a652af3576600198 > > blockchain:001949 > > blockchain:3b95a766d7a99b87188d6875c8484cb2b310b78459b7816d4dfc3f0f7e04281a > > > > Rationale > > ========= > > I thought about using some more complex scheme, or adding qualifiers to > > distinguish blocks from txs, but in the end I think that keeping it simple > > should be practical enough. Blockchain explorers can apply the same > > disambiguation rules they are already using to process the usual search > > box. > > > > From the point of view of a wallet developer (or other tool that need to > > show any kind of Blockchain references), using this scheme mean that he > > can simply make it a blockchain: link and be done with it, without having > > to worry about any specific Blockchain explorer or provide a means for the > > user to select one. > > > > Blockchain explorers in turn will simply offer to handle the blockchain: > > URI, the first time the user visit their website, or launch/install the > > application, or even set themselves if there isn't already one. > > > > Users get the convenience of using always their preferred explorer, which > > can be especially handy on mobile devices, where juggling with cut&paste > > is far from ideal.