Zcash in Simplified Technical English

This page is the Simplified Technical English version of ZIP 246. The source ZIP is the normative text. Read the writing rules to understand the marked words.

ZIP 246: Digests for the Withdrawn Version 6 Transaction Format

ZIP: 246
Title: Digests for the Withdrawn Version 6 Transaction Format
Owners: Arya <arya@zfnd.org>
        Conrado Gouvea <conrado@zfnd.org>
        Daira-Emma Hopwood <daira@jacaranda.org>
        Jack Grigg <thestr4d@gmail.com>
        Kris Nuttycombe <kris@nutty.land>
Status: Withdrawn
Category: Consensus
Created: 2025-02-12
License: MIT

Terminology

On this page, STE words are in the place of the BCP 14 key words of the source. Refer to the key word table.

In this document, these terms have the meaning in ZIP 200 [zip-0200]:

In this document, a "field encoding" is the binary serialized form of a Zcash transaction field. The specification of this form is in section 7.1 of the Zcash protocol specification [protocol-txnencoding].

Abstract

This ZIP contains the sighash algorithms for the v6 transaction format.

Warning: This ZIP is withdrawn. ZIP 229 [zip-0229] now contains the specification of these items for version 6 transactions:

  • Transaction identifiers.
  • Authorizing data commitments.
  • Signature digests.

This ZIP also contains a new concept, "sighash algorithm versioning". Before this concept, each transaction version had one associated sighash algorithm. With this concept, signers will be able to use any sighash algorithm in the closed set that is specified for a given transaction version. This set is made available in consensus through network upgrades.

Motivation

It will be necessary for the signatures for atomic swaps in action bundles to commit to some data. We want to be able to specify the V6 transaction format and signatures without knowledge of this data. That is the motivation for sighash algorithm versioning.

With sighash algorithm versioning, it is possible to specify future signature hash algorithms of these types for V6 transactions:

The ability to remove support for sighash algorithm versions has this result: an effective response is possible if a bug is found in a previously deployed sighash algorithm.

Requirements

Non-requirements

Specification

Sighash versioning

An approximate summary follows:

  • For each transaction version, the numbers of the sighash versions start from 0.
  • By convention, v0 is the "commit to all effecting data" sighash algorithm. Other versions can commit to any data that is applicable to the wanted functionality in that transaction version.
  • In the consensus rules, the digest algorithm for each signer is selected on the basis of the value of sighashVersion.

The sighash version is encoded as a single byte. Next to this byte is any associated data that is necessary for the sighash algorithm version. (This data is necessary to calculate the digest deterministically.)

sighashInfo = [sighashVersion] || associatedData

Here, associatedData is specific to the bundle that contains it.

These sighash algorithm versions are defined for v6 transactions:

\(\hspace{4.5em}\) associatedData
sighashVersionTransparentSaplingOrchardIssuance
0[][][][]

v0 Digests

The base of the v0 digests is the v5 transaction digest algorithm that is defined in ZIP 244 [zip-0244].

TODO: Update the Authorizing Data Commitment below for the sighashInfo changes to the transaction format.

TxId Digest

The overall structure of the TxID digest is as follows. Below, each name in this tree has a reference or a detailed description.

txid_digest
├── header_digest *
├── transparent_digest
│   ├── prevouts_digest
│   ├── sequence_digest
│   └── outputs_digest
├── sapling_digest
│   ├── sapling_spends_digest
│   │   ├── sapling_spends_compact_digest
│   │   └── sapling_spends_noncompact_digest
│   ├── sapling_outputs_digest *
│   │   ├── sapling_outputs_compact_digest *
│   │   └── sapling_outputs_noncompact_digest *
│   └── valueBalance
├── orchard_digest *
│   ├── orchard_action_groups_digest *
│   │   ├── orchard_actions_compact_digest *
│   │   ├── orchard_actions_noncompact_digest *
│   │   ├── flagsOrchard
│   │   ├── anchorOrchard
│   │   ├── nAGExpiryHeight *
│   │   └── orchard_burn_digest *
│   └── valueBalanceOrchard
├── issuance_digest *
│   ├── issuerLength *
│   ├── issuer *
│   └── issue_actions_digest *
│       ├── assetDescHash *
│       ├── issue_notes_digest *
│       └── flagsIssuance *
└── memo_digest *
    ├── nonce *
    └── memo_chunks_digest *
        └── memo_chunk_digest *

