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

<h1>Transaction Format</h1>

<p>Here's an example from my regtest network:</p>

<p><code>0200000000010111b6e0460bb810b05744f8d38262f95fbab02b168b070598a6f31fad438fced4000000001716001427c106013c0042da165c082b3870c31fb3ab4683feffffff0200ca9a3b0000000017a914d8b6fcc85a383261df05423ddf068a8987bf0287873067a3fa0100000017a914d5df0b9ca6c0e1ba60a9ff29359d2600d9c6659d870247304402203b85cb05b43cc68df72e2e54c6cb508aa324a5de0c53f1bbfe997cbd7509774d022041e1b1823bdaddcd6581d7cde6e6a4c4dbef483e42e59e04dbacbaf537c3e3e8012103fbbdb3b3fc3abbbd983b20a557445fb041d6f21cc5977d2121971cb1ce5298978c000000</code></p>

<p>From left to right:</p>

<pre><code>Version: 02000000
Flag: 0001 (if present, indicates segwit)
Input Count: 01
Input 1 Previous Output Hash: 11b6e0460bb810b05744f8d38262f95fbab02b168b070598a6f31fad438fced4
Input 1 Previous Output Index: 00000000
Input 1 script length: 0x17 (23 bytes)
Input 1 signature script: 16001427c106013c0042da165c082b3870c31fb3ab4683
Input 1 sequence: feffffff
Output Count: 02
Output 1 Value: 00ca9a3b00000000 (1B satoshis / 10 BTC)
Output 1 public key script length: 0x17 (23 bytes)
Output 1 public key script: a914d8b6fcc85a383261df05423ddf068a8987bf028787
Output 2 Value: 3067a3fa01000000 (8499980080 sats / 84.9998008 BTC)
Output 2 public key script length: 0x17 (23 bytes)
Output 2 public key script: a914d5df0b9ca6c0e1ba60a9ff29359d2600d9c6659d87
Witness Count: 02
Witness 1 length: 0x47 (71 bytes)
Witness 1: 304402203b85cb05b43cc68df72e2e54c6cb508aa324a5de0c53f1bbfe997cbd7509774d022041e1b1823bdaddcd6581d7cde6e6a4c4dbef483e42e59e04dbacbaf537c3e3e801
Witness 2 length: 0x21 (33 bytes)
Witness 2: 03fbbdb3b3fc3abbbd983b20a557445fb041d6f21cc5977d2121971cb1ce529897
Locktime: 8c000000 (block 140)
</code></pre>

<p><strong>Note</strong>: all values are little endian. Here is a description of all of the fields:</p>

<p><a href="https://i.sstatic.net/7G4tP.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/7G4tP.png" alt="Transaction Format"></a></p>

CC BY-SA 4.0
2018-08-20T14:07:04.533Z
2018-08-20T14:07:04.533Z
JBaczuk
<p>I'm Studying bitcoin from a while, focusing transaction model and I'm looking to extract transaction model only to try out some experiments to make the structure better from the current one. If anyone can guide me through, that will be very helpful.</p>

CC BY-SA 4.0
2018-08-20T06:38:46.067Z
What is your question? It's not clear what you  mean by a "transaction model" and how to extract it
Raghav Sood
<transactions><bitcoin-core><source-code>
Bitcoin Code and Transaction Model
idk
# Bitcoin Code and Transaction Model

(Asked by: username_0 on 2018-08-20)

I'm Studying bitcoin from a while, focusing transaction model and I'm looking to extract transaction model only to try out some experiments to make the structure better from the current one. If anyone can guide me through, that will be very helpful.

**Tags:** transactions, bitcoin-core, source-code

> **Comments:**
> **username_1**: What is your question? It's not clear what you  mean by a "transaction model" and how to extract it  

---

## 1 answers

### Answer by username_2 on 2018-08-20. Score: 0

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

# Transaction Format

Here's an example from my regtest network:

`0200000000010111b6e0460bb810b05744f8d38262f95fbab02b168b070598a6f31fad438fced4000000001716001427c106013c0042da165c082b3870c31fb3ab4683feffffff0200ca9a3b0000000017a914d8b6fcc85a383261df05423ddf068a8987bf0287873067a3fa0100000017a914d5df0b9ca6c0e1ba60a9ff29359d2600d9c6659d870247304402203b85cb05b43cc68df72e2e54c6cb508aa324a5de0c53f1bbfe997cbd7509774d022041e1b1823bdaddcd6581d7cde6e6a4c4dbef483e42e59e04dbacbaf537c3e3e8012103fbbdb3b3fc3abbbd983b20a557445fb041d6f21cc5977d2121971cb1ce5298978c000000`

From left to right:

```
Version: 02000000
Flag: 0001 (if present, indicates segwit)
Input Count: 01
Input 1 Previous Output Hash: 11b6e0460bb810b05744f8d38262f95fbab02b168b070598a6f31fad438fced4
Input 1 Previous Output Index: 00000000
Input 1 script length: 0x17 (23 bytes)
Input 1 signature script: 16001427c106013c0042da165c082b3870c31fb3ab4683
Input 1 sequence: feffffff
Output Count: 02
Output 1 Value: 00ca9a3b00000000 (1B satoshis / 10 BTC)
Output 1 public key script length: 0x17 (23 bytes)
Output 1 public key script: a914d8b6fcc85a383261df05423ddf068a8987bf028787
Output 2 Value: 3067a3fa01000000 (8499980080 sats / 84.9998008 BTC)
Output 2 public key script length: 0x17 (23 bytes)
Output 2 public key script: a914d5df0b9ca6c0e1ba60a9ff29359d2600d9c6659d87
Witness Count: 02
Witness 1 length: 0x47 (71 bytes)
Witness 1: 304402203b85cb05b43cc68df72e2e54c6cb508aa324a5de0c53f1bbfe997cbd7509774d022041e1b1823bdaddcd6581d7cde6e6a4c4dbef483e42e59e04dbacbaf537c3e3e801
Witness 2 length: 0x21 (33 bytes)
Witness 2: 03fbbdb3b3fc3abbbd983b20a557445fb041d6f21cc5977d2121971cb1ce529897
Locktime: 8c000000 (block 140)

```

**Note**: all values are little endian. Here is a description of all of the fields:

[![Transaction Format](https://i.sstatic.net/7G4tP.png)](https://i.sstatic.net/7G4tP.png)


---

