Skip to content
zips.tools

ZIP 248

Extensible Transaction Format

  • Draft
Proposal metadata
ID
248
Status
Draft
Category
Consensus / Wallet
Created
2025-12-17
License
MIT
Contents
  1. Terminology
  2. Abstract
  3. Motivation
  4. Privacy Implications
  5. Requirements
  6. Non-requirements
  7. Specification
  8. Protocol Bundles
  9. Transaction Format
  10. ValuePoolDelta
  11. BundleData
  12. Parsing Rules
  13. Changes to the Protocol Specification

Terminology

The key words "MUST", "MUST NOT", "SHOULD", and "MAY" in this document are to be interpreted as described in BCP 141 when, and only when, they appear in all capitals.

The character § is used when referring to sections of the Zcash Protocol Specification.3

The terms "Mainnet" and "Testnet" are to be interpreted as described in § 3.12 ‘Mainnet and Testnet’.8

The term "full validator" in this document is to be interpreted as defined in § 3.3 ‘The Block Chain’.4

The terms "Orchard protocol", "Orchard pool", and "Ironwood pool" are to be interpreted as described in ZIP 229.21 Following the convention in the Zcash Protocol Specification, slanted text refers to pool names, to distinguish them from shielded protocols.

The functions TransactionFees(height)\mathsf{TransactionFees}(\mathsf{height}), NSMFeeContribution(height)\mathsf{NSMFeeContribution}(\mathsf{height}), and MinerFees(height)\mathsf{MinerFees}(\mathsf{height}) are to be interpreted as defined in ZIP 235.23

The terms "funding stream" and "recipient identifier", the function fs.Value(height)\mathsf{fs.Value}(\mathsf{height}), and the constant MAX_MONEY\mathsf{MAX\_MONEY} are to be interpreted as defined in ZIP 20718 and the Zcash Protocol Specification.3 The term "Deferred Dev Fund Lockbox" is to be interpreted as defined in ZIP 1015.27

The terms below are to be interpreted as follows:

v7 transaction format

The transaction format defined by this ZIP, identified by transaction version 7. Its version group ID is not yet assigned.

v7 transaction

A transaction that is encoded using the v7 transaction format.

pre-v7 transaction format

Any transaction format that precedes the v7 transaction format; that is, any of the v1 to v6 transaction formats.

transparent transaction value pool

An ephemeral balance within the scope of a single transaction, which is modified by additions and subtractions in the processing of the effects of transaction bundles. When all of the effects of a transaction are accounted for, this balance is zero; i.e., the total of additions to the balance equals the total of subtractions from it.

lockbox

A chain value pool balance that receives part of the block subsidy, as allocated by funding streams, without any coinbase output. ZIP 2001 defines the Deferred Dev Fund Lockbox, whose recipient identifier is DEFERRED_POOL\mathsf{DEFERRED\_POOL}.28

lockbox identifier

A nonnegative integer that identifies a lockbox in the v7 transaction format, as assigned in the Lockbox Identifier Registry.

Abstract

This ZIP proposes an encoding for v7 Zcash transactions that reduces the impact of future transaction format changes on wallets and other clients. Previous format changes required clients to update their parsers even when they did not use newly introduced protocol features.

The format defines typecode-length-value encodings for protocol bundles and a value pool delta map describing each bundle's effect on the transparent transaction value pool. The entries of this map serve the same purpose as the Sapling and Orchard value balance fields have done in the past. Effecting data and authorizing data are encoded separately, allowing authorizing data to be pruned without removing the transaction's effects.

Clients can parse the common transaction envelope and enumerate public value flows without understanding every bundle type or variant. Computing the transaction identifier additionally requires a supplied digest for each unsupported effecting bundle. This does not eliminate the need to update wallets for consensus changes that alter how they must construct or interpret transactions.

Future additive bundle introductions can avoid making wallets' support for unused features distinguishable on-chain, reducing the need for further transaction-format changes and their associated privacy leakage.

Motivation

In the past, Zcash network upgrades that changed the transaction format have resulted in substantial disruption for wallets and other third-party clients in the Zcash ecosystem. In order to continue functioning after a network upgrade, clients were required to upgrade their Zcash transaction parsers to read the new format, even if the context in which those parsers were being used didn't need or couldn't make use of newly added transaction data. An example of this is that transparent-only wallets were forced to update their parsers to understand the Sapling and Orchard parts of transactions, even if they would never read or act upon those parts. This has led on occasion to significant problems in the Zcash ecosystem, including situations where funds have been locked and rendered unspendable from transparent-only wallets.

For some kinds of changes to consensus features, it's imperative that every wallet be aware of and be adapted to those changes, and in those cases making a major (breaking) transaction version update as we've done in the past is appropriate. For many new features, however, it is possible for a wallet to continue functioning correctly without having to fully understand a transaction using that feature.

For example, if TZEs were to be added to the protocol, it would be possible for wallets to continue operating with transparent/Sapling/Orchard functionality, ignoring TZE parts. There is substantial precedent for this sort of behavior; transparent-only hardware wallets are currently still important in the Zcash ecosystem, and many wallets didn't begin interacting with Orchard transaction parts until quite a while after Orchard activation.

After this change to transaction encoding, wallets and other third parties will not be required to update their transaction parsers in advance of a network upgrade for the introduction of many (and perhaps most) types of new protocol features. This will enable the Zcash ecosystem to make smaller and more incremental network upgrades without breaking existing wallets.

Privacy Implications

This change alters the encoding of transactions, but does not alter the information content of the transaction that has an effect on consensus. The use of this transaction format acts as a 1-bit distinguisher that reveals that the wallet that generated the transaction has been updated to be aware of the new format. This information leakage is unavoidable for any transaction format change.

A transaction with no transparent inputs does not encode a lock time in this format. In previous formats, the lock time of such a transaction had no effect, but wallets that chose different values for it could be distinguished.

In the future, this change may reduce the amount of information leakage, since transactions created using the proposed TLV format will include bundles only for those protocols for which the transaction modifies chain state. For example, if this transaction format change is deployed in NU8 and a hypothetical NU9 defines a bundle type for TZE components, it will not be possible for a chain observer to distinguish whether or not the wallet that produced an Orchard-only transaction is one that has been updated to understand the TZE component. Under prior practices for changing the transaction format, this would have been distinguishable.

In summary, this proposal provides a net improvement in user privacy in addition to its other benefits.

Requirements

  • The transaction format can be parsed without any knowledge of any Zcash payment protocols.
  • Movement of value into and out of the transparent transaction value pool can be understood with only partial knowledge of the Zcash payment protocols.
  • The information content of transactions should not change as part of this ZIP. Other ZIPs activated along with this ZIP may however make use of it in introducing such changes.
  • It must be possible for wallets to parse any transaction that is valid within a version group that it understands, even if it doesn't have handling for or understand all of the bundle types that are valid for that version group. In such a situation, however, such a wallet must still be able to accurately describe any transparent movement of funds effected by the transaction, and alert the user if the transaction contains bundles that it does not understand.
  • It must be possible for a wallet to correctly construct and sign transactions for a given transaction version group that it understands, even if it doesn't have handling for or understand all of the bundle types that are valid for transactions in that version group.

Non-requirements

  • It is not required to eliminate the need to update wallets for consensus changes that alter how they must construct or interpret transactions.

Specification

Protocol Bundles

This ZIP refines and codifies the concept of "protocol bundles" that emerged from the implementation of the ZIP 22520 transaction format. It makes bundles first-class objects and defines a registry of bundle type and variant identifiers. Within the period that a given transaction format version is used on the Zcash network, the semantics of the bundle associated with a given (bundleType, bundleVariant) pair are fixed.

A protocol bundle is a self-contained component of a transaction that implements a specific piece of protocol functionality. Each bundle is identified by a (bundleType, bundleVariant) pair, where:

  • The bundle type identifies the protocol or value pool that the bundle operates on (e.g., Transparent, Sapling, Orchard).
  • The bundle variant identifies a specific variant of that protocol. New variants of an existing bundle type may be introduced by subsequent ZIPs to evolve a protocol's functionality while preserving the association with the same value pool.

A transaction MUST NOT contain more than one variant of any given bundle type. This constraint is enforced by the map structure of the transaction encoding: the maps mValuePoolDeltas, mEffectBundles, and mAuthBundles are each keyed by bundleType alone, and the parsing rules require the same bundleVariant for a given bundleType across all three maps.

Each bundle type/variant pair defines:

  • What effecting data the bundle contains — the data that determines what state changes the bundle produces (e.g., which notes are spent, which outputs are created, which transparent UTXOs are consumed or produced).
  • What authorizing data the bundle contains — the proofs and signatures that authorize the state changes specified by the effecting data.
  • How the bundle affects the transparent transaction value pool — whether the bundle adds value to, removes value from, or has no effect on this ephemeral pool that balances value flows within a transaction.

Rationale for Effecting Data and Authorizing Data

Click to show/hide

