namada icon indicating copy to clipboard operation
namada copied to clipboard

Better management of disposable keys in wallet

Open grarco opened this issue 1 year ago • 1 comments

We currently run a cleanup procedure of expired disposable keys when generating a new one:

https://github.com/anoma/namada/blob/47fc912f9afbd36dd23d9597630a1e89497541ff/crates/wallet/src/lib.rs#L808-L834

Since we plan to use disposable keys more now, this logic can turn out to be quite dangerous: in general we should not remove keys (not even disposable ones) without an explicit consent from the user. We should remove this logic and replace it with a wallet command that checks the balance of disposable keys and remove (after receiving a confirmation from the user) those whose balance is 0. To achieve this we should probably associate a specific token to the disposable key to avoid the need to look for balances of arbitrary tokens (disposable keys are used with a single token anyways). We could also remove the timestamp from the alias since it would not be needed anymore.

As suggested by @sug0 we could also think of introducing first class support in the wallet for disposable keys, since at the moment they are recognized by just their aliases. By doing this we could, for example, avoid displaying them with namadaw list.

grarco avatar Nov 15 '24 17:11 grarco

After #4233 we'll have the need to refund shielded ibc txs to a disposable address but at the moment we only support generating them on the fly for fee payment: we should extend their usage

grarco avatar Jan 21 '25 12:01 grarco