sumoprojects / SumoGUIWallet

Sumokoin GUI Wallet
Other
38 stars 46 forks source link

Integrating initial block height into mnemonic seed for faster initial wallet sync #4

Closed pwhelan closed 6 years ago

pwhelan commented 6 years ago

When a wallet is generated the current block height, or at least a number close to it could be stored then represented in the mnemonic seed to make re-importing it much faster. This number would be rounded to a certain number instead of an actual fixed numeric block in the past to avoid several problems and would not preclude a client from eventually syncing the entire block chain.

This obviously makes a lot of assumptions, first that the instance of sumokoind used by the client is not also acting in some way as a full node for others, at least not initially, as well that the idea is to get people who are restoring a wallet to be able to use their wallet as soon as possible.

There are a lot of concerns here as well with timing attacks.

In any case I thought I'd float the idea here, at least to see how terrible it is and why.

Muxoid commented 6 years ago

I dont belive you could implement this because each block does not contain every transaction only the transaction of the specific block. Therefore if the wallet where to be older than the block specified transactions would be missing. Also for new acounts the blockchain must be synched to proove that the coins transfered from other acounts are valid.

quangvu3 commented 6 years ago

Thanks @KingOfLinux for excellent explanation why that's not feasible. Though mnemonic seed should not be used as such but wallet cli has already supported your requirement to restore wallet from a specific height (if you can remember) with argument --restore-height:

./sumo-wallet-cli --restore-height xx

sumoprojects commented 6 years ago

So, this is a not an issue. Will be closed.

pwhelan commented 6 years ago

height (if you can remember) with argument --restore-height: ./sumo-wallet-cli --restore-height xx

Could the GUI wallet then some how ask for the block height or approximate date the wallet was created? Adding it to the mnemonic seed would be the way I would have done it (although to save space I would have used an approximate block height, ie: a 16 bit number which represents X blocks). This would be a way to avoid user error more than anything.

I dont belive you could implement this because each block does not contain every transaction only the transaction of the specific block. Therefore if the wallet where to be older than the block specified transactions would be missing.

So speeding up wallet sync for clients by only looking for transactions to itself and then putting the onus of validating them on full nodes is technically unfeasible or just wreckless?

quangvu3 commented 6 years ago

Could the GUI wallet then some how ask for the block height or approximate date the wallet was created? Adding it to the mnemonic seed would be the way I would have done it (although to save space I would have used an approximate block height, ie: a 16 bit number which represents X blocks). This would be a way to avoid user error more than anything.

I think we can add an optional box to enter restore height. It could be really helpful when blockchain gets bigger. But we'll leave seed words alone not bound to specific wallet/blockchain height to avoid any confusion/mistake that may lead to coins lost somehow