Commit and reveal on Plasma ===== # Introduction This document describes how realize trustless commit and reveal process in Plasma Cash. And there is the slide. https://docs.google.com/presentation/d/1uuq1f9li1dFw9UyrVVnuIkva-_vJEU05lrgXsyh0SC0/edit?usp=sharing ### commit ``` [commit, [parent_hash, ...], [hash, ...], [signature, ...]] ``` ### reveal ``` [reveal, [parent_hash, ...], [preimage1, ...]] ``` 1. In commit phase, participants collect all hashes, and sign the transaction. They send it to the operator, and confirm that merkle root is submitted. 2. Participants have to check non-inclustion proof in a while. 3. In reveal phase, the operator collect preimages, and make reveal transaction to submit. 4. After a period or all participants preimages were submitted. Its output will be available. The winner use the output. ## Force-include reveal transaction If operator withhold a proof or withhold user's preimage, user have to exit the commit phase with their preimage and exit bond. ``` startExitCommit(blockNum, txData, proof, preimage) ``` ``` challengeExitCommit(blockNum, revealTxs, proofs) ``` Other participants can challenge with the reveal transaction. But if preimage isn't included, cann't challenge. So operator have to re-submit new reveal transacrion, if operator wanna challenge. It's not double spent, its input is previous reveal transaction. ### re-reveal ``` [reveal, [parent_reveal_hash, ...], [preimage1, ...]] ``` Users can challenge commit by new reveal transaction and previous one. Thus latest reveal transaction will be public. By latest reveal transaction, users who didn't exit or send preimage lost their fund. This is refund desing in Plasma.