I'm trying to understand how Bitcoin works under the hood, but there's something I don't get at all, and can't find it.
Suppose I own address A (I have the public key, A-public, and the private key A-private) and I want to transfer 1 BTC to address B (I know its public key, B-public).
In order to be able to do the transaction, I must, somehow, prove that I own A, and the only way to do that is to show A-private. But, if I show A-private, then I'm exposing my private address, so, someone, somehow, could get it.
To sum up: in the Bitcoin blockchain, how do I prove that I own a certain amount of bitcoins without exposing my private key? Or, alternatively, how does the Bitcoin protocol handle that?