omgnetwork / research

43 stars 2 forks source link

Why we can't have "memorylessness" for state transitions in the protocol #91

Closed paulperegud closed 5 years ago

paulperegud commented 5 years ago

Validity of the transaction T2 being independent of the type of transaction T1 that created T2's inputs would be a great property to have. This would make predicates purely independent of each other. Problem is - this model not expressive enough for combination of restricted custody and MoreVP.

Counter-example:

  1. Alice does deposit T1 to the venue, experiences intermittent trouble with connectivity and creates in-flight exit from T1.
  2. T1 is canonical, Alice exits from output since predicate allows that.
  3. Venue signs a T2 (a spend of T1's output) and uses it as a piggyback challenge.

Now, problem with T2 is - we want to forbid direct spends by venue. T2 is illegal. How can we prove that in contract? Adding additional step of the game is out of the question. Solution - pull in the type of last state transition into the state and check it when doing challenges. This breaks abstraction but the cost is not high.

boolafish commented 5 years ago

One scenario that I think we need "output type" is for partial fill. At first, I thinking we can, at worse case, trace the tx type to know whether it is valid to use the output or not. However, partial fill would possibly result in two type of output, settled output and output with remaining order. We need to be able to differentiate those, so that's why I think introducing "output type" might be actually the easiest way to do it.

paulperegud commented 5 years ago

In context of MoreVP, predicate defines exitability of the transaction. For transaction to be used in claims or challenges, it needs to be exitable.

We can achieve "memoryfullness" by having {predicateA, predicateB} -> bool mapping that would describe if predicateB transactions can challenge transactions of predicateA type.

EDIT: the adjective used in MoreVP docs for this property is exitable, fixing.

boolafish commented 5 years ago

Guess probably there is nothing much for this issue. Close this, if there is anything worth discussing here we can just re-open.