Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: kezown on November 14, 2018, 10:59:31 AM



Title: Detecting when a private key has been swept
Post by: kezown on November 14, 2018, 10:59:31 AM
Does anyone know how the Casascius Bitcoin Analyzer site knows when a coin is Active/Opened? I'm working on an idea that requires knowing when a private key has been swept by a mobile wallet.

Any info or resources that might be able to help me would be greatly appreciated.


Title: Re: Detecting when a private key has been swept
Post by: HeRetiK on November 14, 2018, 01:26:13 PM
I guess the Casascius Bitcoin Analyzer site simply checks whether a Casascius address had an outgoing transaction.

Apart from that there's no way of knowing whether a private key has been swept because no such information is being tracked or held anywhere.


Title: Re: Detecting when a private key has been swept
Post by: TryNinja on November 14, 2018, 01:30:57 PM
The above.

Keep in mind that anyone could unpeel the Casascius, get the private-key but don't sweep the coins immediately. The only thing that identifies whenever it was swept is an outgoing transaction (like HeRetiK said).


Title: Re: Detecting when a private key has been swept
Post by: kezown on November 14, 2018, 01:44:22 PM
I guess the Casascius Bitcoin Analyzer site simply checks whether a Casascius address had an outgoing transaction.


Thanks for your reply.

This is what I need. How do I check if a specific address (that I know) had an outgoing transaction?


Title: Re: Detecting when a private key has been swept
Post by: ABCbits on November 14, 2018, 02:32:30 PM
This is what I need. How do I check if a specific address (that I know) had an outgoing transaction?

There are few ways :
1. If you're running full node, add address as watch-only address. Then configure walletnotify to run script (https://bitcoin.stackexchange.com/questions/24457/how-do-i-use-walletnotify (https://bitcoin.stackexchange.com/questions/24457/how-do-i-use-walletnotify))
2. Use 3rd party API/service which notify when there's transaction related with specified address


Title: Re: Detecting when a private key has been swept
Post by: bigmaster23 on November 14, 2018, 06:42:54 PM
You can study programming and create a program that reads privatekey through your own program whether it was swept or not, also you can watch a btc address if it has an outgoing transaction by doing some website crawling and parsing.


Title: Re: Detecting when a private key has been swept
Post by: keychainX on November 15, 2018, 07:52:54 AM
I guess the Casascius Bitcoin Analyzer site simply checks whether a Casascius address had an outgoing transaction.


Thanks for your reply.

This is what I need. How do I check if a specific address (that I know) had an outgoing transaction?

You need to build a block sniffer and create an sql database of all used keys, then updated the database for each mined blocks.

there are a few github repos, just use search, but most likely you could build your own, using python.

like this https://github.com/alext234/rpc-sniffer

you can also read more on this page
https://en.bitcoin.it/wiki/Raw_Transactions#listunspent_.5Bminconf.3D1.5D_.5Bmaxconf.3D999999.5D

Ideally you would set up your own full node with the full chain, run a block parser to create an preferably sql database of all txs and then update it whenever a new block is mined.

/KX