Glossary | Transaction Data

Transaction Data Raw Transaction

A bitcoin transaction is just a bunch of data.


Here's what a raw transaction looks like: (source)



A transaction is basically a series of inputs and a series of outputs (with a pinch of meta-data).

In further detail; the transaction data tells you how to unlock existing packages of bitcoins (from previous transactions), and how to lock them up again in to new packages.


01000000 4 bytes (hexadecimal, little-endian)
This lets the bitcoin network known which version of transaction data structure we're using. For example, if a new field is added to the transaction data, this field can be updated so that bitcoin nodes will know how to read the rest of the string of data.
01 VarInt
Tell the node how many inputs to work through.
7967a5185e907a25225574544c31f7b059c1a191d65b53dcc1554d339c4f9efc 32 bytes (hexadecimal, little-endian)
We want to use an existing output from the blockchain as in input, so we start by referring to a transaction that's sitting in the blockchain txid (transaction ID).
01000000 4 bytes (hexadecimal, little-endian)
Now we select the specific output we want to use from the transaction we just referenced (because each transactions can hold more than one output).
6a VarInt
We need to specify how big the upcoming signature is going to be, because they can vary in size and anyone who reads this transaction data needs to know where the signature ends.
47304402206a2eb16b7b92051d0fa38c133e67684ed064effada1d7f925c842da401d4f22702201f196b10e6e4b4a9fff948e5c5d71ec5da53e90529c8dbd122bff2b1d21dc8a90121039b7bcd0824b9a9164f7ba098408e63e5b7e3cf90835cceb19868f54f8961a825 (hexadecimal)
This unlocks the lockingscript that was put on the output (so that it can be used as an input for this transaction).
ffffffff 4 bytes (hexadecimal, little-endian)
01 VarInt
How many outputs are we making?
4baf210000000000 8 bytes (hexadecimal, little-endian)
How many satoshis are we putting in to this output?
19 VarInt
76a914db4d1141d0048b1ed15839d0b7a4c488cd368b0e88ac (hexadecimal)
Put a lock on this output. Anyone who wants to use this output will need to be able to satisfy this lock.
00000000 4 bytes (hexadecimal, little-endian)
Set a minimum block height or Unix time that this transaction can be included in. This allows you to create a transaction now, and have your wallet send it in to the network when the blockchain reaches a certain block height, or when the network hits a time in the future.


A raw transaction is sometimes called a "serialized transaction", because it's just a bunch of individual pieces of data zipped up in to one string of data.