<blockquote>
  <p>First Question: private key for what exactly?</p>
</blockquote>

<p>For the scriptPubKey that locks/encumbers the coins from being able to be spent. </p>

<blockquote>
  <p>An output contains instructions for sending bitcoins. Value is the number of Satoshi (1 BTC = 100,000,000 Satoshi) that this output will be worth when claimed. ScriptPubKey is the second half of a script (discussed later). There can be more than one output, and they share the combined value of the inputs. Because each output from one transaction can only ever be referenced once by an input of a subsequent transaction, the entire combined input value needs to be sent in an output if you don't want to lose it. If the input is worth 50 BTC but you only want to send 25 BTC, Bitcoin will create two outputs worth 25 BTC: one to the destination, and one back to you (known as "change", though you send it to yourself). Any input bitcoins not redeemed in an output is considered a transaction fee; whoever generates the block can claim it by inserting it into the coinbase transaction of that block. </p>
</blockquote>

<p>See <a href="https://en.bitcoin.it/wiki/Transaction#Output" rel="nofollow noreferrer">https://en.bitcoin.it/wiki/Transaction#Output</a>.</p>

<blockquote>
  <p>which system validates that I am a private key owner?</p>
</blockquote>

<p>When transactions are submitted, nodes on the network validate the signature with the scriptPubKey before including them in their mempool for miners to include in the next block.</p>

<blockquote>
  <p>Now these two amounts of bitcoins are taken by a system X (what is X?) and it will be created an output with amounts 2 Bitcoin (i) and 0.8 Bitcoin (j). </p>
</blockquote>

<p>The transaction is created and signed using wallet software, and the transaction is submitted to the nodes on the network, it is propagated to all nodes (given it passes the validation checks).</p>

<blockquote>
  <p>Where will the public and private keys for i and j are generated? How and from which holder (after generation) to which (new owner) will they be transmitted? What kind of message do they sign/encrypt (content).</p>
</blockquote>

<p>The private keys are generated by the user usually in their wallet software and usually the pubkey and scriptPubKey (which is encoded into an address) are also created by the user for people to send them Bitcoin. The message that is signed is the new transaction data itself.</p>

CC BY-SA 4.0
2019-06-20T16:20:22.163Z
Okay, let me call "all nodes" "system X" now how does X do it? I know what proof of work is and also know that a number of transactions are included in a block and the block is validated by users/nodes adding further blocks - which leads to the longest chain of blocks...
baxbear
CC BY-SA 4.0
2019-06-20T16:33:23.807Z
I just read about ScriptPubKey spk and ScriptSign ss - so spk signs the output and with ss a user can unlock it to spend it - are both created by user A in my example? Is there independently another public key mechanism to show ownership? If yes, what actions does which of the systems take/secure. The ScriptSigns for each output are transmitted directly from one user to the next/the new owner (email/letter...)?
baxbear
CC BY-SA 4.0
2019-06-20T16:40:31.807Z
Just updated with more detail about the wallet software, which handles the creation of keys, transactions, and transaction signing. In your example, the coins that user A owns are encumbered by a scriptPubKey that was created by user A and received a transaction previously. Ownership is determined by providing a scriptSig that matches the scriptPubkey (which usually is a cryptographic signature, but doesn't have to be). The scriptsigs are added to the transaction data which is broadcast to the network via nodes.
JBaczuk
CC BY-SA 4.0
2019-06-20T17:21:27.430Z
of course! have fun learning more!
JBaczuk
CC BY-SA 4.0
2019-06-20T16:01:31.723Z
2019-06-20T16:37:29.687Z
2019-06-20T16:37:29.687Z
JBaczuk
<p>When I search for transaction in bitcoin I am able to find explanations which tell me that there are e.g. two persons A and B and A wants to tranfer a number of bitcoin to B. Imagine A wants to pay 2 Bitcoin to B and owns an private key for 1.5 Bitcoin and 1.3 Bitcoin. </p>

<p>First Question: private key for what exactly? What is signed/encrypted with a public key - which system validates that I am a private key owner? (I don't need explanations for public key cryptography RSA, ElGamal and GMR are well known to me)</p>

<p>Now these two amounts of bitcoins are taken by a system X (what is X?) and it will be created an output with amounts 2 Bitcoin (i) and 0.8 Bitcoin (j). Where will the public and private keys for i and j are generated? How and from which holder (after generation) to which (new owner) will they be transmitted? What kind of message do they sign/encrypt (content).</p>

<transactions><transaction-verification>
How exactly do transactions work?
baxbear
# How exactly do transactions work?

(Asked by: username_0 on 2019-06-20)

When I search for transaction in bitcoin I am able to find explanations which tell me that there are e.g. two persons A and B and A wants to tranfer a number of bitcoin to B. Imagine A wants to pay 2 Bitcoin to B and owns an private key for 1.5 Bitcoin and 1.3 Bitcoin.

First Question: private key for what exactly? What is signed/encrypted with a public key - which system validates that I am a private key owner? (I don't need explanations for public key cryptography RSA, ElGamal and GMR are well known to me)

Now these two amounts of bitcoins are taken by a system X (what is X?) and it will be created an output with amounts 2 Bitcoin (i) and 0.8 Bitcoin (j). Where will the public and private keys for i and j are generated? How and from which holder (after generation) to which (new owner) will they be transmitted? What kind of message do they sign/encrypt (content).

**Tags:** transactions, transaction-verification


---

## 1 answers

### Answer by username_1 on 2019-06-20. Score: 0 | Accepted answer

> First Question: private key for what exactly?

For the scriptPubKey that locks/encumbers the coins from being able to be spent.

> An output contains instructions for sending bitcoins. Value is the number of Satoshi (1 BTC = 100,000,000 Satoshi) that this output will be worth when claimed. ScriptPubKey is the second half of a script (discussed later). There can be more than one output, and they share the combined value of the inputs. Because each output from one transaction can only ever be referenced once by an input of a subsequent transaction, the entire combined input value needs to be sent in an output if you don't want to lose it. If the input is worth 50 BTC but you only want to send 25 BTC, Bitcoin will create two outputs worth 25 BTC: one to the destination, and one back to you (known as "change", though you send it to yourself). Any input bitcoins not redeemed in an output is considered a transaction fee; whoever generates the block can claim it by inserting it into the coinbase transaction of that block.

See <https://en.bitcoin.it/wiki/Transaction#Output>.

> which system validates that I am a private key owner?

When transactions are submitted, nodes on the network validate the signature with the scriptPubKey before including them in their mempool for miners to include in the next block.

> Now these two amounts of bitcoins are taken by a system X (what is X?) and it will be created an output with amounts 2 Bitcoin (i) and 0.8 Bitcoin (j).

The transaction is created and signed using wallet software, and the transaction is submitted to the nodes on the network, it is propagated to all nodes (given it passes the validation checks).

> Where will the public and private keys for i and j are generated? How and from which holder (after generation) to which (new owner) will they be transmitted? What kind of message do they sign/encrypt (content).

The private keys are generated by the user usually in their wallet software and usually the pubkey and scriptPubKey (which is encoded into an address) are also created by the user for people to send them Bitcoin. The message that is signed is the new transaction data itself.

> **Comments:**
> **username_0**: Okay, let me call "all nodes" "system X" now how does X do it? I know what proof of work is and also know that a number of transactions are included in a block and the block is validated by users/nodes adding further blocks - which leads to the longest chain of blocks...  
> **username_0**: I just read about ScriptPubKey spk and ScriptSign ss - so spk signs the output and with ss a user can unlock it to spend it - are both created by user A in my example? Is there independently another public key mechanism to show ownership? If yes, what actions does which of the systems take/secure. The ScriptSigns for each output are transmitted directly from one user to the next/the new owner (email/letter...)?  
> **username_1**: Just updated with more detail about the wallet software, which handles the creation of keys, transactions, and transaction signing. In your example, the coins that user A owns are encumbered by a scriptPubKey that was created by user A and received a transaction previously. Ownership is determined by providing a scriptSig that matches the scriptPubkey (which usually is a cryptographic signature, but doesn't have to be). The scriptsigs are added to the transaction data which is broadcast to the network via nodes.  
> **username_1**: of course! have fun learning more!  

---

