There has been some talk about how I saved an exchange users' mis-sent coins. Honestly it was not as big a deal as it appears. There has also been some misinformation presented, so I am posting this to get the complete story out.
Every crypto coin uses an address version to define how its public key and script key hash will be defined. For the sake of simplicity I will only be referring to the address version of the public key.
The public key is more commonly referred to as an “address”, the alphanumeric value one uses to send and receive coins.
Bitcoin uses an address version of 0. This will produce public keys starting with the number 1.
Litecoin uses an address version of 48. This will produce public keys starting with the letter “L”
Different coins can safely use the same address version, in fact for the most part this allows one to use the same address across multiple coins by importing the same private key into the coin clients that share the same address version. In fact a few of the early alt-coins did exactly that.
I use the same address for BTC,TRC and FRC. (1CRypTosugXcXQNjp16Cra83c3M24vVW9Y) as it is a valid address on all three chains (Address version 0).
We had a user at
http://scifi-ex.com exchange accidentally use their UFO client to send coins to an address the exchange generated for an UFC deposit.
Both UFO and UFC use the same address version (27) so the addresses generated on both chains are valid on the other. THIS DOES NOT MEAN THAT COINS CROSS CHAINS, ONLY THAT THE ADDRESS IS VALID ON BOTH CHAINS.
To recover the coins, I simply dumped the private key for the address generated from the UFC client and imported it into an UFO client. There were a couple of other little tweaks due to some small changes between the Base58 header file in the two coins, but this is not a common issue.
Once the private key was imported into the UFO client, this gave me access to the coins the were accidentally sent on the UFO chain and I sent them back to the user at an address he provided.
There are only so many address versions available (256), so coins are going to share the same address version. With a few exceptions (For example, if the address encoding has been changed in one of the chains), coins that are sent with the wrong client in this fashion can be recovered by the intended receiving party by dumping the private key from the coin they wanted to receive and importing it into the coin client of the coin that was accidentally sent.
Even in the example of the key encoding being changed, the coins can still be recovered by somebody with the knowledge to change the programming and compile a special version of the client to accept the private key.
List of addresses versions and the resulting Key prefixes:
https://en.bitcoin.it/wiki/List_of_address_prefixesUsing the address version on can also use vanitygen with the -X
to try and generate custom addresses. I have written this subject before, so I am not going to rehash it here.