Post
Topic
Board Development & Technical Discussion
Re: Help me understand pkey + “spending twice”
by
PrimeNumber7
on 03/09/2021, 04:44:54 UTC
When you receive bitcoin to an address/public key, in order to spend that bitcoin, you need to use a private key associated with that specific address to spend that specific output. When you sign a transaction that spends your bitcoin, you are signing that you are spending a specific output to a specific transaction.

For example, if you receive a transaction to address bc1abc123...3 that is the 3rd output to txid 34def...45, you must use the private key associated bc1abc123...3 that signs that you are spending the 3rd output to txid 34def...45.