Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: citb0in on November 27, 2022, 09:32:35 AM



Title: private key - quick balance check for several addresses / coins
Post by: citb0in on November 27, 2022, 09:32:35 AM
Hi all,

i remember reading somewhere regarding a bitcoin puzzle that someone had found a private key and deducted the prize money not only from the corresponding bitcoin (mainnet) address, but also correspondingly from Bitcoin Gold, Bitcoin SV or maybe others.

Let's say someone finds a valid private key from the well-known 32 BTC puzzle. He can quickly take his reward from the the Bitcoin address. Is there a known open-source tool that additionally to Bitcoin mainnet spits out all possible addresses from other networks from that private key? At best, it should also make an API call to query an online block explorer and check whether the respective address also is funded.

For example mass balance-check for

Bitcoin (BTC)
Bitcoin Cash (BCH)
Bitcoin SV (BSV)
Ethereum (ETH)
Litecoin (LTC)
Dogecoin (DOGE)
Dash (DASH)
Zcash (ZEC)
... or others you may think of

Of course, this should all work on the local computer and not on an online website, because you never enter private keys on an online platform, because the operator could know and abuse its content. If anyone knows of such a tool, I would be very grateful.


Title: Re: private key - quick balance check for several addresses / coins
Post by: hosseinimr93 on November 27, 2022, 09:40:49 AM
Take note that Bitcoin Gold and Bitcon SV are forks of bitcoin. So, if you find a private key of a bitcoin address funded before those hard forks time, you should be able to move the forked coins as well.
A bitcoin private key isn't a valid ethereum private key or a valid Dash private key and you can't use that private key to move fund in those blockchains.


Title: Re: private key - quick balance check for several addresses / coins
Post by: citb0in on November 27, 2022, 09:43:52 AM
Aha, now I understand. So this would only work with Bitcoin Gold and Bitcoin SV, right? I have no idea about Bitcoin Gold or SV and have never dealt with them. For example, would the key "1234" generate the same address for Bitcoin Gold and SV or what is the easiest way to get the respective address for this key ? For Bitcoin I know countless tools, but how do I get the result for Gold and SV ?


Title: Re: private key - quick balance check for several addresses / coins
Post by: hosseinimr93 on November 27, 2022, 09:52:26 AM
Aha, now I understand. So this would only work with Bitcoin Gold and Bitcoin SV, right?
A bitcoin private key should work for all bitcoin forks as well.
The most popular forked coin is bitcoin cash (BCH). The bitcoin cash fork happened on August, 1, 2017. Any bitcoin transaction made before that date exists in the bitcoin cash blockchain as well.
So, if a bitcoin address has received fund before that date, it has received bitcoin cash as well.


Title: Re: private key - quick balance check for several addresses / coins
Post by: Charles-Tim on November 27, 2022, 09:54:58 AM
i remember reading somewhere regarding a bitcoin puzzle that someone had found a private key and deducted the prize money not only from the corresponding bitcoin (mainnet) address, but also correspondingly from Bitcoin Gold, Bitcoin SV or maybe others.
Bitcoin SV (BSV) is never a fork of bitcoin, it was a fork from BCH, so no coin can be claimed if you have bitcoin, using a private key wallet before the fork.

To claim forked coins, you can use this guide: LoyceV's Bitcoin Fork claiming guide (and service) (https://bitcointalk.org/index.php?topic=2836875.0)

Bitcoin (BTC)
Bitcoin Cash (BCH)
Bitcoin SV (BSV)
Ethereum (ETH)
Litecoin (LTC)
Dogecoin (DOGE)
Dash (DASH)
Zcash (ZEC)
Others that you mentioned except BCH are not forks of bitcoin, check the forks from the above link.


