Sure! Longish answer below.
In the demo, you âsign inâ to the canister based backend, creating an authenticated session around the ETH address.
The flow:
- Connect ETH wallet
- Sign a message defined by the app, using the wallet
- Generate an identity (Ed25519KeyIdentity) based on the hash of the signature
- Request a SIWE message from the canister
- Sign the SIWE message
- Send signature to canister using identity from step 3 as caller
- Canister verifies signature against saved message from step 4 and recovers ETH address that signed the message
- Canister links signer address with caller and creates a session, returns session info
- Etc. Client calls other canister methods. Canister methods use an auth guard to verify session is valid and if needed get the ETH address of caller.
The identity is stored locally in the browser. Subsequent calls would require user start at step 4 if session has expired.
You can run the whole flow, but you donât need to.
Stop at step 3. Generate an Identity by signing a message and then start interacting with the canister using that Identity.
If the message you sign is identical each time you use the app, the generated identity will be identical. But thatâs it. No secure link between ETH address and Identity is made at the canister level. Also, since generated identity doesnât expire, anyone that manages to get a hold of your identity can impersonate you in the app indefinitely. Not super secure, but most likely still a really good idea for an app that just want to store some user metadata or other non critical info.
Running the whole flow takes us almost over the finish line. After step 8 you have established a secure session with knowledge of the callers ETH address.
What remains uncertain is whether the calling identity establishing the session for an ETH address is indeed the same identity generated using a signature from that ETH address. Verification is possible, but that would require the client sending the signature from step 2 to the canister, a process that poses security risks.
Once vetKeys are launched, we can generate an identity seed on IC and transfer it securely to the client. Then the one-to-one link between ETH address and identity can be verified, meaning: In this app, ETH address X is always represented by IC identity X.
While we cannot ensure that the identity initiating a session is directly created from a specific ETH address, we can confirm that the identity in use has control over the mentioned ETH address. This means that, even though a one-to-one link between the ETH address and the identity isnât fully verifiable now, the current system effectively ensures that the user controlling a given ETH address is the one interacting with the application.
In the ICRC-1 wallet I guess you donât care too much about the ETH address? Could you elaborate what you mean by Metamask signing individual transactions?