graymauser / btcposbal2csv Goto Github PK
View Code? Open in Web Editor NEWList all bitcoin addresses with positive balance.
License: BSD 3-Clause "New" or "Revised" License
List all bitcoin addresses with positive balance.
License: BSD 3-Clause "New" or "Revised" License
Not an issue as such, more of a request. Is there any chance of getting this to work with Python 3?
How can I contact you on an email?
It seems that the converter doesn't support the new BTC address format that starts with bc1 and is usually longer in length.
example:
37XuVSEpWW4trkfmvWzegTHQt7BdktSKUs (older format)
bc1qgdjqv0av3q56jvd82tkdjpy7gdp9ut8tlqmgrpmv24sq90ecnvqqjwvw97 (new format)
This is the error when it tries to convert it:
Traceback (most recent call last):
File "D:\btcposbal2csv\convert2ripemd160.py", line 41, in <module>
process(args.csvin)
File "D:\btcposbal2csv\convert2ripemd160.py", line 19, in process
ripemd_bin = tocondensed(row.split(',')[0])
File "D:\btcposbal2csv\convert2ripemd160.py", line 7, in tocondensed
return base58.b58decode(add_or_pk)[1:-4]
File "C:\Users\Lenovo\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\base58\__init__.py", line 96, in b58decode
acc = b58decode_int(v, alphabet=alphabet)
File "C:\Users\Lenovo\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\base58\__init__.py", line 79, in b58decode_int
decimal = decimal * 58 + alphabet.index(char)
ValueError: subsection not found
Hi Folks,
Given the recent publication
Which goes on to reveal that "Bitcoin private keys should be generated with 256-bits of entropy; unfortunately, affected keys generated with vulnerable BitcoinJS (or dependent projects) often used less entropy than required.... reduces the amount of necessary work anywhere from 32 to 64-bits." due to several potential problems encountered with Random Number Generation in browser-based software used at the time. And that these vulnerable wallets were created between 2011 and 2014.
What modifications would be required to the code to only produce a database of non-zero, dormant wallets generated within a targeted time period - e.g 2011-2012 or 2011-2014?
Appreciate your thoughts, thnaks
I tried several times on Windows before jumping ship and spinning up a VPS with Ubuntu 18.04 and Python 2.7
When I run pip install -r requirements.txt
you can see in the screenshot it kicks some errors and I don't know how to fix this or what it wants....
If I try to install the required modules manually I get the same error.
Any help is highy appreciated!
Hi
I run on window
I don't know what happen with below? path problem? Thanks.
D:\btcposbal2csv-master>btcposbal2csv.py chainstate addresses_with_balance.csv
usage: btcposbal2csv.py [-h] [--bitcoin_version BITCOIN_VERSION] [--keep_sqlite PATH_TO_SQLITE_FILE)] [--lowmem]
[--P2PKH bool] [--P2SH bool] [--P2PK bool] [--sort ASC/DESC]
PATH_TO_CHAINSTATE_DIR OUTFILE
btcposbal2csv.py: error: the following arguments are required: PATH_TO_CHAINSTATE_DIR, OUTFILE
I got parsed transaction 78299200 but in CSV still 1.5gb
When convert to pickle it only got about 2xxxxxxx only which not completed.
Understand Excell only go for 1048576 only.
How to solve this? Need separate to many CSV then convert to pickle?
When I run convert to pickes I got about 128pickle but when run Plutus it read total database only 2xxxxxxx only which way out of total 78299200 parsed.
Who can help on this ..thank you.tq
btcposbal2csv.py doesn't extract segwit addresses, for example:
Public Address bc1 P2WPKH: bc1qetrqrygl7t0fn6hrdmuug3rrp8vjmum8fd8rsk
Public Address bc1 P2WSH: bc1q26swzzjmqgwvcjxplktpyj9xpkzpv8kgs7t545ku6s7v6fl0xt3slnx8k9
I took a few random checks
Block 9901 of 1ly5zpj84hr5wlqsbqk6jb7jsqzkkkcnxb isn't one of them
Can I get a more complete address?
Is the generated file limited to 1.5G?
Hi!
Thank you for sharing your script.
I have tried to run convert2ripemd160.py on a .csv file containing 1 address per line (starting by "1" or "bc1") but it is returning an error (see below). The error appears when it hits adresses starting with "bc1" and if I remove them all in the .csv file there is no errors.
On Debian 10 with Python 3.7.3:
Traceback (most recent call last):
File "convert2ripemd160.py", line 46, in
process(args.csvin)
File "convert2ripemd160.py", line 22, in process
ripemd_encoded = binascii.hexlify(bytearray(script_int))
TypeError: 'NoneType' object is not iterable
On Windows with Python 3.9.2:
Traceback (most recent call last):
File "C:\Users\Dolaor\Desktop\btcposbal2csv\convert2ripemd160.py", line 46, in
process(args.csvin)
File "C:\Users\Dolaor\Desktop\btcposbal2csv\convert2ripemd160.py", line 22, in process
ripemd_encoded = binascii.hexlify(bytearray(script_int))
TypeError: cannot convert 'NoneType' object to bytearray
Thanks for your help.
I am receiving the below error, please could you assist.
(envname) jordyn@DESKTOP-R6AIPP6:~/btcposbal2csv$ python btcposbal2csv.py /mnt/b/.Bitcoin/chainstate /home/jordyn/addresses_with_balance.csv
reading chainstate database
inmem
Traceback (most recent call last):
File "btcposbal2csv.py", line 201, in
for address, sat_val, block_height in add_iter:
File "btcposbal2csv.py", line 101, in in_mem
types=get_types(in_args)):
File "/home/jordyn/btcposbal2csv/utils.py", line 314, in parse_ldb
db = plyvel.DB(fin_name, compression=None) # Change with path to chainstate
File "plyvel/_plyvel.pyx", line 247, in plyvel._plyvel.DB.init
File "plyvel/_plyvel.pyx", line 88, in plyvel._plyvel.raise_for_status
plyvel._plyvel.IOError: IO error: /mnt/b/.Bitcoin/chainstate: Invalid argument
I've tried at run it with 4GB of ram, and still got out of memory exception.
I have chainstate data on my windows machine, I am trying to run the script from WSL. But I am getting the following error.
reading chainstate database
inmem
Traceback (most recent call last):
File "btcposbal2csv.py", line 201, in
for address, sat_val, block_height in add_iter:
File "btcposbal2csv.py", line 101, in in_mem
types=get_types(in_args)):
File "/mnt/e/Finrocks/btc/btcposbal2csv/utils.py", line 323, in parse_ldb
db = plyvel.DB(fin_name, compression=None) # Change with path to chainstate
File "plyvel/_plyvel.pyx", line 247, in plyvel._plyvel.DB.init
File "plyvel/_plyvel.pyx", line 88, in plyvel._plyvel.raise_for_status
plyvel._plyvel.IOError: IO error: /mnt/f/Bitcoin/chainstate/: Invalid argument
what are the Vs for litecoin so i can edit ? im trying to make it work as arg --network litecoin
if out['out_type'] == 0:
if out['out_type'] not in types:
continue
add = hash_160_to_btc_address(out['data'], 0)
yield add, out['amount'], value['height']
elif out['out_type'] == 1:
if out['out_type'] not in types:
continue
add = hash_160_to_btc_address(out['data'], 5)
yield add, out['amount'], value['height']
elif out['out_type'] in (2, 3, 4, 5):
if out['out_type'] not in types:
continue
can you update it for python3 some lib are obsolete
hey
I'm not a professional programmer. I tried to install hashlib, plyvel and SQLite3 with python3 pip, but they couldn't succeed. Can I get all the address files directly?
thank guitar
kevin@Kevin-PC:~/btcposbal2csv$ python3 btcposbal2csv.py /windir/g/.bitcoin/chainstate/ /windir/g/bitcoin_balance.csv
reading chainstate database
inmem
Traceback (most recent call last):
File "btcposbal2csv.py", line 201, in <module>
for address, sat_val, block_height in add_iter:
File "btcposbal2csv.py", line 98, in in_mem
for add, val, height in parse_ldb(
File "/home/kevin/btcposbal2csv/utils.py", line 317, in parse_ldb
o_key = db.get((unhexlify("0e00") + "obfuscate_key"))
TypeError: can't concat str to bytes
Thank you for this great code, i was wondering is it possible to make it dump transactions hashes ?
Is this possible?
Hello graymauser, can you tell me what tool can I use to convert the generated csv file into a pickle file? Thank you graymauser
What should I do?
D:\btcposbal2csv>python btcposbal2csv.py H:\Bitcoin\chainstate addresses_with_balance.csv
reading chainstate database
inmem
Traceback (most recent call last):
File "btcposbal2csv.py", line 201, in
for address, sat_val, block_height in add_iter:
File "btcposbal2csv.py", line 98, in in_mem
for add, val, height in parse_ldb(
File "D:\btcposbal2csv\utils.py", line 317, in parse_ldb
o_key = db.get((unhexlify("0e00") + "obfuscate_key"))
TypeError: can't concat str to bytes
Running on Windows 11 64bit
Bitcoin Core 22.0
Is it possible to get this working for other chainstates? I tried with DOGE and LTC and it did not work. Thanks!
What should I do?
i find there many small error now ,Is it because it doesn't apply to the current chainstare version?
Is there a way/option to extract wallets without balance? (balance = zero satoshi)
Or all... with and without balance...
1FtZwEZKknoquUb6DyQHFZ6g6oomXJYEcb,257219114.44438908,740429
1AQthEXNcQWSfGkUiNAUi6Jj4NYuYLcqdw,5477.777777777777,572839
14frN8WdboAvn29bgED9K5zsCTYThRtzDK,7170.222222222223,586780
possible to modify this code for write all btc address with or without balance but with transaction ?
Hello, gets error with Python 3.8.5
python3 btcposbal2csv.py /root/.bitcoin/chainstate /root/addresses_with_balance.csv
reading chainstate database
inmem
Traceback (most recent call last):
File "btcposbal2csv.py", line 201, in
for address, sat_val, block_height in add_iter:
File "btcposbal2csv.py", line 98, in in_mem
for add, val, height in parse_ldb(
File "/root/btcposbal2csv-master/utils.py", line 317, in parse_ldb
o_key = db.get((unhexlify("0e00") + "obfuscate_key"))
TypeError: can't concat str to bytes
Hi,
I'm using bitcoind v0.18.0 and I have the node up2date.
When I run the btcposbal2csv.py
, it process up to transaction #58027800 before die with the error "unable to decode 831061 transactions".
(btcbal) [bitcoin@btcd btcposbal2csv]$ python btcposbal2csv.py /home/bitcoin/.bitcoin/chainstate/ addrs2.txt
reading chainstate database
inmem
parsed transactions: 58027800
unable to decode 831061 transactions
totaling 24371245714994 satoshi
writen to addrs2.txt
I have enough RAM (the process does not die with an out of memory error). At the moment of the unexpected exit, is just using around 6gb of memory.
Do anyone have any idea of what can I check?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.