I think everybody is agreed that raw bitcoin addresses are unfriendly to the general public.
This post describes an algorithm that combines people's names with the ideas of Firstbits that solves this problem.
(Firstbits - www.firstbits.com
- is an elegant way of shortening bitcoin addresses using the blockchain.)Results
Here are some examples of what bitcoin addresses look like using this algorithm:
As they are based on Firstbits I have called them 'Firstnames'.Algorithm
Here are the steps of the algorithm:
Call the text you are finding a firstname for the target string.
1) Take the first three characters of the target string. In the above examples these would be: 'And', 'Mik', 'Sam', 'Jim', 'goo'.
2) Lower case them, do some tweaking to do with the Base58 alphabet and prefix with a '1'. This gives: '1and', '1mik', '1sam', '1jim', '1goo'.
3) Generate a keypair and calculate its address. Lower case the address and see if the first four characters match the result of step 2.
4) Repeat step 3 until you find a suitable keypair (or give up trying!). You now have a keypair that will be the basis of your firstname.
5) Say you are looking for a firstname for 'google' and the address for the keypair you find is '1GoorQmSabgRFTSF2dGban7RqyhEXapziB'. By scraping firstbits.com you work out that the firstbits for this address is '1goorq' . You strip off the '1goo' (which you know already) and then combine the target string with the remainder 'rq'. In this case the firstname is 'google.rq'. (You need a separator to distinguish the extra characters - I have used a '.')
You can work out the firstbits directly from the firstname:
Andreas.za -> 1andza
Mike.2j -> 1mik2j
Sam.r7 -> 1samr7
Jim.xh -> 1jimxh
google.rq -> 1goorq
Using the firstbits you can look up the complete bitcoin address.
6) To claim the firstbits/ firstname you need to send some bitcoins to the address so that it gets onto the blockchain. Performance
The main cost is obviously the search for the keypair. To get the firstnames described above (except for Sam.r7) took respectively 12000, 3000, 43000, 26000 and 42000 iterations. The choice of using the first 3 characters to match was driven by the number of iterations required.
2 is too easy, 4 is too hard. This algorithm is similar to vanityGen (which I assume was used to find 1samr7) but is intentionally limited to the first three characters of the address to speed it up.Pseudonymity and informality
Because you only use the first 3 characters in the target string and you do a lowercase, all these are equivalent:
You can vary your pseudonymity and level of formality - the suffix remains the same.
As with all vanity addresses you are leaking information by using firstnames. Anytime you publicly associate a particular bitcoin address with a person you have already lost this information.What letters and numbers can you use ?
Because you match on lower cased strings you can use the full 26 letters of the alphabet in a target string. For instance a firstname for 'Polly' is 'Polly.bt' (address = 1PoLBtjvtwxYXQQB8to6f3XWPNHebCLH5f, firstbits = '1polbt'). Lower case 'l' is not valid Base58, but 'L' is. To get round 'zero' being invalid Base58, it is mapped to 'o' for address matching. This makes all numbers valid in a firstname. What about shorter names than 3 characters ?
For brevity I have not described the edge condition of when you have a short name such as 'Jo'. You get firstnames like 'Jo.zqy'. A bit more after the separator. You can see how this is dealt with by looking at the demo code I have produced.Demo code
I have written demo code that generates a firstname from a target string. This is written in Java using the bitcoinj library. It is available at: https://github.com/jim618/multibit/blob/master/multibit/src/org/multibit/firstname/FirstNameGenerator.java
It is open source - MIT licence.
If you want to run it directly without using an IDE, I have included the classes in the MultiBit download (I am the lead MultiBit developer).
If you download and install MultiBit from http://www.multibit.org/download.html
there are two files included:
These run a little command line utility where you type in the target string and it searches for a firstname. It prints out the keypair it finds but you will have to spend your own bitcoins to claim the firstname. :-)
I have tested them on a Mac and Windows XP but not Linux. You will have to do a "chmod 777" on Mac/Linux to run it.Feedback and comments
Your feedback on this algorithm is appreciated.
I think the bitcoin addresses generated are simple to remember and easy to use.