Bitcoin Forum
April 25, 2024, 04:37:28 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Guide on using BTC/TRC/FRC addresses  (Read 1442 times)
dreamwatcher (OP)
Legendary
*
Offline Offline

Activity: 1064
Merit: 1000


View Profile WWW
February 05, 2013, 07:14:00 PM
Last edit: February 08, 2013, 05:25:01 AM by dreamwatcher
 #1

I have seen the question of TRC and BTC addressing in a couple of threads. Both BTC and TRC use the same address version which means addresses on both chains are valid on the other chain. If you have the address in one chains wallet, you also have the private key to that address and you can use that key pair on the other chains wallet. I will demonstrate how to dump private keys and import them.

You can also use a program called "vanitygen" to try and generate custom addresses.


Using either the command line daemon or using the console in the GUI (QT) version of either the BTC or TRC client:


Pick the address you want to use. If using the command line use [getaccountaddress <account name>] to acquire the address from account name if needed.

Code:
getaccountaddress test

1K4QedomXZGvbhSFV5MDf3rkb376seeugU

To extract the private key to the above address use the [dumpprivkey <address>] command.

Code:
dumpprivkey 1K4QedomXZGvbhSFV5MDf3rkb376seeugU

L3PjkDLhzMuPFMu1oEyqyvergjRLSyc5YNVH1QGZg95jNNMUnFtv

Switch over to the client you want to import the address into. Use the [importprivkey <privatekey> [label] ]. Label is optional but using it to name accounts makes life much easier when using the command line version. After running the command, the client will not give any feedback (older client versions would actually give a fake error message).

Code:
importprivkey L3PjkDLhzMuPFMu1oEyqyvergjRLSyc5YNVH1QGZg95jNNMUnFtv

Thats it, you should now have the use of the same address in both chains.

If not using the GUI version you can list addresses with [getaccountaddress <account> ]

Code:
getaccountaddress test

1K4QedomXZGvbhSFV5MDf3rkb376seeugU

Vanitygen is located at: https://github.com/samr7/vanitygen.git

After installing vanitygen you can import the private keys it generates to use your own custom addresses.

One little talked about option with vanitygen is the ability to use different address versions in order to generate addresses for other chains.
For example: PPC address version is 55 (Decimal). Using the -X switch I can generate PPC addresses.
Code:
vanitygen -X 55 PP123
Difficulty: 4553521
Pattern: PP123                                                                
Address: PP123ejYoxefhZkCT1tUgRvMkAT3VgfNT4
Privkey: 79eBxBYKymHAQBxnu3nz98CTLRUSKThvuzyUX2L6yt5D5Ci1xb2

ADD: The Base58.h file will need to be patched and PPCoin recompiled to import private keys

Do not forget about oclvanitygen, it allows you to use your GPU to generate addresses.

Note: All addresses and keys used in this post were made on fresh wallets and deleted afterwards. DO NOT USE any of the address or keys in this post as the pairs are now public information.









1714063048
Hero Member
*
Offline Offline

Posts: 1714063048

View Profile Personal Message (Offline)

Ignore
1714063048
Reply with quote  #2

1714063048
Report to moderator
The grue lurks in the darkest places of the earth. Its favorite diet is adventurers, but its insatiable appetite is tempered by its fear of light. No grue has ever been seen by the light of day, and few have survived its fearsome jaws to tell the tale.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714063048
Hero Member
*
Offline Offline

Posts: 1714063048

View Profile Personal Message (Offline)

Ignore
1714063048
Reply with quote  #2

1714063048
Report to moderator
1714063048
Hero Member
*
Offline Offline

Posts: 1714063048

View Profile Personal Message (Offline)

Ignore
1714063048
Reply with quote  #2

1714063048
Report to moderator
Sunny King
Legendary
*
Offline Offline

Activity: 1205
Merit: 1010



View Profile WWW
February 05, 2013, 08:07:19 PM
Last edit: February 05, 2013, 08:17:59 PM by Sunny King
 #2

Vanitygen is located at: https://github.com/samr7/vanitygen.git

After installing vanitygen you can import the private keys it generates to use your own custom addresses.

One little talked about option with vanitygen is the ability to use different address versions in order to generate addresses for other chains.
For example: PPC address version is 55 (Decimal). Using the -X switch I can generate PPC addresses.

Code:
vanitygen -X 55 PP123
Difficulty: 4553521
Pattern: PP123
...

Ah thanks a lot for the neat vanitygen tutorial! I will add this info to ppcoin's FAQ.
crazy_rabbit
Legendary
*
Offline Offline

Activity: 1204
Merit: 1001


RUM AND CARROTS: A PIRATE LIFE FOR ME


View Profile
February 05, 2013, 11:17:19 PM
 #3

Very cool! Thanks for posting this! It will be helpful and informative for BTC, TRC and other Bitcoin-like coin users!

more or less retired.
dreamwatcher (OP)
Legendary
*
Offline Offline

Activity: 1064
Merit: 1000


View Profile WWW
February 06, 2013, 01:30:38 AM
 #4

Just a couple of notes I left out of the OP.



FRC uses the same address version as BTC/TRC (version 00), so the same address can be used on all three chains.



If the wallet you are working with is encrypted you will need to unlock the wallet using the walletpassphrase command to use the commands needed.

Code:
walletpassphrase <password> <time>

The client again will give no feedback if done correctly. Time is in milliseconds, and the lock resets if the client is shutdown.





There can be multiple public addresses for each account therefore the command line account listing can give a different public address. However, the address you want to use is still usable in the wallet. If you use the getaccount command, you can confirm.

For example: if I imported address 17Y5dz1HquUbeQ81FRvQN6ku9EUnrxUnBq under account name test2.

Code:
getaccountaddress test2

16NmmLXx1Dz5crPTUxtfY8jYZopmHdwkR1

However, if I use the getaccount command:

Code:
getaccount 17Y5dz1HquUbeQ81FRvQN6ku9EUnrxUnBq
test2

The original imported address is valid and usable. This is true even when generating new addresses.

Code:
getnewaddress test3
1Ec5qWzKUBuHHcZfvrbz4wPTFiqjhjwdzA
getaccountaddress test3
18aqMFXSSVBLbVuAaxUZKNwAMADHx2j5uN

This is one case where the GUI makes it easier. The GUI versions will show the address "correctly" after import and restart.


FuzzyBear
Legendary
*
Offline Offline

Activity: 1420
Merit: 1010



View Profile WWW
February 06, 2013, 11:09:04 AM
 #5

dreamwatcher.... post an addy then for you to receive donations please on this excellent guide Smiley

I expect to see one addy for your BTC, TRC and FRC now Tongue

***** Earn DEV at http://devtome.com *****
dreamwatcher (OP)
Legendary
*
Offline Offline

Activity: 1064
Merit: 1000


View Profile WWW
February 07, 2013, 10:09:11 PM
Last edit: February 10, 2013, 12:56:24 AM by dreamwatcher
 #6

dreamwatcher.... post an addy then for you to receive donations please on this excellent guide Smiley

I expect to see one addy for your BTC, TRC and FRC now Tongue

Here Ya go:

BTC/TRC/FRC  1CRypTosugXcXQNjp16Cra83c3M24vVW9Y  (Address is valid on all 3 chains)

PPC: PAYCKSPFGRUdWPyYt2pDs1WYXdPEkah9Qy

I will add these to the cryptocoinexplorer site for donations.

Thank You!!
dreamwatcher (OP)
Legendary
*
Offline Offline

Activity: 1064
Merit: 1000


View Profile WWW
February 07, 2013, 10:28:37 PM
 #7



 I have been having some issues with importing the PPC keys that Vanitygen makes, I will look into it further and see if I can fix the issue.

I have successfully done this in the past, so I was kind of surprised when the issue came up recently.

Sunny: Please hold off adding to the FAQ until I provide a solution.

DannyM
Sr. Member
****
Offline Offline

Activity: 275
Merit: 250



View Profile
February 08, 2013, 01:48:16 AM
 #8

of course devcoin uses the same address format.
dreamwatcher (OP)
Legendary
*
Offline Offline

Activity: 1064
Merit: 1000


View Profile WWW
February 08, 2013, 03:05:30 AM
Last edit: February 08, 2013, 03:28:59 AM by dreamwatcher
 #9

Update on PPC:

It appears the private key format from vanitygen needs to be converted to a Base58 encoding of 6 for the PPCoin daemon to import it.

First the vanitygen output need to be converted to the complete private key and then converted to the Base58 (6).

I have found a web page that does this, but of course I would NEVER EVER recommend putting private keys to addresses you intend to use into a web page!!!!

So in short, Vanitygen is generating the correct private keys. However it is in a format the PPCoin daemon does not like.


Added:

It looks like vanitygen is giving out Base58check (version 183) and the PPC Daemon wants Base58check (version 128)
dreamwatcher (OP)
Legendary
*
Offline Offline

Activity: 1064
Merit: 1000


View Profile WWW
February 08, 2013, 04:59:24 AM
Last edit: February 08, 2013, 05:56:38 AM by dreamwatcher
 #10

SOLVED!!

The solution involves patching PPCoin. I will put in the suggestion in github.

Basically it involves changing the base58.h file.Litecoin has an altered base58.h, and it appears that the file has to be changed whenever using a address version above 00.

In Base58.h

Code:
public:
    void SetSecret(const CSecret& vchSecret, bool fCompressed)
    {
        assert(vchSecret.size() == 32);
        SetData(fTestNet ? 239 : 128, &vchSecret[0], vchSecret.size());
        if (fCompressed)

Change the 239 to 245 (Testnet 128+117) 128 to 183 (Livenet 128+55)
Code:
public:
    void SetSecret(const CSecret& vchSecret, bool fCompressed)
    {
        assert(vchSecret.size() == 32);
        SetData(fTestNet ? 245 : 183, &vchSecret[0], vchSecret.size());
        if (fCompressed)

And again in here

Code:
 bool IsValid() const
    {
        bool fExpectTestNet = false;
        switch(nVersion)
        {
            case 128:
                break;

            case 239:
                fExpectTestNet = true;
                break;

to:

Code:
 bool IsValid() const
    {
        bool fExpectTestNet = false;
        switch(nVersion)
        {
            case 183:
                break;

            case 245:
                fExpectTestNet = true;
                break;
dreamwatcher (OP)
Legendary
*
Offline Offline

Activity: 1064
Merit: 1000


View Profile WWW
February 08, 2013, 05:28:41 AM
 #11

I have put in a pull request in the PPCoin git.

I have tested the patching with importing both keys that Vanitygen and the PPCoin daemon dumps itself.

With the changes, both generated and dumped keys import successfully into a fresh wallet.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!