Skip to content

Commit 14559b8

Browse files
committed
Overview flow chart
1 parent 5ad901b commit 14559b8

File tree

4 files changed

+136
-2
lines changed

4 files changed

+136
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ only)
2626
This uses the emerging [Sign In With Substrate standard](https://siws.xyz/) for login and a custom system for the
2727
onboarding. The user/data flows will look as follows:
2828

29-
- [Onboarding sign-up flow](./docs/signup-flow.md)
30-
- [Sign-in flow](./docs/login-flow.md)
29+
- [Overview](./docs/overview-flow.md)
30+
- [Onboarding sign-up sequence](./docs/signup-flow.md)
31+
- [Sign-in sequence](./docs/login-flow.md)
3132

3233
## Usage
3334

docs/login-flow.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Sequence Diagram of Login Flow
2+
13
```mermaid
24
sequenceDiagram
35
actor A as User

docs/overview-flow.md

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
# UI Flow Overview
2+
3+
## Existing Flow with Notes
4+
5+
```mermaid
6+
flowchart TD
7+
Start[User Clicks Login/Signup] --Open Popup-->
8+
Wallet[User Selects/Installs Wallet]-->
9+
RequestAddresses(Request Addresses from Wallet)-->
10+
CheckMsa{"`Check Frequency
11+
for existing
12+
MSAs & Handles`"}
13+
CheckMsa--Existing MSAs Found-->Existing[Show List of MSAs]
14+
15+
Existing--Option: Create Account-->ACF(Account Creation Flow)
16+
Existing--Option: Select Existing MSA-->
17+
DelegationCheck{"`Check Frequency
18+
for existing Delegation`"}
19+
DelegationCheck--Has Delegation-->SignIn
20+
SignIn--Wallet: Sign SIWS Payload-->ReturnSiws([Return SIWS Payload])-->Close
21+
22+
DelegationCheck--Needs Delegation-->
23+
DelegationOnly[Authorize New Provider]--Wallet: Sign Delegation-->
24+
ReturnDelegationOnly([Return Delegation Only Payload])-->Close
25+
26+
DelegationCheck-.->noteDC>"`Note: Should also offer
27+
for handle creation
28+
if no handle found`"]
29+
30+
31+
CheckMsa--No MSAs-->
32+
ACF-->
33+
KeyAndHandle[Select Key and Handle]--Next-->
34+
KeyAndHandleValidate[Sign Handle]--Wallet: Sign Handle-->
35+
DelegateValidate[Sign Permissions]--Wallet: Sign Delegation Permissions-->
36+
ReturnSignup([Return Signup Payload])-->Close
37+
38+
KeyAndHandle-.->noteKH>"`Note: Should also offer
39+
to skip handle creation`"]
40+
41+
Close(("`Close Popup
42+
& Return Payload`"))
43+
Wallet-.->noteWallet>"`Note: Each Wallet can
44+
have different flows`"]
45+
```
46+
47+
## Web Wallet Integration Option 1: Use SIWF UI
48+
49+
Open Question: How can we make sure the auth token isn't hijacked?
50+
51+
```mermaid
52+
flowchart TD
53+
Start[User Clicks Login/Signup] --Open Popup-->
54+
Wallet[User Selects Web Wallet]-->
55+
WW[Multistep: Web Wallet Login Flow]-->
56+
ReturnSIWF["`Return to SIWF UI
57+
with Authorization Token
58+
for single Address`"]-->
59+
RequestAddresses[[Background Request Address with Token]]-->
60+
CheckMsa{"`Check Frequency
61+
for existing
62+
MSA & Handle`"}
63+
CheckMsa--Existing MSA Found-->Existing[Show MSA & Handle]
64+
65+
Existing--Option: Create Account-->ACF(Account Creation Flow)
66+
Existing--Option: Select Existing MSA-->
67+
DelegationCheck{"`Check Frequency
68+
for existing Delegation`"}
69+
DelegationCheck--Has Delegation-->
70+
SignInValidate[[Background Request with Token: Sign SignIn]]-->
71+
ReturnSignIn([Return Signin Payload])-->Close
72+
73+
DelegationCheck--Needs Delegation-->
74+
DelegationOnly[[Background Request with Token: Sign Delegation]]-->
75+
ReturnDelegationOnly([Return Delegation Only Payload])-->Close
76+
77+
CheckMsa--No MSAs-->
78+
ACF-->
79+
KeyAndHandle[Select Handle]--Next-->
80+
KeyAndHandleValidate[[Background Request with Token: Sign Handle]]-->
81+
DelegateValidate[Verify Permissions]--Next-->
82+
DelegationValidate[[Background Request with Token: Sign Delegation]]-->
83+
ReturnSignup([Return Signup Payload])-->Close
84+
85+
Close(("`Close Popup
86+
& Return Payload`"))
87+
```
88+
89+
## Web Wallet Integration Option 2: Custom UI
90+
91+
```mermaid
92+
flowchart TD
93+
Start2["`User Clicks
94+
Web Wallet Specific
95+
Login/Signup Button`"]-->RedirectWW
96+
Start[User Clicks SIWF Login/Signup] --Open Popup-->
97+
Wallet[User Selects Web Wallet]-->
98+
RedirectWW[Redirect to Web Wallet]-->
99+
100+
WWLogin[Login/Signup Flow for Web Wallet]-->
101+
WWLoginEmail[Web Wallet Authentication/Registration]-->
102+
103+
CheckMsa{"`Find Existing Account(s)`"}
104+
CheckMsa--Existing Account(s) Found-->Existing[Select Account]
105+
106+
Existing--Option: Create Account-->ACF(Account Creation Flow)
107+
Existing--Option: Select Existing Account-->
108+
DelegationCheck{"`Check Frequency
109+
for existing Delegation`"}
110+
DelegationCheck--Has Delegation-->
111+
SignInVerify[Verify User Signin Request]-->
112+
BackgroundSignSIWS[[Background: Sign SIWS]]--Redirect-->ReturnSIWF
113+
114+
DelegationCheck--Needs Delegation-->
115+
DelegationVerify[Verify User Delegation Request]-->
116+
DelegationOnly[[Background: Sign Delegation]]-->
117+
ReturnDelegationOnly([Return Delegation Only Payload])--Redirect-->ReturnSIWF
118+
119+
CheckMsa--No Account-->
120+
ACF-->
121+
KeyAndHandle[User Selects Handle]--Next-->
122+
PermissionsVerify[User Verifies Permissions]--Next-->
123+
DelegationValidate[[Background: Sign Delegation & Sign Handle]]--Redirect-->
124+
125+
ReturnSIWF["Return to SIWF UI with Payload"]-->
126+
ReturnSignup([Return SIWF Structured Payload])-->
127+
Close(("`Close Popup
128+
& Return Payload`"))
129+
```

docs/signup-flow.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Sequence Diagram of Signup
2+
13
```mermaid
24
sequenceDiagram
35
actor A as User

0 commit comments

Comments
 (0)