Bitcoin Forum
August 19, 2019, 01:20:44 PM *
News: Latest Bitcoin Core release: 0.18.0 [Torrent] (New!)
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to determine a WIFPrefix and compressed.WIFPrefix for a Paper Wallet? e.g.  (Read 556 times)
XBITCOIN
Member
**
Offline Offline

Activity: 129
Merit: 10


View Profile
May 04, 2015, 01:56:09 AM
 #1

Im forking this https://github.com/cantonbecker/bitcoinpaperwallet  and going to make paper wallets for my favorite Alts,


case 'Bitcoin':  
     window.networkVersion = 0x00;
     window.privateKeyPrefix = 0x80;
    window.WIFPrefix = '5';
     window.compressedWIFPrefix = '[LK]';

     break;
   case 'Litecoin':
      window.networkVersion = 0x30;
      window.privateKeyPrefix = 0xb0;
      window.WIFPrefix = '6';
      window.compressedWIFPrefix = 'T'
;
      break;

I am trying to set up an alt coin paper wallet generator and I havent been able to figure out how exactly to determine or find the value that needs to be place for the WIFPrefix and the compressedWIFPrefix?

I know how to determine window.networkVersion = 0x00; window.privateKeyPrefix = 0x80; from here
https://forum.digitalcoin.co/archive/index.php/t-1447.html
https://bitcointalk.org/index.php?topic=384093.msg4134858#msg4134858

Now all I need to make sure its 100% functional is the WIFPrefix!

Any help here would be appreciated?

Thanks,

Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1566220844
Hero Member
*
Offline Offline

Posts: 1566220844

View Profile Personal Message (Offline)

Ignore
1566220844
Reply with quote  #2

1566220844
Report to moderator
achow101_alt
Sr. Member
****
Offline Offline

Activity: 268
Merit: 250


View Profile
May 04, 2015, 02:07:35 AM
 #2

You will probably need to look in the source code to find these prefixes. If the coins have a wiki or forum, you could ask there.

Tip Me!: 1AQx99s7q1wVinbgXbA48BaZQVWpHe5gYM | My PGP Key: Fingerprint 0x17565732E08E5E41
Muhammed Zakir
Hero Member
*****
Offline Offline

Activity: 560
Merit: 504


I prefer Zakir over Muhammed when mentioning me!


View Profile WWW
May 04, 2015, 04:14:59 AM
 #3

AFAIU compressedWIFPrefix = 'x', where x is first letter of private key associated with compressed public key.

elbandi
Hero Member
*****
Offline Offline

Activity: 520
Merit: 503


View Profile
May 04, 2015, 09:58:40 AM
 #4

I calculated it from the possible key prefixes, here is the result:
https://github.com/bitbandi/UniversalWalletGenerator/blob/master/src/ninja.setupwallet.js#L90
fbueller
Sr. Member
****
Offline Offline

Activity: 412
Merit: 250


View Profile
May 04, 2015, 12:00:08 PM
 #5

I can't speak to the specific code you're using but networkVersion and privateKeyVersion are all you should need, and they can be found in the source code of the altcoin.

WifPrefix and compressedWIFPrefix are not important. PrivateKeyPrefix is used in both cases to derive the base58 private key, and it just so happens a base58 encoded, uncompressed private key with a prefix of 0x80 gives you a prefix of 5, and when compressed, is either L or K. Perhaps they're used in the app for a quick sanity check..

Bitwasp Developer.
XBITCOIN
Member
**
Offline Offline

Activity: 129
Merit: 10


View Profile
May 04, 2015, 01:19:28 PM
 #6

I was able to figure out the compressedWIFPrefix is basically the Letter that the wallet generated private key starts with, in the case of Bitcoin it starts with either L or K which is why you see [LK] and Litcoin is T

The way that I determine the compressedWIFPrefix was by opening a wallet and typing in the console: dumpprivkey "The wallets address" Press enter and it will give you the compressed private key (52 digits), then you can see what letter the key starts with, Litecoin starts with T T77jSKLkPvX4SBgRN8v11jTdnHwb8ckrn7WLjXcNjLikug2dAhaP

To Determine the WIFPrefix I had to run the rest of the code with
window.networkVersion = 0x30;
      window.privateKeyPrefix = 0xb0;
      window.WIFPrefix = 'Put any Number in here to start';
      window.compressedWIFPrefix = 'T';

And the output automatically shows the Private Key Prefix as the first number of the 51 digit string using
https://github.com/cantonbecker/bitcoinpaperwallet


The Private Key WIF (Wallet Import Format) is a code that needs to be keep secret since it can be used to spend any funds that have been sent to the corresponding public key. Keys can be encoded in a number of different formats. The most popular encoding formats (WIF, WIFC, HEX, B64) are shown below.


Public Litecoin Address
LdZ2AU1oWfmqGopivVGG5fmmR4KyM42kva
Litecoin Address Compressed Format
LMvQWzsUppbdxq39JeMv3KqXantVSH2idr


Public Key (130 characters [0-9A-F]): 04C5CE09ABF9C5E1A0ACE700F7729FA996AB5115B05857D8EF550DB34F96A7E184C1BB8E00A07A0 6F3BF64FB3641A13A1618A8822B9791BEDC33AD40116BF68244
Public Key (compressed, 66 characters [0-9A-F]): 02C5CE09ABF9C5E1A0ACE700F7729FA996AB5115B05857D8EF550DB34F96A7E184

Private Key WIF
51 characters base58, starts with a '6'
6v3S2CrndTdGH8QS1Fw9cWZKJWfee52KytmiB687HPbPBdobUX9
Private Key WIF Compressed
52 characters base58, starts with a 'T'
T77jSKLkPvX4SBgRN8v11jTdnHwb8ckrn7WLjXcNjLikug2dAhaP



Private Key Hexadecimal Format (64 characters [0-9A-F]): 79480E439276C481E13799439A9A0BEC103E2701B17851A236650658F685C272
Private Key Base64 (44 characters): eUgOQ5J2xIHhN5lDmpoL7BA+JwGxeFGiNmUGWPaFwnI=

So, it works perfect now!

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!