public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
From: "Luke-Jr" <luke@dashjr.org>
To: bitcoin-development@lists.sourceforge.net
Subject: Re: [Bitcoin-development] Version bytes "2.0"
Date: Tue, 6 Dec 2011 16:28:16 -0500	[thread overview]
Message-ID: <201112061628.18634.luke@dashjr.org> (raw)
In-Reply-To: <201112061610.41083.luke@dashjr.org>

Some bugs I found in my spec so far:
- Bitcoin public keys begin with '2' (same as testnet data)
- For the first first-class "aux" network, signatures and private keys will
  start with the same character.
- More "collisions" are possible if the "reserved" values were ever assigned.

To address these slightly better, here's a revised proposal:
* Bits 128/64 define network class
** 0 = main network
** 64,128 = reserved
** 192 = test network
* Bits 32/16 define network
** 0 = Bitcoin
** 16,32 = reserved
** 48 = OTHER (next octet)
* Bits 8/4/2 define data class
** 0 = Public key hash
** 2 = reserved
** 4 = Script hash
** 6 = Public key (raw)
** 8 = Signature
** 10 = reserved
** 12 = Private key (raw)
** 14 = OTHER (next octet)
* Bit 1 is freely chosen (for aesthetic assignment)

Note that under this scheme, both script hashes and raw public keys begin with 
'3'; I consider this a non-issue since neither are supported by current-
generation clients, and both pubkey-hash and script-hash are quite capable of 
the same functionality as a raw public key. Also, the raw public key will 
presumably be noticably longer.

For reference, a table of version number to first-base58-char mappings:
+........   0 => 1
-.......1   1 => QRSTUVWXYZabcdefghijkmno
-......1.   2 => 2opqrstuvwxyz
+......11   3 => 2
-.....1..   4 => 23
+.....1.1   5 => 3
+.....11.   6 => 3
-.....111   7 => 34
+....1...   8 => 4
-....1..1   9 => 45
+....1.1.  10 => 5
+....1.11  11 => 5
-....11..  12 => 56
+....11.1  13 => 6
-....111.  14 => 67
+....1111  15 => 7
+...1....  16 => 7
-...1...1  17 => 78
+...1..1.  18 => 8
-...1..11  19 => 89
+...1.1..  20 => 9
+...1.1.1  21 => 9
-...1.11.  22 => 9A
+...1.111  23 => A
-...11...  24 => AB
+...11..1  25 => B
+...11.1.  26 => B
-...11.11  27 => BC
+...111..  28 => C
-...111.1  29 => CD
+...1111.  30 => D
+...11111  31 => D
-..1.....  32 => DE
+..1....1  33 => E
-..1...1.  34 => EF
+..1...11  35 => F
+..1..1..  36 => F
-..1..1.1  37 => FG
+..1..11.  38 => G
-..1..111  39 => GH
+..1.1...  40 => H
+..1.1..1  41 => H
-..1.1.1.  42 => HJ
+..1.1.11  43 => J
-..1.11..  44 => JK
+..1.11.1  45 => K
+..1.111.  46 => K
-..1.1111  47 => KL
+..11....  48 => L
-..11...1  49 => LM
+..11..1.  50 => M
+..11..11  51 => M
-..11.1..  52 => MN
+..11.1.1  53 => N
-..11.11.  54 => NP
+..11.111  55 => P
+..111...  56 => P
-..111..1  57 => PQ
+..111.1.  58 => Q
-..111.11  59 => QR
+..1111..  60 => R
+..1111.1  61 => R
-..11111.  62 => RS
+..111111  63 => S
-.1......  64 => ST
+.1.....1  65 => T
+.1....1.  66 => T
-.1....11  67 => TU
+.1...1..  68 => U
-.1...1.1  69 => UV
+.1...11.  70 => V
+.1...111  71 => V
-.1..1...  72 => VW
+.1..1..1  73 => W
-.1..1.1.  74 => WX
+.1..1.11  75 => X
+.1..11..  76 => X
-.1..11.1  77 => XY
+.1..111.  78 => Y
-.1..1111  79 => YZ
+.1.1....  80 => Z
+.1.1...1  81 => Z
-.1.1..1.  82 => Za
+.1.1..11  83 => a
-.1.1.1..  84 => ab
+.1.1.1.1  85 => b
-.1.1.11.  86 => bc
+.1.1.111  87 => c
+.1.11...  88 => c
-.1.11..1  89 => cd
+.1.11.1.  90 => d
-.1.11.11  91 => de
+.1.111..  92 => e
+.1.111.1  93 => e
-.1.1111.  94 => ef
+.1.11111  95 => f
-.11.....  96 => fg
+.11....1  97 => g
+.11...1.  98 => g
-.11...11  99 => gh
+.11..1.. 100 => h
-.11..1.1 101 => hi
+.11..11. 102 => i
+.11..111 103 => i
-.11.1... 104 => ij
+.11.1..1 105 => j
-.11.1.1. 106 => jk
+.11.1.11 107 => k
+.11.11.. 108 => k
-.11.11.1 109 => km
+.11.111. 110 => m
-.11.1111 111 => mn
+.111.... 112 => n
+.111...1 113 => n
-.111..1. 114 => no
+.111..11 115 => o
-.111.1.. 116 => op
+.111.1.1 117 => p
+.111.11. 118 => p
-.111.111 119 => pq
+.1111... 120 => q
-.1111..1 121 => qr
+.1111.1. 122 => r
+.1111.11 123 => r
-.11111.. 124 => rs
+.11111.1 125 => s
-.111111. 126 => st
+.1111111 127 => t
+1....... 128 => t
-1......1 129 => tu
+1.....1. 130 => u
-1.....11 131 => uv
+1....1.. 132 => v
+1....1.1 133 => v
-1....11. 134 => vw
+1....111 135 => w
-1...1... 136 => wx
+1...1..1 137 => x
+1...1.1. 138 => x
-1...1.11 139 => xy
+1...11.. 140 => y
-1...11.1 141 => yz
+1...111. 142 => z
+1...1111 143 => z
-1..1.... 144 => 2z
+1..1...1 145 => 2
+1..1..1. 146 => 2
+1..1..11 147 => 2
+1..1.1.. 148 => 2
+1..1.1.1 149 => 2
+1..1.11. 150 => 2
+1..1.111 151 => 2
+1..11... 152 => 2
+1..11..1 153 => 2
+1..11.1. 154 => 2
+1..11.11 155 => 2
+1..111.. 156 => 2
+1..111.1 157 => 2
+1..1111. 158 => 2
+1..11111 159 => 2
+1.1..... 160 => 2
+1.1....1 161 => 2
+1.1...1. 162 => 2
+1.1...11 163 => 2
+1.1..1.. 164 => 2
+1.1..1.1 165 => 2
+1.1..11. 166 => 2
+1.1..111 167 => 2
+1.1.1... 168 => 2
+1.1.1..1 169 => 2
+1.1.1.1. 170 => 2
+1.1.1.11 171 => 2
+1.1.11.. 172 => 2
+1.1.11.1 173 => 2
+1.1.111. 174 => 2
+1.1.1111 175 => 2
+1.11.... 176 => 2
+1.11...1 177 => 2
+1.11..1. 178 => 2
+1.11..11 179 => 2
+1.11.1.. 180 => 2
+1.11.1.1 181 => 2
+1.11.11. 182 => 2
+1.11.111 183 => 2
+1.111... 184 => 2
+1.111..1 185 => 2
+1.111.1. 186 => 2
+1.111.11 187 => 2
+1.1111.. 188 => 2
+1.1111.1 189 => 2
+1.11111. 190 => 2
+1.111111 191 => 2
+11...... 192 => 2
+11.....1 193 => 2
+11....1. 194 => 2
+11....11 195 => 2
+11...1.. 196 => 2
+11...1.1 197 => 2
+11...11. 198 => 2
+11...111 199 => 2
+11..1... 200 => 2
+11..1..1 201 => 2
+11..1.1. 202 => 2
+11..1.11 203 => 2
+11..11.. 204 => 2
+11..11.1 205 => 2
+11..111. 206 => 2
+11..1111 207 => 2
+11.1.... 208 => 2
+11.1...1 209 => 2
+11.1..1. 210 => 2
+11.1..11 211 => 2
+11.1.1.. 212 => 2
+11.1.1.1 213 => 2
+11.1.11. 214 => 2
+11.1.111 215 => 2
+11.11... 216 => 2
+11.11..1 217 => 2
+11.11.1. 218 => 2
+11.11.11 219 => 2
+11.111.. 220 => 2
+11.111.1 221 => 2
+11.1111. 222 => 2
+11.11111 223 => 2
+111..... 224 => 2
+111....1 225 => 2
+111...1. 226 => 2
+111...11 227 => 2
+111..1.. 228 => 2
+111..1.1 229 => 2
+111..11. 230 => 2
+111..111 231 => 2
+111.1... 232 => 2
+111.1..1 233 => 2
+111.1.1. 234 => 2
+111.1.11 235 => 2
+111.11.. 236 => 2
+111.11.1 237 => 2
+111.111. 238 => 2
+111.1111 239 => 2
+1111.... 240 => 2
+1111...1 241 => 2
+1111..1. 242 => 2
+1111..11 243 => 2
+1111.1.. 244 => 2
+1111.1.1 245 => 2
+1111.11. 246 => 2
+1111.111 247 => 2
+11111... 248 => 2
+11111..1 249 => 2
+11111.1. 250 => 2
+11111.11 251 => 2
+111111.. 252 => 2
+111111.1 253 => 2
+1111111. 254 => 2
+11111111 255 => 2




  reply	other threads:[~2011-12-06 21:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-06 21:10 [Bitcoin-development] Version bytes "2.0" Luke-Jr
2011-12-06 21:28 ` Luke-Jr [this message]
2011-12-10 18:16   ` Luke-Jr
     [not found]     ` <20111212205559.GA16665@ulyssis.org>
2011-12-12 20:57       ` Pieter Wuille
2011-12-12 21:02       ` Luke-Jr
2011-12-13 10:38         ` Mike Hearn
2011-12-13 10:56           ` Wladimir
2011-12-13 11:07             ` Mike Hearn
2011-12-13 11:15               ` Wladimir
2011-12-13 15:43               ` Luke-Jr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201112061628.18634.luke@dashjr.org \
    --to=luke@dashjr.org \
    --cc=bitcoin-development@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox