Skip to content

Commit 2d2dffa

Browse files
nuttycomclaude
andcommitted
[Draft-Extensible-Tx]: Address PR review comments.
- Update PR URL to 1156 and fix email addresses - Use conformance language (MAY/MUST NOT) for registry column descriptions - Add constraint that map keys must be in increasing order - Change "ordered by" to "in increasing order of" throughout - Fix "transparent transaction value pool" terminology - Change AssetUuid subscript notation to function notation - Add registry update mechanism language - Add "Defining ZIP" column to bundle type registry table - Rephrase consensus rules section to clarify modifications to protocol spec - Add clarifying text for fee bundle semantics (coinbase collects, others pay) - Add mutual exclusion consensus rule for Sapling/Orchard bundle variants Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 9f789a0 commit 2d2dffa

File tree

1 file changed

+81
-61
lines changed

1 file changed

+81
-61
lines changed

zips/draft-core-extensible-tx-format.rst

Lines changed: 81 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
ZIP: TBD
44
Title: Extensible Transaction Format
5-
Owners: Jack Grigg <jack@electriccoin.co>
6-
Kris Nuttycombe <kris@electriccoin.co>
7-
Daira-Emma Hopwood <daira@electriccoin.co>
8-
Schell Scivally <schell@electriccoin.co>
5+
Owners: Jack Grigg <jack@znewco.com>
6+
Kris Nuttycombe <kris@nutty.land>
7+
Daira-Emma Hopwood <daira@jacaranda.org>
8+
Schell Scivally <efsubenovex@gmail.com>
99
Status: Draft
1010
Category: Consensus / Wallet
1111
Created: 2025-12-17
1212
License: MIT
1313
Discussions-To: <TBD>
14-
Pull-Request: <https://github.com/zcash/zips/pull/???>
14+
Pull-Request: <https://github.com/zcash/zips/pull/1156>
1515

1616

1717
Terminology
@@ -265,50 +265,53 @@ transaction format. All currently-defined IDs are encoded as single-byte
265265
``compactSize`` values where they appear in the transaction format.
266266

267267
The ``mValuePoolDeltas`` column indicates whether or not an entry for this
268-
bundle type is permitted in ``mValuePoolDeltas``. For rows where an ❌
268+
bundle type MAY appear in ``mValuePoolDeltas``. For rows where an ❌
269269
is present, the value pool delta for every pool is guaranteed to be zero, and
270-
so entries in ``mValuePoolDeltas`` are disallowed.
270+
so entries in ``mValuePoolDeltas`` MUST NOT be present.
271271

272272
The ``mEffectBundles`` column indicates whether or not an entry for this bundle
273-
type is permitted in ``mEffectBundles``. For rows where an ❌ is present, the
274-
bundle has no effecting data, and so no entry in ``mEffectBundles`` is
275-
permitted.
273+
type MAY appear in ``mEffectBundles``. For rows where an ❌ is present, the
274+
bundle has no effecting data, and so an entry in ``mEffectBundles`` MUST NOT
275+
be present.
276276

277277
The ``mAuthBundles`` column indicates whether or not an entry for this bundle
278-
type is permitted in ``mAuthBundles``. For rows where an ❌ is present, the
279-
bundle has no authorizing data, and so no entry in ``mAuthBundles`` is
280-
permitted.
281-
282-
+------------+----------------------+--------------------+------------------+-------------------------------------------------------------+
283-
| BundleType | ``mValuePoolDeltas`` | ``mEffectBundles`` | ``mAuthBundles`` | Bundle kind |
284-
+============+======================+====================+==================+=============================================================+
285-
| 0 |✅ |✅ |✅ | Transparent |
286-
+------------+----------------------+--------------------+------------------+-------------------------------------------------------------+
287-
| 1 | | | | Reserved |
288-
+------------+----------------------+--------------------+------------------+-------------------------------------------------------------+
289-
| 2 |✅ |✅ |✅ | Sapling |
290-
+------------+----------------------+--------------------+------------------+-------------------------------------------------------------+
291-
| 3 |✅ |✅ |✅ | Orchard |
292-
+------------+----------------------+--------------------+------------------+-------------------------------------------------------------+
293-
| 4\* |✅ |❌ |❌ | Transaction fee (\*if ZIP 2002 activated) |
294-
+------------+----------------------+--------------------+------------------+-------------------------------------------------------------+
295-
| 5\* |✅ |❌ |❌ | ZIP 233 NSM field (\*if ZIP 233 activated) |
296-
+------------+----------------------+--------------------+------------------+-------------------------------------------------------------+
297-
| 6\* |❌ |✅ |✅ | ZIP 270 Key rotation (\*if ZIP 270 activated) |
298-
+------------+----------------------+--------------------+------------------+-------------------------------------------------------------+
299-
| 7\* |✅ |✅ |✅ | Lockbox disbursement / "Consensus accounts" |
300-
| | | | | (\*for miner payouts, lockbox, etc if ZIP activated) |
301-
+------------+----------------------+--------------------+------------------+-------------------------------------------------------------+
302-
| |❌ |✅ |❌ | ZIP 231 Memos |
303-
+------------+----------------------+--------------------+------------------+-------------------------------------------------------------+
304-
| |✅ |✅ |✅ | Sapling-post-ZIP 231 (if ZIP 231 activated after this ZIP) |
305-
+------------+----------------------+--------------------+------------------+-------------------------------------------------------------+
306-
| |✅ |✅ |✅ | Orchard-post-ZIP 231 (if ZIP 231 activated after this ZIP) |
307-
+------------+----------------------+--------------------+------------------+-------------------------------------------------------------+
308-
| |✅ |✅ |✅ | ZSA Issuance |
309-
+------------+----------------------+--------------------+------------------+-------------------------------------------------------------+
310-
| |✅ |✅ |✅ | OrchardZSA |
311-
+------------+----------------------+--------------------+------------------+-------------------------------------------------------------+
278+
type MAY appear in ``mAuthBundles``. For rows where an ❌ is present, the
279+
bundle has no authorizing data, and so an entry in ``mAuthBundles`` MUST NOT
280+
be present.
281+
282+
+------------+----------------------+--------------------+------------------+--------------+----------------------------------------------+
283+
| BundleType | ``mValuePoolDeltas`` | ``mEffectBundles`` | ``mAuthBundles`` | Defining ZIP | Bundle kind |
284+
+============+======================+====================+==================+==============+==============================================+
285+
| 0 |✅ |✅ |✅ | This ZIP | Transparent |
286+
+------------+----------------------+--------------------+------------------+--------------+----------------------------------------------+
287+
| 1 | | | | | Reserved |
288+
+------------+----------------------+--------------------+------------------+--------------+----------------------------------------------+
289+
| 2 |✅ |✅ |✅ | This ZIP | Sapling |
290+
+------------+----------------------+--------------------+------------------+--------------+----------------------------------------------+
291+
| 3 |✅ |✅ |✅ | This ZIP | Orchard |
292+
+------------+----------------------+--------------------+------------------+--------------+----------------------------------------------+
293+
| 4 |✅ |❌ |❌ | ZIP 2002 | Transaction fee |
294+
+------------+----------------------+--------------------+------------------+--------------+----------------------------------------------+
295+
| 5 |✅ |❌ |❌ | ZIP 233 | ZIP 233 NSM field |
296+
+------------+----------------------+--------------------+------------------+--------------+----------------------------------------------+
297+
| 6 |❌ |✅ |✅ | ZIP 270 | Key rotation |
298+
+------------+----------------------+--------------------+------------------+--------------+----------------------------------------------+
299+
| 7 |✅ |✅ |✅ | TBD | Lockbox disbursement |
300+
+------------+----------------------+--------------------+------------------+--------------+----------------------------------------------+
301+
| |❌ |✅ |❌ | ZIP 231 | Memos |
302+
+------------+----------------------+--------------------+------------------+--------------+----------------------------------------------+
303+
| |✅ |✅ |✅ | ZIP 231 | Sapling-post-ZIP 231 |
304+
+------------+----------------------+--------------------+------------------+--------------+----------------------------------------------+
305+
| |✅ |✅ |✅ | ZIP 231 | Orchard-post-ZIP 231 |
306+
+------------+----------------------+--------------------+------------------+--------------+----------------------------------------------+
307+
| |✅ |✅ |✅ | ZIP 227 | ZSA Issuance |
308+
+------------+----------------------+--------------------+------------------+--------------+----------------------------------------------+
309+
| |✅ |✅ |✅ | ZIP 226 | OrchardZSA |
310+
+------------+----------------------+--------------------+------------------+--------------+----------------------------------------------+
311+
312+
Additional bundle types MAY be added to this registry via modifications to this
313+
ZIP specified in other ZIPs. Such modifications MUST specify all of the
314+
information required by the `Bundle Type Registration`_ section above.
312315