In this tree, each node in snake_case is a BLAKE2b-256 hash of its children. This hash is initialized with a personalization string that is specific to that branch of the tree. Nodes that are not digests are in camelCase. In the specification below, the nodes of the tree are in depth-first order.

The nodes with a * have new definitions below. All other nodes have the same definition as in ZIP 244 [zip-0244].

txid_digest

This is a BLAKE2b-256 hash of these values:

T.1: header_digest       (32-byte hash output)
T.2: transparent_digest  (32-byte hash output)
T.3: sapling_digest      (32-byte hash output)
T.4: orchard_digest      (32-byte hash output)
T.5: issuance_digest     (32-byte hash output)
T.6: memo_digest         (32-byte hash output)

The personalization field of this hash is set to:

"ZcashTxHash_" || CONSENSUS_BRANCH_ID

ZcashTxHash_ has 1 underscore character.

As in ZIP 244 [zip-0244], CONSENSUS_BRANCH_ID is the 4-byte little-endian encoding of the consensus branch ID for the epoch of the block that contains the transaction.

T.1: header_digest

This is a BLAKE2b-256 hash of these values:

T.1a: version             (4-byte little-endian version identifier including overwinter flag)
T.1b: version_group_id    (4-byte little-endian version group identifier)
T.1c: consensus_branch_id (4-byte little-endian consensus branch id)
T.1d: lock_time           (4-byte little-endian nLockTime value)
T.1e: expiry_height       (4-byte little-endian block height)
T.1f: fee                 (8-byte little-endian fee amount)
T.1g: burn_amount         (8-byte little-endian burn amount)

The personalization field of this hash is set to:

"ZTxIdHeadersHash"
T.3b: sapling_outputs_digest

If Sapling outputs are present, this digest is a BLAKE2b-256 hash of these values:

T.3b.i:  sapling_outputs_compact_digest    (32-byte hash)
T.3b.ii: sapling_outputs_noncompact_digest (32-byte hash)

The personalization field of this hash is set to:

"ZTxIdSOutputHash"

If the transaction has Sapling spends but no Sapling outputs, sapling_outputs_digest is:

BLAKE2b-256("ZTxIdSOutputHash", [])
T.3b.i: sapling_outputs_compact_digest

This is a BLAKE2b-256 hash of the subset of Sapling output information that is in the ZIP-307 [zip-0307] CompactBlock format. The hash is for all Sapling shielded outputs of the transaction. For each output, the hash includes these elements:

T.3b.i.1: cmu                  (field encoding bytes)
T.3b.i.2: ephemeral_key        (field encoding bytes)
T.3b.i.3: enc_ciphertext       (field encoding bytes)

The personalization field of this hash is set to:

"ZTxId6SOutC_Hash" (1 underscore character)

The field encodings are specified in ZIP 230 [zip-0230-sapling-output-field-encodings].

T.3b.ii: sapling_outputs_noncompact_digest

This is a BLAKE2b-256 hash of the remaining subset of Sapling output information that is not in the ZIP 307 [zip-0307] CompactBlock format. This subset does not include the zkproof data. The hash is for all Sapling shielded outputs of the transaction. For each output, the hash includes these elements:

T.3b.ii.1: cv                    (field encoding bytes)
T.3b.ii.3: out_ciphertext        (field encoding bytes)

The personalization field of this hash is set to:

"ZTxId6SOutN_Hash" (1 underscore character)

