Skip to content

Commit

Permalink
fixed design
Browse files Browse the repository at this point in the history
  • Loading branch information
zkokelj committed Nov 15, 2023
1 parent 0801a61 commit cb4ac13
Showing 1 changed file with 37 additions and 5 deletions.
42 changes: 37 additions & 5 deletions design/ux/Obscuro_Gateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ group Second click
end
group Third click
Alice -> MM: Automatically open MM with request to \nsign over "Register $UserId for $Acct"
Alice -> MM: Automatically open MM with request to \nsign over EIP-712 formatted message
note right
This text will be sent as is
accompanied by the signature and
Expand All @@ -129,7 +129,39 @@ Alice -> OG: All further Obscuro interactions will be to\nhttps://gateway.obscur
The onboarding should be done in 3 clicks.
1. The user goes to a website (like "obscuro.network"), where she clicks "Join Obscuro". This will add a network to their wallet.
2. User connects the wallet to the page.
3. In the wallet popup, the user has to sign over a message: "Register $UserId for $ACCT"
3. In the wallet popup, the user has to sign over EIP-712 formatted message.

Format of EIP-712 message used for signing viewing keys is:

```
types: {
EIP712Domain: [
{ name: "name", type: "string" },
{ name: "version", type: "string" },
{ name: "chainId", type: "uint256" },
{ name: "verifyingContract", type: "address" },
],
Register: [
{ name: "userID", type: "string" },
{ name: "account", type: "address" },
],
},
primaryType: "Register",
domain: {
name: "Obscuro",
version: "1.0",
chainId: obscuroChainIDDecimal,
verifyingContract: "0x0000000000000000000000000000000000000000",
},
message: {
userID: "0x"+userID,
account: account,
},
};
```

TODO:
- should we have our management contract as verifyingContract or just use 0x0 as we don't use it?

##### Click 1
1. Behind the scenes, a js functions calls "gateway.obscuro.network/v1/join" where it will generate a VK and send back the hash of the Public key. This is the "UserId"
Expand All @@ -139,7 +171,9 @@ Notice that the UserId has to be included as a query parameter because it must b

##### Click 2
After these actions are complete, the same page will now ask the user to connect the wallet and switch to Obscuro.
Automatically the page will open metamask and ask the user to sign over a text "Register $UserId for $ACCT", where ACCT is the current account selected in metamask.
Automatically the page will open metamask
and ask the user to sign over an EIP-712 formatted message as described above.
It is important to follow exactly the same format, otherwise verifying signatures will fail.

##### Click 3
Once signed, this will be submitted in the background to: "https://gateway.obscuro.network/v1?u=$UserId&action=register"
Expand All @@ -149,8 +183,6 @@ Note: Any further accounts will be registered similarly for the same UserId.

Note: The user must guard the UserId. Anyone who can read it, will be able to read the data of this user.

The ultimate goal of this protocol is to submit the "Register $UserId for $ACCT" text to the gateway, which is required by an Obscuro node to authenticate viewing keys per address.

Note: Alternative UXes that achieve the same goal are ok.


Expand Down

0 comments on commit cb4ac13

Please sign in to comment.