<p>As of <a href="https://github.com/spesmilo/electrum/commit/29a8c41025971140b0055b11fa8f86a4a3f81b17" rel="nofollow noreferrer">29a8c41025971140b0055b11fa8f86a4a3f81b17</a>, when calling <code>ismine</code>, electrum will check:</p>
<ol>
<li>If known derived addresses contain the target address</li>
<li>If addresses that have been imported into the wallet (typically, for non-hierarchical wallets) contain the target address</li>
</ol>
<p>It will not attempt to search as-of-yet not in the database, but theoretically derivable addresses from the same seed.</p>
<p>Such a search would always be non-exhaustive. Given the potential combinations for derivation paths, and the ~4 billion addresses at each level, you can't really conclusively prove that an address is <em>not</em> in a given wallet. You could exhaustively search a single BIP32 account, but even that would be extremely slow given the sheer number of addresses you would have to derive. No wallet that I'm aware of does this.</p>

CC BY-SA 4.0
2024-12-26T03:34:18.940Z
"_Given the potential combinations for derivation paths, and the ~4 billion addresses at each level, you can't really conclusively prove that an address is not in a given wallet._" Yes, good point.
Geremia
CC BY-SA 4.0
2024-12-26T02:40:51.407Z
2024-12-26T03:11:13.893Z
2024-12-26T03:11:13.893Z
Raghav Sood
<p>How does Electrum <code>ismine()</code> work?</p>
<p>All <a href="https://github.com/spesmilo/electrum/blob/29a8c41025971140b0055b11fa8f86a4a3f81b17/electrum/commands.py#L552C12-L552C87" rel="nofollow noreferrer">the help</a> says is:</p>
<blockquote>
<p>Check if address is in wallet. Return true if and only address is in wallet</p>
</blockquote>
<p>Does <code>ismine()</code> check if an address could be derived from the master key, or does it simply check if it's in the list of already-derived addresses in the wallet?</p>

<address><electrum><address-generation>
How does Electrum ismine() work?
Geremia
# How does Electrum ismine() work?

(Asked by: username_0 on 2024-12-25)

How does Electrum `ismine()` work?

All [the help](https://github.com/spesmilo/electrum/blob/29a8c41025971140b0055b11fa8f86a4a3f81b17/electrum/commands.py#L552C12-L552C87) says is:

> Check if address is in wallet. Return true if and only address is in wallet

Does `ismine()` check if an address could be derived from the master key, or does it simply check if it's in the list of already-derived addresses in the wallet?

**Tags:** address, electrum, address-generation


---

## 1 answers

### Answer by username_1 on 2024-12-26. Score: 4 | Accepted answer

As of [29a8c41025971140b0055b11fa8f86a4a3f81b17](https://github.com/spesmilo/electrum/commit/29a8c41025971140b0055b11fa8f86a4a3f81b17), when calling `ismine`, electrum will check:

1. If known derived addresses contain the target address
2. If addresses that have been imported into the wallet (typically, for non-hierarchical wallets) contain the target address

It will not attempt to search as-of-yet not in the database, but theoretically derivable addresses from the same seed.

Such a search would always be non-exhaustive. Given the potential combinations for derivation paths, and the ~4 billion addresses at each level, you can't really conclusively prove that an address is *not* in a given wallet. You could exhaustively search a single BIP32 account, but even that would be extremely slow given the sheer number of addresses you would have to derive. No wallet that I'm aware of does this.

> **Comments:**
> **username_0**: "_Given the potential combinations for derivation paths, and the ~4 billion addresses at each level, you can't really conclusively prove that an address is not in a given wallet._" Yes, good point.  

---

