richardkiss / pycoin

Python-based Bitcoin and alt-coin utility library.
MIT License
1.4k stars 497 forks source link

Bitcoin address to Hash160 #238

Closed Napulsnik closed 6 years ago

Napulsnik commented 7 years ago

Hello. How can I get Hash160 (only) from Bitcoin address? I have txt file whith addresses. Example: cat addresses.txt | ku | grep hash160 > result.txt - Not working ku addresses.txt | grep hash160 > result.txt - can't parse

richardkiss commented 7 years ago

Try

cat address | xargs -n1| ku | grep hash160

On Fri, Aug 4, 2017 at 16:37 Napulsnik notifications@github.com wrote:

Hello. How can I get Hash160 (only) from Bitcoin address? I have txt file whith addresses. Example: cat addresses.txt | ku | grep hash160 > result.txt - Not working ku addresses.txt | grep hash160 > result.txt - can't parse

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/richardkiss/pycoin/issues/238, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAU2NqnJFL7sDrQ-dpOIxO5gOs4_FGPks5sU48BgaJpZM4OuN0C .

Napulsnik commented 7 years ago

Hi. $ cat addr.txt | xargs -n1 | ku | grep hash160 > hash160.txt usage: ku [-h] [-w] [-W] [-a] [-u] [-P] [-j] [-s SUBKEY] [-n {BTC,XTN,LTC,XLT,VIA,TVI,FTC,FTX,DOGE,XDT,BC,DASH,tDASH,MEC,MYR,UNO,JBS,MZC,RIC,DFC,FAI,ARG,ZEC,BTCD}] [--override-network {BTC,XTN,LTC,XLT,VIA,TVI,FTC,FTX,DOGE,XDT,BC,DASH,tDASH,MEC,MYR,UNO,JBS,MZC,RIC,DFC,FAI,ARG,ZEC,BTCD}] item [item ...] ku: error: too few arguments xargs: echo: terminated by signal 13

richardkiss commented 7 years ago

Sorry, no "|" between xargs and ku.

cat addr.txt | xargs -n1 ku | grep hash160

You can also use -j in ku to create json output, and then parse it with a command-line json processor like https://stedolan.github.io/jq/

richardkiss commented 6 years ago

Did you get this working? Can I close this issue?

Napulsnik commented 6 years ago

Yes, thank you!

agoora commented 6 years ago

Command "cat addr.txt | xargs -n1 ku | grep hash160" give me this message :

can't parse 3A1Rp7pkcETkukPjLBvW3AUYwfrokZEfuQ can't parse 3Po6LdjDSVRwsGJYA6avhvo82fTzxjFmA7

Where is the problem ?