Skip to content

Commit 68f3ef9

Browse files
nuttycomclaude
andcommitted
[ZIP 248]: Change bundle identifiers to (bundleType, bundleVersion) tuples.
This makes the mutual exclusivity of bundle variants (e.g. Orchard vs OrchardZSA) implicit in the map structure, and allows clients that do not recognize a specific bundleVersion to still identify which pool is affected. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 831ac31 commit 68f3ef9

File tree

6 files changed

+184
-132
lines changed

6 files changed

+184
-132
lines changed

zips/zip-0226.rst

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -371,14 +371,21 @@ The ZSA-related changes in v6 include:
371371
Changes to ZIP 248
372372
``````````````````
373373

374-
This ZIP proposes to register the OrchardZSA bundle type in the V6 transaction
375-
bundle type registry defined in ZIP 248 [#zip-0248]_:
376-
377-
+------------+----------------------+--------------------+------------------+-------------+
378-
| BundleType | ``mValuePoolDeltas`` | ``mEffectBundles`` | ``mAuthBundles`` | Bundle kind |
379-
+============+======================+====================+==================+=============+
380-
| TBD |✅ |✅ |✅ | OrchardZSA |
381-
+------------+----------------------+--------------------+------------------+-------------+
374+
This ZIP proposes to register a new version of the Orchard bundle type
375+
(``bundleType`` 3) in the V6 transaction bundle type registry defined in
376+
ZIP 248 [#zip-0248]_:
377+
378+
+------------+---------------+----------------------+--------------------+------------------+-------------+
379+
| BundleType | BundleVersion | ``mValuePoolDeltas`` | ``mEffectBundles`` | ``mAuthBundles`` | Bundle kind |
380+
+============+===============+======================+====================+==================+=============+
381+
| 3 | TBD |✅ |✅ |✅ | OrchardZSA |
382+
+------------+---------------+----------------------+--------------------+------------------+-------------+
383+
384+
Because this is a new version of the Orchard bundle type rather than a new
385+
bundle type, a transaction that includes an OrchardZSA bundle cannot also
386+
include an Orchard or Orchard-post-ZIP-231 bundle. This constraint is enforced
387+
by the ZIP 248 requirement that each bundle map is keyed by ``bundleType``
388+
alone.
382389

383390
OrchardZSA Effecting Data
384391
'''''''''''''''''''''''''
@@ -543,9 +550,11 @@ The OrchardZSA bundle has value pool deltas (transfers move value in and out of
543550
the transparent transaction value pool), effecting data (the OrchardZSA actions
544551
and burn information), and authorizing data (the proofs and binding signature).
545552

546-
A transaction MUST NOT contain both an Orchard bundle (type 3) and an OrchardZSA
547-
bundle. The OrchardZSA bundle replaces the Orchard bundle for transactions that
548-
transfer Custom Assets.
553+
Because OrchardZSA is registered as a new version of ``bundleType`` 3
554+
(Orchard), a transaction cannot contain both an Orchard bundle and an
555+
OrchardZSA bundle; this is enforced by the ZIP 248 constraint that each bundle
556+
map is keyed by ``bundleType`` alone. The OrchardZSA bundle version replaces
557+
the Orchard bundle version for transactions that transfer Custom Assets.
549558

550559
Implications for Wallets
551560
````````````````````````

zips/zip-0227.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -371,17 +371,17 @@ The issuance bundle is added within the transaction format as a new bundle.
371371
The encoding of the issuance bundle's effecting and authorizing data is
372372
defined in `Changes to ZIP 248`_ below.
373373

374-
This ZIP proposes to register the ZSA Issuance bundle type in the V6
374+
This ZIP proposes to register a new bundle type for ZSA Issuance in the V6
375375
transaction bundle type registry defined in ZIP 248 [#zip-0248]_:
376376

377377
Changes to ZIP 248
378378
``````````````````
379379

380-
+------------+----------------------+--------------------+------------------+--------------+
381-
| BundleType | ``mValuePoolDeltas`` | ``mEffectBundles`` | ``mAuthBundles`` | Bundle kind |
382-
+============+======================+====================+==================+==============+
383-
| TBD |✅ |✅ |✅ | ZSA Issuance |
384-
+------------+----------------------+--------------------+------------------+--------------+
380+
+------------+---------------+----------------------+--------------------+------------------+--------------+
381+
| BundleType | BundleVersion | ``mValuePoolDeltas`` | ``mEffectBundles`` | ``mAuthBundles`` | Bundle kind |
382+
+============+===============+======================+====================+==================+==============+
383+
| TBD | 0 |✅ |✅ |✅ | ZSA Issuance |
384+
+------------+---------------+----------------------+--------------------+------------------+--------------+
385385

386386
The ZSA Issuance bundle has value pool deltas (issuance adds value to the
387387
transparent transaction value pool for Custom Assets), effecting data (the

zips/zip-0231.md

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -145,28 +145,33 @@ to both Sapling and Orchard outputs.
145145

146146
## Changes to ZIP 248
147147

148-
This ZIP proposes to register the following bundle types in the V6 transaction
149-
bundle type registry defined in ZIP 248 [^zip-0248]:
148+
This ZIP proposes to register a new bundle type for Memos and new versions of
149+
the Sapling and Orchard bundle types in the V6 transaction bundle type registry
150+
defined in ZIP 248 [^zip-0248]:
150151

151-
| BundleType | `mValuePoolDeltas` | `mEffectBundles` | `mAuthBundles` | Bundle kind |
152-
|------------|--------------------| -----------------|----------------|----------------------|
153-
| TBD |||| Memos |
154-
| TBD |||| Sapling-post-ZIP 231 |
155-
| TBD |||| Orchard-post-ZIP 231 |
152+
| BundleType | BundleVersion | `mValuePoolDeltas` | `mEffectBundles` | `mAuthBundles` | Bundle kind |
153+
|------------|---------------|--------------------|------------------|----------------|----------------------|
154+
| TBD | 0 |||| Memos |
155+
| 2 | TBD |||| Sapling-post-ZIP 231 |
156+
| 3 | TBD |||| Orchard-post-ZIP 231 |
156157

157158
The Memos bundle has no value pool deltas (memo data does not involve value
158159
transfers) and no authorizing data. The effecting data consists of the encoded
159160
memo bundle as defined in [Encoding in transactions].
160161

162+
The Sapling-post-ZIP 231 and Orchard-post-ZIP 231 entries are new versions of
163+
the existing Sapling (``bundleType`` 2) and Orchard (``bundleType`` 3) bundle
164+
types respectively. Because ZIP 248 requires that each bundle map is keyed by
165+
``bundleType`` alone, a transaction that includes a Sapling-post-ZIP 231 bundle
166+
cannot also include a pre-ZIP 231 Sapling bundle, and similarly for Orchard.
167+
161168
If this ZIP is activated in the same network upgrade as ZIP 248, the encoding
162169
of the Sapling and Orchard bundles described in this ZIP will be used for
163-
bundle types 2 and 3, respectively, and ZIP 248's definition of the Sapling and
164-
Orchard bundles must be updated accordingly. If this ZIP is activated in a
165-
network upgrade AFTER the network upgrade in which ZIP 248 is activated, the
166-
encodings it describes will be assigned distinct bundle identifiers. In this
167-
latter case, a transaction MUST NOT contain both a Sapling-pre-ZIP 231 bundle
168-
and a Sapling-post-ZIP 231 bundle, or both an Orchard-pre-ZIP 231 bundle and an
169-
Orchard-post-ZIP 231 bundle.
170+
bundle type 2 version 0 and bundle type 3 version 0, respectively, and
171+
ZIP 248's definition of the Sapling and Orchard bundles must be updated
172+
accordingly. If this ZIP is activated in a network upgrade AFTER the network
173+
upgrade in which ZIP 248 is activated, the encodings it describes will be
174+
assigned distinct bundle version identifiers for their respective bundle types.
170175

171176
## Sapling-post-ZIP 231 Bundle
172177

zips/zip-0233.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@ network.
9494

9595
## Changes to ZIP 248
9696

97-
This ZIP proposes to register bundle type 5 ("ZIP 233 NSM field") in the V6
98-
transaction bundle type registry defined in ZIP 248 [^zip-0248].
97+
This ZIP proposes to register bundle type 5 version 0 ("ZIP 233 NSM field") in
98+
the V6 transaction bundle type registry defined in ZIP 248 [^zip-0248].
9999

100-
| BundleType | `mValuePoolDeltas` | `mEffectBundles` | `mAuthBundles` |
101-
|------------|--------------------| -----------------|----------------|
102-
| 5 ||||
100+
| BundleType | BundleVersion | `mValuePoolDeltas` | `mEffectBundles` | `mAuthBundles` |
101+
|------------|---------------|--------------------|------------------|----------------|
102+
| 5 | 0 ||||
103103

104104
The NSM bundle has no effecting data and no authorizing data. The amount to be
105105
removed from circulation is represented solely as an entry in `mValuePoolDeltas`

0 commit comments

Comments
 (0)