mobilecoinofficial / full-service

A MobileCoin service for wallet implementations.
Other
46 stars 21 forks source link

Add ability to specify subaddress to generate SenderMemoCredential from for RTH memos #558

Closed briancorbin closed 2 years ago

briancorbin commented 2 years ago

Is your feature request related to a problem? Please describe. Currently only the default subaddress is being used when generating the memo credentials based on the following code

https://github.com/mobilecoinofficial/full-service/blob/c21ae7606b01064257a40b3c2708b5b11ad748fc/full-service/src/service/transaction_builder.rs#L253

https://github.com/mobilecoinfoundation/mobilecoin/blob/3b25b55869e09caaa8e2c80c4939268dc3d7e573/transaction/extra/src/memo/credential.rs#L45-L52

which prevents users from being able to specify which subaddress they wish to create the credentials from.

This makes it impossible to identify yourself in a transaction to a recipient that you have given a subaddress to for address book purposes, as the memo would appear to have credentials coming from the main subaddress, not the given subaddress.

Describe the solution you'd like Add an optional argument to all build transaction endpoints to specify which subaddress to generate the memo credentials from. This would not apply to Burn Redemption transactions, as they use a special BurnRedemptionMemo, or Unsigned Transactions, as they are built without access to the private spend key, which is required to generate the SenderMemoCredential

briancorbin commented 2 years ago

@sugargoat this has been merged into develop and will be a part of the next release!

sugargoat commented 2 years ago

Thank you @briancorbin !

sugargoat commented 2 years ago

cc @remoun