Title: javascript address validation? 0.2 BTC bounty (bounty paid) Post by: bytemaster on May 25, 2011, 03:08:17 PM I am looking for something off the shelf that takes an address and validates it via javascript.
Something like this... validate_btc( address ) { return { version:0, hash:'...' } or false; } I figure it is out there somewhere and google is failing me, so only a small tip, 0.1 BTC, for an answer. Title: Re: javascript address validation? 0.1 BTC bounty Post by: Alex Beckenham on May 25, 2011, 03:11:44 PM I figure it is out there somewhere and google is failing me, so only a small tip, 0.1 BTC, for an answer. I will double that, purely out of curiosity... 0.1 from me too. Title: Re: javascript address validation? 0.2 BTC bounty Post by: unfinishe on May 25, 2011, 07:01:12 PM Well, going off of this thread, http://forum.bitcoin.org/index.php?topic=1026.0 , I was able to make a Javascript version of the code here:
http://dl.dropbox.com/u/28441300/check.html (Code and example) http://dl.dropbox.com/u/28441300/sha256.js http://dl.dropbox.com/u/28441300/BigInt.js Title: Re: javascript address validation? 0.2 BTC bounty Post by: Alex Beckenham on May 26, 2011, 01:21:12 AM Well, going off of this thread, http://forum.bitcoin.org/index.php?topic=1026.0 , I was able to make a Javascript version of the code here: http://dl.dropbox.com/u/28441300/check.html (Code and example) http://dl.dropbox.com/u/28441300/sha256.js http://dl.dropbox.com/u/28441300/BigInt.js Good stuff! Just sent 0.1 to your 'college Ramen' fund :) Title: Re: javascript address validation? 0.2 BTC bounty Post by: bytemaster on May 26, 2011, 01:44:28 AM Thanks, 0.1BTC sent to 17TMiP6xtT4PJu6tQoKb5L8xEL1AA7dafS
Title: Re: javascript address validation? 0.2 BTC bounty (bounty paid) Post by: unfinishe on May 26, 2011, 03:21:20 AM Thank you!
Title: Re: javascript address validation? 0.2 BTC bounty (bounty paid) Post by: DBordello on February 21, 2012, 07:01:27 PM I appear to have found a false negative.
This address does not pass, however is a valid bitcoin address: 1RRi5kDMck5cj2ob4UcjKxnGL2sjknRtv Thoughts on what it doesn't like? Title: Re: javascript address validation? 0.2 BTC bounty (bounty paid) Post by: Joric on February 22, 2012, 07:05:54 AM Tried to debug unfinishe's version, found a strange 4-bit shift which I was unable to fix:
1RRi5kDMck5cj2ob4UcjKxnGL2sjknRtv <- base58 address than gives false negative 00 04 9e 9b c9 36 6d fc 95 15 5e 53 00 84 a7 2a bf 6d 59 1f 07 <- b58decode 00 49 e9 bc 93 66 df c9 51 55 e5 30 08 4a 72 ab f6 d5 91 f0 72 <- javascript It's either bignum or base58 implementation. This one works fine http://pastebin.com/B5r3P5Ny (I used modified bitaddress.org code). |