The field encodings are specified in ZIP 230 [zip-0230-sapling-output-field-encodings].

T.4: orchard_digest

When OrchardZSA Action Groups are present in the transaction, this digest is a BLAKE2b-256 hash of these values:

T.4a: orchard_action_groups_digest   (32-byte hash output)
T.4b: valueBalanceOrchard            (64-bit signed little-endian)

The personalization field of this hash is set to:

"ZTxIdOrchardHash"

If the transaction has no OrchardZSA Action Groups, orchard_digest is:

BLAKE2b-256("ZTxIdOrchardHash", [])
T.4a: orchard_action_groups_digest

This is a BLAKE2b-256 hash of the subset of OrchardZSA Action Groups information for all OrchardZSA Action Groups of the transaction. For each Action Group, the hash includes these elements:

T.4a.i   : orchard_actions_compact_digest      (32-byte hash output)
T.4a.ii  : orchard_actions_noncompact_digest   (32-byte hash output)
T.4a.iii : flagsOrchard                        (1 byte)
T.4a.iv  : anchorOrchard                       (32 bytes)
T.4a.v   : nAGExpiryHeight                     (4 bytes)
T.4a.vi  : orchard_burn_digest                 (32-byte hash output)

The personalization field of this hash is set to:

"ZTxIdOrcActGHash"
T.4a.i: orchard_actions_compact_digest

This is a BLAKE2b-256 hash of the subset of OrchardZSA Action information for all OrchardZSA Actions of the Action Group. The intention is to include this subset in an updated version of the ZIP-307 [zip-0307] CompactBlock format. For each Action, the hash includes these elements:

T.4a.i.1 : nullifier            (field encoding bytes)
T.4a.i.2 : cmx                  (field encoding bytes)
T.4a.i.3 : ephemeralKey         (field encoding bytes)
T.4a.i.4 : encCiphertext        (field encoding bytes)

The personalization field of this hash is set to:

"ZTxId6OActC_Hash" (1 underscore character)

The field encodings are specified in ZIP 230 [zip-0230-orchardzsa-action-description-orchardzsaaction].

T.4a.ii: orchard_actions_noncompact_digest

This is a BLAKE2b-256 hash of the remaining subset of OrchardZSA Action information for all OrchardZSA Actions of the Action Group. The intention is not to include this subset in an updated version of the ZIP 307 [zip-0307] CompactBlock format. For each Action, the hash includes these elements:

T.4a.ii.1 : cv                    (field encoding bytes)
T.4a.ii.2 : rk                    (field encoding bytes)
T.4a.ii.3 : outCiphertext         (field encoding bytes)

The personalization field of this hash is set to:

"ZTxId6OActN_Hash" (1 underscore character)

The field encodings are specified in ZIP 230 [zip-0230-orchardzsa-action-description-orchardzsaaction].

T.4a.vi: orchard_burn_digest

This is a BLAKE2b-256 hash of the data from the burn fields of the transaction. For each tuple in the \(\mathsf{assetBurn}\) set, the hash includes these elements:

T.4b.i : assetBase    (field encoding bytes)
T.4b.ii: valueBurn    (64-bit unsigned little-endian)

The personalization field of this hash is set to:

"ZTxIdOrcBurnHash"

If the transaction contains no burn of Assets (that is, the \(\mathsf{assetBurn}\) set is empty), orchard_burn_digest is:

BLAKE2b-256("ZTxIdOrcBurnHash", [])

The field encodings are specified in ZIP 230 [zip-0230-orchardzsa-asset-burn-description].

T.5: issuance_digest

This is a BLAKE2b-256 hash of these values:

T.5a: issuerLength            (field encoding bytes)
T.5b: issuer                  (field encoding bytes)
T.5c: issue_actions_digest    (32-byte hash output)

The personalization field of this hash is set to:

"ZTxIdSAIssueHash"

