Author

Topic: Extract Prefix of Private Key of various AltCryptocurriencies [SOLVED] (Read 3307 times)

full member
Activity: 154
Merit: 100
ahh, was wasting time on trivialities...

here is the code to understand the logic

Code:
        
        PRIVKEY_ADDRESS = CBitcoinAddress::PUBKEY_ADDRESS + 128,
        PRIVKEY_ADDRESS_TEST = CBitcoinAddress::PUBKEY_ADDRESS_TEST + 128,
 

This is true for most, but not all.
member
Activity: 70
Merit: 10
ahh, was wasting time on trivialities...

here is the code to understand the logic

Code:
        
        PRIVKEY_ADDRESS = CBitcoinAddress::PUBKEY_ADDRESS + 128,
        PRIVKEY_ADDRESS_TEST = CBitcoinAddress::PUBKEY_ADDRESS_TEST + 128,
 
member
Activity: 70
Merit: 10
I have been trying to scour through the code of various alt-cryptocurriencies but am unable to extract the prefix character of private key. Can someone help me point into the right direction of where i need to look for? Currently the importprivkey just removes any prefix code >=0X80 (bitcoin prefix)

I am aware of the work done by zamgo (https://github.com/zamgo/PHPCoinAddress/blob/master/README.md). but would like to expand on that project to include various other curriecies as well.

Here is where I am so far

Code:
// base58.h: Litecoin public key prefixes

class CBitcoinAddress : public CBase58Data
{
public:
    enum
    {
        PUBKEY_ADDRESS = 48, // Litecoin addresses start with L
        SCRIPT_ADDRESS = 5,
        PUBKEY_ADDRESS_TEST = 111,
        SCRIPT_ADDRESS_TEST = 196,
    };
Jump to: