1

I want to know how the prefixes for EXT_PUBLIC_KEY and EXT_PRIVATE_KEY are derived. For example in bitcoin you have:

base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,0);
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,5);
base58Prefixes[SECRET_KEY] =     std::vector<unsigned char>(1,128);
base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x88, 0xB2, 0x1E};
base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x88, 0xAD, 0xE4};

And I another cryptocurrency has:

base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,25); 
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,5);
base58Prefixes[SECRET_KEY]     = std::vector<unsigned char>(1,153); // 25 + 128
base58Prefixes[SECRET_KEY_OLD] = std::vector<unsigned char>(1,151);
base58Prefixes[EXT_PUBLIC_KEY] = list_of(0x1E)(0x56)(0x2D)(0x9A).convert_to_container<std::vector<unsigned char> >();
base58Prefixes[EXT_SECRET_KEY] = list_of(0x1E)(0x56)(0x31)(0xBC).convert_to_container<std::vector<unsigned char> >();

Im trying to make a server that generates addresses from the Extended public key without exposing the private key on the latter cryptocurrency but I've been running into some problems. I want to understand how the EXT_PUBLIC_KEY is derived as for the development and how it is used to generate addresses. I'm trying to implement it into pywallet (https://github.com/ranaroussi/pywallet) but it seems to not support this kind of EXT_PUBLIC_KEY

2
  • Are you asking about the prefixes or the actual keys themselves? The code you posted is related to the prefixes and not at all anything to do with key derivation.
    – Ava Chow
    Commented Jun 24, 2020 at 20:19
  • Sorry, the question has been edited. I was asking about the prefixes
    – MisterSir
    Commented Jun 25, 2020 at 11:36

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.