Bitcoin Forum
November 21, 2019, 06:45:08 PM *
News: Help collect the most notable posts made over the last 10 years.
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How the Bitcoin Private pubkey prefix is generated ?  (Read 101 times)
streamplus
Newbie
*
Offline Offline

Activity: 108
Merit: 0


View Profile
May 06, 2018, 06:05:22 PM
 #1

Hi,

I noticied that bitcoin private contain two bytes !

Code:
        // guarantees the first 2 characters, when base58 encoded, are "b1"
        base58Prefixes[PUBKEY_ADDRESS]     = {0x13,0x25};
        // guarantees the first 2 characters, when base58 encoded, are "bx"
        base58Prefixes[SCRIPT_ADDRESS]     = {0x13,0xAF};
        // the first character, when base58 encoded, is "5" or "K" or "L" (as in Bitcoin)
        base58Prefixes[SECRET_KEY]         = {0x80};
        // do not rely on these BIP32 prefixes; they are not specified and may change
        base58Prefixes[EXT_PUBLIC_KEY]     = {0x04,0x88,0xB2,0x1E};
        base58Prefixes[EXT_SECRET_KEY]     = {0x04,0x88,0xAD,0xE4};
        // guarantees the first 2 characters, when base58 encoded, are "zk"
        base58Prefixes[ZCPAYMENT_ADDRRESS] = {0x16,0xA8};
        // guarantees the first 2 characters, when base58 encoded, are "SK"
        base58Prefixes[ZCSPENDING_KEY] = {0xAB,0x36};

How is that calculated ?

Thank you in advance.
1574361908
Hero Member
*
Offline Offline

Posts: 1574361908

View Profile Personal Message (Offline)

Ignore
1574361908
Reply with quote  #2

1574361908
Report to moderator
1574361908
Hero Member
*
Offline Offline

Posts: 1574361908

View Profile Personal Message (Offline)

Ignore
1574361908
Reply with quote  #2

1574361908
Report to moderator
1574361908
Hero Member
*
Offline Offline

Posts: 1574361908

View Profile Personal Message (Offline)

Ignore
1574361908
Reply with quote  #2

1574361908
Report to moderator
The Bitcoin Forum is turning 10 years old! Join the community in sharing and exploring the notable posts made over the years.
shahzadafzal
Copper Member
Full Member
***
Offline Offline

Activity: 308
Merit: 153


View Profile WWW
May 06, 2018, 07:19:33 PM
 #2

Public key prefix yes but are there prefixes for private key too? I don't think so.

1 prefix is public key hash
3 prefix is a script hash

For public key prefix you can get idea from below

Quote
Bitcoin address is a Base58Check representation of a Hash160 of a public key with a version byte 0x00 which maps to a prefix "1". Typically represented as text (ex. 1CBtcGivXmHQ8ZqdPgeMfcpQNJrqTrSAcG) or as a QR code.

A more recent variant of an address is a P2SH address: a hash of a spending script with a version byte 0x05 which maps to a prefix "3" (ex. 3NukJ6fYZJ5Kk8bPjycAnruZkE5Q7UW7i8).


Ref: https://github.com/oleganza/CoreBitcoin/blob/master/GLOSSARY.md

You check here list of address prefixes: https://en.bitcoin.it/wiki/List_of_address_prefixes

nc50lc
Hero Member
*****
Offline Offline

Activity: 784
Merit: 799


Self-proclaimed Genius ㊙️


View Profile WWW
May 07, 2018, 03:24:22 AM
Last edit: May 07, 2018, 06:24:43 AM by nc50lc
 #3

-snip-
I'm pretty sure that the OP is talking about an Altcoin: Bitcoin Private (BTCP).
Its addresses starts with "b1" prefix.
Code:
        // guarantees the first 2 characters, when base58 encoded, are "b1"
        base58Prefixes[PUBKEY_ADDRESS]     = {0x13,0x25};

@streamplus
This forum is for Bitcoin development, you can move this to Altcoin Discussion to look for the accurate answers from BTCP users and developers.

Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!