<p>Yes, currencies like Bitcoin typically have a version byte that gets stored in the address which would be the <code>PUBLIC_KEY_VERSION</code> in the code you found.</p>

<p>More information here:</p>

<p><a href="https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses" rel="nofollow">https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses</a></p>

<p><a href="https://en.bitcoin.it/wiki/List_of_address_prefixes" rel="nofollow">https://en.bitcoin.it/wiki/List_of_address_prefixes</a></p>

<p>There is another byte used for private keys as well. See:</p>

<p><a href="https://en.bitcoin.it/wiki/Wallet_import_format" rel="nofollow">https://en.bitcoin.it/wiki/Wallet_import_format</a></p>

<p>These bytes can't really uniquely identify a coin but they should make it harder for users to accidentally send Bitcoin to a Dogecoin address or make other mistakes like that.</p>

CC BY-SA 3.0
2014-05-05T16:35:13.967Z
thanks!, very helpful, so if a bunch of coins using the same prefix, so basically i can have the same address for all of them, like doge and datacoin? that's weird... :) , i really expeted by desgn to be some kind of a long identifier like a uuid for eatch currency...
itai
CC BY-SA 3.0
2014-05-06T01:31:31.873Z
Addresses currently have 20 bytes of payload data and 1 version byte.  UUIDs are 16 bytes, so if you added a UUID then you would almost double the length of the address and any kind of operation you do with them (e.g. writing them down or scanning a QR code) would be harder.
David Grayson
CC BY-SA 3.0
2014-05-06T13:03:50.497Z
yes i understand, i also think because of the massive amount of coin types, there need to be a larger identifier, maby 4 bytes.. but i also know that by the original design of bitcoin no one anticipate there will be other coins... only put "version" to use as a version, not type of currency... there are collisions like datacoin & doge coin, there are only room for 255 types of currency, but there are much more now...
itai
CC BY-SA 3.0
2014-05-05T15:42:05.020Z
2014-05-05T15:42:05.020Z
David Grayson
<p>i looked at the link: <a href="http://brainwallet.org/" rel="nofollow">http://brainwallet.org/</a></p>

<p>witch generate offline wallets for all major coins,
i noticed that the same Passphrase generate different  [Private Key&amp;Address] pairs for eatch coin type, witch means eatch coin has a public shared id (or salt) added to the mix of the hash, am i right?</p>

<p>so how can i get that public coins key? and how can i edit the javascript  to support other scrypt coins? </p>

<p>eatch time i change coin in the menu a function is called,
i got that code of the page:</p>

<pre><code>  PUBLIC_KEY_VERSION = parseInt($(this).attr('data-target'));
  PRIVATE_KEY_VERSION = (PUBLIC_KEY_VERSION+128)&amp;255;
  ADDRESS_URL_PREFIX = $(this).attr('href');
 ....
    var eckey = gen_eckey;
    var compressed = gen_compressed;
    var hash_str = pad($('#hash').val(), 64, '0');   
    var hash = Crypto.util.hexToBytes(hash_str);

    var hash160 = eckey.getPubKeyHash();        
    var h160 = Crypto.util.bytesToHex(hash160);
    $('#h160').val(h160);

    var addr = new Bitcoin.Address(hash160);
    addr.version = PUBLIC_KEY_VERSION;

    $('#addr').val(addr);
</code></pre>

<p>when addr is the wallet address....</p>

<p>and the data-target  for the links are:</p>

<pre><code>bitcoin : 0x00
dogecoin: 0x1E
litecoin: 0x30
namecoin: 0x34
.
.
.
</code></pre>

<p>is this is the uniqe identifire of the coin? is if possible? 
it's just a single byte...</p>

<p>if not than what is?, and if yes how can i get the identifier of other coins, not listed (any way to extract it from the network/wallet software)?</p>

<p>thanks</p>

