<p>Transactions consist of a version number, a list of inputs, a list of outputs, and a lock time.</p>

<p>Each input contains a reference to the output it is spending. This reference is the hash of the transaction containing the output followed by the 0-based index of the output's position in list of outputs. Then there is the input script which contains whatever data is necessary to satisfy the conditions of the output script. Lastly there is a sequence number.</p>

<p>Each output contains the amount of Bitcoin in satoshis and an output script that defines the conditions necessary to spend that output.</p>

<p>It is important to note that addresses are not included anywhere; rather they encode data that is then used to construct the output script. It is also important to note that output scripts are not just public keys (although a public key can be included in the output script) and input scripts are not just signatures (although signatures can be included in the input script).</p>

<p>A description of the actual transaction format can be found on <a href="https://bitcoin.org/en/developer-reference#raw-transaction-format" rel="nofollow noreferrer">bitcoin.org</a>.</p>

CC BY-SA 4.0
2018-06-16T10:50:40.687Z
Thanks Andrew. Regarding my understanding of hash pointers, am I right to say that it simply points to the 'output' it is hashing ? (i.e referencing)
DCH
CC BY-SA 4.0
2018-06-16T18:31:58.033Z
The hash itself does not point to the output. It points to the transaction. The index number, combined with the hash, points to the output.
Ava Chow
CC BY-SA 4.0
2018-06-14T21:53:16.490Z
2018-06-14T21:53:16.490Z
Ava Chow
<p>I'm learning about basic transactions and know that a transaction should contain:</p>

<p>i) Signature of the sender using some operator: sign(private key,message)</p>

<p>ii) Receivers Public key (wallet address)</p>

<p>iii) Hash Pointer pointing to the originating transaction / previous owner (i.e. A hash of the previous transaction's hash, signatures, etc) </p>

<p>I'm not sure if this is all that a transaction should contain, and also whether my understanding of point i) and especially iii) is correct. Hash pointers are a bit confusing; I understand the 'direction' of the arrow to mean we are pointing to what we are hashing, as opposed to the direction of flow of information.</p>

<p>Interested to hear your thoughts to help my understanding! </p>

<transactions><bitcoin-core><hash><signature><utxo>
What does a bitcoin transaction contain?
DCH
# What does a bitcoin transaction contain?

(Asked by: username_0 on 2018-06-14)

I'm learning about basic transactions and know that a transaction should contain:

i) Signature of the sender using some operator: sign(private key,message)

ii) Receivers Public key (wallet address)

iii) Hash Pointer pointing to the originating transaction / previous owner (i.e. A hash of the previous transaction's hash, signatures, etc)

I'm not sure if this is all that a transaction should contain, and also whether my understanding of point i) and especially iii) is correct. Hash pointers are a bit confusing; I understand the 'direction' of the arrow to mean we are pointing to what we are hashing, as opposed to the direction of flow of information.

Interested to hear your thoughts to help my understanding!

**Tags:** transactions, bitcoin-core, hash, signature, utxo


---

## 1 answers

### Answer by username_1 on 2018-06-14. Score: 1

Transactions consist of a version number, a list of inputs, a list of outputs, and a lock time.

Each input contains a reference to the output it is spending. This reference is the hash of the transaction containing the output followed by the 0-based index of the output's position in list of outputs. Then there is the input script which contains whatever data is necessary to satisfy the conditions of the output script. Lastly there is a sequence number.

Each output contains the amount of Bitcoin in satoshis and an output script that defines the conditions necessary to spend that output.

It is important to note that addresses are not included anywhere; rather they encode data that is then used to construct the output script. It is also important to note that output scripts are not just public keys (although a public key can be included in the output script) and input scripts are not just signatures (although signatures can be included in the input script).

A description of the actual transaction format can be found on [bitcoin.org](https://bitcoin.org/en/developer-reference#raw-transaction-format).

> **Comments:**
> **username_0**: Thanks Andrew. Regarding my understanding of hash pointers, am I right to say that it simply points to the 'output' it is hashing ? (i.e referencing)  
> **username_1**: The hash itself does not point to the output. It points to the transaction. The index number, combined with the hash, points to the output.  

---

