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

MCIP Draft - View Authenticated Sender Memo #58

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

briancorbin
Copy link

@briancorbin briancorbin commented Nov 9, 2022

@briancorbin briancorbin changed the title View Authenticate Sender Memo (#55) View Authenticate Sender Memo (#58) Nov 9, 2022
@briancorbin briancorbin changed the title View Authenticate Sender Memo (#58) MCIP Draft - View Authenticate Sender Memo Nov 9, 2022
@briancorbin briancorbin changed the title MCIP Draft - View Authenticate Sender Memo MCIP Draft - View Authenticated Sender Memo Nov 9, 2022
# Rationale and alternatives
[rationale-and-alternatives]: #rationale-and-alternatives

An alternative would be to generate the SenderMemoCredential during signing and modify the TxOut during the signing process. This would require more discovery as it is uncertain if this is possible without regenerating all of the contents of the TxOut and TxPrefix, which may not be desireable (especially if signing using a hardware wallet).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We currently have designed the hardware wallets stuff to have one round where it computes memo hmacs for these sender memos (using the spend private key), and then a second round where it actually signs ring mlsags.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If copper really wants us to provide just one payload, and they would have a round where they do memo signing and then another round where they do transaction signing, and those two rounds happen in their application, that seems like it should be possible, it will just make the UnsignedTx object a lot messier.

# Motivation
[motivation]: #motivation

With the introduction of the ViewAccountKey and UnsignedTransactions, generating a SenderMemo for RTH became impossible because of the requirement of the Subaddress Spend Private Key during the creation of the TxOuts for the transaction.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's actually impossible now, we have a plan here: mobilecoinfoundation/mobilecoin#2585

The idea is to refactor the MemoBuilder object implementation that currently requires the spend key to make it more abstract, and allow that to be a hardware device connection instead.

The only one who is impacted here is Copper's multiparty compute flow.


An alternative would be to generate the SenderMemoCredential during signing and modify the TxOut during the signing process. This would require more discovery as it is uncertain if this is possible without regenerating all of the contents of the TxOut and TxPrefix, which may not be desireable (especially if signing using a hardware wallet).

The rationale for adding the ViewAuthenticateSenderMemo is that it allows users to utilize RTH with an offline transaction signer or hardware wallet.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other main alternative is, do nothing. Then, RTH cannot be used with Copper (at least, the authenticated sender memos cannot be).

This may be acceptable -- after all, we did not prioritize making RTH work with mobilecoind, and I'm not sure it works with full-service right now? You would have to tell me.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works with full service

# Unresolved questions
[unresolved-questions]: #unresolved-questions

> - Is it possible to modify just the encrypted memo portion of a TxOut without requiring the TxPrefix and OutputSecrets to be regenerated?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The TxPrefix would change, but the output secrets would not.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, then that might actually be a plausible solution for offline transaction signing

@cbeck88
Copy link
Contributor

cbeck88 commented Nov 11, 2022

So the main thing that makes me think twice about this is, as you say, it reduces the security from the recipient's point of view -- when validating these memos, the signer could be someone who stole the view key (rather than needing to be someone who has the spend key).

If I'm a client and I receive a TxOut with a view authenticated sender memo, do I validate it and then display it in basically the same way as the existing sender memo? So then as a client, I trust view and spend-based sender memos equally?

I wonder if there's a way to make it so that clients only trust view authenticated sender memos when it's necessary. So for instance, for a copper-style multisig account, maybe the public address has a flag that says to accept view authenticated sender memos? And then if I'm a client, I only respect view authenticated sender memos if the public address contains that flag? And other "normal" account types aren't affected, and the client needs to see a spend-key authenticated sender memo in order to treat the origin of the payment as verified.

This would prevent any regression around what happens if I'm a "normal" user and someone steals my view key, which today is bad, but doesn't enable forging these authenticated memos.

That's my 2 cents for now, will think some more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants