As long as we are pondering useless stuff..
Full address to Min-Address Conversion:
#Take the full address and find the block in which the first transaction to address occurs.The block number is the converted to hex-code and forms the first part of Min-Address.
#Get all the receiving addresses in the block and do a case insensitive comparison to find the minimum number of initial characters which uniquely identify the address, this forms the second part of the Min-Address.
It occurs to me that this could be more compact.
Let's take a random recently-seen address:
This is your min-address format:
4f4d6-1pi9
Instead of block number + firstbits of a block, we can get all the information from the structure of transactions in the blockchain, and then encode it smartly.
We can find the first occurrence of a payment to an address, and then refer to it by block_number->transaction_number->txout_number
We can call this micro-address. It can be the base58 encode of a bitstream-type encoding of the above data:
Most-significant-bit placeholder1st bit set to 1
block number:bit 0 - len of block count:
0 - 23 bits
1 - 31 bitsbit 1-24 or bit 1-32:
23 bit length: (blocks 0-7fffff) (blocks 0-524287)
31 bit length: add 00800000 (0-7fffffff + 00800000) (blocks 524288-8912895)transaction number in block:bit 0-2: length: number of words + 2 - 3 bits
000: 5 bit length (0-31)
001: 9 bit length (0-511)
010: 13 bit length (0-8191)
...
111: 25 bit length (0-33554431)vout number:bit 0-1: length: number of words + 2 - 2 bits
00: 6 bit length (0-63)
01: 10 bit length (0-1023)
10: 14 bit length (0-16383)
11: 18 bit length (0-262143)for my example address:
block 234822, 0x39546h : 000000000000000006880233f89f572f006fd5dad0d1729d6d81622e8921e15f
transaction #18, 0x11h : fe17ff4c6df314cc708b2bab011a6327b61ffce81b4f7948ca8c6e7d3ee46105
vout #3, 0x02h: address 1Pi9uP6YMqbvbrQ1b7m6qzAS5ejN7mSwWR
encoding base58(bitstream):
MSB 1: 1
block# bits: 0 00000111001010101000110
trans# bits: 000 10001
vout# bits: 00 00000010
>>> hex(0b1000000111001010101000110000100010000000010)
'0x40e55184402L'
>>> bitcoin.changebase('1000000111001010101000110000100010000000010',2,58)
'329UugoB'
So I get an eight-character micro-address of 329UugoB.
The length here doesn't vary based on how many bitcoin address characters it takes to be unique within a block. It only gets longer after block 524287 or if there was a huge block and the transaction also had many outs. I'm sure even more optimized encoding could be thought up to minimize the average address lookup bits required.