<p>For a transaction spending a single p2tr output via the key-path and creating a single p2tr output, we would construct a transaction with the following fields:</p>
<pre><code>version (4 bytes)
witness marker (1 byte)
witness flag (1 byte)
input count (1 byte)
  inputs (41 bytes)
output count (1 byte)
  outputs (43 bytes)
witness stacks (as many as input count)
  witness item count (1 byte)
  witness items (65 bytes)
locktime (4 bytes)
</code></pre>
<p>For more details and to understand how the numbers above were chosen, make sure to read <a href="https://bitcoin.stackexchange.com/questions/111395/what-is-the-weight-of-a-p2tr-input">What is the weight of a P2TR input?</a>.</p>
<p>This gives us a <em>raw byte size</em> of: <code>(4 + 1 + 1 + 1 + 41 + 1 + 43 + 1 + 65 + 4) = 162 bytes</code>. However, post-segwit, block limits are no longer measured in bytes but in weight units.</p>
<p>To calculate the weight units for our transaction, recall that each non-witness byte is counted as 4 weight units and each witness byte is counted as one weight unit: <code>(94) x 4 WU + (68) x 1 WU = 444 WU</code>.</p>
<p>With a blockweight limit of 4M WU, we could fit 9,009 of our simple transactions in a single block (<code>4M WUs / 444 WUs per tx = 9,009 txs</code>).</p>
<p>Furthermore, each additional p2tr input adds 230 WU and each additional p2tr output adds 172 WU to the transaction. A more realistic transaction would be a 2-input, 2-output transaction with a total weight of <code>846 WU (444 + 230 + 172)</code>, of which we could fit 4,728 in a single block.</p>

CC BY-SA 4.0
2023-01-30T17:54:17.600Z
Nit: the necessity of having a coinbase transaction with a witness commitment shaves one or two off of your estimate. :)
Murch
CC BY-SA 4.0
2023-01-30T17:59:30.843Z
@Murch good point! IIRC, the block header also counts towards the block weight limit?
josie
CC BY-SA 4.0
2023-01-30T18:06:00.340Z
Oh, yes that too.
Murch
CC BY-SA 4.0
2023-01-30T13:15:19.523Z
2023-01-30T18:14:42.950Z
2023-01-30T18:14:42.950Z
josie
<p>If all transactions in a block were spending one p2tr output using the key-path spend and sending to a p2tr output, how many of these transactions could we fit in a single block?</p>

<transactions><taproot><blocksize><transaction-weight><block-weight>
What is the maximum number of taproot transactions that can be mined in a single block?
josie
# What is the maximum number of taproot transactions that can be mined in a single block?

(Asked by: username_0 on 2023-01-30)

If all transactions in a block were spending one p2tr output using the key-path spend and sending to a p2tr output, how many of these transactions could we fit in a single block?

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


---

## 1 answers

### Answer by username_0 on 2023-01-30. Score: 4 | Accepted answer

For a transaction spending a single p2tr output via the key-path and creating a single p2tr output, we would construct a transaction with the following fields:

```
version (4 bytes)
witness marker (1 byte)
witness flag (1 byte)
input count (1 byte)
  inputs (41 bytes)
output count (1 byte)
  outputs (43 bytes)
witness stacks (as many as input count)
  witness item count (1 byte)
  witness items (65 bytes)
locktime (4 bytes)

```

For more details and to understand how the numbers above were chosen, make sure to read [What is the weight of a P2TR input?](https://bitcoin.stackexchange.com/questions/111395/what-is-the-weight-of-a-p2tr-input).

This gives us a *raw byte size* of: `(4 + 1 + 1 + 1 + 41 + 1 + 43 + 1 + 65 + 4) = 162 bytes`. However, post-segwit, block limits are no longer measured in bytes but in weight units.

To calculate the weight units for our transaction, recall that each non-witness byte is counted as 4 weight units and each witness byte is counted as one weight unit: `(94) x 4 WU + (68) x 1 WU = 444 WU`.

With a blockweight limit of 4M WU, we could fit 9,009 of our simple transactions in a single block (`4M WUs / 444 WUs per tx = 9,009 txs`).

Furthermore, each additional p2tr input adds 230 WU and each additional p2tr output adds 172 WU to the transaction. A more realistic transaction would be a 2-input, 2-output transaction with a total weight of `846 WU (444 + 230 + 172)`, of which we could fit 4,728 in a single block.

> **Comments:**
> **username_1**: Nit: the necessity of having a coinbase transaction with a witness commitment shaves one or two off of your estimate. :)  
> **username_0**: @username_1 good point! IIRC, the block header also counts towards the block weight limit?  
> **username_1**: Oh, yes that too.  

---

