hivewallet / discussions

Discussions and issues related to Hive
https://github.com/hivewallet/discussions/issues
3 stars 2 forks source link

Support sweeping of private keys #3

Closed javgh closed 10 years ago

javgh commented 10 years ago

On the topic of importing/sweeping private keys, I was thinking we might go for a compromise, where we support keys that are specified in a format like this: privkey|timestamp . Where timestamp is a unix timestamp of when that key was generated. To sweep such a key, one would launch another instance of bitcoinj, have it scan the blockchain starting from that timestamp, then empty the wallet into a key of the primary wallet.

An alternative would be to use the block height, but that would require access to the block chain when creating the private key, which I think would be inconvenient. In https://github.com/schildbach/bitcoin-wallet/issues/38 Andreas Schildbach talked about the idea of adding the necessary UXTO details to a paper wallet:

It is possible to rescan the blockchain, yes. However it will take about half a day currently because you don't even know the birth date of the key to swipe.

I have proposed adding the UXTOs to the QR code of private keys. This would essentially extend paper wallets in a way so they are redeemable without connectivity at all (except for broadcasting the signed transaction of course). I could not find followers for the idea, however I'm not very good at evangelizing. If you want to make it happen, I'd appreciate.

But if I understand it correctly, you would then not detect any funds that are added later. I think that would be a big disadvantage.

So privkey + timestamp seems like a good middle ground to me, to have reasonable fast sweeping and not require some extra server.

mackuba commented 10 years ago

I've tried rebuilding the wallet from the blockchain in Hive and it took half an hour, not half a day. I'm pretty sure it went through the whole chain from the beginning. (Though I suppose it will be much slower on a phone...)

ghost commented 10 years ago

Closing since this has been implemented in at least one wallet and can still be referenced.