# Smart way to find next unused seed derived address

**URL:** <https://talk.jelurida.com/t/smart-way-to-find-next-unused-seed-derived-address/69>\
**Category:** Developers\
**Created:** [25 November 2020 13:49 UTC](https://talk.jelurida.com/t/smart-way-to-find-next-unused-seed-derived-address/69 "2020-11-25T13:49:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheWireMaster](https://talk.jelurida.com/user_avatar/talk.jelurida.com/thewiremaster/32/12_2.png) [@TheWireMaster](https://talk.jelurida.com/u/TheWireMaster)\
**Post date:** [25 November 2020 13:49 UTC](https://talk.jelurida.com/t/smart-way-to-find-next-unused-seed-derived-address/69/1 "2020-11-25T13:49:17Z")

</div>

How do you determine on the client the next free seed derived address? In SmartVoting I test them all (bib32 indexes) until I find the first unused address. I could make they loop smarter… But is there a smarter way, eg used by the client? Thx

---

<div class="post-metadata">

**Author:** ![sergi](https://talk.jelurida.com/user_avatar/talk.jelurida.com/sergi/32/21_2.png) [@sergi](https://talk.jelurida.com/u/sergi)\
**Post date:** [25 November 2020 14:02 UTC](https://talk.jelurida.com/t/smart-way-to-find-next-unused-seed-derived-address/69/2 "2020-11-25T14:02:03Z")

</div>

The wallet has no “smart loop”. It just starts at the provided index (0 by default), derives the account id, and calls the API (request getAccountPublicKey) to check whether that address is published on the blockchain.

I can’t think of a faster way unless you store the “next free index” in some place (like data cloud or alias).

---

<div class="post-metadata">

**Author:** ![TheWireMaster](https://talk.jelurida.com/user_avatar/talk.jelurida.com/thewiremaster/32/12_2.png) [@TheWireMaster](https://talk.jelurida.com/u/TheWireMaster)\
**Post date:** [25 November 2020 14:11 UTC](https://talk.jelurida.com/t/smart-way-to-find-next-unused-seed-derived-address/69/3 "2020-11-25T14:11:56Z")

</div>

Thanks for the answer. It’s surprisingly fast! Ok, I didn’t try to create a new address with a SEED having 20k accounts created. I’ll try that.  
Otherwise I’ll just optimize my loop to make it faster. Was just wondering if there was some hidden API call… 😃  
Thank you Sergi!
