Bitcoin Forum
July 18, 2024, 03:29:18 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Extract Prefix of Private Key of various AltCryptocurriencies [SOLVED]  (Read 3280 times)
QueenB (OP)
Member
**
Offline Offline

Activity: 70
Merit: 10



View Profile
May 27, 2013, 09:44:14 AM
Last edit: May 27, 2013, 04:06:58 PM by QueenB
 #1

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,
    };

QueenB (OP)
Member
**
Offline Offline

Activity: 70
Merit: 10



View Profile
May 27, 2013, 04:06:44 PM
 #2

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,
 

radus
Full Member
***
Offline Offline

Activity: 154
Merit: 100



View Profile
August 07, 2014, 10:45:35 AM
 #3

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.

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!