light-client
light-client copied to clipboard
Signer recovery deeply hidden
Description
The signer recovery of a message is very crucial for the protocol, for example the secret should be only revealed to the receiver of a transfer, and this check is done in (src/transfers/epics/secret.ts:74
). However, the address is set from the matrix meta data and only verified against the signature in the function parseMessage
. This works, but I do think it would be safer for future source code change to:
- Set the address from the signature recovery and validate the room meta data
- Have the validation more prominent, like in a function called
validateSender
or similar, instead of hidden inparseMessage
Copied from the team repo
Acceptance criteria
Tasks
- [ ]
Why do this?
Would allow the user to easily download their subkey and use it wherever they want (e.g. MetaMask) and not have it locked in the client.
We could rename parseMessage
to something like parseAndVerifyMessage
, to make it more obvious. It doesn't make a difference to set the address from the signature recovery, since this function explicitly validate this address is the same than the matrix's peer one, but we can make it more readable.
@andrevmatos to include in a separate tech debt issue and close this one.