Advertisement
Guest User

Untitled

a guest
Sep 18th, 2018
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.19 KB | None | 0 0
  1. @startuml
  2.  
  3. actor USER as "Investor"
  4. participant UI as "portal-ui"
  5. participant BJS as "bitgojs"
  6. participant API as "portal-api"
  7. participant WWW as "bitgo-express"
  8.  
  9. USER -[#blue]> UI: <b>Set up wallet
  10. UI -> USER: Passphrase Entry
  11. USER -> USER: Enters passphrase x 2
  12. USER -[#blue]> UI: <b>Continue
  13. UI -> USER: Generate Your Keycard
  14. USER -[#blue]> UI: <b>Generate Keys
  15.  
  16. == Key Generation ==
  17.  
  18. UI -> BJS: Create user keychain
  19. BJS -> UI: User keychain
  20. note over UI
  21. {
  22. pub: "xpub123...",
  23. prv: "xprv456..."
  24. }
  25. end note
  26.  
  27. UI -> BJS: Encrypt user prv
  28. BJS -> UI
  29. note over UI
  30. userKey.encryptedPrv = bitgo.encrypt({
  31. input: userKey.prv,
  32. password: passphrase
  33. })
  34. end note
  35. UI -> BJS: Create backup keychain
  36. BJS -> UI: Backup keychain
  37. note over UI
  38. {
  39. pub: "xpub789...",
  40. prv: "xprv001..."
  41. }
  42. end note
  43. UI -> BJS: Encrypt backup prv
  44. BJS -> UI
  45. note over UI
  46. backupKey.encryptedPrv = bitgo.encrypt({
  47. input: backupKey.prv,
  48. password: passphrase
  49. })
  50. end note
  51.  
  52. == Keycard Creation ==
  53.  
  54. UI -> UI: Generate Keycard
  55. note over UI
  56. {
  57. jsPDF,
  58. QRCode,
  59. userKeychain: {
  60. pub: "xpub123...",
  61. encryptedPrv: "..."
  62. },
  63. backupKeychain: {
  64. pub: "xpub789...",
  65. encryptedPrv: "..."
  66. },
  67. activationCode: 123456
  68. }
  69. end note
  70. UI -> USER: Save Keycard
  71.  
  72. == Activate Keycard ==
  73.  
  74. USER -> UI: Enter activation code\nfrom keycard
  75. USER -[#blue]> UI: <b>Continue
  76. UI -> UI: Confirm activation code
  77. UI -> USER: Complete Set Up
  78. USER -> UI: Ticks checkbox
  79. USER -[#blue]> UI: <b>Complete Set Up
  80.  
  81. == BitGo Keychain Creation ==
  82.  
  83. UI -> API: Create wallet
  84. note over API
  85. {
  86. userKey: {
  87. pub: "xpub123...",
  88. encryptedPrv: "..."
  89. },
  90. backupKey: {
  91. pub: "xpub789...",
  92. encryptedPrv: "..."
  93. }
  94. }
  95. end note
  96. API -> WWW: POST /api/v2/eth/key
  97. note right #ffaaff: Create User Keychain
  98. note over WWW
  99. {
  100. pub: "xpub123...",
  101. encryptedPrv: "...",
  102. enterprise: "42de..."
  103. }
  104. end note
  105. WWW -> API: 200 SUCCESS
  106. note over API
  107. {
  108. id: "54ab...",
  109. pub: "xpub123..."
  110. }
  111. end note
  112. API -> WWW: POST /api/v2/eth/key
  113. note right #ffaaff: Create Backup Keychain
  114. note over WWW
  115. {
  116. pub: "xpub789...",
  117. encryptedPrv: "...",
  118. enterprise: "42de..."
  119. source: "backup"
  120. }
  121. end note
  122. WWW -> API: 200 SUCCESS
  123. note over API
  124. {
  125. id: "884f...",
  126. pub: "xpub789..."
  127. }
  128. end note
  129. API -> WWW: POST /api/v2/eth/key
  130. note right #ffaaff: Create BitGo Keychain
  131. note over WWW
  132. {
  133. enterprise: "42de..."
  134. source: "bitgo"
  135. }
  136. end note
  137. WWW -> API: 200 SUCCESS
  138. note over API
  139. {
  140. id: "cd9a...",
  141. pub: "xpub83b..."
  142. }
  143. end note
  144.  
  145. == BitGo Wallet Creation ==
  146.  
  147. API -> WWW: POST /api/v2/eth/wallet
  148. note over WWW
  149. {
  150. label: "Harbor wallet",
  151. m: 2,
  152. n: 3,
  153. keys: [
  154. "54ab...", "884f...", "cd9a..."
  155. ],
  156. enterprise: "42de..."
  157. }
  158. end note
  159. WWW -> API: 200 SUCCESS
  160. note over API
  161. {
  162. wallet: {
  163. _wallet: {
  164. id: "138f...",
  165. label: "Harbor wallet",
  166. ...
  167. }
  168. }
  169. }
  170. end note
  171. API -> UI: Wallet Provisioning Success
  172.  
  173. ... later, upon on chain wallet confirmation ...
  174.  
  175. WWW -> API: Webhook fired
  176. API -> UI: Wallet is ready to use
  177. @enduml
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement