Bitcoin Forum
December 06, 2016, 04:15:31 PM *
News: Latest stable version of Bitcoin Core: 0.13.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Firstnames | Combining people's names with Firstbits for short bitcoin addresses  (Read 1404 times)
jim618
Legendary
*
Offline Offline

Activity: 1708



View Profile WWW
August 22, 2011, 12:53:56 PM
 #1

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:
Andreas.za
Mike.2j
Sam.r7
Jim.xh
google.rq

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:
Jim.xh
Jim Burton.xh
jimmyB.xh
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:
(Windows)  generateFirstName.bat
(Mac/Linux) generateFirstName.sh
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.

MultiBit HD   Lightweight desktop client.                    Bitcoin Solutions Ltd   Bespoke software. Consultancy.
1481040931
Hero Member
*
Offline Offline

Posts: 1481040931

View Profile Personal Message (Offline)

Ignore
1481040931
Reply with quote  #2

1481040931
Report to moderator
1481040931
Hero Member
*
Offline Offline

Posts: 1481040931

View Profile Personal Message (Offline)

Ignore
1481040931
Reply with quote  #2

1481040931
Report to moderator
1481040931
Hero Member
*
Offline Offline

Posts: 1481040931

View Profile Personal Message (Offline)

Ignore
1481040931
Reply with quote  #2

1481040931
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1481040931
Hero Member
*
Offline Offline

Posts: 1481040931

View Profile Personal Message (Offline)

Ignore
1481040931
Reply with quote  #2

1481040931
Report to moderator
1481040931
Hero Member
*
Offline Offline

Posts: 1481040931

View Profile Personal Message (Offline)

Ignore
1481040931
Reply with quote  #2

1481040931
Report to moderator
1481040931
Hero Member
*
Offline Offline

Posts: 1481040931

View Profile Personal Message (Offline)

Ignore
1481040931
Reply with quote  #2

1481040931
Report to moderator
kjj
Legendary
*
Offline Offline

Activity: 1302



View Profile
August 22, 2011, 03:10:43 PM
 #2

Excellent.  Now I can send some coins to my friend Scott using his shortened address, Joseph.8r

p2pcoin: a USB/CD/PXE p2pool miner - 1N8ZXx2cuMzqBYSK72X4DAy1UdDbZQNPLf - todo
I routinely ignore posters with paid advertising in their sigs.  You should too.
jim618
Legendary
*
Offline Offline

Activity: 1708



View Profile WWW
August 22, 2011, 04:31:25 PM
 #3

I like that.
Yes - because the search depth for the target string is fixed, you can pretty much search the whole of the space (even in Java, and even on my Macbook).   You can get any text to the left of the separator.

If you want to be Elvis, I just found : Elvis.cs (1ELVcSSiUSme2uGkkpFxMayMbLou4bhRSq)

According to wikipedia, there are 25,000 Elvis impersonators in the world.  25,000 variants can be coded into 3 characters of firstbits address so every Elvis on the planet can have an address of form:
   Elvis.xxx



MultiBit HD   Lightweight desktop client.                    Bitcoin Solutions Ltd   Bespoke software. Consultancy.
casascius
Mike Caldwell
VIP
Legendary
*
Offline Offline

Activity: 1344


The Casascius 1oz 10BTC Silver Round (w/ Gold B)


View Profile WWW
August 22, 2011, 04:53:01 PM
 #4

While we are at it, why not just take the name staking concept from Namecoin and build it into the block chain?

That way, if I wanted to "destroy" some BTC (which increases the value of all other BTC), I could own the payment alias "Mike Caldwell" for 12,000 blocks, assuming I'm the first to get it.  Perhaps that "destroyed BTC" wouldn't really be lost forever, instead would pay out to miners slowly over then next N blocks in the form of transaction fees, which would help pay for miners to mine as the block creation reward diminishes.

Companies claiming they got hacked and lost your coins sounds like fraud so perfect it could be called fashionable.  I never believe them.  If I ever experience the misfortune of a real intrusion, I declare I have been honest about the way I have managed the keys in Casascius Coins.  I maintain no ability to recover or reproduce the keys, not even under limitless duress or total intrusion.  Remember that trusting strangers with your coins without any recourse is, as a matter of principle, not a best practice.  Don't keep coins online. Use paper wallets instead.
jim618
Legendary
*
Offline Offline

Activity: 1708



View Profile WWW
August 22, 2011, 05:11:39 PM
 #5

To anyone not familiar with Namecoin's working (myself included !) here is the main Namecoin thread:

https://bitcointalk.org/index.php?topic=6017.0

More things to learn.   :-)

MultiBit HD   Lightweight desktop client.                    Bitcoin Solutions Ltd   Bespoke software. Consultancy.
netrin
Sr. Member
****
Offline Offline

Activity: 322


FirstBits: 168Bc


View Profile
August 24, 2011, 01:54:03 PM
 #6

With case insensitive alphanumeric, you have a keyspace of only a few dozen million. I don't think this will scale, particularly because the entropy on real names is low. If I am not mistaken, there can only be a thousand Johns, Mikes, Jim, Mar, Ali, Moh, or any other firstname.

Greenlandic tupilak. Hand carved, traditional cursed bone figures. Sorry, polar bear, walrus and human remains not available for export.
FreeMoney
Legendary
*
Offline Offline

Activity: 1246


Strength in numbers


View Profile WWW
August 24, 2011, 05:31:42 PM
 #7

With case insensitive alphanumeric, you have a keyspace of only a few dozen million. I don't think this will scale, particularly because the entropy on real names is low. If I am not mistaken, there can only be a thousand Johns, Mikes, Jim, Mar, Ali, Moh, or any other firstname.

Yeah, it seems like just a way to rewrite a small fraction of the possible firstbits.

I guess you can't make the length of the name and suffix parts variable because then you can't convert both ways. So you have to pick the same length for everyone, meh.

Play Bitcoin Poker at sealswithclubs.eu. We're active and open to everyone.
jim618
Legendary
*
Offline Offline

Activity: 1708



View Profile WWW
August 24, 2011, 08:46:18 PM
 #8

I think the examples I gave did not make it clear that the suffix part can be of any length.

"Lowercase alphanumeric" space has a keysize of 35 (as 'zero' gets mapped to 'o').   So two letters of firstbits give you a keysize of 35 * 35 = 1,225.  I round it down mentally to a thousand just for easier numbers.


If you take any name, say, Martin.

There are 35 firstnames that have the form:

    Martin.a

(where 'a' is a firstbit character)

There are 1000 (approx) firstnames of form:

   Martin.ab

(again 'a' and 'b' are any firstbit character)

Including more first bit characters you get:
   35,000 of form: Martin.abc
   1,000,000 of form: Martin.abcd
   35,000,000 of form Martin.abcde
   1,000,000,000 of form: Martin.abcdef


You are correct that the entropy in names is low - I estimate that the first three firstbits that get represented in the name only explores around 1,000 names i.e. two first bits worth of entropy as you mentioned.

Because people can remember names more easily (especially their own name) to remember a firstname like:

   Martin.kw4p

'feels like' only remembering 4 characters but it gives you about 6 characters' worth of entropy.

When you think that postcodes in the UK are 6+ characters and PINs are 4 I think it makes it possible for John and Jane Doe to remember their bitcoin addresses.

For that example "Martin.kw4p" the firstbits is "1markw4p".   You can always map from a firstname to a firstbits but not in the reverse direction.   "1markw4p" could be "Mark.kw4p", "Martina.kw4p" etc.





MultiBit HD   Lightweight desktop client.                    Bitcoin Solutions Ltd   Bespoke software. Consultancy.
jim618
Legendary
*
Offline Offline

Activity: 1708



View Profile WWW
August 24, 2011, 08:55:38 PM
 #9

oh I should add:
I have deliberately searched in the demo code from a minimum firstbits length of 5 even if there actually was a firstbits length of 4.

I wanted the firstname format always to have at least one suffix character as then the user has to write:

<a name>.<at least one character>


The reason for that it it makes it possible to have just one entry field for all of regular bitcoin addresses, firstbits and firstnames as follows:

1.   If address length is greater than or equal to the firstbits cutoff length (which I forget) -> it is a regular bitcoin address.
2.   If address is shorter and has no separator -> it is a firstbits address.
3.   If address is shorter and has a separator -> it is a firstnames address.

The separator char is not a Base58 character.

MultiBit HD   Lightweight desktop client.                    Bitcoin Solutions Ltd   Bespoke software. Consultancy.
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!