vulpemventures / ocean

:ocean: Elements/Liquid wallet daemon
MIT License
5 stars 7 forks source link

Account namespace and label #44

Closed altafan closed 1 year ago

altafan commented 1 year ago

Following the discussion of #42, we should update the protos by renaming the Name field of the Create*Account request message to Label and make it optional in the service instead of being required. Also, we should update the response message by returning the AccountInfo of the newly created account.

Internally, we should rename the related domain's actual Name field to Label and add a new one Namespace.

The namespace is something immutable and assigned by the service to every account. It could be a string like <root_path_purpose>-account-<derivation index>, for example 84-account-0 for account 0 of wallet with root path m/84'/<network>'. The namespace must be used by the repo to identify an account uniquely.

The label, instead, is something mutable and set by the user optionally. If a label is set, the user/client can refer to the account with it, otherwise the namespace must be used.

We should add also a new rpc SetAccountLabel to allow one to change account label at will.