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

Initiator sends encrypted secret in metadata #7191

Closed
fredo opened this issue Jun 24, 2021 · 0 comments · Fixed by #7196
Closed

Initiator sends encrypted secret in metadata #7191

fredo opened this issue Jun 24, 2021 · 0 comments · Fixed by #7196
Assignees
Milestone

Comments

@fredo
Copy link
Contributor

fredo commented Jun 24, 2021

Abstract

In order to safe the time of sending secret requests and secret reveals between target and initiator, a safe way to speed this process up is to send the secret with the LockedTransfer. To ensure the security aspects it must be ECIES encrypted with the target's public key.
It is crucial that we maintain backwards compatibility and leave it optional to send this data with the LockedTransfer. If the initiator decides not to send it (Should be set by a flag in the RaidenConfig), simply the current way of exchanging the secret proceeds. Even if the secret was sent with the payment the target should still be able to ask for the secret.
Sending the secret directly with the LockedTransfer message should be the new default.

Below there is the description taken out of #7071

  • Initiator encrypts the transfer's secret and include it in metadata.secret, together with the Request parameters, in order to ensure the target will be able to decide if they should reveal it and the mediators didn't take more fees than intended
    • Initiator always knows target's public key, due to knowing their presence, which allows the pubkey to be derived from displayName signature and used for ECIES encryption
    • metadata.secret is a hex-encoded bytestring containing the encrypted version of a CanonicalJSON-serialized object
    • pseudo-code: metadata.secret = hex_encode(encryptEcies(JSON.stringify(secret_payload), target.pubkey));
    • secret_payload schema:
      • payment_identifier: string decimal encoded number up to 64bits
      • secret: hex-string 32bytes
      • amount: string decimal encoded number up to 256bits
      • expiration: block, string decimal encoded number up to 256bits
    • If the initiator needs to retain its ability to cancel the transfer by not revealing the secret at SecretRequest time, they may simply not do it, and go with the current schema.
    • Even if sending it, the initiator should still be able to keep current behavior and reveal the secret to target in case they ask and SecretRequest parameters match, ensuring backwards compatibility.
@netcriptus netcriptus self-assigned this Jun 25, 2021
@istankovic istankovic added this to the Raiden v2.1 milestone Jul 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants