Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: ptrk on February 19, 2019, 07:33:01 AM



Title: Python implementation of bs58check?
Post by: ptrk on February 19, 2019, 07:33:01 AM
Is there somewhere a bs58check library in Python available? All I could find was a NodeJs (https://github.com/bitcoinjs/bs58check) implementation. I need to convert Bitcoin addresses to Bitcoin Gold addresses and I read using bs58check is the best way to do so.
 


Title: Re: Python implementation of bs58check?
Post by: Pmalek on February 19, 2019, 09:34:36 AM
have you tried this?
https://sopaxorztaker.github.io/gold-address/

It was made by a member of Bitcointalk.
https://bitcointalk.org/index.php?topic=2485083.0


Title: Re: Python implementation of bs58check?
Post by: darosior on February 19, 2019, 11:09:59 AM
Is there somewhere a bs58check library in Python available? All I could find was a NodeJs (https://github.com/bitcoinjs/bs58check) implementation. I need to convert Bitcoin addresses to Bitcoin Gold addresses and I read using bs58check is the best way to do so.
 

Hi,

it's not a library but if you are interested in how to implement it I did at https://github.com/darosior/bitcoineasy/blob/995b98f9c440aa4fa3c428750f51b7a59b327fad/bitcoineasy/utils.py#L77


Title: Re: Python implementation of bs58check?
Post by: ptrk on February 19, 2019, 08:17:07 PM
have you tried this?
https://sopaxorztaker.github.io/gold-address/

It was made by a member of Bitcointalk.
https://bitcointalk.org/index.php?topic=2485083.0

Thanks, I know this page and the bitcointalk thread. However, the library it uses is the one (NodeJs lib) I mentioned in my first post.

Hi,
it's not a library but if you are interested in how to implement it I did at https://github.com/darosior/bitcoineasy/blob/995b98f9c440aa4fa3c428750f51b7a59b327fad/bitcoineasy/utils.py#L77

Thanks, this is what I was looking for. I will try it but it looks good so far.


Title: Re: Python implementation of bs58check?
Post by: Sukrim on February 21, 2019, 10:41:27 PM
https://github.com/keis/base58 (https://pypi.org/project/base58/) could be what you need.


Title: Re: Python implementation of bs58check?
Post by: bitaps on March 08, 2019, 01:05:13 PM
https://github.com/bitaps-com/pybtc/blob/master/pybtc/functions/encode.py#L79  Check this library


Title: Re: Python implementation of bs58check?
Post by: Karen Sloot on March 14, 2019, 08:00:38 AM
Straight Forward Python Implementation Of bs58check

var bs58check = require('bs58check')

var decoded = bs58check.decode('5Kd3NBUAdUnhyzenEwVLy9pBKxSwXvE9FMPyR4UKZvpe6E3AgLr')

console.log(decoded)
// => <Buffer 80 ed db dc 11 68 f1 da ea db d3 e4 4c 1e 3f 8f 5a 28 4c 20 29 f7 8a d2 6a f9 85 83 a4 99 de 5b 19>

console.log(bs58check.encode(decoded))
// => 5Kd3NBUAdUnhyzenEwVLy9pBKxSwXvE9FMPyR4UKZvpe6E3AgLr


Title: Re: Python implementation of bs58check?
Post by: Pmalek on March 14, 2019, 09:35:32 AM
@Karen Sloot
You need to provide the source when you copy/paste something. I assume you took that from here - https://github.com/bitcoinjs/bs58check
You first post could be a reason for getting banned, so be careful with that.


Title: Re: Python implementation of bs58check?
Post by: ptrk on March 24, 2019, 07:11:53 PM
@Karen Sloot
You need to provide the source when you copy/paste something. I assume you took that from here - https://github.com/bitcoinjs/bs58check
You first post could be a reason for getting banned, so be careful with that.

It seems to be from the mentioned source.The snippet works if the appropriate library is imported.

My question is solved. I lock this thread.