Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC - Full Wallet Lifecycle #18

Merged
merged 21 commits into from
Aug 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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