coblox / bobtimus

an autobot that automatically handles swaps as Bob
Apache License 2.0
1 stars 1 forks source link

Store outputs and used addresses in local file #13

Open D4nte opened 5 years ago

D4nte commented 5 years ago

Bobtimus should store unspent outputs and local addresses in a local file. This will allow Bobtimus to:

When starting, the data from the local file should be loaded in memory. Such file should be updated on a regular basis.

I suggest JSON file for now (one or two separate files).

If there are no file present, then a scan of first 100 (what bitcoind do by default, can be configured) derive addresses should be done to check if they are used. Please note that scantxoutset does not help with that as it only provide UTXOs.

If the 100th address is used then a second scan should be done to ensure that all used addresses are found and saved.

Once all used addresses (with a GAP of 100 addresses) then an UTXO search can be done from address 0 to i+100th (i being the index of the last used address). If using Bitcoin Core RPC, then it should be done by passing the exact addresses directly and not a key that bitcoind uses to derive.

D4nte commented 5 years ago

Please note that as already stated, it may not be possible to do the recovery part (no file present) with bitcoind?

D4nte commented 5 years ago

Back in "New". I suggest we simply close this issue if we do not intend to tackle it.