Glossary | Transaction Data
$4,133.51/BTCBuy

Transaction Data Raw Transaction

A bitcoin transaction is just a bunch of data.

Example

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

01000000017967a5185e907a25225574544c31f7b059c1a191d65b53dcc1554d339c4f9efc010000006a47304402206a2eb16b7b92051d0fa38c133e67684ed064effada1d7f925c842da401d4f22702201f196b10e6e4b4a9fff948e5c5d71ec5da53e90529c8dbd122bff2b1d21dc8a90121039b7bcd0824b9a9164f7ba098408e63e5b7e3cf90835cceb19868f54f8961a825ffffffff014baf2100000000001976a914db4d1141d0048b1ed15839d0b7a4c488cd368b0e88ac00000000

Structure

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.

Fields.

version
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.
inputcount
01 VarInt
Tell the node how many inputs to work through.
txid
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).
vout
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).
signaturesize
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.
signature
47304402206a2eb16b7b92051d0fa38c133e67684ed064effada1d7f925c842da401d4f22702201f196b10e6e4b4a9fff948e5c5d71ec5da53e90529c8dbd122bff2b1d21dc8a90121039b7bcd0824b9a9164f7ba098408e63e5b7e3cf90835cceb19868f54f8961a825 (hexadecimal)
This unlocks the lockingscript that was put on the output (so that it can be used as an input for this transaction).
sequence
ffffffff 4 bytes (hexadecimal, little-endian)
outputcount
01 VarInt
How many outputs are we making?
value
4baf210000000000 8 bytes (hexadecimal, little-endian)
How many satoshis are we putting in to this output?
lockingscriptsize
19 VarInt
lockingscript
76a914db4d1141d0048b1ed15839d0b7a4c488cd368b0e88ac (hexadecimal)
Put a lock on this output. Anyone who wants to use this output will need to be able to satisfy this lock.
locktime
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.

Notes

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.