Bitcoin Forum
March 19, 2024, 05:50:28 AM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Base58  (Read 8168 times)
MrJoshua (OP)
Member
**
Offline Offline

Activity: 76
Merit: 10


View Profile
July 15, 2011, 08:30:09 PM
 #1

The base58 article is deleted. "(Non-notable ASCII encoding format, not a reference in sight, not a good candidate for an encyclopedia article.)"

http://en.wikipedia.org/wiki/Base58

What's up with that?  Can anyone help provide wikipedea with with some references (or me for that matter)?

Base58 seems odd vs. Base64


The value of bitcoins is not a theory, predictions of it's failure are what is theoretical.
1710827428
Hero Member
*
Offline Offline

Posts: 1710827428

View Profile Personal Message (Offline)

Ignore
1710827428
Reply with quote  #2

1710827428
Report to moderator
1710827428
Hero Member
*
Offline Offline

Posts: 1710827428

View Profile Personal Message (Offline)

Ignore
1710827428
Reply with quote  #2

1710827428
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
deepceleron
Legendary
*
Offline Offline

Activity: 1512
Merit: 1025



View Profile WWW
July 16, 2011, 07:15:30 PM
 #2

https://en.bitcoin.it/wiki/Base_58_Encoding

it is a character coding that reduces the chance of mistaking 1 for l or 0 for O if you re-type addresses, passwords or other information.

The same format is used for other things, like product keys etc. Google comes up with flickr URLs. There's enough reason for it to stay in wikipedia.
etotheipi
Legendary
*
expert
Offline Offline

Activity: 1428
Merit: 1093


Core Armory Developer


View Profile WWW
July 16, 2011, 08:24:55 PM
 #3

Base58 is the same concept as Base64, but without the '/', '=', 'I', 'l', '0', and 'O' characters.  This guarantees that the address consists only of alphanumeric characters, and ones that are easily identifiable in any font.

Since python handles arbitrarily large integers, Base58 can be defined the "mathematical" way without having to worry about integer overflows.  The left-most digits are the most significant bits:

Code:
b58_digits = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'

def base58str_to_int(b58str):
   n = 0
   for s in b58str:
      n *= 58
      digit = b58_digits.index(s)
      n += digit
   return n

Then:
Code:
>>> base58Str_to_int('Eto')
46736

Because:
46736 = index('E') * 58^2 + index('t') * 58 + index('o') = 13*58*58 + 51*58 + 46

Hope that helps!
-Eto




Founder and CEO of Armory Technologies, Inc.
Armory Bitcoin Wallet: Bringing cold storage to the average user!
Only use Armory software signed by the Armory Offline Signing Key (0x98832223)

