# How the sender recover the transactions that he spent?

In order to compute the balance of his own wallet, (I assume that) a client needs to retrieve:

1- The transaction that he is the receiver.(By scanning the whole block-chain and compare with his own view-key).

2- To reduce from 1, the transactions that he already spent.

According to 2, does he needs to keep the secret `r`s that he used to compute the stealth address of the the recipients?

What if he lost those secret values? (The only solution that is to see whether the transactions that he spent already spent in other transactions- but unfortunately I'm not sure it still possible to distinguish if that transaction were a decoy or not)

In algebra, the sender knows the shared secret as `Hs(rA)`, and the recipient knows the same shared secret as `Hs(aR)`. This is why the sender cannot recover the shared secret later. The sender would have needed to know both the transaction private key `r` and the recipient's public view key `A` in order to recover the transaction shared secret.