STATUS: AVAILABLE
I am offering a 25 BTC bounty, payable by me, to the first person who does the following:
Create a patch to the most recent version of Bitcoin, to offer the ability to reindex the block chain, as follows:
- A reindex should occur upon bitcoin startup if --reindex is supplied as a parameter.
- The patch should read blk0001.dat, and copy only the longest chain to a new file, discarding any orphan blocks below the last hardcoded checkpoint, as well as anything that is obviously corrupted. (then delete blk0001.dat and rename the new file into its place)
- Rebuild blkindex.dat from scratch based entirely on the contents of the new blk0001.dat file.
- Re-creation of blkindex.dat should occur automatically, any time bitcoin is started and blk0001.dat is found but blkindex.dat is missing. (In this case, if --reindex is not supplied, blk0001.dat need not be rewritten).
To claim the bounty, the patch needs to be submitted to github and test successfully. Not necessarily to the main Bitcoin client source, but just where everyone can get at it. (either as a pull request or as a fork)
- - - - - - - - - - -
SECOND BOUNTY (ANOTHER 25 BTC):
if the reindex function does the following:
In addition to adding all the usual data to blkindex.dat, also add an optional index that, given the binary form of a bitcoin address, returns a list of all the blocks where a reference to that bitcoin address can be found.
- This index shall not exist by default, unless the user asks for it to be built (e.g. --reindex full).
- There needs to be a function in the code that allows the index to be queried. (if the index doesn't exist, then it's OK for this function to simply report the index doesn't exist.)
- Pubkeys appearing in transactions (e.g. coinbase) need to be converted to a binary bitcoin address before being added as keys to this index.
- The index does not need to be concerned with whether the reference is to a standard transaction, nonstandard, txin, txout, whatever. Just, if there's a reference of any kind within a transaction, make an entry.
- The index needs to be updated each time a new block is written to disk.
Same rule: it must be on github and testable for the bounty to be payable.
- - - - - - - - - - -
THIRD BOUNTY (ANOTHER 40 BTC... TOTAL SO FAR 90 BTC)
Implement the sweepprivkey function as I have proposed in the Wiki.
https://en.bitcoin.it/wiki/SweepprivkeyThe sweepprivkey needs to be able to take advantage of the index that is the subject of the second bounty, so that it completes quickly (typically under 2 seconds). If the index does not exist, it may (at your option) either report failure, or conduct a scan of the block chain if needed.
- - - - - - - - - - -
FOURTH BOUNTY (ANOTHER 10 BTC... TOTAL 100 BTC)
Add the sweep function to the user interface. The sweep function should only be visible if the extra index is built.
The sweep should have its own dialog. Upon filling in a bitcoin address and pressing Enter, if the bitcoin address has funds, a "YES/NO" dialog box should pop up, tell the user the amount of available funds, and then ask a YES/NO, "do you want to sweep". If the bitcoin address is invalid or has no funds, the only choice should be "OK" to dismiss the dialog box saying so, not yes/no.
If the user clicks yes, a transaction should be immediately broadcast that sweeps the funds into a new wallet address.