If the transaction has no issuance components, issuance_digest is:

BLAKE2b-256("ZTxIdSAIssueHash", [])

The field encodings are specified in ZIP 230 [zip-0230-transaction-format].

T.5a: issue_actions_digest

This is a BLAKE2b-256 hash of Issue Action information for all Issuance Actions of the transaction. For each Action, the hash includes these elements:

T.5a.i  : assetDescHash           (field encoding bytes)
T.5a.ii : issue_notes_digest      (32-byte hash output)
T.5a.iii: flagsIssuance           (1 byte)

The personalization field of this hash is set to:

"ZTxIdIssuActHash"

The field encodings are specified in ZIP 230 [zip-0230-issuance-action-description-issueaction].

T.5a.i: issue_notes_digest

This is a BLAKE2b-256 hash of Note information for all Issue Note Descriptions of the Issuance Action. For each Note, the hash includes these elements:

T.5a.i.1: recipient                    (field encoding bytes)
T.5a.i.2: value                        (field encoding bytes)
T.5a.i.3: rho                          (field encoding bytes)
T.5a.i.4: rseed                        (field encoding bytes)

The personalization field of this hash is set to:

"ZTxIdIAcNoteHash"

If the transaction has no Issue Notes, issue_notes_digest is:

BLAKE2b-256("ZTxIdIAcNoteHash", [])

The field encodings are specified in ZIP 230 [zip-0230-issue-note-description-issuenotedescription].

T.6: memo_digest

This is a BLAKE2b-256 hash of these values:

T.6a: nonce                 (field encoding bytes)
T.6b: memo_chunks_digest    (32-byte hash output)

The personalization field of this hash is set to:

"ZTxIdMemo___Hash" (3 underscore characters)

If the transaction has no memo chunks, memo_digest is:

BLAKE2b-256("ZTxIdMemo___Hash", [])

The field encodings are specified in ZIP 230 [zip-0230-transaction-format].

T.6b: memo_chunks_digest

This is a BLAKE2b-256 hash of the concatenated memo_chunk_digest values of all memo chunks in the memo bundle.

The personalization field of this hash is set to:

"ZTxIdMemoCksHash"

If the transaction has no memo chunks, memo_chunks_digest is:

BLAKE2b-256("ZTxIdMemoCksHash", [])
T.6b.i: memo_chunk_digest

This is a BLAKE2b-256 hash of the field encoding of a single encrypted Memo Chunk.

The personalization field of this hash is set to:

"ZTxIdMemoCk_Hash" (1 underscore character)

The field encodings are specified in ZIP 230 [zip-0230-transaction-format].

Signature Digest

ZIP 244 [zip-0244-sigdigest] has a per-input transaction digest algorithm to generate the signature digest. This algorithm is changed. After the change, a signature digest is produced for each of these items:

  • Each transparent input.
  • Each Sapling input.
  • Each OrchardZSA Action.
  • Also, each Issuance Action.

With these changes, a new orchard_digest is in the place of the orchard_digest in ZIP 244. Also, a new branch, issuance_digest, is added for the Issuance Action information.

The overall structure of the hash is as follows. We do not give the descriptions of the sections that stay the same for the OrchardZSA protocol.

signature_digest
├── header_digest
├── transparent_sig_digest
├── sapling_digest
├── orchard_digest
├── issuance_digest
└── memo_digest
signature_digest

This is a BLAKE2b-256 hash of these values:

S.1: header_digest          (32-byte hash output)
S.2: transparent_sig_digest (32-byte hash output)
S.3: sapling_digest         (32-byte hash output)
S.4: orchard_digest         (32-byte hash output)
S.5: issuance_digest        (32-byte hash output)
S.6: memo_digest            (32-byte hash output)

The personalization field stays the same as in ZIP 244 [zip-0244]. It is:

"ZcashTxHash_" || CONSENSUS_BRANCH_ID

