Skip to content

rpc: Update z_sendmany to handle purely-transparent change correctly. #617

Description

@nuttycom

In a pairing, @nuttycom and I came to two conclusions:

  • We will add an argument to z_sendmany (and maybe the other similar APIs) that lets the caller specify where change should go. Then if the source of funds is not a UA (a "normal account"), require it to be set. In particular, this means that:
    • for the migrated legacy Sapling addresses, you can retain previous behaviour by setting the same address as the source and the change-to.
    • you can specify any address you want the change to go to, even to a different account.
    • you can specify an account UUID, in which case:
      • if the UUID is for the same account as the source address, then change goes to the ZIP 316 change address (i.e. internal receiver for shielded, next change address for transparent).
      • if the UUID is for a different account, then change goes to the next time-based shielded address for that account (to preserve the requirement that account-internal receivers are never shown to users, which could otherwise happen if the receiving account was later imported into a separate wallet on its own), or returns an error if it would be transparent change.
  • We will add a config option to specify which account UUID to use for the legacy transparent RPCs. This means that:
    • The legacy transparent RPCs are disabled by default.
    • When a UUID is specified, the legacy transparent RPCs are enabled.
    • Any other RPC that would do shielded operations will check that the account UUID is not the one used for legacy transparent, and return an error if so.
    • Maybe Zallet fails to start if the specified account UUID has previously been used for shielded?
      • It will be possible to create transparent-only accounts with Zallet. Currently that can be done by generating a new mnemonic, starting Zallet, calling z_getnewaccount (which creates the account and gives it shielded viewing keys, but does not create any shielded addresses for it), stopping Zallet, then setting the legacy account setting. Maybe this should be made easier if we impose this restriction.

Originally posted by @str4d in #138

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions