We're all familiar with the 12 words we write down to secure our crypto. What if we also wrote down a 3-digit number and it saved us hours and hours of frustration in the future.
What's the number for?
I'm proposing that wallets that generate a seed, which becomes your 12-words, also give you a number. The number is the number of weeks after Ravencoin's Genesis block.
Why? Because the wallets can be far more efficient at finding your funds. Remember that there was no possible way for funds to be in addresses generated from your 12-words before the random number that created the 12 words existed. So if we mark that time, we only need to scan the blockchain after that to look for funds.
Why record the number in weeks? Well this isn't a precise thing, so we just need an idea of where to start, but the number could, in the future, save us 27 years of blockchain we don't need to wade through to find the funds. The number is only 3 digits. This works best for SPV mobile wallets like RVN Wallet or BRD Wallet.
Here's the spec. It isn't specific to Ravencoin, except that the Genesis date is based on Ravencoin's birthday. It doesn't matter if you use it for other coins because the spec didn't exist before today anyway. Using 0 on Ravencoin Wallets will scan from Jan 3, 2018, the day the The Times wrote "Bitcoin is name of the game for new generation of firms."
and we embedded the text into the Ravencoin genesis block to prove we hadn't pre-mined it. Using 0 on other wallets will scan through their entire blockchain.
The Unix epoch is the time 00:00:00 UTC on Jan 1, 1970, and the Unix timestamp is the number of seconds since then.
Take the Unix timestamp for Jan 3, 2018 at 0:00 UTC
Take the Unix timestamp for the date/time that the seed words are generated:
Now = 1616530560
Take the difference:
1616530560 - 1514962800 = 101567760
That gives you the number of seconds since the Genesis date (not necessarily the date and time of launch).
Divide the result by 604800
101567760 / 604800 = 167.936111111111111
Truncate after the decimal
FLOOR(167.936111111111111) = 167
That's the number that should be included after the 12-words
For the Wallets:
Take the number and multiply it by 604800 and add it to 1514962800, and start scanning blocks from there.
There's a few ways to go about this:
Estimate the starting block based on the coins block time. If the timestamps in the block header are before the calculated Unix timestamp, then scan from there. If less, then back up by some number of blocks and try again.
If the SPV has checkpoints, then use the closest checkpoint that has a timestamp in the block header that is before the Unix timestamp.
The number is optional. If the wallet doesn't support it, then the wallet scans from the beginning of the blockchain.
The number is optional. If the wallet does support it, and the user doesn't have it, then the wallet scans from the beginning of the blockchain.
The number is small, and unlikely to be written down wrong. Even ten years from now the number is: 689.
It will be a 3 digit number for another 15 years.
It gets more valuable over time, potentially shaving off ten or twenty years of blockchain to scan.
For someone restoring a recently created mobile wallet, this could save 18 hours of sync time -- every time it is restored.
The Unix timestamp is based off of UTC, so it is the same around the world. It does not factor in time zones.
By lopping off the decimal, the wallet is starting on average 1/2 week before the first transaction.
At-worst at the time of the transaction if the transaction was instantly put into a block and instantly mined. Clocks may be off, but are rarely off by much, and since transactions take time to be mined the transaction will almost certainly take place after the calculated Unix timestamp.
If, in the extreme case of the timestamp in the block being off (late) indicating to the wallet that it does not need to scan earlier, and the transaction was missed, then decrementing the number by 1 will solve it. This is an extreme case, and unlikely to ever happen.
If you want to know when you created the wallet, you can use this: