Does an Invalid Transaction persist in the mempool? My basic understanding is that a transaction will continue to exist in the MemPool until it can be completed, (or eventually gets evicted due to the size of the MemPool).

To me, this leads to a strange situation:


A Wallet tries to spend more BTC than it current has
Miners reject that transaction (or more properly, fail to confirm it). But the transaction remains in the mempool.
At some much later point, the Wallet gets more value.
The previously rejected transaction can suddenly be confirmed.


This is roughly equivalent to bouncing a check with your bank, and then having the check clear days, weeks, or months later when you eventually get the money!

Is this actually how BTC works?  Or is there point where a transaction can be officially and completely rejected, just as at it can be confirmed?
A Wallet tries to spend more BTC than it current has


Technically, that would only be possible, if you try to spend an input (coin) that you can't sign (a.k.a. that you don't own).


Your local mempool (if you run Bitcoin Core or a similar fullnode) would reject the transaction immediately.
The transaction would not be broadcasted over the p2p network, because all nodes do reject transactions that are trying to spend inputs with invalid signatures (or inputs that doesn't exists)



  At some much later point, the Wallet gets more value.


The transaction is already made. It won't auto-update. It was already rejected.

Now one expect your local wallet knows the ("old", invalid transaction).

The only thing you can do now is to recreate the transaction (now with the correct inputs) and have it send over the network (and have it mined).


  The previously rejected transaction can suddenly be confirmed.


Invalid transactions cannot be mined and will not be broadcasted (broadcasting would be possible but extremely unlikely).