FourthState / plasma-mvp-rootchain

smart contract implementation according to the Plasma MVP spec.
Apache License 2.0
79 stars 24 forks source link

how to avoid double spent at the end of the exited duration ? #53

Closed liwei00wade closed 6 years ago

liwei00wade commented 6 years ago

how to avoid double spent at the end of the exited duration ? I am not sure it is because of the Tx "finalizeExits"


startExit: When a user decides to exit for any reason, they will call startExit() and their pending exit will be added to a priority queue that has a 1 week challenge period. This function requires a bond.

challengeExit: If any users notice an invalid withdrawal attempt, they may challenge this exit by providing the relevant information. If their challenge is successful, they will be awarded the bond associated with the exit attempt.

finalizeExits: This function will finalize any pending exits that have been in the priority queue for longer than a week. If the exit attempt has not been invalidated by a successful challenge then it will be eligible for withdrawal.

withdraw: Allows users to withdraw any balance that avaliable after the successful processing of an exit.

hamdiallam commented 6 years ago

During the beginning of the startExit() phase, the utxo is deleted and invalid on the side chain. A user trying to spend the funds that they have began to exit will not be processed by the validators. If they do, it is considered malicious activity and is grounds for an exit for users.

Does this make sense?