dtr-org / unit-e

A digital currency for a new era of decentralized trust
https://unit-e.io
MIT License
45 stars 15 forks source link

Add support for SPV wallets #98

Open Ruteri opened 6 years ago

Ruteri commented 6 years ago

The idea is to enable thin clients to verify finalized checkpoints without downloading the whole chain. Previous discussion. We assume that blocks up to the finalization point are secure enough to base the SPV wallet on.

The way to do this is to add an option to the filterload message that will make the "full" peer match and send transactions that affect the finalization (deposits, votes, slashes and logouts). The thin client will download all the headers starting from genesis or what it had previously cached. For each block he will get all of his own transactions and the finalization affecting transactions and update the state (set of the validators and votes for current epoch). Confirming that transactions were actually included in the block is already here (merkle tree).

After the initial sync the SPV wallet should keep track of the transactions just as described above. If the wallet notices another fork, it has to validate the finalizations on the new one and choose the main one. The wallet should only include transactions that happened before the most recent finalization.

To ensure this will be enough I will add a functional test imitating the behaviour of a SPV wallet.

mergeable[bot] commented 5 years ago

There has not been any activity in the past month. Is there anything to follow-up?

scravy commented 5 years ago

Thanks mergeable. @Ruteri can you update?

mergeable[bot] commented 5 years ago

There has not been any activity in the past month. Is there anything to follow-up?

Ruteri commented 5 years ago

This issue needs update as ADR-21 allows for a better approach.