ZcashTxHash_ has 1 underscore character.

S.4: orchard_digest

This digest is the same as the digest that is specified for the transaction identifier.

S.5: issuance_digest

This digest is the same as the issuance_digest that is specified for the transaction identifier.

S.6: memo_digest

This digest is the same as the digest that is specified for the transaction identifier.

Authorizing Data Commitment

In ZIP 244 [zip-0244-authcommitment], a transaction digest algorithm commits to the authorizing data of a transaction. This algorithm is changed by the OrchardZSA protocol. The changed algorithm has the structure in this section.

A new branch is added for issuance information. Also, the orchard_auth_digest in ZIP 244 is changed because of the presence of Action Groups.

We do not give the descriptions of the sections that stay the same for the OrchardZSA protocol.

auth_digest
├── transparent_auth_digest
├── sapling_auth_digest
├── orchard_auth_digest
└── issuance_auth_digest

The pair (Transaction Identifier, Auth Commitment) is a commitment to all the data of a serialized transaction that can be included in a block.

auth_digest

The auth_digest is a BLAKE2b-256 hash of these values:

A.1: transparent_auth_digest          (32-byte hash output)
A.2: sapling_auth_digest              (32-byte hash output)
A.3: orchard_auth_digest              (32-byte hash output)
A.4: issuance_auth_digest             (32-byte hash output)

The personalization field of this hash stays the same as in ZIP 244.

Note: The structure of sapling_auth_digest stays the same as in ZIP 244. But the field encodings of some of its components are different. These components are spend_auth_sigs and binding_sig. The cause is changes to their field encodings in ZIP 230 [zip-0230-transaction-format].

A.1: transparent_auth_digest

If the transaction contains transparent inputs, this is a BLAKE2b-256 hash of these values for each transparent input:

A.1a: TransparentSighashInfo    (field encoding bytes)
A.1b: scriptSig                 (field encoding bytes)

The personalization field of this hash is:

"ZTxAuthTransHash"

If the transaction has no transparent inputs, transparent_auth_digest is:

BLAKE2b-256("ZTxAuthTransHash", [])

The field encoding of TransparentSighashInfo is specified in ZIP 230 [zip-0230-transparent-sighash-info-field-encodings].

A.3: orchard_auth_digest

If OrchardZSA Action Groups are present, this is a BLAKE2b-256 hash of these values:

A.3a: orchard_action_groups_auth_digest    (32-byte hash output)
A.3b: bindingSigOrchard                    (field encoding bytes)

The personalization field of this hash is the same as in ZIP 244. It is:

"ZTxAuthOrchaHash"

If the transaction has no OrchardZSA Action Groups, orchard_auth_digest is:

BLAKE2b-256("ZTxAuthOrchaHash", [])

The field encodings are specified in ZIP 230 [zip-0230-transaction-format]. Thus the encoding of bindingSigOrchard is different from the encoding in ZIP 244.

A.3a: orchard_action_groups_auth_digest

This is a BLAKE2b-256 hash of the subset of OrchardZSA Action Group information for all OrchardZSA Action Groups of the transaction. For each OrchardZSA Action Group, this is a BLAKE2b-256 hash of these values:

A.3a.i:  proofsOrchard                              (field encoding bytes)
A.3a.ii: orchard_zsa_spend_auth_sigs_auth_digest    (32-byte hash output)

The personalization field of this hash is set to:

"ZTxAuthOrcAGHash"

The field encodings are specified in ZIP 230 [zip-0230-orchardzsa-action-group-description].

A.3a.ii: orchard_zsa_spend_auth_sigs_auth_digest

This is a BLAKE2b-256 hash of the concatenation of OrchardSignature encodings for the spend authorization signature of each OrchardZSA Action in the OrchardZSA Action Group (that is, the contents of the vSpendAuthSigsOrchard field of the ActionGroupDescription):

A.3a.ii.1: spendAuthSigsOrchard    (field encoding bytes)

