<p><strong>No.</strong> That's not possible.</p>

<p>A transaction id is calculated from the raw transaction. More specifically the raw transaction is hashed twice with sha256: <code>sha256(sha256(rawtransaction))</code>.</p>

<p>That means, that the id is always 256 bits long (64 characters).
Because sha256 and hashing in general is a one-way-operation, it's not possible to calculate the size of the rawtransaction just from the transaction id.</p>

<p>if you need more information about a transaction, you have to fetch that from a client. In bitcoin core you can use <code>gettransaction</code> or <code>getrawtransaction</code>. (getrawtransaction only works if the transaction belongs to one of your addresses or you have <code>txindex</code> enabled in your wallet.)</p>

CC BY-SA 4.0
2019-01-15T10:28:38.750Z
TXID is `dsha256` +`endian swap` of the over-the-wire transaction serialisation.
James C.
CC BY-SA 4.0
2019-01-15T10:40:04.757Z
That is part of the p2p protocol, not implementation, as this is how txids / prevouts are referenced in overthewire tx serialisations.
James C.
CC BY-SA 4.0
2019-01-15T08:36:30.490Z
2019-01-15T08:42:51.597Z
2019-01-15T08:42:51.597Z
Jack O'Neill
<p>Is it possible to calculate the transaction size from the transaction id ?</p>

CC BY-SA 4.0
2019-01-15T11:05:30.417Z
I think [this](https://bitcoin.stackexchange.com/questions/1195/how-to-calculate-transaction-size-before-sending-legacy-non-segwit-p2pkh-p2sh) should answer to your question more than exhaustively. If yes this can be marked as duplicate, I suppose.
AG23
<bitcoin-core><transaction-fees>
How to calculate the transaction size?
Pankaj Kumar
# How to calculate the transaction size?

(Asked by: username_0 on 2019-01-15)

Is it possible to calculate the transaction size from the transaction id ?

**Tags:** bitcoin-core, transaction-fees

> **Comments:**
> **username_1**: I think [this](https://bitcoin.stackexchange.com/questions/1195/how-to-calculate-transaction-size-before-sending-legacy-non-segwit-p2pkh-p2sh) should answer to your question more than exhaustively. If yes this can be marked as duplicate, I suppose.  

---

## 1 answers

### Answer by username_2 on 2019-01-15. Score: 1

**No.** That's not possible.

A transaction id is calculated from the raw transaction. More specifically the raw transaction is hashed twice with sha256: `sha256(sha256(rawtransaction))`.

That means, that the id is always 256 bits long (64 characters).
Because sha256 and hashing in general is a one-way-operation, it's not possible to calculate the size of the rawtransaction just from the transaction id.

if you need more information about a transaction, you have to fetch that from a client. In bitcoin core you can use `gettransaction` or `getrawtransaction`. (getrawtransaction only works if the transaction belongs to one of your addresses or you have `txindex` enabled in your wallet.)

> **Comments:**
> **username_3**: TXID is `dsha256` +`endian swap` of the over-the-wire transaction serialisation.  
> **username_3**: That is part of the p2p protocol, not implementation, as this is how txids / prevouts are referenced in overthewire tx serialisations.  

---

