Hey everyone, I could really use some help here. I'm trying to figure out how to download all the Bitcoin public keys that have been involved in transactions, but I can't seem to find a method to do it.
How to get all Bitcoin public keys from transactions
5 replies 215 views
stack_2017Senior Member
Posts: 201 · Reputation: 1389
#2Jan 19, 2017, 02:02 AM
Do you mean the bitcoin addresses? If so, then take a look here: https://bitcointalk.org/index.php?topic=5254914.0
This doesn't list all addresses that made a transaction though. Only the ones with a balance.
humbleledgerLegendary
Posts: 1027 · Reputation: 6554
#3Jan 19, 2017, 10:13 PM
For pubkeys, start reading around this post. I haven't updated it anymore, and since my server is gone (I'm currently in the process of replacing it), I can't easily work on the data now.
If you adapt it to Bitcoin Core, it will be faster.
python
>>Start block height: 735000
>>End block height: 735003
INFO:root:Processing block: 735000
INFO:root:Saved 1834 unique public keys from block 735000 to pubkeys.txt
INFO:root:Processing block: 735001
INFO:root:Saved 2360 unique public keys from block 735001 to pubkeys.txt
INFO:root:Processing block: 735002
INFO:root:Saved 2244 unique public keys from block 735002 to pubkeys.txt
INFO:root:Processing block: 735003
INFO:root:Saved 795 unique public keys from block 735003 to pubkeys.txt
I'm not aware of any website which share list of public keys that made a transaction. But you can see thread Bitcoin Public Key Database with balance 2009-2022 for ways to obtain it by yourself.
Looks great, but what kind of address can be parsed? From quick read, it seems it only support P2PKH and P2WPKH.
TY!, here is an improved script that extracts the different addresses where Pubkey is exposed:
>>Start block height: 874101
End block height: 874102
INFO:root:Processing block: 874101
INFO:root:Saved 3814 unique public keys and addresses from block 874101 to pubkeys.txt
INFO:root:Processing block: 874102
INFO:root:Saved 2918 unique public keys and addresses from block 874102 to pubkeys.txt
and for a unique TX:
>>Tx hash: 4c51abc2d2972e9ad4044ad55d1d26c5c6a41c77ab3ac68fc91249d1920837e6
INFO:root:Processing tx: 4c51abc2d2972e9ad4044ad55d1d26c5c6a41c77ab3ac68fc91249d1920837e6
INFO:root:Saved 4 unique public keys and addresses from transaction 4c51abc2d2972e9ad4044ad55d1d26c5c6a41c77ab3ac68fc91249d1920837e6 to pubs_tx.txt
Related topics
- bitcoin-qt sync issues and slow speeds 6
- Recovering a Bitcoin wallet and address 8
- Affordable quiet mini PC for running a Bitcoin node and blockchain explorer 19
- Electrum Fees for Transactions 13
- Using two different Bitcoin versions without messing up blockchain data 3
- Issue with Bitcoin Core Wallet after power outage 8