The personalization field of this hash is set to:

"ZTxAuthOrSASHash"

The encoding of OrchardSignature is specified in ZIP 230 [zip-0230-orchard-signature-orchardsignature]. Thus the encoding of spendAuthSigsOrchard is different from the encoding in ZIP 244.

A.4: issuance_auth_digest

If Issuance Actions are present, this is a BLAKE2b-256 hash of the field encoding of the issueAuthSig field of the transaction:

A.4a: issueAuthSig            (field encoding bytes)

The personalization field of this hash is set to:

"ZTxAuthZSAOrHash"

If the transaction has no Orchard Actions, issuance_auth_digest is:

BLAKE2b-256("ZTxAuthZSAOrHash", [])

The field encodings are specified in ZIP 230 [zip-0230-transaction-format].

Rationale

TBD.

Rationale for auth_digest domain separator reuse from ZIP 244

It is not possible to use an authorizing data commitment without the context of a transaction ID. That is, it is not possible to use it independently of the version and versionGroupId fields. The transaction ID includes a commitment to these fields. Thus, it is safe to use the same personalization values in the authorizing data commitment tree as in ZIP 244. This is true although the structure can be different from the structure in ZIP 244.

Reference implementation

TBD.

References

[BCP14]
Information on BCP 14 — "RFC 2119: Key words for use in RFCs to Indicate Requirement Levels" and "RFC 8174: Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words"
[protocol]
Zcash Protocol Specification, Version 2025.6.2 or later [NU6.1]
[protocol-spenddesc]
Zcash Protocol Specification, Version 2025.6.2 [NU6.1]. Section 4.4: Spend Descriptions
[protocol-outputdesc]
Zcash Protocol Specification, Version 2025.6.2 [NU6.1]. Section 4.5: Output Descriptions
[protocol-actiondesc]
Zcash Protocol Specification, Version 2025.6.2 [NU6.1]. Section 4.6: Action Descriptions
[protocol-txnencoding]
Zcash Protocol Specification, Version 2022.3.8. Section 7.1: Transaction Encoding and Consensus
[zip-0200]
ZIP 200: Network Upgrade Mechanism
[zip-0229]
ZIP 229: Version 6 Transaction Format
[zip-0230-transaction-format]
ZIP 230: Version 6 Transaction Format — Specification: Transaction Format
[zip-0230-orchardzsa-action-group-description]
ZIP 230: Version 6 Transaction Format — Specification: OrchardZSA Action Group Description
[zip-0230-orchardzsa-action-description-orchardzsaaction]
ZIP 230: Version 6 Transaction Format — Specification: OrchardZSA Action Description
[zip-0230-orchardzsa-asset-burn-description]
ZIP 230: Version 6 Transaction Format — Specification: OrchardZSA Asset Burn Description
[zip-0230-sapling-output-field-encodings]
ZIP 230: Version 6 Transaction Format — Specification: Sapling Output Description (OutputDescriptionV6)
[zip-0230-transparent-sighash-info-field-encodings]
ZIP 230: Version 6 Transaction Format — Specification: Transparent Sighash Information
[zip-0230-orchard-signature-orchardsignature]
ZIP 230: Version 6 Transaction Format — Specification: Orchard Signature
[zip-0230-issuance-action-description-issueaction]
ZIP 230: Version 6 Transaction Format — Specification: Issuance Action Description
[zip-0230-issue-note-description-issuenotedescription]
ZIP 230: Version 6 Transaction Format — Specification: Issue Note Description
[zip-0244]
ZIP 244: Transaction Identifier Non-Malleability
[zip-0244-sigdigest]
ZIP 244: Transaction Identifier Non-Malleability: Signature Digest
[zip-0244-authcommitment]
ZIP 244: Transaction Identifier Non-Malleability: Authorizing Data Commitment
[zip-0307]
ZIP 307: Light Client Protocol for Payment Detection