From f03c7bb90ac854f711eaf03574cc210051164299 Mon Sep 17 00:00:00 2001 From: Marco Pontello Date: Tue, 5 Jan 2016 02:58:30 +0100 Subject: [PATCH] Reworked layout, clarified chain ID. --- bip-MarcoPon-BlockchainURI.mediawiki | 69 +++++++++++++++++-------- bip-MarcoPon-BlockchainURI/chainid.png | Bin 0 -> 2967 bytes 2 files changed, 48 insertions(+), 21 deletions(-) create mode 100644 bip-MarcoPon-BlockchainURI/chainid.png diff --git a/bip-MarcoPon-BlockchainURI.mediawiki b/bip-MarcoPon-BlockchainURI.mediawiki index 8da74dbc3a..1897326b50 100644 --- a/bip-MarcoPon-BlockchainURI.mediawiki +++ b/bip-MarcoPon-BlockchainURI.mediawiki @@ -21,45 +21,73 @@ The same happens with posts and messages that reference some particular txs or b ==Specification== -The URI follow this simple form: +The URI follow this form: blockchain:[//chain] Where: -;chain: -: (optional) to uniquely point to a specific chain, the hash of the corresponding genesis block is used (leading zeros included). For forked chains, the hash of the relevant first block after fork is used. In principle some kind of alias/mnemonic could also be used, but that is out of the scope of this BIP, and maybe could be developed in another subsequent one. If omitted (which would be the usual case), Bitcoin's mainnet is assumed. As a reference, see for example this code fragment from Bitcoin chainparams.cpp source: - const std::map CChainParams::supportedChains = - boost::assign::map_list_of - ( "main", uint256S("0x000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f")) - ( "test", uint256S("0x000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943")) - ( "regtest", uint256S("0x0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206")) - ; +{| class="wikitable" +! style="text-align: center;" | Element +! colspan="2" style="text-align: center;" | Description +! +|- +| chain +| colspan="2" | '''chain ID''' (see below) of the desired chain, leading 0s included. If omitted (which would be the usual case), Bitcoin main net is assumed. +| optional +|- +| rowspan="3" | type +| tx +| for transactions. +| rowspan="3" | +|- +| block +| for blocks (supports both hash or height). +|- +| address +| for addresses. +|- +| hash +| colspan="2" | the relevant hash to refer to (leading zeros included), or block height. +| +|} + +---- +===Definition of chain ID=== + +The '''chain ID''' of a chain is the block hash of the corresponding genesis block. For forked chains, it's the block hash of the first block after fork. + +So, for example: +
+Bitcoin main   : 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f 
+Bitcoin test   : 000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943
+Bitcoin regtest: 0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206 
+
+An example of forked chain (Feathercoin, that forked Litecoin): + -;type: -: '''tx''': for transactions. -: '''block''': for blocks (supports both hash or height). -: '''address''': for addresses. +
+Litecoin   : 12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2
+Feathercoin: fdbe99b90c90bae7505796461471d89ae8388ab953997aa06a355bbda8d915cb
+
-;hash: -: the relevant hash to refer to (leading zeros included), or block height. ==Examples== -A transaction on Bitcoin's mainnet: +A transaction on Bitcoin main net: blockchain:/tx/b462ae6eb8bdae2e060239a2a3ea5d9c3e0f9ef34d9717beb2dcf0ed42cee7da -A block on Bitcoin's mainnet: +A block on Bitcoin main net: blockchain:/block/00000000000000000119af5bcae2926df54ae262e9071a94a99c913cc217cc72 or blockchain:/block/372338 -An address on Bitcoin's mainnet: +An address on Bitcoin main net: blockchain:/address/16EW6Rv9P9AxFDBrZV816dD4sj1EAYUX3f -A transaction on Bitcoin's testnet: +A transaction on Bitcoin test net: blockchain://000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943/tx/3b95a766d7a99b87188d6875c8484cb2b310b78459b7816d4dfc3f0f7e04281a ==Rationale== @@ -77,5 +105,4 @@ Thanks to Richard Moore, Matt Whitlock, Andreas Schildbach for suggestions about ==Copyright== -This document is placed in the public domain. - +This document is placed in the public domain. \ No newline at end of file diff --git a/bip-MarcoPon-BlockchainURI/chainid.png b/bip-MarcoPon-BlockchainURI/chainid.png new file mode 100644 index 0000000000000000000000000000000000000000..ab6957ab2d059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