---
# System prepended metadata

title: Account Service Flows
tags: [Templates, ' Talk']

---

---
title: Account Service Flows
tags: Templates, Talk
description: User account workflows in sequence diagrams
---

# New Account

```mermaid

sequenceDiagram

    actor U as User
    participant A as API
    participant S as Cloud<br/>Services
    participant E as Email<br/>Provider
    
    U->>A: New Account :Email :Name

    activate A
    A->>S: Create Wallet
    activate S
    note over S: Generate "WalletId" and<br/>initialize storage<br/>provider
    S->>A: :WalletId
    deactivate S
    
    A->>A: Generate :DeviceId
    A->>S: Grant Access<br/>:DeviceId :WalletId

    activate S
    S->>S: Generate :Token
    S->>S: Blind Token :Code
    S->>E: Send :Code to :Email
    S->>A: :BlindedToken
    deactivate S

    A->>U: Response<br/>:BlindedToken :AccessData
    note right of U: :AccessData = { :DeviceId :WalletId }
    deactivate A

    U->>E: Check :Email for :Code
    activate U
    U->>U: Unblind :BlindedToken<br/>using :Code
    note over U: Optionally, blind token<br />using :PIN or<br/>:KeyChainSecret
    U->>U: Store :AccountProfile
    note over U: :AccountProfile = { :Token :AccessData }
    deactivate U

```

```mermaid

sequenceDiagram

    actor U as User
```