Layer-Agnostic Optimistic Roll-In For Self-State Management
If your contract(s) has any functionality that results in isolated state changes for individual accounts, which means you could rewrite certain function to take in the user's state, and some arguments, and result ina a new state, via a pure function) then this library should allow your users to perform Optimistic Roll Ins. Effectively, your users can assert their intent to the chain, by providing their current state, the call data they would have sent to the chain normally, and their expected new state, and optimistically update their state, without wasting any gas actually performing the on-chain verifications and logic. They can perform as many of these state transitions as they want, one at a time, or even cheeper in batch (allowing for offline play and syncing afterwards), and any other users can validate their proposed state changes after the fact, and prove if anyone committed fraud. Users can enter and exit this "optimistic" state at will (some conditions) so that they can perform non-optimistic transitions that are the result on non-pure functions in your contract.
Things to note:
'- Custom Append-able Merkle Tree Libraries supporting compact proofs (JS and Solidity)
A framework allows users of some on-chain platform to maintain their entire state as a single storage slot, shifting any data costs to much cheaper calldata. A proxy contract allows user state to transition by touching (reading and writing) world state, or purely. Any impure transition is is executed on chain, but the state remains as a root, where individual elements must be proven to be used. And pure transition can be done optimistically, and the call data and new state appending to an append-able Merkle tree. Any use can lock someones account in order to prove that a past transition was invalid by actually proving the calldata in question and actually calling the contract. If fraud was proven, the fraudulent user is slashed and forced to roll back. If no fraud is proven, account lockers are slashed. Eventually, after some time, users can exit optimism by "coming up for air" to perform transactions that once again touch world state.
Because of this optimistic framework, users can play game entirely offline, and batch upload their entire set of individual state transitions to the blockchain when they regain connectivity.