Bitcoin Forum
May 07, 2024, 04:25:10 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: bitaddress.org source code modification  (Read 637 times)
oinkoink (OP)
Jr. Member
*
Offline Offline

Activity: 34
Merit: 1


View Profile
November 18, 2016, 09:36:58 PM
Last edit: November 18, 2016, 10:02:20 PM by oinkoink
Merited by ABCbits (1)
 #1

pls help me out!

where are the bold parts coming from?
THX

    /**
    * Whether public keys should be returned compressed by default.
@@ -230,16 +230,16 @@ Bitcoin.ECKey = (function () {
    // 51 characters base58, always starts with a '5'<--why?
    ECKey.isWalletImportFormat = function (key) {
       key = key.toString();
      return (ECKey.privateKeyPrefix == 0x80) ?
                     (/^5[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{50}$/.test(key)) :
                      (/^9[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{50}$/.test(key));
    };
 
    // 52 characters base58
    ECKey.isCompressedWalletImportFormat = function (key) {
       key = key.toString();
      return (ECKey.privateKeyPrefix == 0x80) ?
                     (/^[LK][123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{51}$/.test(key)) :
                      (/^c[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{51}$/.test(key));
    };
"Bitcoin: mining our own business since 2009" -- Pieter Wuille
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715055910
Hero Member
*
Offline Offline

Posts: 1715055910

View Profile Personal Message (Offline)

Ignore
1715055910
Reply with quote  #2

1715055910
Report to moderator
1715055910
Hero Member
*
Offline Offline

Posts: 1715055910

View Profile Personal Message (Offline)

Ignore
1715055910
Reply with quote  #2

1715055910
Report to moderator
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3388
Merit: 6587


Just writing some code


View Profile WWW
November 18, 2016, 10:04:27 PM
Merited by ABCbits (1)
 #2

Those are base58 check encoding prefixes. It is just the way that the encoding works with the version byte to always produce the same prefix characters. For mainnet, uncompressed keys begin with a 5, on testnet, a 9. Compressed keys begin with a K or L on mainnet and a c on testnet.

oinkoink (OP)
Jr. Member
*
Offline Offline

Activity: 34
Merit: 1


View Profile
November 19, 2016, 09:43:56 PM
 #3

eventually i got it and played with an address in the format prefix.payload.ckechsum for an uncompressed WIF key and pre.pl.01.cksum for a compressed one and that the prefix 80 results in 5 and e.g. b0 in 6 (uncompress so without 01)
uff thx...

are there alts using complete other techniques than privKey->sha256-> sha256-> checksum + to privkey -> base58encode ?
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!