Title: Re: private key - quick balance check for several addresses / coins
Post by: citb0in on November 27, 2022, 09:56:01 AM
Understood. For example, this adress 1CYGAH11BRDtTfX13SDSjBvrxJpmugRwSm (https://blockchair.com/search?q=1CYGAH11BRDtTfX13SDSjBvrxJpmugRwSm) has three entries in the block explorer
Quote

Bitcoin BTC
1CYGAH11BRDtTfX13SDSjBvrxJpmugRwSm
Balance: 0.00000000 BTC 0.00000000 USD

Bitcoin Cash BCH
1CYGAH11BRDtTfX13SDSjBvrxJpmugRwSm
Balance: 0.00000000 BCH 0.00000000 USD

Bitcoin SV BSV
1CYGAH11BRDtTfX13SDSjBvrxJpmugRwSm
Balance: 0.00000000 BSV 0.00000000 USD

Thank you.


Title: Re: private key - quick balance check for several addresses / coins
Post by: PawGo on November 27, 2022, 11:30:46 AM
Understood. For example, this adress 1CYGAH11BRDtTfX13SDSjBvrxJpmugRwSm (https://blockchair.com/search?q=1CYGAH11BRDtTfX13SDSjBvrxJpmugRwSm) has three entries in the block explorer
Quote
Bitcoin BTC

Bitcoin Cash BCH

Bitcoin SV BSV

That's only what your block explored shows (I assume you use blockchair.com, right)? There are other fork coins, it is really well described in Loyce's topic, mentioned before.
You may also use page https://findmycoins.ninja/ At least they provide links to explorers of other coins, so you may check the balance there, for example: http://explorer.btcd.io/#/address?loading=true&address=1CYGAH11BRDtTfX13SDSjBvrxJpmugRwSm


Title: Re: private key - quick balance check for several addresses / coins
Post by: citb0in on November 27, 2022, 12:09:15 PM
Thank you for the feedback.

I would favor a solution where I enter a Bitcoin address (e.g. 1CYGAH11BRDtTfX13SDSjBvrxJpmugRwSm) and all known fork addresses including balance are listed. The site https://findmycoins.ninja suggested by PawGo shows me some alternative fork addresses, but not its balance.

https://i.ibb.co/JkHK6BN/forked-coins.png (https://ibb.co/C0QzC1q)

I would even prefer a CLI tool (via command line, no matter if bash or python or other). But I'm also happy with online tools, better than nothing.


Title: Re: private key - quick balance check for several addresses / coins
Post by: pooya87 on November 28, 2022, 04:00:35 AM
A bitcoin private key isn't a valid ethereum private key or a valid Dash private key and you can't use that private key to move fund in those blockchains.
Since a lot of shitcoins like Ethereum and DASH have copied bitcoin where it matters (ie. key generation and elliptic curve, namely secp256k1) a bitcoin private key is always valid for those shitcoins too.
The only thing different is how they generate the address. For example IIRC Ethereum computes the keccak256 hash of the public key and truncates it to produce the address. Otherwise the private key and public key are both the same.


Title: Re: private key - quick balance check for several addresses / coins
Post by: MixMAx123 on November 28, 2022, 04:07:57 AM
This Java program may be that what you are looking for.

https://github.com/MrMaxweII/Bitcoin-Address-Generator

https://user-images.githubusercontent.com/34688939/75117189-a18dba00-566f-11ea-9ff1-2c1db29ded1a.png


You can enter the Priv.Key in different formats.
You get 4 formats of the addresses.
The credit is displayed below. (The credit is queried online by API)
I think you can manage over 1000 coins.




Title: Re: private key - quick balance check for several addresses / coins
Post by: citb0in on November 28, 2022, 06:46:38 AM
unfortunately not really helpful. The tool does not do more (but a lot less) than other common Bitcoin tools or libraries. It does generate the addresses to a private key, but no balance line appears at the bottom as in your screenshot and thus the account balance is not queried. But even if this would work, it would not be helpful for the described intended use, because the other coins would not be displayed and queried.

By the way, the tool only works exclusively with Bitcoin, because there is no other selection in the top left dropdown. Nevertheless, thanks for the effort and the link.


Title: Re: private key - quick balance check for several addresses / coins
Post by: PawGo on November 28, 2022, 07:54:18 AM
This Java program may be that what you are looking for.
https://github.com/MrMaxweII/Bitcoin-Address-Generator


Sehr gut! I though it is only me using Java here :) Props for QR codes! In my programs I used bitcoinj library but I see you went 'deeper' and rely on bouncycastle.
What I would change is to display all 4 types of addresses, not only one + choice. Or I would change settings to checkboxes, that user may select which ones he wants to display. Anyway, it is a good alternative to https://iancoleman.io/bitcoin-key-compression/ page.


Title: Re: private key - quick balance check for several addresses / coins
Post by: MixMAx123 on November 28, 2022, 05:39:22 PM
This Java program may be that what you are looking for.
https://github.com/MrMaxweII/Bitcoin-Address-Generator


Sehr gut! I though it is only me using Java here :) Props for QR codes! In my programs I used bitcoinj library but I see you went 'deeper' and rely on bouncycastle.
What I would change is to display all 4 types of addresses, not only one + choice. Or I would change settings to checkboxes, that user may select which ones he wants to display. Anyway, it is a good alternative to https://iancoleman.io/bitcoin-key-compression/ page.


Thanks for your feedback.
With the "Address format" button, 1 of 4 address formats can be selected.
I don't want to show all 4 at the same time, as many would mess it up very safely. And the output field would be even more crowded.


Title: Re: private key - quick balance check for several addresses / coins
Post by: LoyceV on November 28, 2022, 07:00:40 PM
Let's say someone finds a valid private key from the well-known 32 BTC puzzle. He can quickly take his reward from the the Bitcoin address. Is there a known open-source tool that additionally to Bitcoin mainnet spits out all possible addresses from other networks from that private key?
Only a few Bitcoin Forks are worth claiming. Just get their Electrum-fork (don't trust the software, so use a VM) and move the funds (after you moved all Bitcoins out of the address).

Quote
BEthereum (ETH)
Litecoin (LTC)
Dogecoin (DOGE)
Dash (DASH)
Zcash (ZEC)
Altcoins have nothing to do with BTC puzzles.

Aha, now I understand. So this would only work with Bitcoin Gold and Bitcoin SV, right?
Don't forget eCash and possibly BCD (although the latter is only worth it if you had many Bitcoins in the address).

Bitcoin SV (BSV) is never a fork of bitcoin, it was a fork from BCH, so no coin can be claimed if you have bitcoin, using a private key wallet before the fork.
If the Bitcoin address is old enough, and the BCH wasn't moved before BSV Forked, the address will hold BSV too.

You may also use page https://findmycoins.ninja/ At least they provide links to explorers of other coins
I use the site, but know that it's inaccurate. I've seen empty results for funded addresses (maybe funds sent to pubkey are ignored).
Also, most of the Forks are really not worth your time. Even if some of them show a higher price on CoinMarketCap.com, usually the trading volume is close to zero, so there's no real value in it.


Title: Re: private key - quick balance check for several addresses / coins
Post by: citb0in on November 28, 2022, 07:03:13 PM
This Java program may be that what you are looking for.
unfortunately no, as I already said. The tool is not helpful for the mentioned requirements.

The credit is displayed below. (The credit is queried online by API)
Not on my system. I am running GNU/Linux with OpenJDK Runtime Environment build 11.0.17 2022-10-18.
Code:
$ java -jar release/CoinAddressGeneratorV3.1.0.jar

Tool opens, in the tab [Input private key] I enter the privkey 00000000000000000000000000000000000000000000000000000000B862A62E and press ENTER. This is the result I get
https://i.ibb.co/kGKnMRp/coind-address-generator-no-balance.png (https://ibb.co/S6NTJh2)

As you can easily see, there is no trace of a balance display here. I can click to the generated link of the associated address (https://www.blockchain.com/btc/address/1FRoHA9xewq7DjrZ1psWJVeTer8gHRqEvR), yes, but that's not the way that to go.

I think you can manage over 1000 coins.
It's great that the tool offers countless coins in one list, but again, what has already been said is valid --> it doesn't help with the problem this thread is about. Please scroll up again and read this carefully.

To do this, the desired coin must first be selected.
Please click on "Settings" and then on "Import New Coin"
Now a list of all coins that can be selected opens.
This behavior is also not affected when I click on SETTINGS --> Import Coins and select e.g. BCH and BCD. This allows me to select BCH or BCD in the dropdown field at the top left, but the balance is not automatically displayed as you had shown in the screenshot.

If everyone is not available or you separate the internet connection, nothing can of course be displayed.
You mean my internet connection is the reason the tool doesn't work as advertised?

However, it is correct that the account stand query is only implemented for a few coins.
In your screenshot shown here (https://bitcointalk.org/index.php?topic=5423719.msg61359263#msg61359263), Bitcoin (BTC) is selected in the dropdown field and the balance display is visible in your screenshot. However, this is not the case for me.

@Citb0in Please don't say things that are wrong.
Now please explain to me what I should have said that was not true.

No offense, but it gives me the impression that you are the author of this tool and feel personally attacked because I said the tool was not helpful for the intended use. Throwing a tool you developed into the room, but it doesn't fit the matter, seems that happened before already on another thread (https://bitcointalk.org/index.php?topic=5400202.msg60234297#msg60234297). I appreciate your work and dedication to creating such tools, but it doesn't change the fact that the things I mentioned and also that the tool doesn't do what it was about in the topic. You can consider my criticism as constructive. For everything else I would suggest to open a separate thread for the tool and discuss it there, otherwise it becomes offtopic here.

@LoyceV: Thanks. Appreciate your feedback

After understanding the principle thanks to your answers and reading a little bit about these forks, the suggested web address should be useful. For example, if I enter there the address 1FRoHA9xewq7DjrZ1psWJVeTer8gHRqEvR, I would see the credits of all the forks. If it wasn't for the problem that LoyceV just mentioned. Is there anything alternative to this website, maybe something you could run locally on your own computer and query all the forks by account balance? Otherwise, I'll settle for https://findmycoins.ninja/, which ends up doing exactly what I was looking for.

Thanks to all for the helpful advice.


Title: Re: private key - quick balance check for several addresses / coins
Post by: LoyceV on November 28, 2022, 07:16:09 PM
Is there anything alternative to this website, maybe something you could run locally on your own computer and query all the forks by account balance?
There's Bitcoin Core and it's respective Forks. This (https://bitcointalk.org/index.php?topic=2836875.msg60084872#msg60084872) is how I set it up for the Forks I claim (note that BSV is even more annoying than this).

For some (https://gz.blockchair.com/bitcoin-cash/addresses/) forks (https://gz.blockchair.com/bitcoin-sv/addresses/), you can download the full list of funded addresses. That makes it easy to check each balance locally, but you probably have to convert the legacy address format first.


Title: Re: private key - quick balance check for several addresses / coins
Post by: citb0in on November 28, 2022, 07:19:47 PM
Thank you LoyceV


Title: Re: private key - quick balance check for several addresses / coins
Post by: MixMAx123 on November 28, 2022, 08:59:57 PM
As you can easily see, there is no trace of a balance display here. I can click to the generated link of the associated address (https://www.blockchain.com/btc/address/1FRoHA9xewq7DjrZ1psWJVeTer8gHRqEvR), yes, but that's not the way that to go.


Yes, it is due to the internet connection.
For some reason, the tool cannot access the API of the blockchainexplorer. Maybe it's because of a firewall or something else.

It was about her statement that the program could only create Bitcoin addresses what is wrong. Other coins can also be used.

Thank you for your constuctive criticism.


Title: Re: private key - quick balance check for several addresses / coins
Post by: citb0in on November 29, 2022, 08:24:36 AM
Yes, it is due to the internet connection.
For some reason, the tool cannot access the API of the blockchainexplorer. Maybe it's because of a firewall or something else.
I can't imagine that, since I use absolutely no firewall. Please tell us the URL and port address where the program is trying to make the API request and I can check it immediately using a simple telnet connection or a small websocket Python program.