<blockquote>
  <p>What about the second one ? That can be 61 bytes long ? </p>
</blockquote>

<p>Yes.</p>

<blockquote>
  <p>Also, does each transaction carry a counter ?</p>
</blockquote>

<p>No. There is a global counter in the block that is right after the block header. That counter is the number of transactions included in the block. It is not part of any transaction and its size does not affect the size of any transaction in the block (compared to when that transaction was unconfirmed and in the mempool).</p>

<p>The transactions come after that counter just listed one after another with no additional information separating them (transactions follow a specific format so it is trivial to know when one ends and the next starts).</p>

CC BY-SA 4.0
2019-03-26T14:54:12.930Z
The "global counter" (between header and transactions) is not a part of consensus block :) You can serialize your data on disk as <header>|<transactions>|<16bit-counter> or <counter>|<header>|<transactions> and so on. And you definetely can add any counters for transactions while saving block to your local database. (There is no reason for it)
amaclin
CC BY-SA 4.0
2019-03-26T14:58:35.017Z
The counter is part of the block weight so it is consensus critical. However, yes you can put the counter wherever you want, although blocks received over the network will have them after the header because that's what the `block` message specifies.
Ava Chow
CC BY-SA 4.0
2019-03-26T15:15:30.390Z
@andrewchow when does the transaction counter get the max of 9 bytes ?
user92452
CC BY-SA 4.0
2019-03-26T16:26:55.793Z
Whenever the counter requires 8 bytes to represent it. Currently this is not possible because that's way too many transactions than can fit within the block weight limit. However the number of bytes required for the counter is variable.
Ava Chow
CC BY-SA 4.0
2019-03-27T01:08:56.077Z
@AndrewChow sorry let me ask differently, how is the value represented in hex ? so with let's say 5 bytes what would be the max value we could obtain ?
user92452
CC BY-SA 4.0
2019-03-27T02:03:30.313Z
That way of asking differently does not make any sense. What is it that you really want to know? The way you are asking questions sounds like an [XY problem](http://xyproblem.info/) as it seems like you are fixated on this counter and think that answering a question about the counter will get you an answer for some other related question.
Ava Chow
CC BY-SA 4.0
2019-03-27T03:38:24.937Z
What is the maximum number of transactions that be showcased by the maximum value which is 9 bytes, could you illustrate this ? Then I might be able to answer my own misunderstandings myself.
user92452
CC BY-SA 4.0
2019-03-27T04:15:03.227Z
Just ask what it is that you are misunderstanding instead of asking for something that you think will help you understand it. A block can contain 16392 minimally sized transactions, including the coinbase transaction. This does not require 9 bytes to represent, it requires 3. The maximum number of transactions that 9 bytes can count is 18446744073709551615 (0xffffffffffffffff), but that far exceeds the maximum number of transactions in a block (and basically the capacity of  storage you would find in any computer ).
Ava Chow
CC BY-SA 4.0
2019-03-27T10:02:49.167Z
@andrewchow thank you. that does answer a lot of  questions.
user92452
CC BY-SA 4.0
2019-03-26T14:42:17.907Z
2019-03-26T14:42:17.907Z
Ava Chow
<p>In <a href="https://bitcoin.stackexchange.com/questions/54679/what-are-the-minimum-sizes-for-transactions-and-blocks-in-bitcoin/54682#54682">What are the minimum sizes for transactions and blocks in Bitcoin?</a></p>

<p>The first transaction is set to be 65 bytes long, due to coinbase requirements. What about the second one ? That can be 61 bytes long ? Also, does each transaction carry a counter ? How is that added to the byte count.</p>

CC BY-SA 4.0
2019-03-26T11:34:54.373Z
By "does each transaction carry a counter", do you mean a counter as to how many transactions are included in the block?
Ugam Kamat
CC BY-SA 4.0
2019-03-26T11:59:08.927Z
The transaction counter is part of the blockheader or not ? Does the counter refer to the number of all transactions inside the block or does each transaction have a counter ID ?
user92452
CC BY-SA 4.0
2019-03-26T12:51:10.027Z
There’s a counter after the block header, but not part of it. Transactions have no other index.
Claris
CC BY-SA 4.0
2019-03-26T13:13:44.220Z
There’s a counter after the block header if you mean block serialization to disk by BitcoinCore. In fact, serialization to your disk is not a consensus rule. You have a right to write data on your disk in your own format.
amaclin
<transactions><blocksize><transaction-weight>
regarding transaction size in a block
user92452
# regarding transaction size in a block

(Asked by: username_0 on 2019-03-26)

In [What are the minimum sizes for transactions and blocks in Bitcoin?](https://bitcoin.stackexchange.com/questions/54679/what-are-the-minimum-sizes-for-transactions-and-blocks-in-bitcoin/54682#54682)

The first transaction is set to be 65 bytes long, due to coinbase requirements. What about the second one ? That can be 61 bytes long ? Also, does each transaction carry a counter ? How is that added to the byte count.

**Tags:** transactions, blocksize, transaction-weight

> **Comments:**
> **username_1**: By "does each transaction carry a counter", do you mean a counter as to how many transactions are included in the block?  
> **username_0**: The transaction counter is part of the blockheader or not ? Does the counter refer to the number of all transactions inside the block or does each transaction have a counter ID ?  
> **username_2**: There’s a counter after the block header, but not part of it. Transactions have no other index.  
> **username_3**: There’s a counter after the block header if you mean block serialization to disk by BitcoinCore. In fact, serialization to your disk is not a consensus rule. You have a right to write data on your disk in your own format.  

---

## 1 answers

### Answer by username_4 on 2019-03-26. Score: 2

> What about the second one ? That can be 61 bytes long ?

Yes.

> Also, does each transaction carry a counter ?

No. There is a global counter in the block that is right after the block header. That counter is the number of transactions included in the block. It is not part of any transaction and its size does not affect the size of any transaction in the block (compared to when that transaction was unconfirmed and in the mempool).

The transactions come after that counter just listed one after another with no additional information separating them (transactions follow a specific format so it is trivial to know when one ends and the next starts).

> **Comments:**
> **username_3**: The "global counter" (between header and transactions) is not a part of consensus block :) You can serialize your data on disk as <header>|<transactions>|<16bit-counter> or <counter>|<header>|<transactions> and so on. And you definetely can add any counters for transactions while saving block to your local database. (There is no reason for it)  
> **username_4**: The counter is part of the block weight so it is consensus critical. However, yes you can put the counter wherever you want, although blocks received over the network will have them after the header because that's what the `block` message specifies.  
> **username_0**: @andrewchow when does the transaction counter get the max of 9 bytes ?  
> **username_4**: Whenever the counter requires 8 bytes to represent it. Currently this is not possible because that's way too many transactions than can fit within the block weight limit. However the number of bytes required for the counter is variable.  
> **username_0**: @AndrewChow sorry let me ask differently, how is the value represented in hex ? so with let's say 5 bytes what would be the max value we could obtain ?  
> **username_4**: That way of asking differently does not make any sense. What is it that you really want to know? The way you are asking questions sounds like an [XY problem](http://xyproblem.info/) as it seems like you are fixated on this counter and think that answering a question about the counter will get you an answer for some other related question.  
> **username_0**: What is the maximum number of transactions that be showcased by the maximum value which is 9 bytes, could you illustrate this ? Then I might be able to answer my own misunderstandings myself.  
> **username_4**: Just ask what it is that you are misunderstanding instead of asking for something that you think will help you understand it. A block can contain 16392 minimally sized transactions, including the coinbase transaction. This does not require 9 bytes to represent, it requires 3. The maximum number of transactions that 9 bytes can count is 18446744073709551615 (0xffffffffffffffff), but that far exceeds the maximum number of transactions in a block (and basically the capacity of  storage you would find in any computer ).  
> **username_0**: @andrewchow thank you. that does answer a lot of  questions.  

---

