<p>The serialized format is described <a href="https://en.bitcoin.it/wiki/Protocol_specification#tx" rel="nofollow">here</a>.</p>

CC BY-SA 3.0
2013-09-28T23:46:51.477Z
2013-09-28T23:46:51.477Z
Pieter Wuille
<p>I'd like to create a transaction object from scratch. I've read that the tx id for a transaction is the <a href="https://bitcoin.stackexchange.com/questions/5887/how-is-a-transaction-id-generated-when-does-it-change-with-a-new-sequence-id?rq=1">double SHA-256 hash of a serialized transaction</a>, but havent been able to find details on exactly how the data is formatted before its serialized or how it is serialized for that matter. </p>

<p>Could someone, perhaps, provide an example of how the data is organized before it's serialized and/or describe the manner of serialization taking place?</p>

<transactions><raw-transaction>
How exactly can I generate a transaction id?
rocketas
# How exactly can I generate a transaction id?

(Asked by: username_0 on 2013-09-28)

I'd like to create a transaction object from scratch. I've read that the tx id for a transaction is the [double SHA-256 hash of a serialized transaction](https://bitcoin.stackexchange.com/questions/5887/how-is-a-transaction-id-generated-when-does-it-change-with-a-new-sequence-id?rq=1), but havent been able to find details on exactly how the data is formatted before its serialized or how it is serialized for that matter.

Could someone, perhaps, provide an example of how the data is organized before it's serialized and/or describe the manner of serialization taking place?

**Tags:** transactions, raw-transaction


---

## 1 answers

### Answer by username_1 on 2013-09-28. Score: 4

The serialized format is described [here](https://en.bitcoin.it/wiki/Protocol_specification#tx).


---

