It is currently Thu Feb 22, 2018 6:10 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Bitcoin addresses
PostPosted: Sun Nov 08, 2015 6:28 am 
Offline
New User
New User

Joined: Sun Nov 08, 2015 5:46 am
Posts: 2
I have programmed a set of procedures to calculate bitcoin addresses in Purebasic.

- Calculate private key from a 32 byte seed (uncompressed and compressed).
- Calculate two public keys from a 32 byte seed (uncompressed and compressed).
- Calculate a hash160 from public key and bitcoin address
- Look for received amount and balance for a bitcoin address into blockchain.info site.

For example, here is an "brain wallet" application, that converts a passphrase into a 32 byte seed, and then calculate private keys and bitcoin addressed from it.

Two additional libraries are needed:
HashLib (for SHA256 and RIPEMD160)
gmp (for large numbers operations)

This application compiled for Windows 32bit, with source code and libraries, can be downloaded from here:
https://mega.nz/#!hQ81mKJb!ApkL3nM7qtJK ... I-30YVTJ6I

All contributions and questions are welcome!
If you find useful this work for your projects, please donate to bitcoin address: 13FLoNypGzztXv9sNsQt1tgfspJJu2F4QM
Thank you

Here is the code:

Code:
XIncludeFile "HashLib.pb"
XIncludeFile "gmp.pbi"

Global ana,fnd,found$

Procedure.l WebToMem(url.s,*lpRam,ramsize.l)
  Protected agent.s, hINet.l, hData.l, bytes.l
  Define hFile
  agent.s = "Mozilla/4.0 (compatible; ST)"
  hINet.l = InternetOpen_ ( @agent.s,0,0,0,0 )
  hData.l = InternetOpenUrl_ ( hINet, @url.s, "", 0, $8000000, 0 )
  If hData > 0 : InternetReadFile_ ( hData, *lpRam, ramsize.l, @bytes.l ) : Else : bytes = -1 : EndIf
  InternetCloseHandle_ (hINet)
  InternetCloseHandle_ (hFile)
  InternetCloseHandle_ (hData)
  ProcedureReturn bytes.l
EndProcedure

Procedure.s Sinceros(big$)
  While Left(big$,1)="0"
    big$=Mid(big$,2)
  Wend
  If big$="": big$="0":EndIf
  ProcedureReturn big$
EndProcedure