Please donate to the Armory project by clicking here!    (or donate directly via 1QBDLYTDFHHZAABYSKGKPWKLSXZWCCJQBX -- yes, it's a real address!)
julz
Legendary
*
Offline Offline

Activity: 1092
Merit: 1001



View Profile
July 17, 2011, 03:48:44 AM
 #4

https://en.bitcoin.it/wiki/Base_58_Encoding

it is a character coding that reduces the chance of mistaking 1 for l or 0 for O if you re-type addresses, passwords or other information.

The same format is used for other things, like product keys etc. Google comes up with flickr URLs. There's enough reason for it to stay in wikipedia.

Except.. I gather that flickr uses a slightly different alphabet for their base58.

@electricwings   BM-GtyD5exuDJ2kvEbr41XchkC8x9hPxdFd
wumpus
Hero Member
*****
qt
Offline Offline

Activity: 812
Merit: 1022

No Maps for These Territories


View Profile
July 17, 2011, 09:53:37 AM
 #5

Sigh, more wikipedia delete-fetishism  Roll Eyes

Bitcoin Core developer [PGP] Warning: For most, coin loss is a larger risk than coin theft. A disk can die any time. Regularly back up your wallet through FileBackup Wallet to an external storage or the (encrypted!) cloud. Use a separate offline wallet for storing larger amounts.
TeraPool
Newbie
*
Offline Offline

Activity: 42
Merit: 0


View Profile
July 18, 2011, 02:53:53 AM
 #6

Who is "Cyde" to say that it is not worthy encyclopedic material.

It's not like we're making the wikipedia encyclopedia too heavy to ship or anything.

If somebody wants information on Base 58, they should be able to find it.

If they have no idea what Base 58 is, they shouldn't really mind that wikipedia has an article on it.
MrJoshua (OP)
Member
**
Offline Offline

Activity: 76
Merit: 10


View Profile
August 07, 2011, 10:26:56 AM
 #7

The problem is the lack of site-able references.  The bitcoin wiki article doesn't explain why it exists, so until there is an article somewhere that explains the logic of base58 I fear we will never see it at wikipedia.


The value of bitcoins is not a theory, predictions of it's failure are what is theoretical.
oOoOo
Full Member
***
Offline Offline

Activity: 238
Merit: 100


View Profile
August 07, 2011, 06:18:51 PM
 #8


46736 = index('E') * 58^2 + index('t') * 58 + index('o') = 13*58*58 + 51*58 + 46

Hope that helps!
-Eto


so, "test" would be
(51 * 58 * 58 * 58) + (37 * 58 * 58) + (50 * 58) + (51) which would be 10078131. Is this correct?
.
jackjack
Legendary
*
Offline Offline

Activity: 1176
Merit: 1233


May Bitcoin be touched by his Noodly Appendage


View Profile
August 07, 2011, 07:11:01 PM
 #9


46736 = index('E') * 58^2 + index('t') * 58 + index('o') = 13*58*58 + 51*58 + 46

Hope that helps!
-Eto


so, "test" would be
(51 * 58 * 58 * 58) + (37 * 58 * 58) + (50 * 58) + (51) which would be 10078131. Is this correct?
.
Yes

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
oOoOo
Full Member
***
Offline Offline

Activity: 238
Merit: 100


View Profile
August 08, 2011, 01:23:11 PM
 #10

lol! how am I supposed to calculate 51 * 58^33 ??
etotheipi
Legendary
*
expert
Offline Offline

Activity: 1428
Merit: 1093


Core Armory Developer


View Profile WWW
August 08, 2011, 01:47:08 PM
 #11

If you're doing it in Python, you just "58**33" since it can handle arbitrarily large integers.   If you're doing it in another language such as C++, there is no native integer representation larger than 64-bits, so you have need a special class.  I believe the OpenSSL C++ library uses a "bignum" class, or you can google for a open-source solutions, such as this one. There will be an option somewhere ,for just about every language...

Btw, why do you need 58**33?  For bitcoin, most Base58 addresses are about 25 characters long.  This means, the biggest int you would need would be about 58**26

Founder and CEO of Armory Technologies, Inc.
Armory Bitcoin Wallet: Bringing cold storage to the average user!
Only use Armory software signed by the Armory Offline Signing Key (0x98832223)

Please donate to the Armory project by clicking here!    (or donate directly via 1QBDLYTDFHHZAABYSKGKPWKLSXZWCCJQBX -- yes, it's a real address!)
kjj
Legendary
*
Offline Offline

Activity: 1302
Merit: 1024



View Profile
August 08, 2011, 02:51:27 PM
 #12

lol! how am I supposed to calculate 51 * 58^33 ??

Use BC.

Code:
root@inana:~# bc
bc 1.06
Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
51 * 58^33
795598514708271371396201516761468809858422083444006597951488

It is in POSIX, so libraries can be found for just about any language or platform.  Here is a PHP example:

Code:
root@inana:~# cat b58.php
<?php
echo bcmul("51",bcpow("58","33"))."\n";
?>

root@inana:~# php -q b58.php
795598514708271371396201516761468809858422083444006597951488
root@inana:~#

17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8
I routinely ignore posters with paid advertising in their sigs.  You should too.
oOoOo
Full Member
***
Offline Offline

Activity: 238
Merit: 100


View Profile
August 08, 2011, 06:29:03 PM
 #13

Btw, why do you need 58**33?  For bitcoin, most Base58 addresses are about 25 characters long.  This means, the biggest int you would need would be about 58**26

What do you mean? My favorite priv key, 5K5zGnFRJAD3viw93hPQLq5Fa3xsLFGYC9yoGMcmVdS1CEaKYs7, which I use everywhere, is 50 characters long! (more or less)
.
jackjack
Legendary
*
Offline Offline

Activity: 1176
Merit: 1233


May Bitcoin be touched by his Noodly Appendage


View Profile
August 08, 2011, 06:33:42 PM
 #14

Btw, why do you need 58**33?  For bitcoin, most Base58 addresses are about 25 characters long.  This means, the biggest int you would need would be about 58**26

What do you mean? My favorite priv key, 5K5zGnFRJAD3viw93hPQLq5Fa3xsLFGYC9yoGMcmVdS1CEaKYs7, which I use everywhere, is 50 characters long! (more or less)
.
I bet it's a fake Grin

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
oOoOo
Full Member
***
Offline Offline

Activity: 238
Merit: 100


View Profile
August 08, 2011, 06:35:20 PM
 #15

No! It's a real key, containing all my life savings (0).

5K5z GnFR JAD3 viw9 3hPQ Lq5F a3xs LFGY C9yo GMcm VdS1 CEaK Ys7

4 18 4 57-15 45 14 24-17 9 12 2-56 41 54 8-2 40 22 23-19 48 4 14-33 2 55 50-19 14 15 31-11 8 56 46-
15 20 35 44-28 36 25 0-11 13 33 18-31 50 6  

5935532256285717999993358604737352755352447108304822663869987597039882747861497 3660266496+
4605154336773401896546571331261739206738967584029603790933611066668874545754610 025365504+
1764426948955326397144280203548559083041750032195250494610578952746695228258471 2740864+
4335014486657482958501033258718442574714644475652124060034612082179380517704002 699264+
1966884975797406061025877159128149988527515642310401116168154302259247058849366 0160+
1017354297826244514323729565066284476824577056367448853190424639099610547680706 560+
5457072861903227279897399965872790297143325206568691166538676225055382248095744+
161292793947878638814701476823826314201280547977399738912473188917893071372288+
1969811420340471882076095622130062745274259565815945087293135209485763084288+
17980023106556031377976532047840329317919204961808829397199002926340636672+
413333864518529456964977748226214467078602412915145503383885124743462912+
1187740989995774301623499276512110537582190841710188228114612427423744+
573392202066925524921689305902398190556919716687677075641537033928704+
7238017329046781564590289883620174203458654059173263577987382509568+
164362041954804964040317768593561567277866828929922722124187828224+
419826416231941159745383827825189188449212845287158932628832256+
1809596621689401550626654430280987881246607091754995399262208+
623998835065310879526432562165857890085036928191377723883520+
5917230332515879029992032917090031716323626043194099105792+
106658540476383399443430060417767029369469748427479842816+
1519124639468729077530113304301029653688099865159008256+
66168768325316693032164644833438678200570593037778944+
95070069432926283092190581657239480173233610686464+
5736986948538655014183914410350658286315821334528+
233153410470167014123237900913265669271455793152+
243629478025252888321042738676348661725659136+
115513976649904386703942677820682555128545280+
1810563897333924556488129746405682682265600+
11862315189429160887336022476451024470016+
150700918921967561182127327287036608512+
2783883970233390908536834863676784640+
99195865606017377200737793993080832+
606871257878860483430542677377024+
7609670945189473146464484982784+
918408562350453655607782670336+
13007017816539676157006774272+
73127911262404476145090560+
1681101408331137382645760+
50722887320336041717760+
1099412336007283662848+
12062517793183363072+
267395714627217408+
3201577042950400+
0+
418755617984+
8532637984+
373444368+
3512016+
104284+
2900+
6

result: 6398247687543120230611217925528537819731860764507939242623555882076675375130382 4780494710

Now I only need to find a way to turn this into hex, and I'm done! YAY
jackjack
Legendary
*
Offline Offline

Activity: 1176
Merit: 1233


May Bitcoin be touched by his Noodly Appendage


View Profile
August 08, 2011, 06:37:01 PM
 #16

Pywallet says:
Code:
Address (Bitcoin): 1GPtKcQXVnayMz7fjyZnr89oVoFiCMTv2P
Privkey (Bitcoin): 5K5zGnFRJAD3viw93hPQLq5Fa3xsLFGYC9yoGMcmVdS1CEaKYs7
Hexprivkey: a7593394a809fe36b10fb3203480dd789fd12e771b07e3df50b37080714f1d2e

And Block Explorer says 'never used' Tongue

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
oOoOo
Full Member
***
Offline Offline

Activity: 238
Merit: 100


View Profile
August 08, 2011, 06:40:51 PM
Last edit: August 08, 2011, 06:58:19 PM by oOoOo
 #17

Yeah, because I have yet to find a way to convert it from base58 into a usable hex key like the ones stored in the wallet... At least to know what the result of such a conversion looks like, would already be a big help.

EDIT:
Code:
Hexprivkey: a7593394a809fe36b10fb3203480dd789fd12e771b07e3df50b37080714f1d2e

oh cool! are these two
6398247687543120230611217925528537819731860764507939242623555882076675375130382
and
a7593394a809fe36b10fb3203480dd789fd12e771b07e3df50b37080714f1d2e
the same?
etotheipi
Legendary
*
expert
Offline Offline

Activity: 1428
Merit: 1093


Core Armory Developer


View Profile WWW
August 08, 2011, 07:43:42 PM
 #18

Allow me to inject some sanity into this adventure (although it is fun):

(1) An ECDSA private key is literally a random number, between 1 and slightly less than 2^256 (something like 0.999999999*(2^256))
(2) Any number greater than that range is identical to private key that is in in the range of (1)

Therefore, you can pick yourself a 4000-bit ECDSA key if you wanted, but there's an equivalent 256-bit key, and you might as well use that one because it's shorter.  

Speaking of this, I miscalculated in my previous post.  The maximum address size is actually 33 Base58 characters, so I shouldn't have given you a hard time about wanting to calculate 58^33.  Sorry!

-Eto


Founder and CEO of Armory Technologies, Inc.
Armory Bitcoin Wallet: Bringing cold storage to the average user!
Only use Armory software signed by the Armory Offline Signing Key (0x98832223)

Please donate to the Armory project by clicking here!    (or donate directly via 1QBDLYTDFHHZAABYSKGKPWKLSXZWCCJQBX -- yes, it's a real address!)
jackjack
Legendary
*
Offline Offline

Activity: 1176
Merit: 1233


May Bitcoin be touched by his Noodly Appendage


View Profile
August 08, 2011, 09:17:32 PM
 #19

Yeah, because I have yet to find a way to convert it from base58 into a usable hex key like the ones stored in the wallet... At least to know what the result of such a conversion looks like, would already be a big help.

EDIT:
Code:
Hexprivkey: a7593394a809fe36b10fb3203480dd789fd12e771b07e3df50b37080714f1d2e

oh cool! are these two
6398247687543120230611217925528537819731860764507939242623555882076675375130382
and
a7593394a809fe36b10fb3203480dd789fd12e771b07e3df50b37080714f1d2e
the same?
I'm sure a7593394a809fe36b10fb3203480dd789fd12e771b07e3df50b37080714f1d2e is equivalent to 5K5zGnFRJAD3viw93hPQLq5Fa3xsLFGYC9yoGMcmVdS1CEaKYs7
If you are sure 5K5zGnFRJAD3viw93hPQLq5Fa3xsLFGYC9yoGMcmVdS1CEaKYs7 is equivalent to 6398247687543120230611217925528537819731860764507939242623555882076675375130382
Then yes they are the same

Allow me to inject some sanity into this adventure (although it is fun):

(1) An ECDSA private key is literally a random number, between 1 and slightly less than 2^256 (something like 0.999999999*(2^256))
(2) Any number greater than that range is identical to private key that is in in the range of (1)

Therefore, you can pick yourself a 4000-bit ECDSA key if you wanted, but there's an equivalent 256-bit key, and you might as well use that one because it's shorter.   

Speaking of this, I miscalculated in my previous post.  The maximum address size is actually 33 Base58 characters, so I shouldn't have given you a hard time about wanting to calculate 58^33.  Sorry!

-Eto


For those interested by the exact value: 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 is equivalent to 0, so [...]142 to 1, etc

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
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!