Create an end-to-end substrate connect prototype #93
Labels
browser extension
Planning
@substrate/connect
umbrella-issue
An issue that holds the main description and have rest under it
Milestone
Introduction
Create an end-to-end prototype to get more insight into this:
This is an umbrella ticket to describe the architecture and design needed to have a working end-to-end prototype. It is a migration from #82
All tasks are tracked under the v0 Milestone
Theory
We can make a polkadot-js API provider that makes the use of an extension transparent to the application developer.
Proposed API for using the extension from a web page
A page exists in a browser tab and a page may instantiate multiple UApps to talk to the extension. Each UApp may talk to multiple networks (blockchains).
Proposed flow:
Substrate-connect tries to detect the availability of extension on browser that uApp runs on:
Extension installed:
Web page -> sc.detect -> ExtensionProvider (extension) -> smoldot
Extension not installed:
Webpage -> sc.detect -> SmoldotProvider -> smoldot
Proposed developer experience - public API for substrate connect
The UI
Designs for the extension UI
How will the extension UI integrate with the connection management
The ClientManager of the extension is primarily concerned with managing communication ports from UApps and the smoldot clients and brokers communication between them.
In contrast the UI is primarily concerned with what apps are on which browser tab (and URL) and which networks those apps connect to.
To achieve this the background will also maintain and expose a shared state data structure as a tree that groups the apps under the browser tab where they were instantiated, the URL of that tab and their connections to networks . It will also be responsible for triggering events when the state associated with a tab changes.
How will the UI interact with the state?
What is the shape of the shared datastructure
The UI should not try to update the datastructure - the background will always return a new representation when asked for one (frozen, immutable?)
Task tracking
All tasks are tracked under the v0 milestone
The non UI extension tasks are labelled extension-bg
The UI extension tasks are labelled extension-ui
The text was updated successfully, but these errors were encountered: