Concepts
Wallet consists of 6 main parts:
smart contracts
connector
wallet bridge
app bridge
service worker
wallet window
When user creates his wallet, wallet smartcontract is deployed to the network. Address of user wallet smartcontract is the wallet address
In order to integrate wallet in to an application, connector is used.
It's added to a web3 library like wagmi
or ethers.js
and wallet starts to work with the application.
Connector opens wallet window when transaction is requested
All the wallet data is separated from applications and bound to the wallet domain.
To access wallet related data or make calls to wallet, bridge
is used that consists of two connected parts.
App bridge
used byconnector
on the application side to request information like address from wallet or to request an action.Wallet bridge
is the opposite side used byiframe on wallet domain spawned to application
to receive app requests and send answers back
Serice worker is a background process in browser bound to the wallet domain. It stores sessions, raiseauthn auth, transaction confirmations
- Wallet window allows user to manage his wallet, approve transactions.
- Wallet window can be opened by app bridge or by user from the widget that is spawned on applications connected the wallet
- Wallet is a PWA (Progressive Web Application) and can be installed to user devices as a native application as well as be integrated to dapps distributed as PWAs