Skip to content

Commit

Permalink
Merge pull request #18 from yeastplume/wallet_lifecycle
Browse files Browse the repository at this point in the history
RFC - Full Wallet Lifecycle
  • Loading branch information
yeastplume authored Aug 21, 2019
2 parents 07f01a9 + 4dcc0d3 commit 3fc8d75
Show file tree
Hide file tree
Showing 12 changed files with 452 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ To begin writing your own RFC or to find out more about the process and the gene
|:---|:---|
| [0001-rfc-process](text/0001-rfc-process.md) | Introduce RFC process |
| [0002-grin-governance](text/0002-grin-governance.md) | Articulate community values, define core and sub-teams |
| [0003-security-process](text/0003-security-process.md) | Define community standards for ethical disclosure behaviour |
| [0004-full-wallet-lifecycle](text/0004-full-wallet-lifecycle.md) | Define API standard for sensitive wallet operations |

## License

Expand Down
16 changes: 16 additions & 0 deletions assets/0004/0004-api-call-direct.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@startuml
actor "Client" as client
participant "Internal Rust API" as rustapi
participant "Wallet Backend" as backend

title Wallet API Call (Directly Linked)

== API Call ==
client -> client: Stored token **t**
client -> rustapi: call_api_function(**t**, **other_params**)
rustapi -> backend: retrieve_seed(**t**)
backend -> backend: calc(**t** ^ **seedT**) -> **seed**
rustapi -> backend: Internal Wallet Calls
backend -> backend: Drop **seed**
rustapi -> client: Return (**return_data**)
@enduml
29 changes: 29 additions & 0 deletions assets/0004/0004-api-call-direct.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions assets/0004/0004-api-call.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@startuml
actor "Client" as client
participant "JSON-RPC API (if used)" as jsonrpc
participant "Internal Rust API" as rustapi
participant "Wallet Backend" as backend

title Wallet API Call via JSON-RPC


== API Call ==
client -> client: Supply stored token **t** in **req** as **req.t**
client -> client: enc(**req**, **s**) -> **reqEnc**
client -> jsonrpc: call_api_function(**reqEnc**)
jsonrpc -> jsonrpc: dec(**reqEnc**, **s**) -> **req**
jsonrpc -> rustapi: call_api_function(**req**)
rustapi -> backend: retrieve_seed(**req.t** as **t**)
backend -> backend: calc(**t** ^ **seedT**) -> **seed**
rustapi -> backend: Internal Wallet Calls
backend -> backend: Drop **seed**
rustapi -> jsonrpc: Return (**resp**)
jsonrpc -> jsonrpc: enc(**resp**, **s**) -> (**respEnc**)
jsonrpc -> client: Return (**respEnc**)
client -> client: dec(**s**, **respEnc**) -> **resp**
@enduml
37 changes: 37 additions & 0 deletions assets/0004/0004-api-call.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions assets/0004/0004-dh-init.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@startuml
actor "Client" as client
participant "JSON-RPC API" as jsonrpc
participant "Internal Rust API" as rustapi
participant "Wallet Backend" as backend

title Wallet JSON-RPC API ECDH Initialization

== Initialization (ECDH/secp256k1)==
client -> client: Calc Pub ECDH Key (**cP**)
client -> jsonrpc: init_api_secure (**cP**)
jsonrpc -> jsonrpc: Calc Pub ECDH Key (**sP**)
jsonrpc -> jsonrpc: Calc + store shared secret (**s**)
jsonrpc -> client: **sP**
client -> client: Calc + store shared secret (**s**)
@enduml
Loading

0 comments on commit 3fc8d75

Please sign in to comment.