Procedure.s Suma(na$,nb$)
  Define i.mpz, j.mpz, l.mpz, r.i, Str1.s, r$
  Str1=Space(4096)
  mpz_init(@i)
  mpz_init(@j)
  mpz_init(@l)
  mpz_set_str(@i,na$,10)
  mpz_set_str(@j,nb$,10)
  mpz_add(@l, @i, @j)
  r=gmp_snprintfz(@Str1,4096,"%Zd",@l)
  r$=PeekS(@Str1,-1,#PB_Ascii)
  mpz_clear(@i)
  mpz_clear(@j)
  mpz_clear(@l)
  ProcedureReturn r$
EndProcedure

Procedure.s Resta(na$,nb$)
  Define i.mpz, j.mpz, l.mpz, r.i, Str1.s, r$
  Str1=Space(4096)
  mpz_init(@i)
  mpz_init(@j)
  mpz_init(@l)
  mpz_set_str(@i,na$,10)
  mpz_set_str(@j,nb$,10)
  mpz_sub(@l, @i, @j)
  r=gmp_snprintfz(@Str1,4096,"%Zd",@l)
  r$=PeekS(@Str1,-1,#PB_Ascii)
  mpz_clear(@i)
  mpz_clear(@j)
  mpz_clear(@l)
  ProcedureReturn r$
EndProcedure

Procedure.s Multi(na$,nb$)
  Define i.mpz, j.mpz, l.mpz, r.i, Str1.s, r$
  Str1=Space(4096)
  mpz_init(@i)
  mpz_init(@j)
  mpz_init(@l)
  mpz_set_str(@i,na$,10)
  mpz_set_str(@j,nb$,10)
  mpz_mul(@l, @i, @j)
  r=gmp_snprintfz(@Str1,4096,"%Zd",@l)
  r$=PeekS(@Str1,-1,#PB_Ascii)
  mpz_clear(@i)
  mpz_clear(@j)
  mpz_clear(@l)
  ProcedureReturn r$
EndProcedure

Procedure.s Resto(na$,nb$)
  Define i.mpz, j.mpz, l.mpz, r.i, Str1.s, r$
  If nb$="0"
    r$="0"
  Else
    Str1=Space(4096)
    mpz_init(@i)
    mpz_init(@j)
    mpz_init(@l)
    mpz_set_str(@i,na$,10)
    mpz_set_str(@j,nb$,10)
    mpz_mod(@l, @i, @j)
    r=gmp_snprintfz(@Str1,4096,"%Zd",@l)
    r$=PeekS(@Str1,-1,#PB_Ascii)
    mpz_clear(@i)
    mpz_clear(@j)
    mpz_clear(@l)
  EndIf
  ProcedureReturn r$
EndProcedure

Procedure.s Divid(na$,nb$)
  Define i.mpz, j.mpz, l.mpz, r.i, Str1.s, r$
  If nb$="0"
    r$="0"
  Else
    Str1=Space(4096)
    mpz_init(@i)
    mpz_init(@j)
    mpz_init(@l)
    mpz_set_str(@i,na$,10)
    mpz_set_str(@j,nb$,10)
    mpz_fdiv_q(@l, @i, @j)
    r=gmp_snprintfz(@Str1,4096,"%Zd",@l)
    r$=PeekS(@Str1,-1,#PB_Ascii)
    mpz_clear(@i)
    mpz_clear(@j)
    mpz_clear(@l)
  EndIf
  ProcedureReturn r$
EndProcedure
 
Procedure.s Invert(na$,nb$)
  Define i.mpz, j.mpz, l.mpz, r.i, Str1.s, r$
  Str1=Space(4096)
  mpz_init(@i)
  mpz_init(@j)
  mpz_init(@l)
  mpz_set_str(@i,na$,10)
  mpz_set_str(@j,nb$,10)
  mpz_invert(@l, @i, @j)
  r=gmp_snprintfz(@Str1,4096,"%Zd",@l)
  r$=PeekS(@Str1,-1,#PB_Ascii)
  mpz_clear(@i)
  mpz_clear(@j)
  mpz_clear(@l)
  ProcedureReturn r$
EndProcedure

Procedure.s Bina(da$)
  Define i.mpz, Str1.s, r$
  Str1=Space(4096)
  mpz_init(@i)
  mpz_set_str(@i,da$,10)
  mpz_get_str(@Str1,2,@i)
  r$=PeekS(@Str1,-1,#PB_Ascii)
  mpz_clear(@i)
  ProcedureReturn r$
EndProcedure

Procedure.s Hexa(da$)
  Define i.mpz, Str1.s, r$
  Str1=Space(4096)
  mpz_init(@i)
  mpz_set_str(@i,da$,10)
  mpz_get_str(@Str1,16,@i)
  r$=PeekS(@Str1,-1,#PB_Ascii)
  mpz_clear(@i)
  If Mod(Len(r$),2)=1: r$="0"+r$: EndIf
  ProcedureReturn r$
EndProcedure

Procedure.s Deci(ha$)
  Define i.mpz, Str1.s, r$
  Str1=Space(4096)
  mpz_init(@i)
  mpz_set_str(@i,ha$,16)
  mpz_get_str(@Str1,10,@i)
  r$=PeekS(@Str1,-1,#PB_Ascii)
  mpz_clear(@i)
  ProcedureReturn r$
EndProcedure

Procedure.s Base58encode(hexa$)
  Define hs$,digi$,d$,r$,j,v0,v1,v2,deci$,b
  hs$=""
  digi$="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
  deci$=Deci(hexa$)
  While deci$>"0"
    r$=Resto(deci$,"58")
    hs$=Mid(digi$,Val(r$)+1,1)+hs$
    deci$=Divid(deci$,"58")
  Wend
  For b=1 To Len(hexa$)/2
    If Mid(hexa$,b*2-1,2)="00": hs$="1"+hs$: EndIf
  Next
  ProcedureReturn hs$
EndProcedure

Procedure.s Base58decode(code$)
  Define h$,digi$,d$,r$,j,v0,v1,v2,i,p,z$
  d$="0": z$=""
  While Left(code$,1)="1"
    z$=z$+"00"
    code$=Mid(code$,2)
  Wend
  digi$="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
  For j=1 To Len(code$)
    p=FindString(digi$,Mid(code$,j,1))-1
    d$=Suma(Multi("58",d$),Str(p))
  Next
  h$=z$+Hexa(d$)
  ProcedureReturn h$
EndProcedure

Procedure.s Checksum(hh$)
  Define *MemoryID,j,ch$,chk$
  *MemoryID = AllocateMemory(70)
  For j=1 To Len(hh$)/2
    PokeB(*MemoryID+j-1,Val("$"+Mid(hh$,j*2-1,2)))
  Next
  ch$=PureHash_SHA256Fingerprint(*MemoryID,Len(hh$)/2)
  For j=1 To Len(ch$)/2
    PokeB(*MemoryID+j-1,Val("$"+Mid(ch$,j*2-1,2)))
  Next
  chk$=PureHash_SHA256Fingerprint(*MemoryID,32)
  ProcedureReturn Left(chk$,8)
EndProcedure

Procedure.s GetBTCadd(pb$)
  Define *MemoryID,j,ch$,ad$,chk$,dec$
  *MemoryID=AllocateMemory(70)
  For j=1 To Len(pb$)/2
    PokeB(*MemoryID+j-1,Val("$"+Mid(pb$,j*2-1,2)))
  Next
  ch$=PureHash_SHA256Fingerprint(*MemoryID,Len(pb$)/2)
  For j=1 To Len(ch$)/2
    PokeB(*MemoryID+j-1,Val("$"+Mid(ch$,j*2-1,2)))
  Next
  ch$="00"+PureHash_RIPEMD160Fingerprint(*MemoryID,32)
  chk$=Checksum(ch$)
  ch$=ch$+chk$
  ad$=Base58encode(ch$)
  FreeMemory(*MemoryID)
  ProcedureReturn ad$
EndProcedure

Procedure.s GetUPrivKey(ha$)
  Define hx$,dc$,pk$
  ha$=Right("0000000000000000000000000000000000000000000000000000000000000000"+ha$,64)
  hx$="80"+ha$
  pk$=Base58encode(hx$+Checksum(hx$))
  ProcedureReturn pk$
EndProcedure

Procedure.s GetCPrivKey(ha$)
  Define hx$,dc$,pk$
  ha$=Right("0000000000000000000000000000000000000000000000000000000000000000"+ha$,64)
  hx$="80"+ha$+"01"
  pk$=Base58encode(hx$+Checksum(hx$))
  ProcedureReturn pk$
EndProcedure

Procedure.s GetPubKeys(ha$)
  Define bin$,i,pc$
  Define gx.mpz, gy.mpz, x.mpz, y.mpz, p.mpz, r.i, Str1.s, Str2.s, x$,y$,ru$,rc$
  Define a.mpz, b.mpz, c.mpz, d.mpz, l.mpz, rx.mpz, ry.mpz
  Str1=Space(4096)
  Str2=Space(4096)
  mpz_init(@gx): mpz_init(@gy): mpz_init(@rx): mpz_init(@ry)
  mpz_init(@x): mpz_init(@y): mpz_init(@a): mpz_init(@b): mpz_init(@c): mpz_init(@d)
  mpz_init(@l): mpz_init(@p)
  mpz_set_str(@p,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F",16)
  mpz_set_str(@gx,"55066263022277343669578718895168534326250603453777594175500187360389116729240",10)
  mpz_set_str(@gy,"32670510020758816978083085130507043184471273380659243275938904335757337482424",10)
  mpz_set_str(@a,ha$,16)
  mpz_get_str(@Str1,2,@a)
  bin$=PeekS(@Str1,-1,#PB_Ascii)
  mpz_add_ui(@x,@gx,0):mpz_add_ui(@y,@gy,0)
  For i=2 To Len(bin$)
    ;ECdouble
    mpz_mul_ui(@a,@x,3): mpz_mul_ui(@b,@y,2)
    mpz_mul(@c,@a,@x) : mpz_invert(@d,@b,@p)
    mpz_mul(@a,@c,@d)
    mpz_mod(@l,@a,@p) ; lam
    mpz_mul(@a,@l,@l) : mpz_mul_ui(@b,@x,2): mpz_sub(@c,@a,@b)
    mpz_mod(@rx,@c,@p)
    mpz_sub(@a,@x,@rx): mpz_mul(@b,@l,@a) : mpz_sub(@a,@b,@y)
    mpz_mod(@ry,@a,@p)
    mpz_add_ui(@x,@rx,0):mpz_add_ui(@y,@ry,0)
    If Mid(bin$,i,1)="1"
      ;ECadd     
      mpz_sub(@a,@gx,@x): mpz_invert(@b,@a,@p)
      mpz_sub(@a,@gy,@y): mpz_mul(@c,@a,@b)
      mpz_mod(@l,@c,@p) ; lad
      mpz_mul(@a,@l,@l): mpz_sub(@b,@a,@x): mpz_sub(@c,@b,@gx)
      mpz_mod(@rx,@c,@p)
      mpz_sub(@a,@x,@rx): mpz_mul(@b,@l,@a): mpz_sub(@c,@b,@y)
      mpz_mod(@ry,@c,@p)
      mpz_add_ui(@x,@rx,0):mpz_add_ui(@y,@ry,0)
    EndIf
  Next
  mpz_get_str(@Str1,16,@x)
  mpz_get_str(@Str2,16,@y)
  x$=PeekS(@Str1,-1,#PB_Ascii)
  x$=RSet(x$,64,"0")
  y$=PeekS(@Str2,-1,#PB_Ascii)
  y$=RSet(y$,64,"0")
  ru$="04"+x$+y$
  If FindString("13579bdf",Right(y$,1))>0
    rc$="03"+x$
  Else
    rc$="02"+x$
  EndIf
  mpz_clear(@gx): mpz_clear(@gy): mpz_clear(@rx): mpz_clear(@ry)
  mpz_clear(@x): mpz_clear(@y): mpz_clear(@a): mpz_clear(@b): mpz_clear(@c): mpz_clear(@d)
  mpz_clear(@l): mpz_clear(@p)
  ProcedureReturn ru$+","+rc$
EndProcedure

Procedure.s GetHash160(pb$)
  Define *MemoryID,j,ch$,ad$,chk$,dec$
  *MemoryID = AllocateMemory(70)
  For j=1 To Len(pb$)/2
    PokeB(*MemoryID+j-1,Val("$"+Mid(pb$,j*2-1,2)))
  Next
  ch$=PureHash_SHA256Fingerprint(*MemoryID,Len(pb$)/2)
  For j=1 To Len(ch$)/2
    PokeB(*MemoryID+j-1,Val("$"+Mid(ch$,j*2-1,2)))
  Next
  ch$=PureHash_RIPEMD160Fingerprint(*MemoryID,32)
  FreeMemory(*MemoryID)
  ProcedureReturn ch$
EndProcedure

Procedure.s Add2Hash(ad$)
  Define r$
  r$=Base58decode(ad$)
  ProcedureReturn Mid(r$,3,40)
EndProcedure

Procedure.s Pk2Seed(pk$)
  Define r$
  r$=Base58decode(pk$)
  ProcedureReturn Mid(r$,3,64)
EndProcedure

Procedure.d Received(ad$)
  Define zx$,v1.d,*Buff
  *Buff=AllocateMemory(1000)
  If WebToMem("https://blockchain.info/es/q/getreceivedbyaddress/"+Trim(ad$),*Buff,1000)
    zx$=PeekS(*Buff)
    v1=ValD(zx$)/100000000
  EndIf
  ProcedureReturn v1
EndProcedure

Procedure.d Balance(ad$)
  Define zx$,v1.d,*Buff
  *Buff=AllocateMemory(1000)
  If WebToMem("https://blockchain.info/es/q/addressbalance/"+Trim(ad$),*Buff,1000)
    zx$=PeekS(*Buff)
    v1=ValD(zx$)/100000000
  EndIf
  ProcedureReturn v1
EndProcedure

ana=0: fnd=0
Define i$,h$,hx$,ch$,dc$,pb$,bal.d,rcv.d,i,tx$,pk$,ad$,tx.s,k,hh$,sq$,b$,ps$,fic$,pu$,pc$,op
Define tx.s,Event,eg
Dim byt(256): Dim link.s(1000)
LoadFont(1,"Consolas",11)
LoadFont(2,"Consolas",11, #PB_Font_Bold)
LoadFont(3,"Arial",7)
OpenWindow(0,0,0,800,500,"BTC Brain Wallets",#PB_Window_MinimizeGadget|#PB_Window_SizeGadget)
SetGadgetFont(#PB_Default,FontID(2))
TextGadget(1,10,30,100,28, "Word/Phrase:")
StringGadget(30,120,28,550,28,"")
TextGadget(11,10,80,100,28,"SHA256 Seed:")
StringGadget(31,120,78,550,28,"")
SetGadgetFont(#PB_Default,FontID(1))
TextGadget(12,10,130,100,28,"Uncompressed:")
TextGadget(13,10,160,100,28,"Private Key:")
StringGadget(33,120,158,450,28,"")
TextGadget(14,10,190,100,28,"Hash 160   :")
StringGadget(34,120,188,360,28,"")
SetGadgetFont(#PB_Default,FontID(2))
TextGadget(15,10,220,100,28,"Address    :")
StringGadget(35,120,218,290,28,"")
TextGadget(16,620,210,190,20,"Rec:     0.00000000")
TextGadget(17,620,232,190,20,"Bal:     0.00000000")
SetGadgetFont(#PB_Default,FontID(1))
TextGadget(22,10,270,500,28,"Compressed: ")
TextGadget(23,10,300,100,28,"Private Key:")
StringGadget(43,120,298,450,28,"")
TextGadget(24,10,330,100,28,"Hash 160   :")
StringGadget(44,120,328,360,28,"")
SetGadgetFont(#PB_Default,FontID(2))
TextGadget(25,10,360,100,28,"Address    :")
StringGadget(45,120,358,290,28,"")
TextGadget(26,620,350,190,20,"Rec:     0.00000000")
TextGadget(27,620,372,190,20,"Bal:     0.00000000")
SetGadgetFont(#PB_Default,FontID(2))
ButtonGadget(51,690,28,90,28,"Calculate")
ButtonGadget(52,690,78,90,28,"Calculate")
ButtonGadget(55,690,450,90, 30, "Exit")
op=1
Repeat
  Event=WaitWindowEvent()
  If Event=#PB_Event_Gadget
    eg=EventGadget()
    If eg=51
      tx=Trim(GetGadgetText(30))
      h$=LCase(PureHash_SHA256Fingerprint(@tx.s,Len(tx)))
      pb$=GetPubKeys(h$)
      pu$=StringField(pb$,1,",")
      pc$=StringField(pb$,2,",")
      hh$=LCase(GetHash160(pu$))
      pk$=GetUPrivKey(h$)
      ad$=GetBTCadd(pu$)
      SetGadgetText(31,h$)
      SetGadgetText(33,pk$)
      SetGadgetText(34,hh$)
      SetGadgetText(35,ad$)
      While WindowEvent() : Wend
      rcv=Received(ad$)
      If rcv>0
        SetGadgetText(16,"Rec: "+RSet(StrD(rcv,8),14))
        Delay(2000)
        bal=Balance(ad$)
        SetGadgetText(17,"Bal: "+RSet(StrD(bal,8),14))
      Else
        SetGadgetText(16,"Rec:     0.00000000")
        SetGadgetText(17,"Bal:     0.00000000")
      EndIf
      Delay(2000)
      hh$=LCase(GetHash160(pc$))
      pk$=GetCPrivKey(h$)
      ad$=GetBTCadd(pc$)
      SetGadgetText(43,pk$)
      SetGadgetText(44,hh$)
      SetGadgetText(45,ad$)
      While WindowEvent() : Wend
      rcv=Received(ad$)
      If rcv>0
        SetGadgetText(26,"Rec: "+RSet(StrD(rcv,8),14))
        Delay(2000)
        bal=Balance(ad$)
        SetGadgetText(27,"Bal: "+RSet(StrD(bal,8),14))
      Else
        SetGadgetText(26,"Rec:     0.00000000")
        SetGadgetText(27,"Bal:     0.00000000")
      EndIf
    EndIf
    If eg=52
      h$=LCase(Left(Trim(GetGadgetText(31)),64))
      While Len(h$)<64: h$="0"+h$: Wend
      pb$=GetPubKeys(h$)
      pu$=StringField(pb$,1,",")
      pc$=StringField(pb$,2,",")
      hh$=LCase(GetHash160(pu$))
      pk$=GetUPrivKey(h$)
      ad$=GetBTCadd(pu$)
      SetGadgetText(31,h$)
      SetGadgetText(33,pk$)
      SetGadgetText(34,hh$)
      SetGadgetText(35,ad$)
      While WindowEvent() : Wend
      rcv=Received(ad$)
      If rcv>0
        SetGadgetText(16,"Rec: "+RSet(StrD(rcv,8),14))
        Delay(2000)
        bal=Balance(ad$)
        SetGadgetText(17,"Bal: "+RSet(StrD(bal,8),14))
      Else
        SetGadgetText(16,"Rec:     0.00000000")
        SetGadgetText(17,"Bal:     0.00000000")
      EndIf
      Delay(2000)
      hh$=LCase(GetHash160(pc$))
      pk$=GetCPrivKey(h$)
      ad$=GetBTCadd(pc$)
      SetGadgetText(43,pk$)
      SetGadgetText(44,hh$)
      SetGadgetText(45,ad$)
      While WindowEvent() : Wend
      rcv=Received(ad$)
      If rcv>0
        SetGadgetText(26,"Rec: "+RSet(StrD(rcv,8),14))
        Delay(2000)
        bal=Balance(ad$)
        SetGadgetText(27,"Bal: "+RSet(StrD(bal,8),14))
      Else
        SetGadgetText(26,"Rec:     0.00000000")
        SetGadgetText(27,"Bal:     0.00000000")
      EndIf
    EndIf
    If eg=55
      op=0
    EndIf
  EndIf
Until op<>1
CloseWindow(0)


Top
 Profile  
Reply with quote  
 Post subject: Re: Bitcoin addresses
PostPosted: Sun Nov 29, 2015 3:18 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Aug 03, 2003 12:06 am
Posts: 264
Location: Austria
Hi
This looks interesting at first glance.
Less interesting is that I shall install a MEGAsyncSetup.exe only to download some files. Since I will not do that I will miss this one.

Don't understand me wrong ... just a little critics ... there are 1000 solutions and websites on the internet offering free file uploads and downloads ... just easy without hazzle as rar or zip - and you selected the most unattractive way: an exe with installation ...

_________________
--------------
Yes, its an Irish Wolfhound.
Height: 107 cm; Weight: 88 kg


Last edited by Thade on Sun Nov 29, 2015 3:35 am, edited 2 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Bitcoin addresses
PostPosted: Sun Nov 29, 2015 3:26 am 
Offline
New User
New User

Joined: Sun Nov 08, 2015 5:46 am
Posts: 2
Thade wrote:
Hi
This looks interesting at first glance.
Less interesting is that I shall install a MEGAsyncSetup.exe only to download some files. Since I will not do that I will miss this one.

Don't understand me wrong ... just a little critics ... there are 1000 solutions and websites on the internet offering free file uploads and downloads ... just easy without hazzle as rar or zip - and you selected the most unattractive way: an exe with installation ...


Hi Thade

It is not necessary to install the exe, just click "download with browser" (this link is under the megasync link).
Cheers!


Top
 Profile  
Reply with quote  
 Post subject: Re: Bitcoin addresses
PostPosted: Sun Nov 29, 2015 3:32 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Aug 03, 2003 12:06 am
Posts: 264
Location: Austria
I tried that - but there is no link

Oops - sorry - I missed that link ... too late at night ... should have opened my eyes ;)
I clicked the button first without reading the line below.


Edit: Got it. Thank you very much

_________________
--------------
Yes, its an Irish Wolfhound.
Height: 107 cm; Weight: 88 kg


Top
 Profile  
Reply with quote  
 Post subject: Re: Bitcoin addresses
PostPosted: Sun Dec 06, 2015 11:50 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Mon Feb 25, 2013 5:51 pm
Posts: 521
Location: US or Estonia
I've done work with bitcoin as well. The addresses and networking aren't that interesting. Block operations and mining blocks are where all the cool stuff is. There is actually a block-chain script language you might want to look in to built right in to the implementation reference client.

_________________
The truth hurts.


Top
 Profile  
Reply with quote  
 Post subject: Re: Bitcoin addresses
PostPosted: Mon Feb 12, 2018 2:49 pm 
Offline
Enthusiast
Enthusiast

Joined: Sun Jul 29, 2012 2:51 pm
Posts: 106
I copied and pasted the code - does not compile - gives all kinds of errors.

I did download the project and lib files and put the code in the same folder so the includes would work.

Any advice?

Mike


Top
 Profile  
Reply with quote  
 Post subject: Re: Bitcoin addresses
PostPosted: Mon Feb 12, 2018 4:38 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Oct 09, 2007 2:15 am
Posts: 903
Wich Errors, Wich PB Version, Wich OS, wich....

But... I see the initial post is from 2015... so it can be tons of ASCII/Unicode issues...
Try to start it with an older PB Version (one of the year 2015) that is x86 (cause I saw a lot of .l definitions)
an compile it in ASCII Mode.

just my 2 cent ....

_________________
PureBasic 5.46 LTS / 5.61 (Windows x86/x64) | Windows10 Pro x64 | Z87-PLUS | i7 4770k | 32GB RAM | iChill GeForce GTX 980 X4 Ultra | HAF XF Evo​​
English is not my native language... (I often use DeepL to translate my texts.)


Top
 Profile  
Reply with quote  
 Post subject: Re: Bitcoin addresses
PostPosted: Tue Feb 13, 2018 12:57 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Mon Feb 25, 2013 5:51 pm
Posts: 521
Location: US or Estonia
In main source ASCII on PeekS() and WebtoM can be replaced. I didn't look at includes and didn't try to build.

It's amazing there is openssl and CSP covering every up to date OS out there out of the box and most communities are still using maybe-its-done-right RSA implementations..

I can't get motivated just to generate keys from a seed. JSON services, "tumbling", blockchain scripts, and mining are pretty much the only interesting aspects of BTC and most other worth mentioning crypto currencies like Monero and Zcash.. I've been over every line of the reference client on github before..

_________________
The truth hurts.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye