Bitcoin Forum
May 03, 2024, 06:43:19 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Mathematica Base58encode function  (Read 785 times)
Altoidnerd (OP)
Sr. Member
****
Offline Offline

Activity: 406
Merit: 251


http://altoidnerd.com


View Profile WWW
January 24, 2014, 12:51:12 AM
Last edit: January 24, 2014, 03:20:55 AM by Altoidnerd
 #1

I want wolfram to start including packaged functions for bitcoin.  Here is one that tries to take a large int as an argument and encodes the bitcoin base58 symbol chart, but I'd like someone to check this works

Code:
base58encode[v_] := 
 StringJoin[
  IntegerDigits[v, 58] /. ((*the rest encodes the symbol chart*)
    Table[i -> ToString[i + 1], {i, 0, 8}]~Join~
     Table[i ->
       DeleteCases[CharacterRange["A", "Z"],
         x_ /; x == "I" || x == "O"][[i - 8]], {i, 9, 32}]~Join~
     Table[i ->
       DeleteCases[CharacterRange["a", "z"], "l"][[i - 32]], {i, 33,
       57}])]

Here is an example of the function executing

Code:
In[11]:= base58encode[2^210-8676823059+9832745091327059]

Out[11]= YMeFyt4YTd4bsX4GLEupDjyGbF2oLbW1LCGw

Sanity check: does it work?  What else can we make so that raspberry pi + wolfram people can use bitcoin?

If this works properly, I'll write tools to go from the keys to addresses, etc.

Do you even mine?
http://altoidnerd.com 
12gKRdrz7yy7erg5apUvSRGemypTUvBRuJ
1714718599
Hero Member
*
Offline Offline

Posts: 1714718599

View Profile Personal Message (Offline)

Ignore
1714718599
Reply with quote  #2

1714718599
Report to moderator
1714718599
Hero Member
*
Offline Offline

Posts: 1714718599

View Profile Personal Message (Offline)

Ignore
1714718599
Reply with quote  #2

1714718599
Report to moderator
"There should not be any signed int. If you've found a signed int somewhere, please tell me (within the next 25 years please) and I'll change it to unsigned int." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714718599
Hero Member
*
Offline Offline

Posts: 1714718599

View Profile Personal Message (Offline)

Ignore
1714718599
Reply with quote  #2

1714718599
Report to moderator
1714718599
Hero Member
*
Offline Offline

Posts: 1714718599

View Profile Personal Message (Offline)

Ignore
1714718599
Reply with quote  #2

1714718599
Report to moderator
Altoidnerd (OP)
Sr. Member
****
Offline Offline

Activity: 406
Merit: 251


http://altoidnerd.com


View Profile WWW
January 24, 2014, 03:22:01 AM
 #2

Its based on this https://en.bitcoin.it/wiki/Base58Check_encoding#Base58_symbol_chart

Do you even mine?
http://altoidnerd.com 
12gKRdrz7yy7erg5apUvSRGemypTUvBRuJ
Altoidnerd (OP)
Sr. Member
****
Offline Offline

Activity: 406
Merit: 251


http://altoidnerd.com


View Profile WWW
January 24, 2014, 02:08:16 PM
 #3

Wolfram, the maniacal thing he is..he's pushing his language relentlessly. It's on r pi prepackaged.  It's not too bad an idea to get a library going.  

I just hope I understand the Base58check correctly...then I won't be so durn shy 'bout it.

Do you even mine?
http://altoidnerd.com 
12gKRdrz7yy7erg5apUvSRGemypTUvBRuJ
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!