<p>The network does not obtain your private key.  That is why it is called "private", and this is the whole reason that <a href="https://en.wikipedia.org/wiki/Digital_signature" rel="nofollow noreferrer">digital signatures</a> are secure</p>

<p>When someone pays coins to you, the transaction includes your address, which is a <a href="https://en.wikipedia.org/wiki/Hash_function" rel="nofollow noreferrer">hash</a> of a public key.  Public keys and private keys come in matched pairs, and to spend the transaction, you create a new transaction that is digitally signed using the corresponding private key.  The signature incorporates your public key, and anyone on the network can verify that it is valid.  A valid signature cannot be created without access to the private key, but the private key is not part of the signature and cannot be recovered from it.</p>

<p>If future transactions are paid to your address, you're still the only one who can spend them, so long as you keep your private key secure.</p>

CC BY-SA 3.0
2017-05-24T07:50:46.420Z
What does keep an adversary from storing your signed transaction and transmit it to the network again at a later point in time, effectively triggering the same transaction again?
bweber
CC BY-SA 3.0
2017-05-25T02:15:23.083Z
@user1488118: Your transaction has to list one or more specific previous transactions as inputs that it's spending.  The network will only allow any given input transaction to be spent once.  They can transmit it as many times as they want but everybody will just ignore it.
Nate Eldredge
CC BY-SA 3.0
2017-05-23T14:48:55.700Z
2017-05-23T14:48:55.700Z
Nate Eldredge
<p>If I pay someone in bitcoin, presumably I have to utilise both my private and public key in some way, and presumably this has to be verified by the network.</p>

<p>Now does the network thus obtain my private key as part of the verification process?  If not, how do they verify without it and if they do, does this mean my private key is now compromised?</p>

CC BY-SA 3.0
2017-05-23T16:47:32.750Z
related: [How can transactions be verified without the private key?](https://bitcoin.stackexchange.com/q/36152/5406)
Murch
<transactions><private-key><signature>
What happens to Private Key on Payment
Kenshin
# What happens to Private Key on Payment

(Asked by: username_0 on 2017-05-23)

If I pay someone in bitcoin, presumably I have to utilise both my private and public key in some way, and presumably this has to be verified by the network.

Now does the network thus obtain my private key as part of the verification process? If not, how do they verify without it and if they do, does this mean my private key is now compromised?

**Tags:** transactions, private-key, signature

> **Comments:**
> **username_1**: related: [How can transactions be verified without the private key?](https://bitcoin.stackexchange.com/q/36152/5406)  

---

## 1 answers

### Answer by username_2 on 2017-05-23. Score: 4 | Accepted answer

The network does not obtain your private key. That is why it is called "private", and this is the whole reason that [digital signatures](https://en.wikipedia.org/wiki/Digital_signature) are secure

When someone pays coins to you, the transaction includes your address, which is a [hash](https://en.wikipedia.org/wiki/Hash_function) of a public key. Public keys and private keys come in matched pairs, and to spend the transaction, you create a new transaction that is digitally signed using the corresponding private key. The signature incorporates your public key, and anyone on the network can verify that it is valid. A valid signature cannot be created without access to the private key, but the private key is not part of the signature and cannot be recovered from it.

If future transactions are paid to your address, you're still the only one who can spend them, so long as you keep your private key secure.

> **Comments:**
> **username_3**: What does keep an adversary from storing your signed transaction and transmit it to the network again at a later point in time, effectively triggering the same transaction again?  
> **username_2**: @user1488118: Your transaction has to list one or more specific previous transactions as inputs that it's spending.  The network will only allow any given input transaction to be spent once.  They can transmit it as many times as they want but everybody will just ignore it.  

---

