Hi everyone,
Cardano-wallet uses on Shelley called Random wallets, and the wallet comes with unused addresses (given as wallet pool gap parameter, when wallet create ) All ok, but I have a question at this point:
1- when the wallet generates a new address? when I use an address or another?
2- Exchanges or wallets apps serves a new address for each customers, at this point: If I give an address to a client, this address is used for me but for the wallet isn't it. The wallet agree still the address is unused. but I can do the address as used for my wallet (the address even has any transaction). How can exchanges or wallet apps do manage addresses of it's wallets? what is the best practice for Shelley?
3- Can I mark an address manually as used for my wallet?
thank you
The wallet maintains an invariant that is always keep a fixed number of consecutive unused addresses (following the specification from CIP-1852). Therefore, if an address is used within what we call the _edge_ and splits the consecutive sequence in two, then the set of unused addresses is automatically extended to keep the invariant true.
We've seen exchanges maintain their own indexes, knowing which addresses were assigned to which users. However, is it true that Shelley wallets do not let you generate new unused addresses. So if users aren't making deposit to their given addresses, you may run out of unused addresses. To cope with that, one can use larger gaps than the default one (although having gaps that are too large may badly impact performances), or simply, force the wallet to extend its set of unused address by sending Ada to one of the last address (which should be kept unassigned to anyone). You could imagine a scheme where a gap of 500 is used, so that every address at index 499 is never assigned to a user, but is triggered by the application whenever it needs to generate new unused addresses.
No because "used" has a precise semantic. An address is used if it appears in a transaction that is in the ledger. So, the only way to manually mark an address is what I described in (2).
hi @KtorZ ,
I'm clearly now! I have a one question too: are address at the same point (or same index) in wallet, everytime or changeable ?
thank you
@gitloverr I do not understand your question? Could you try to reformulate it please?
hi @KtorZ ,
if I call the addresses of wallet with Cardano-wallet list address method, are those addresses always in the same index?
for example:
we assume;
at t time: if the addresses of wallet sequence is like this: A, B, C, D, E, F
is it same sequence at t+1 time -everytime- : A,B,C,D,E,F ?
Addresses are ordered by derivation indexes, so yes.
thank you so much @KtorZ !