CIP-30 getUnusedAddresse() method of WalletAPI

Hey guys, hope you’re doing great!

I was exploring the methods of the WalletAPI object we can use from the cip30.

One of those methods is the getUnusedAddresses() method. My interrogation was: Shouldn’t it return an extremely big, almost infinite amount of addresses ? My understanding of the addresses is that from your stake key and private key you can derive a pretty huge amount of addresses? I might have a misunderstanding of something on that matter, could someone enlighten me ?

Thanks in advance!

Math

CIP-30 does not specify that it should return a list of all unused addresses, but just a list of unused addresses.

It would also be practically impossible to return all 2^32 of them. And addresses with a too wide unused gap also should not be used, since it is impractical bordering on impossible for a wallet app to find the correct key when restoring/importing a wallet.

It is unfortunately unspecified what a wallet app should do for single-address wallets – return nothing or return the single address despite it being used already (probably hundreds of times).

It is also not specified if the addresses should come from the external or the change chain. Both could be plausible, external, since a dApp is external, change, since the transactions are most often signed by the wallet owner, so they are somehow also internal.

In the CIP Github, the only discussion I could find is in this issue: https://github.com/cardano-foundation/CIPs/issues/171 it is quite old and never got resolved.

You would probably have to test out how several more prominent wallet apps interpret all these unspecified points and if it is consistent enough to use for your use case.

Hi @HeptaSean thank you so much for taking the time to answer my question!

I wish you an amazing day.

Mathieu