CC BY-SA 3.0
2014-05-05T15:08:11.577Z
oooh just noticed that dogecoin and datacoin has the samve publick_key_version 0x1E !
itai
CC BY-SA 3.0
2014-05-05T15:10:37.770Z
witch means that same dogecoin wallet address can store datacoin aswell, depanded on the network you connected to? so what is this public_key_version?, and how can i tell witch version is witch coin?
itai
<wallet><scrypt><algorithms>
what is the difference between eatch coins wallet address,what is the coin public id/salt?
itai
# what is the difference between eatch coins wallet address,what is the coin public id/salt?

(Asked by: username_0 on 2014-05-05)

i looked at the link: <http://brainwallet.org/>

witch generate offline wallets for all major coins,
i noticed that the same Passphrase generate different [Private Key&Address] pairs for eatch coin type, witch means eatch coin has a public shared id (or salt) added to the mix of the hash, am i right?

so how can i get that public coins key? and how can i edit the javascript to support other scrypt coins?

eatch time i change coin in the menu a function is called,
i got that code of the page:

```
  PUBLIC_KEY_VERSION = parseInt($(this).attr('data-target'));
  PRIVATE_KEY_VERSION = (PUBLIC_KEY_VERSION+128)&255;
  ADDRESS_URL_PREFIX = $(this).attr('href');
 ....
    var eckey = gen_eckey;
    var compressed = gen_compressed;
    var hash_str = pad($('#hash').val(), 64, '0');   
    var hash = Crypto.util.hexToBytes(hash_str);

    var hash160 = eckey.getPubKeyHash();        
    var h160 = Crypto.util.bytesToHex(hash160);
    $('#h160').val(h160);

    var addr = new Bitcoin.Address(hash160);
    addr.version = PUBLIC_KEY_VERSION;

    $('#addr').val(addr);

```

when addr is the wallet address....

and the data-target for the links are:

```
bitcoin : 0x00
dogecoin: 0x1E
litecoin: 0x30
namecoin: 0x34
.
.
.

```

is this is the uniqe identifire of the coin? is if possible?
it's just a single byte...

if not than what is?, and if yes how can i get the identifier of other coins, not listed (any way to extract it from the network/wallet software)?

thanks

**Tags:** wallet, scrypt, algorithms

> **Comments:**
> **username_0**: oooh just noticed that dogecoin and datacoin has the samve publick_key_version 0x1E !  
> **username_0**: witch means that same dogecoin wallet address can store datacoin aswell, depanded on the network you connected to? so what is this public_key_version?, and how can i tell witch version is witch coin?  

---

## 1 answers

### Answer by username_1 on 2014-05-05. Score: 2

Yes, currencies like Bitcoin typically have a version byte that gets stored in the address which would be the `PUBLIC_KEY_VERSION` in the code you found.

More information here:

<https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses>

<https://en.bitcoin.it/wiki/List_of_address_prefixes>

There is another byte used for private keys as well. See:

<https://en.bitcoin.it/wiki/Wallet_import_format>

These bytes can't really uniquely identify a coin but they should make it harder for users to accidentally send Bitcoin to a Dogecoin address or make other mistakes like that.

> **Comments:**
> **username_0**: thanks!, very helpful, so if a bunch of coins using the same prefix, so basically i can have the same address for all of them, like doge and datacoin? that's weird... :) , i really expeted by desgn to be some kind of a long identifier like a uuid for eatch currency...  
> **username_1**: Addresses currently have 20 bytes of payload data and 1 version byte.  UUIDs are 16 bytes, so if you added a UUID then you would almost double the length of the address and any kind of operation you do with them (e.g. writing them down or scanning a QR code) would be harder.  
> **username_0**: yes i understand, i also think because of the massive amount of coin types, there need to be a larger identifier, maby 4 bytes.. but i also know that by the original design of bitcoin no one anticipate there will be other coins... only put "version" to use as a version, not type of currency... there are collisions like datacoin & doge coin, there are only room for 255 types of currency, but there are much more now...  

---

