Outcomes where the total balance != the opening channel balance

Hi. Can someone talk me through when this might occur and what the use cases are? Thanks!

This is slightly different in the way its implemented in the NitroAdjudicator but in Counterfactual there is a kind of application whose outcome is a view function which depends on the address(···).balance value of the multisignature wallet being used as the state deposit holder. So, when you start the application the outcome will show 0 but if ETH is deposited into the multisig then the outcome would be higher than 0.

Ok. So does that mean that you have state transitions that are sometimes valid and sometimes not? Or are these balances provably only monotonically increasing?

and even if they are, how do you deal with uncle blocks/chain reorgs?

(edit: I guess that doesn’t matter if you’re inside a virtual channel…)

They aren’t always monotonically increasing. They could also be decreasing (e.g., in the case of a withdrawal). These could just be two special cases though.

1 Like

I currently implemented it like this:

  • If the channel is underfunded (e.g. one participant did not put in enough money, or all participants agree to an invalid state with higher outcome):
    the money is just returned as is.

  • If the channel is closed with a valid allocation:
    The money is distributed according to the allocation.

  • If the channel is overfunded:
    The money is distributed according to the allocation. Money that is overfunded is locked indefinitely in the contract, each participant gets exactly what they get according to the allocation.