The separation of effecting data from authorizing data serves several purposes:

  1. Transaction identifier stability: The transaction identifier (txid) is computed only from the effecting data. This means that the txid is determined by what the transaction does, not by how it is authorized. Third parties cannot change a transaction's identifier by modifying signatures or proofs.
  2. Efficient pruning: Full nodes that have validated a transaction may prune the authorizing data while retaining the effecting data. Since authorizing data appears at the end of the encoded transaction, pruning is simply truncation.
  3. Partial processing: A wallet can parse a transaction's envelope without understanding every bundle type or variant. To compute the transaction identifier, it needs the corresponding bundle_effects_digest for each unsupported effecting bundle, as described in Implications for Wallets; hashing the opaque payload does not in general produce that digest.

The Transparent Transaction Value Pool

The transparent transaction value pool is an ephemeral concept that exists only within the scope of processing a single transaction. It serves as a balancing mechanism through which value flows between bundles.

Each bundle may contribute a value pool delta — a signed value indicating how much the bundle adds to or removes from the transparent transaction value pool. A positive delta means the bundle is adding value to the pool (e.g., a shielded spend releasing value), while a negative delta means the bundle is consuming value from the pool (e.g., a shielded output absorbing value, or a transaction fee).

For a valid transaction, the sum of all value pool deltas MUST equal zero. This ensures that value is neither created nor destroyed — it is only transferred between bundles within the transaction.

This holds for coinbase transactions as well. The part of the block subsidy that the transaction pays out enters the transparent transaction value pool as the value pool delta of the coinbase bundle, and the fees collected from the other transactions in the block enter it as the value pool delta of the fee bundle; the coinbase outputs then consume that value like any other bundle.

Bundle Type Registration

When a ZIP introduces a new bundle type or a new variant of an existing bundle type, it MUST:

  1. Request allocation of a (bundleType, bundleVariant) pair in the registry defined below. The bundleType and bundleVariant are each non-negative integers. If the ZIP introduces a new bundle type, it requests a new bundleType value with bundleVariant 0. If it introduces a new variant of an existing bundle type, it requests a new bundleVariant value for the existing bundleType.
  2. Specify whether entries for this bundle type are permitted in mValuePoolDeltas (the value pool delta map).
  3. Specify whether entries for this bundle type are permitted in mEffectBundles (the effecting data map).
  4. Specify whether entries for this bundle type are permitted in mAuthBundles (the authorizing data map).
  5. If effecting data is permitted, define the encoding of that data.
  6. If authorizing data is permitted, define the encoding of that data.
  7. Define the digest algorithm for the bundle's contribution to the transaction identifier, if effecting data is present.
  8. Define the digest algorithm for the bundle's contribution to the authorizing data commitment, if authorizing data is present.

A bundle type MUST NOT permit entries in mAuthBundles unless it also permits entries in mEffectBundles. That is, authorizing data cannot exist without corresponding effecting data for a given bundle type.

If a bundle's encoding defines a per-element sequence in its authorizing data as corresponding to a per-element sequence in its effecting data, it MUST specify that the two sequences have the same length and that elements at the same index correspond.

Once a (bundleType, bundleVariant) pair is assigned for a given transaction version, its semantics are fixed for the lifetime of that transaction version. A subsequent network upgrade may define a new transaction version that reassigns identifiers or changes bundle semantics, but within a single transaction version, bundle type and variant identifiers have stable, unchanging meanings.

A new variant of an existing bundle type MUST affect the same value pool(s) as the original bundle type. This ensures that a client that does not recognize a particular bundleVariant can still determine which pool(s) are affected by the bundle and inform its user accordingly.

v7 Transaction Bundle Type Registry

The following (bundleType, bundleVariant) pairs are registered for the v7 transaction format. All currently-defined values are encoded as single-byte compactSize values where they appear in the transaction format.

The mValuePoolDeltas column indicates whether or not an entry for this bundle type MAY appear in mValuePoolDeltas. For rows where an ❌ is present, the value pool delta for every pool is guaranteed to be zero, and so entries in mValuePoolDeltas MUST NOT be present.

The mEffectBundles column indicates whether or not an entry for this bundle type MAY appear in mEffectBundles. For rows where an ❌ is present, the bundle has no effecting data, and so an entry in mEffectBundles MUST NOT be present.

The mAuthBundles column indicates whether or not an entry for this bundle type MAY appear in mAuthBundles. For rows where an ❌ is present, the bundle has no authorizing data, and so an entry in mAuthBundles MUST NOT be present.

BundleType BundleVariant mValuePoolDeltas mEffectBundles mAuthBundles Defining ZIP Bundle kind
0 0 ✅ ✅ ✅ This ZIP Transparent
1 0 ✅ ✅ ❌ This ZIP Coinbase
2 0 ✅ ✅ ✅ This ZIP Sapling
3 0 ✅ ✅ ✅ This ZIP Orchard
4 0 ✅ ✅ ✅ This ZIP Ironwood
5 0 ✅ ❌ ❌ ZIP 2002 Transaction fee
6 0 ✅ ❌ ❌ ZIP 233 ZIP 233 NSM field

Additional bundle types or variants MAY be added to this registry via modifications to this ZIP specified in other ZIPs. Such modifications MUST specify all of the information required by the Bundle Type Registration section above.

Potential Future Bundle Types

Click to show/hide

This subsection is non-normative. The following bundle kinds illustrate possible future extensions; they do not register or activate any (bundleType, bundleVariant) pair. Where a bundle type is given, the kind is a new variant of that existing type and only its variant identifier is unassigned. Those proposed by a ZIP name it; the rest illustrate how potential future upgrades might affect the bundle registry:

BundleType BundleVariant mValuePoolDeltas mEffectBundles mAuthBundles Defining ZIP Bundle kind
2 1 (provisional) ✅ ✅ ✅ ZIP 231 Sapling-post-ZIP 231
3 1 (provisional) ✅ ✅ ✅ ZIP 231 Orchard post-ZIP 231
3 2 (provisional) ✅ ✅ ✅ ZIP 226 OrchardZSA
4 1 (provisional) ✅ ✅ ✅ ZIP 231 Ironwood post-ZIP 231
0 ❌ ✅ ✅ ZIP 270 Key rotation
0 ✅ ✅ ✅ TBD Lockbox disbursement
0 ❌ ✅ ❌ ZIP 231 Memos
0 ✅ ✅ ✅ ZIP 227 ZSA Issuance
0 ✅ ✅ ✅ TZEs
0 ✅ ✅ ✅ Pool that only has a long-term storage protocol (PQ, very simple thus insulated from counterfeiting fears, can be used for payments but higher latency for that purpose)
0 ✅ ✅ ✅ Tachyon
0 ✅ ✅ ❌ Staking
0 ✅ ✅ ✅ Unstaking (if it can't be combined with the Staking bundle)
0 ✅ ✅ ✅ Post-quantum fast payment protocol

Transaction Format

Bytes Name Data Type Description
Common Transaction Fields
4 header uint32

Contains:

  • fOverwintered flag (bit 31, always set)
  • version (bits 30 .. 0) – transaction version.
4 nVersionGroupId uint32 Version group ID (nonzero).
4 nConsensusBranchId uint32 Consensus branch ID (nonzero).
4 nExpiryHeight uint32 A block height in the range {1 .. 499999999} after which the transaction will expire, or 0 to disable expiry.17
Transaction transparent value pool balance map
varies nValuePoolDeltas compactSize Number of entries in the mValuePoolDeltas map.
varies mValuePoolDeltas ValuePoolDelta[nValuePoolDeltas] A map describing the change to the transparent value pool produced by each bundle. Only bundles that produces changes to the transparent value balance will have corresponding entries in this map. For bundles that have no data except for a value, such as the ZIP 233 amount, no additional bundle data will be present in the Bundles section.
Bundles
varies nEffectBundles compactSize Number of bundles in the transaction that have per-bundle data.
varies mEffectBundles BundleData[nEffectBundles] A map from bundle identifier to the effecting data of a bundle.
varies nAuthBundles compactSize Number of bundles in the transaction that have per-bundle data.
varies mAuthBundles BundleData[nAuthBundles] A map from bundle identifier to the authorizing data of a bundle.

mValuePoolDeltas, mEffectBundles, and mAuthBundles are interpreted as maps keyed by bundleType. Lookups in mValuePoolDeltas are denoted with the syntax mValuePoolDeltas[BundleType]\mathsf{mValuePoolDeltas}[\mathsf{BundleType}]. A lookup for a key that is not present yields 0.

Encoding constraints on these maps (uniqueness, ordering, and cross-map consistency) are specified in Parsing Rules.

Rationale for non-extensible Common Transaction Fields

Click to show/hide

A transaction contains two kinds of information:

  • Changes enacted on global chain state. These belong in effecting bundles, including changes that move no value (such as the potential key rotation bundle in ZIP 270). Together with the value pool delta and authorizing data maps, these provide extensibility for the kinds of future changes currently envisaged.
  • Constraints on when the state change may be enacted. Pool-specific constraints are encoded within the corresponding effecting or authorizing bundles, while pool-agnostic constraints are encoded within the Common Transaction Fields.

The lock time is an example of a pool-specific constraint. It has an effect only through transparent inputs, and so it is encoded in the transparent bundle's effecting data, as described in Rationale for the transparent lock time. The expiry height applies to every non-coinbase transaction, whichever bundles it contains, and so it remains a Common Transaction Field.

There are no current proposals for pool-agnostic constraints that would require extensible Common Transaction Fields. Making them extensible without a concrete use would also require choosing commitment rules for fields whose semantics are not yet known. The Common Transaction Fields are therefore kept fixed rather than adding speculative flexibility. If future ZIPs require additions or modifications to the Common Transaction Fields, a new transaction version can introduce them while retaining compatibility with this ZIP's bundle registry (by explicitly importing those bundle definitions into its bundle registry).

ValuePoolDelta

Bytes Name Data Type Description
varies bundleType compactSize An encoding of the bundle type identifier.
varies bundleVariant compactSize An encoding of the bundle variant identifier.
8 value nonzero int64 The net change to the transparent transaction value pool, produced by the bundle with this bundle type identifier, in zatoshis. This value MUST be nonzero; if a ValuePoolDelta record would have zero value, it MUST be elided from the encoding of mValuePoolDeltas instead.

The values of all entries in mValuePoolDeltas are required to sum to zero; this balance rule is specified in Cross-bundle and chain-context rules.

Rationale for ValuePoolDelta

Click to show/hide

A previous version of ValuePoolDelta supported representing different asset kinds via an assetUuid. This was removed because it is unnecessary; any future ZIP proposing support for non-ZEC assets could instead propose a new bundle type with a non-ZEC asset value map in its effecting data, and consensus rules defining how to interpret and balance that map. This provides equivalent extensibility without adding fields to every value pool delta entry or requiring all transaction parsers to understand asset identifiers.

BundleData

Bytes Name Data Type Description
varies bundleType compactSize An encoding of the bundle type identifier.
varies bundleVariant compactSize An encoding of the bundle variant identifier.
varies nBundleDataLen compactSize The length of the vBundleData byte array.
varies vBundleData byte[nBundleDataLen] The effecting or authorizing data for the bundle, dependent upon whether the BundleData occurs in mEffectBundles or mAuthBundles.

Parsing Rules

The rules in this section are requirements on the byte encoding of a v7 transaction. A byte stream that violates any of these rules is not a well-formed v7 transaction and MUST be rejected by any parser, regardless of which bundle types the parser understands. Enforcement of these rules is what makes it safe for a wallet to parse, identify, and compute the transaction identifier for a transaction containing bundle types that the wallet does not itself implement.

  • Each of mValuePoolDeltas, mEffectBundles, and mAuthBundles MUST contain at most one entry per bundleType, and the entries MUST be encoded in strictly increasing bundleType order.
  • Every ValuePoolDelta record MUST have a nonzero value field. A ValuePoolDelta record that would have value = 0 MUST be elided from the encoding of mValuePoolDeltas.
  • For each bundleType that appears in any of mValuePoolDeltas, mEffectBundles, or mAuthBundles, all entries for that bundleType across all three maps MUST encode the same bundleVariant. (Together with the uniqueness rule above, this ensures that a transaction uses at most one variant of any given bundle type.)
  • For each bundleType that appears in mAuthBundles, a corresponding entry with the same bundleVariant MUST exist in mEffectBundles.

A wallet that successfully parses a v7 transaction under these rules is guaranteed to be able to compute the transaction identifier (given, for each (bundleType, bundleVariant) pair in mEffectBundles it does not understand, the corresponding 32-byte bundle_effects_digest value as described in Implications for Wallets), and to enumerate the transparent value flows of the transaction at the granularity of bundle types.

Let CoinbaseBundleId, SaplingBundleId, OrchardBundleId, IronwoodBundleId, and FeeBundleId be the identifiers of the coinbase, Sapling, Orchard, Ironwood, and fee bundles, respectively. In v7 transactions, CoinbaseBundleId=1\mathsf{CoinbaseBundleId} = 1, SaplingBundleId=2\mathsf{SaplingBundleId} = 2, OrchardBundleId=3\mathsf{OrchardBundleId} = 3, IronwoodBundleId=4\mathsf{IronwoodBundleId} = 4, and FeeBundleId=5\mathsf{FeeBundleId} = 5 as defined in the table above.

Shielded balancing values

The logical Sapling, Orchard, and Ironwood balancing values are signed integers measured in zatoshis, as defined in the 'Balance and Binding Signature' sections of the protocol specification.910 They are obtained from the v7 encoding as follows:

vSaplingPoolBalance=mValuePoolDeltas[SaplingBundleId]vOrchardPoolBalance=mValuePoolDeltas[OrchardBundleId]vIronwoodPoolBalance=mValuePoolDeltas[IronwoodBundleId]\begin{aligned} \begin{aligned} \mathsf{v}^{\textit{SaplingPoolBalance}} &= \mathsf{mValuePoolDeltas}[\mathsf{SaplingBundleId}] \\ \mathsf{v}^{\textit{OrchardPoolBalance}} &= \mathsf{mValuePoolDeltas}[\mathsf{OrchardBundleId}] \\ \mathsf{v}^{\textit{IronwoodPoolBalance}} &= \mathsf{mValuePoolDeltas}[\mathsf{IronwoodBundleId}] \end{aligned} \end{aligned}

Each balancing value has the sign convention defined for its pool: a positive value takes net value from the corresponding chain value pool and adds it to the transparent transaction value pool; a negative value does the reverse.

Coinbase accounting values

For a v7 coinbase transaction, the transparent outputs used in the total output value definition in § 7.1.2 'Transaction Consensus Rules' are the entries in tx_out of its transparent bundle, or the empty sequence if that bundle is absent.12 The shielded balancing values in that definition are obtained as specified above. The coinbase bundle's blockSubsidy field equals the protocol-defined block subsidy, and each entry of its mLockboxDeposits field holds the value that the funding streams deposit into one lockbox, as required by the Cross-bundle and chain-context rules. In particular, the entry for lockbox identifier 0, if present, has value totalDeferredOutput(height)\mathsf{totalDeferredOutput}(\mathsf{height}).18

Transaction inputs and outputs

For variant 0 of the corresponding bundle types, the logical counts and flags used in the protocol specification are obtained from the v7 effecting data as follows:

  • tx_in_count\mathtt{tx\_in\_count} and tx_out_count\mathtt{tx\_out\_count} are the transparent bundle's tx_in_count and tx_out_count fields.
  • nSpendsSapling\mathtt{nSpendsSapling} and nOutputsSapling\mathtt{nOutputsSapling} are the Sapling bundle's nSpendsSapling and nOutputsSapling fields.
  • nActionsOrchard\mathtt{nActionsOrchard} and nActionsIronwood\mathtt{nActionsIronwood} are the nActionsOrchard field of the Orchard and Ironwood bundles, respectively.
  • enableSpendsOrchard\mathtt{enableSpendsOrchard} and enableOutputsOrchard\mathtt{enableOutputsOrchard} are the enableSpends and enableOutputs bits of the Orchard bundle's flagsOrchard field. enableSpendsIronwood\mathtt{enableSpendsIronwood} and enableOutputsIronwood\mathtt{enableOutputsIronwood} are the corresponding bits of the Ironwood bundle's flagsOrchard field.

Counts are nonnegative integers and flags are bits. If a bundle is absent, its counts and flags are zero.

Transaction lock time

The consensus rules inherited from Bitcoin refer to a transaction's lock_time\mathtt{lock\_time} in two places: the rule that a transaction must be final in order to be included in a block, and the evaluation of OP_CHECKLOCKTIMEVERIFY2. For a v7 transaction, lock_time\mathtt{lock\_time} is the lock_time field of the transparent bundle's effecting data if that field is present, and 0 otherwise.

Under those rules, a transaction is final at every block height and time if its lock_time\mathtt{lock\_time} is 0, or if every one of its transparent inputs has nSequence = 0xFFFFFFFF. OP_CHECKLOCKTIMEVERIFY is evaluated only when validating a transparent input. A transaction with no transparent inputs is therefore final whatever its lock time is, and taking lock_time\mathtt{lock\_time} to be 0 when the field is absent gives the same result for every rule.

Changes to the Protocol Specification

Consensus Rules

This ZIP requires the following modifications to the consensus rules in the Zcash Protocol Specification. These rules are additional to the parsing rules above; a transaction that satisfies the parsing rules but violates any of these consensus rules is well-formed but invalid.

Bundle availability

For every (bundleType, bundleVariant) pair appearing in any of mValuePoolDeltas, mEffectBundles, or mAuthBundles, a full validator MUST verify that the pair is registered for v7 and activated for the consensus epoch of the block containing the transaction. A full validator MUST reject a transaction containing an unregistered or unactivated pair. Registration alone does not activate a bundle type or variant.

These consensus checks do not prevent a wallet from parsing an unsupported bundle type or variant opaquely under Parsing Rules.

Bundle-local rules

The following rules constrain the contents of individual bundles. Full validators MUST enforce every applicable rule. A wallet only needs to enforce a given rule in this subsection if it understands the bundle type and variant that the rule applies to.

  • A bundle type MUST NOT appear in any map for which the corresponding column of the v7 Transaction Bundle Type Registry is marked ❌, and MUST NOT appear in any map at all if its row in the registry is marked as Reserved.
  • Each entry in mValuePoolDeltas for variant 0 of the transparent, coinbase, Sapling, Orchard, or Ironwood bundle MUST have a corresponding entry in mEffectBundles.
  • If a transparent effecting bundle has tx_in_count > 0, a corresponding entry in mAuthBundles MUST be present.
  • For each TransparentInputAuth whose sighashInfo specifies sighash variant 0, the hash_type byte of every nonempty signature supplied to OP_CHECKSIG, OP_CHECKSIGVERIFY, OP_CHECKMULTISIG, or OP_CHECKMULTISIGVERIFY when validating that input MUST be SIGHASH_ALL (0x01).
  • Every Sapling, Orchard, or Ironwood effecting bundle MUST have a corresponding entry in mAuthBundles.
  • A coinbase transaction MUST NOT spend any transparent output. If a transparent bundle is present in a coinbase transaction, its effecting data MUST have tx_in_count = 0.
  • For coinbase transactions, the nSpendsSapling field of the Sapling bundle's effecting data MUST be 0.
  • For coinbase transactions, the enableSpends bit of the flagsOrchard field of every Orchard protocol bundle MUST be 0.
  • In an Orchard bundle, the enableCrossAddress bit of flagsOrchard MUST be 0; that is, transfers into the Orchard pool are restricted to the protocol-level address of the action's spend.30 The bit is unrestricted in an Ironwood bundle.
Cross-bundle and chain-context rules

The following rules relate the contents of a bundle to the other bundles of its transaction, or to the block that contains it. They MUST be enforced by full validators.

  • For coinbase transactions, the value of mValuePoolDeltas[FeeBundleId]\mathsf{mValuePoolDeltas}[\mathsf{FeeBundleId}] MUST be nonnegative. This represents the total transaction fees collected from all other transactions in the block.

  • For non-coinbase transactions, the value of mValuePoolDeltas[FeeBundleId]\mathsf{mValuePoolDeltas}[\mathsf{FeeBundleId}] MUST be nonpositive. This represents the transaction fee paid by the transaction (expressed as a negative value, since it is removed from the transparent transaction value pool).

  • The fees collected by the coinbase transaction MUST equal the sum of the fees paid by all other transactions in the block, regardless of their transaction formats. For each non-coinbase transaction, its fee is:

    • for a v7 transaction, the negation of mValuePoolDeltas[FeeBundleId]\mathsf{mValuePoolDeltas}[\mathsf{FeeBundleId}];
    • for a pre-v7 transaction, the implicit fee defined in § 3.4 'Transactions and Treestates'.6

    For a v7 coinbase transaction, its fee bundle value MUST equal this sum. In a block containing only v7 transactions, this is equivalent to requiring the sum of fee bundle values to equal zero.

  • Exactly one transaction in a block MUST be a coinbase transaction, and it MUST be the first transaction in the block.

  • The blockHeight field of the coinbase bundle's effecting data MUST equal the height of the block containing the transaction.

  • The blockSubsidy field of the coinbase bundle's effecting data MUST equal the block subsidy for that block, as defined in § 7.8 'Block Subsidy and Founders' Reward'.15

  • For a lockbox identifier id\mathsf{id}, let R(id)\mathsf{R}(\mathsf{id}) be the recipient identifier assigned to id\mathsf{id} in the Lockbox Identifier Registry. For a block height height\mathsf{height}, let LockboxDeposit(id,height)\mathsf{LockboxDeposit}(\mathsf{id}, \mathsf{height}) be the sum of fs.Value(height)\mathsf{fs.Value}(\mathsf{height}) over the funding streams with recipient identifier R(id)\mathsf{R}(\mathsf{id}) in the block at height\mathsf{height}. Funding streams and their values are as defined in § 7.10 'Payment of Funding Streams, Deferred Lockbox, and Lockbox Disbursement'. 16 The sum LockboxDeposit(id,height)\mathsf{LockboxDeposit}(\mathsf{id}, \mathsf{height}) is zero if no such funding stream exists. In the mLockboxDeposits field of the coinbase bundle's effecting data:

    • every entry MUST have a lockboxId that is assigned in the Lockbox Identifier Registry;
    • every entry MUST have value equal to LockboxDeposit(lockboxId,height)\mathsf{LockboxDeposit}(\mathsf{lockboxId}, \mathsf{height}) for the height of the block containing the transaction; and
    • for every assigned lockbox identifier id\mathsf{id} for which LockboxDeposit(id,height)\mathsf{LockboxDeposit}(\mathsf{id}, \mathsf{height}) is nonzero, an entry with lockboxId equal to id\mathsf{id} MUST be present.

    Under these rules and the encoding rules in Coinbase Effecting Data, exactly one value of mLockboxDeposits is valid at each block height.

  • The value of mValuePoolDeltas[CoinbaseBundleId]\mathsf{mValuePoolDeltas}[\mathsf{CoinbaseBundleId}] MUST equal the block subsidy less the total of the lockbox deposits and NSMFeeContribution(height)\mathsf{NSMFeeContribution}(\mathsf{height}) for the block containing the transaction.

    mValuePoolDeltas[CoinbaseBundleId]=blockSubsidy−∑d∈mLockboxDepositsd.value−NSMFeeContribution(height)\mathsf{mValuePoolDeltas}[\mathsf{CoinbaseBundleId}] = \mathsf{blockSubsidy} - \sum_{\mathsf{d} \in \mathsf{mLockboxDeposits}} \mathsf{d.value} - \mathsf{NSMFeeContribution}(\mathsf{height})

    Note that the coinbase value pool delta can be negative.

  • For every transaction, the sum of all value pool delta values MUST equal 0.

    ∑d∈mValuePoolDeltasd.value=0\sum_{\mathsf{d} \in \mathsf{mValuePoolDeltas}} \mathsf{d.value} = 0

    For v7 transactions, this rule replaces the remaining-value treatment of the transparent transaction value pool in § 3.4 'Transactions and Treestates', including the implicit transaction fee.6 It does not change the balance or implicit-fee rules for pre-v7 transactions.

In § 7.1.2 'Transaction Consensus Rules',12 change:

[NU6.3 onward] If effectiveVersion≥6\mathsf{effectiveVersion} \geq 6 then this rule MUST hold: tx_in_count>0\mathtt{tx\_in\_count} > 0 or nSpendsSapling>0\mathtt{nSpendsSapling} > 0 or (nActionsOrchard>0\mathtt{nActionsOrchard} > 0 and enableSpendsOrchard=1\mathtt{enableSpendsOrchard} = 1) or (nActionsIronwood>0\mathtt{nActionsIronwood} > 0 and enableSpendsIronwood=1\mathtt{enableSpendsIronwood} = 1).

[NU6.3 onward] If effectiveVersion≥6\mathsf{effectiveVersion} \geq 6 then this rule MUST hold: tx_out_count>0\mathtt{tx\_out\_count} > 0 or nOutputsSapling>0\mathtt{nOutputsSapling} > 0 or (nActionsOrchard>0\mathtt{nActionsOrchard} > 0 and enableOutputsOrchard=1\mathtt{enableOutputsOrchard} = 1) or (nActionsIronwood>0\mathtt{nActionsIronwood} > 0 and enableOutputsIronwood=1\mathtt{enableOutputsIronwood} = 1).

to:

[NU6.3 onward] If effectiveVersion≥6\mathsf{effectiveVersion} \geq 6, at least one of these input-side conditions MUST be satisfied:

  • effectiveVersion≥7\mathsf{effectiveVersion} \geq 7 and mEffectBundles contains an entry with bundleType = CoinbaseBundleId.
  • tx_in_count>0\mathtt{tx\_in\_count} > 0.
  • nSpendsSapling>0\mathtt{nSpendsSapling} > 0.
  • nActionsOrchard>0\mathtt{nActionsOrchard} > 0 and enableSpendsOrchard=1\mathtt{enableSpendsOrchard} = 1.
  • nActionsIronwood>0\mathtt{nActionsIronwood} > 0 and enableSpendsIronwood=1\mathtt{enableSpendsIronwood} = 1.

[NU6.3 onward] If effectiveVersion≥6\mathsf{effectiveVersion} \geq 6, at least one of these output-side conditions MUST be satisfied:

  • tx_out_count>0\mathtt{tx\_out\_count} > 0.
  • nOutputsSapling>0\mathtt{nOutputsSapling} > 0.
  • nActionsOrchard>0\mathtt{nActionsOrchard} > 0 and enableOutputsOrchard=1\mathtt{enableOutputsOrchard} = 1.
  • nActionsIronwood>0\mathtt{nActionsIronwood} > 0 and enableOutputsIronwood=1\mathtt{enableOutputsIronwood} = 1.
  • zip233_amount>0\mathsf{zip233\_amount} > 0, as defined in ZIP 233.22

Signature hash references

In § 4.10 'SIGHASH Transaction Hashing',13 change:

The means of authorization differs between transparent inputs, inputs to Sprout JoinSplit transfers, and Sapling Spend transfers or Orchard Action transfers, but for a given transaction version the same SIGHASH transaction hash algorithm is used.

to:

Citation graph

Hover or tap a node to see its title and citations.
Loading citation graph…