Proposal Status
Status: Inception
Last updated: 06.06.2020
Team: TBD
Planned Delivery: TBD
Value Proposition
Mobile client for State Channels that relies on a synced node with a FSM. Something resembling a wallet but for State Channels.
We had been talking for this for years now and made some demoes. The demoes themselves were valuable and provided insight on what should be changed or improved in the FSM. Based on this feedback I think now we can actually do it. Possibly the longest and deepest description can be seen here (note more than an year ago):
A short version would be that developing a mobile client for State Channels is hard. To make it worse - our current expectation is every service provider to build their own client. This makes it both expensive for them and trustful for their clients.
Proposal is to make a unified generic State Channel mobile client that can run different contracts.
Definition of Terms
I propose we make a TypeScript mobile progressive web app that opens one state channel and deploys a contract. This mobile client will handle all FSM events and will allow all functionality that is already there to be actually used:
- open a state channel with an arbitrary participant
- close a channel with a mutual agreement
- deposit more tokens to the channel
- withdraw tokens from the channel
- snapshot current channel state on-chain
- force progress a contract call on-chain
- transfer tokens to a participant off-chain
- import an arbitrary Sophia Contract with a UI corresponding to the contract’s ACI (this is the cool stuff, really)
- close a channel using the unhappy path
- reestablish a temporaryly closed connection to the other participant
- handling conflicts and race conditions
- have off-chain encrypted chat (because it is cool)
In order to make this safe, the app will also:
- keep keys for the participant
- persist the state of the channel locally (so if the node that provides the FSM dies, client can still reestablish)
In order to make the contract depoyment decentralized, we will implement a small website to provide two contracts with corresponding UIs.
Users will open a channel, drop a link to desired contract and thus install it in the channel. Then they can safely execute calls and close it. Then they could open another channel and install a different contract in it. The application will behave homogeniously with regards of the FSM.
This proposal will make writing State Channel applications as simple as writing Sophia Contracts and corresponding UI, both of which will be public. This will greatly lower the entry barrier for projects that want to use State Channels.
Status Quo
We have a few demoes, to the best of my understanding only one of which is supported. None of those came even close to this.
We expect any service provider that wants to use State Channels to implement all of the work described in an open and honest manner. If for example they decide to forget implementing the forced progress - users will end up in a trustfull scenario.
If we leave it to service providers to implement their own apps, we will end up in a messy situation where different actions are triggered differently and this will confuse users.
Required Work
If there is interest for this, I will assemble a team and will define the details.
Estimate
If there is interest for this, I will assemble a team and will define the details.
Known Limitations
There is a lot of work to be done, a great deal of which will revolve around handling communication from and to the FSM. This is a MVP and could be further extended in another proposal(s).
I want to make it clear that having a couple of opened State Channels in the mobile app will complicate it even further. This is not in the scope of this proposal.
State Channels support having as many contracts in their state as one needs. This will complicate the UX further more. This proposal is just for one contract in a single opened State Channel.
Regarding the webpage that hosts contracts - we want it to keep it simple. No upload, no edit, no nothing. It will be a set of static pages. If someone wants something else - they can host it themselves.
Although we will try making it pretty, design is not in the focus of this proposal. The State Channel UX is a problem all projects face. I don’t expect we solve it with this proposal.
Outlook
For developers:
- they will only have to write Sophia smart contract and UI for it. No work with SDK, no interaction with FSM
- this will greatly reduce their invested effort of time spent
- this will ease their learning curve
For users:
- they will get a homogenious State Channel experience
- they will get one app for their State Channels that behaves as expected
For the ecosystem:
- this will make State Channel addoption much easier (or even possible)
For me personally:
- I will be finally able to explain my mother what I am doing