313316
Potential Future Bundle Types
314317
`````````````````````````````
@@ -387,10 +390,11 @@ Transaction Format
387390
| varies |``mAuthBundles`` |``BundleData[nAuthBundles]`` |A map from bundle identifier to the authorizing data of a bundle. |
388391
+-----------------------------+------------------------------+------------------------------------------------+---------------------------------------------------------------------+
389392

390-
``mEffectBundles`` and ``mAuthBundles`` are interpreted as a maps keyed by
391-
bundle type. Each map MUST NOT contain more than a single entry for a given
392-
key. For each key that exists in ``mAuthBundles``, a corresponding entry
393-
must exist in ``mEffectBundles``.
393+
``mEffectBundles`` and ``mAuthBundles`` are interpreted as maps keyed by
394+
bundle type. The entries in each map MUST be in increasing order of key.
395+
Each map MUST NOT contain more than a single entry for a given key. For each
396+
key that exists in ``mAuthBundles``, a corresponding entry must exist in
397+
``mEffectBundles``.
394398

395399
ValuePoolDelta
396400
--------------
@@ -407,8 +411,8 @@ ValuePoolDelta
407411
| | | |array containing a universally unique 64-byte identifier for the |
408412
| | | |asset. |
409413
+-----------------------------+------------------------------+------------------------------------------------+---------------------------------------------------------------------+
410-
| 8 |``value`` |``nonzero int64`` |The net change to the transparent value pool of the given asset |
411-
| | | |produced by the bundle corresponding to the bundle type identifier. |
414+
| 8 |``value`` |``nonzero int64`` |The net change to the transparent transaction value pool for the |
415+
| | | |given asset, produced by the bundle with this bundle type identifier.|
412416
| | | |This value MUST be nonzero; if a ``ValuePoolDelta`` record would |
413417
| | | |have zero value, it MUST be elided from the encoding |
414418
| | | |of ``mValuePoolDeltas`` instead. |
@@ -419,15 +423,15 @@ $(\mathsf{BundleType}, \mathsf{AssetUuid}).$ The map MUST NOT contain more than
419423
a single entry for a given key. Lookups in this map are denoted with the
420424
syntax $\mathsf{mValuePoolDeltas}[(\mathsf{BundleType}, \mathsf{AssetUuid})].$
421425

422-
Let $\mathsf{AssetUuid}_\mathsf{d}$ be the asset indicated by the ``mValuePoolDeltas`` entry $\mathsf{d}.$
426+
Let $\mathsf{AssetUuid}(\mathsf{d})$ be the asset indicated by the ``mValuePoolDeltas`` entry $\mathsf{d}.$
423427

424428
.. math::
425429
426-
\mathsf{AssetUuid} =
430+
\mathsf{AssetUuid}(\mathsf{d}) =
427431
\begin{cases}
428432
\mathsf{Zec} & \text{if } \mathsf{d}.\mathsf{assetClass} = 0 \\
429433
\mathsf{d}.\mathsf{assetUuid} & \text{if } \mathsf{d}.\mathsf{assetClass} = 1 \\
430-
\bot \text{otherwise}
434+
\bot & \text{otherwise}
431435
\end{cases}
432436
433437
BundleData
@@ -707,20 +711,36 @@ that authorize the actions.
707711
Consensus Rules
708712
---------------
709713

714+
This ZIP requires the following modifications to the consensus rules in the
715+
Zcash Protocol Specification.
716+
710717
Let ``FeeBundleId`` be the identifier of the fee bundle. In V6 transactions,
711718
$\mathsf{FeeBundleId} = 4$ as defined in the table above.
712719

713-
Full node implementations MUST verify that:
720+
The following transaction validity rules are added:
714721

715722
* The ``assetClass`` value for any entry in ``mValuePoolDeltas`` having
716723
``bundleType = FeeBundleId`` is 0 (fee amounts are denominated in ZEC
717724
and no other asset.)
718725

719-
* For coinbase transaction, the value of $\mathsf{mValuePoolDeltas}[(\mathsf{FeeBundleId}, \mathsf{Zec})]$ must be nonnegative.
726+
* For coinbase transactions, the value of $\mathsf{mValuePoolDeltas}[(\mathsf{FeeBundleId}, \mathsf{Zec})]$
727+
must be nonnegative. This represents the total transaction fees collected from
728+
all other transactions in the block.
720729

721-
* For non-coinbase transactions, the value of $\mathsf{mValuePoolDeltas}[(\mathsf{FeeBundleId}, \mathsf{Zec})]$ must be nonpositive.
730+
* For non-coinbase transactions, the value of $\mathsf{mValuePoolDeltas}[(\mathsf{FeeBundleId}, \mathsf{Zec})]$
731+
must be nonpositive. This represents the transaction fee paid by the
732+
transaction (expressed as a negative value, since it is removed from the
733+
transparent transaction value pool).
722734

723735
* Within the scope of a block, the sum of the fee bundle values must equal 0.
736+
That is, the fees collected by the coinbase transaction must equal the sum of
737+
fees paid by all other transactions in the block.
738+
739+
* Certain bundle types are mutually exclusive: a transaction MUST NOT contain
740+
more than one bundle from each of the following sets:
741+
742+
* {Sapling, Sapling-post-ZIP-231}
743+
* {Orchard, Orchard-post-ZIP-231, OrchardZSA}
724744

725745
* For the coinbase transaction, the sum of value pool deltas in the ZEC asset
726746
is equal to the negative of the block subsidy for that block; the block
@@ -729,7 +749,7 @@ Full node implementations MUST verify that:
729749

730750
.. math::
731751
732-
\sum_{\mathsf{d} \in \mathsf{mValuePoolDeltas} | \mathsf{AssetUuid}_\mathsf{d} = \mathsf{Zec}} \mathsf{d.value} = -\mathsf{BlockSubsidy}(\mathsf{height})
752+
\sum_{\mathsf{d} \in \mathsf{mValuePoolDeltas} | \mathsf{AssetUuid}(\mathsf{d}) = \mathsf{Zec}} \mathsf{d.value} = -\mathsf{BlockSubsidy}(\mathsf{height})
733753
734754
where $\mathsf{BlockSubsidy}$ is defined in § 7.8 'Block Subsidy and
735755
Founders' Reward'. [#protocol-subsidies]_
@@ -739,7 +759,7 @@ Full node implementations MUST verify that:
739759

740760
.. math::
741761
742-
\forall \mathsf{a}. \sum_{\mathsf{d} \in \mathsf{mValuePoolDeltas} | \mathsf{AssetUuid}_\mathsf{d} = \mathsf{a}} \mathsf{d.value} = 0
762+
\forall \mathsf{a}. \sum_{\mathsf{d} \in \mathsf{mValuePoolDeltas} | \mathsf{AssetUuid}(\mathsf{d}) = \mathsf{a}} \mathsf{d.value} = 0
743763
744764
Digest Algorithms
745765
-----------------
@@ -822,7 +842,7 @@ T.2: value_pool_deltas_digest
822842
'''''''''''''''''''''''''''''
823843

824844
A BLAKE2b-256 hash of the concatenated encodings of all entries in
825-
``mValuePoolDeltas``, ordered by ``(bundleType, assetClass, assetUuid)``.
845+
``mValuePoolDeltas``, in increasing order of ``(bundleType, assetClass, assetUuid)``.
826846
For each entry, the following values are concatenated::
827847

828848
T.2a: bundleType (compactSize encoding)
@@ -844,7 +864,7 @@ T.3: effects_bundles_digest
844864
'''''''''''''''''''''''''''
845865

846866
A BLAKE2b-256 hash of the concatenated tagged bundle effect digests for all
847-
bundles present in ``mEffectBundles``, ordered by ``bundleType``. For each
867+
bundles present in ``mEffectBundles``, in increasing order of ``bundleType``. For each
848868
bundle, the following values are concatenated::
849869

850870
T.3a: bundleType (compactSize encoding)
@@ -1313,7 +1333,7 @@ A.1: auth_bundles_digest
13131333
''''''''''''''''''''''''
13141334

13151335
A BLAKE2b-256 hash of the concatenated tagged bundle auth digests for all
1316-
bundles present in ``mAuthBundles``, ordered by ``bundleType``. For each
1336+
bundles present in ``mAuthBundles``, in increasing order of ``bundleType``. For each
13171337
bundle, the following values are concatenated::
13181338

13191339
A.1a: bundleType (compactSize encoding)

0 commit comments

Comments
 (0)