Thanks so much for thinking this through! It’s a really helpful discussion.
I guess you’re referring to something like this:
https://github.com/ChronosProtocol/poc/blob/master/contracts/Stream.sol
The rationale for choosing the infrastructure as proposed in the OP over an on-chain smart contract is:
-
Fast finality via a single operator/ PoS set of validators, getting rid of reorgs and uncles
-
Better time measurement, due to shorter interval blocks
-
Cheaper state updates
Hmm you’re completely right! I was unconsciously imagining the Plasma contract as a black box, probably because of this excerpt:
zk-SNARKs are a different beast though. For streams, you can just do the difference between the closing and starting times and multiply by the rate - and indeed, the closing block could be the withdrawal attempt time. The chains have different block numberings, but you could potentially agree on a rough estimation of time/value of money if you keep a block height scaling coefficient in the contract (and update that accordingly over time, similar to how retargeting works in PoW).
The only problematic edge case I see is when the rate is calculated at smaller intervals than the block time on the main chain. That is, if the agreed off-chain rate is x units per y seconds and we consider the main chain to have z seconds blocks, where z>y by a non-trivial margin, the potential loss could be as high as (z-y)*x (“loss” as in Bob would get that money instead of Alice, because she tried to exit exactly y seconds after a block was generated on the main chain). I admit though that this potential loss is negligible in most cases, especially when building an MVP.