You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ultimately, the pool is responsible for adding coinbase transaction outputs for payouts and other uses, and thus the Template Provider will need to consider this additional block size, and sigops when selecting transactions for inclusion in a block (to not create an invalid, oversized block).
16
-
Thus, this message is used to indicate that some additional space and sigops in the block/coinbase transaction be reserved for the pool’s use (while always assuming the pool will use the entirety of available coinbase space and sigops).
15
+
When crafting a template, the Template Provider needs to reserve appropriate blockspace and sigops for the Coinbase Transaction (to not create an invalid, oversized block). Here's a table with all fields of a Coinbase Transaction that have fixed size:
So a Template Provider MUST reserve 242 weight units for the fixed-size fields in case of a SegWit block, or 200 weight units in the unlikely case of a legacy block. Meanwhile, the following fields of a Coinbase Transaction have variable size:
|`scriptSig`| 100 bytes max | 4 WU/byte | 400 WU max |
36
+
|`output count`| 9 bytes max | 4 WU/byte | 46 WU max |
37
+
|`outputs`| no limit | 4 WU/byte | no limit |
38
+
39
+
So a Template Provider MUST also reserve:
40
+
- the worst-case 400 weight units for `scriptSig` field
41
+
- the worst-case 46 weight units for `output count` field
42
+
- 188 weight units for witness commitment output
43
+
44
+
But ultimately, the Pool (or JDC, in case of Job Declaration) is responsible for adding coinbase transaction outputs for payouts and other uses, and thus the Template Provider will need to consider this additional block size, and sigops when selecting transactions for inclusion in a block.
45
+
46
+
Thus, the `CoinbaseOutputConstraints` message is used to indicate that some additional space and sigops in the block/coinbase transaction be reserved for the Pool or JDC use (while always assuming the entirety of available coinbase space and sigops will be used).
47
+
48
+
JDC MUST discover the maximum serialized size of the additional outputs and sigops which will be added by the Pool(s) it intends to use this work with (via `AllocateMiningJobToken.Success`). It then MUST communicate it to the Template Provider via `CoinbaseOutputConstraints`.
17
49
18
-
The Job Declarator MUST discover the maximum serialized size of the additional outputs and sigops which will be added by the pool(s) it intends to use this work.
19
-
It then MUST communicate it to the Template Provider via this message.
20
50
The Template Provider MUST NOT provide `NewTemplate` messages which would represent consensus-invalid blocks once this additional size and sigops — along with a maximally-sized (100 byte) coinbase script field — is added.
21
-
Further, the Template Provider MUST consider the maximum additional bytes required in the output count variable-length integer in the coinbase transaction when complying with the size limits.
22
-
Current sigops limit per block in bitcoin is 80_000. We are not aware of any use cases where
23
-
coinbase have more the 65_535 so coinbase_output_max_sigops is an U16. Note that taproot outputs consume 0 sigops.
51
+
52
+
Current sigops limit per block in bitcoin is `80_000`. We are not aware of any use cases where a coinbase transaction has more than `65_535` so `coinbase_output_max_sigops` is an `U16`. Note that taproot outputs consume `0` sigops.
0 commit comments