ZIP: 227
Title: Issuance of Zcash Shielded Assets
Owners: Pablo Kogan <pablo@qed-it.com>
        Vivek Arte <vivek@qed-it.com>
        Daira-Emma Hopwood <daira-emma@electriccoin.co>
        Jack Grigg <str4d@electriccoin.co>
Credits: Daniel Benarroch
         Aurelien Nicolas
         Deirdre Connolly
         Teor
Status: Draft
Category: Consensus
Created: 2022-05-01
License: MIT
Discussions-To: <https://github.com/zcash/zips/issues/618>
Pull-Request: <https://github.com/zcash/zips/pull/680>

Terminology

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

The term "network upgrade" in this document is to be interpreted as described in ZIP 200 7.

The terms "Orchard" and "Action" in this document are to be interpreted as described in ZIP 224 9.

We define the following additional terms:

Abstract

This ZIP (ZIP 227) proposes the Orchard Zcash Shielded Assets (OrchardZSA) protocol, in conjunction with ZIP 226 10. This protocol is an extension of the Orchard protocol that enables the creation, transfer and burn of Custom Assets on the Zcash chain. The creation of such Assets is defined in this ZIP (ZIP 227), while the transfer and burn of such Assets is defined in ZIP 226 10. This ZIP must only be implemented in conjunction with ZIP 226 10. The proposed issuance mechanism is only valid for the OrchardZSA transfer protocol, because it produces notes that can only be transferred via this protocol.

Motivation

This ZIP introduces the issuance mechanism for Custom Assets on the Zcash chain. While originally part of a single ZSA ZIP, the issuance mechanism turned out to be substantial enough to stand on its own and justify the creation of this supporting ZIP for ZIP 226 10.

This ZIP only enables transparent issuance. As a first step, transparency will allow for proper testing of the applications that will be most used in the Zcash ecosystem, and will enable the supply of Assets to be tracked.

The issuance mechanism described in this ZIP is broad enough for issuers to either create Assets on Zcash (i.e. Assets that originate on the Zcash blockchain), as well as for institutions to create bridges from other chains and import Wrapped Assets. This enables what we hope will be a useful set of applications.

Use Cases

The design presented in this ZIP enables issuance of shielded Assets in various modes:

See the Concrete Applications section for more details.

Requirements

Specification: Issuance Keys and Issuance Authorization Signature Scheme

The OrchardZSA Protocol adds the following keys to the key components 24 25:

  1. The issuance authorizing key, denoted as \(\mathsf{isk}\!\) , is the key used to authorize the issuance of Asset Identifiers by a given issuer, and is only used by that issuer.
  2. The issuance validating key, denoted as \(\mathsf{ik}\!\) , is the key that is used to validate issuance transactions. This key is used to validate the issuance of Asset Identifiers by a given issuer, and is used by all blockchain users (specifically the owners of notes for that Asset, and consensus validators) to associate the Asset in question with the issuer.

The relations between these keys are shown in the following diagram:

Diagram of Issuance Key Components for the OrchardZSA Protocol

Issuance Authorization Signature Scheme

We instantiate the issuance authorization signature scheme \(\mathsf{IssueAuthSig}\) as a BIP-340 Schnorr signature over the secp256k1 curve. The signing and validation algorithms, signature encoding, and public key encoding MUST follow BIP 340 22.

Batch verification MAY be used. Precomputation MAY be used if and only if it produces equivalent results; for example, for a given verification key \(pk\) and \(\mathit{lift\_x}(\mathit{int}(pk))\) MAY be precomputed.

We define the constants as per the secp256k1 standard parameters, as described in BIP 340.

The associated types of the \(\mathsf{IssueAuthSig}\) signature scheme are as follows:

  • \(\mathsf{IssueAuthSig.Message} = \mathbb{B}^{\mathbb{Y}^{[\mathbb{N}]}}\)
  • \(\mathsf{IssueAuthSig.Signature} = \mathbb{B}^{\mathbb{Y}^{[64]}} \cup \{\bot\}\)
  • \(\mathsf{IssueAuthSig.Public} = \mathbb{B}^{\mathbb{Y}^{[32]}} \cup \{\bot\}\)
  • \(\mathsf{IssueAuthSig.Private} = \mathbb{B}^{\mathbb{Y}^{[32]}}\)

where \(\mathbb{B}^{\mathbb{Y}^{[k]}}\) denotes the set of sequences of \(k\) bytes, and \(\mathbb{B}^{\mathbb{Y}^{[\mathbb{N}]}}\) denotes the type of byte sequences of arbitrary length, as defined in the Zcash protocol specification 23.

The issuance authorizing key generation algorithm and the issuance validating key derivation algorithm are defined in the Issuance Key Derivation section, while the corresponding signing and validation algorithms are defined in the Issuance Authorization Signing and Validation section.

Issuance Key Derivation

Issuance authorizing key generation for hierarchical deterministic wallets

The issuance authorizing key is generated using the Hardened-only key derivation process defined in ZIP 32 3. For the \(\mathsf{Issuance}\) context, we define the following constants:

  • \(\mathsf{Issuance.MKGDomain} := \texttt{“ZcashSA\_Issue\_V1”}\)
  • \(\mathsf{Issuance.CKDDomain} := \mathtt{0x81}\)

Let \(S\) be a seed byte sequence of a chosen length, which MUST be at least 32 and at most 252 bytes. We define the master extended issuance key \(m_{\mathsf{Issuance}} := \mathsf{MKGh}^{\mathsf{Issuance}}(S)\!\) .

We use hardened-only child key derivation as defined in ZIP 32 4 for the issuance authorizing key.

\(\mathsf{CKDsk}((\mathsf{sk}_{par},\mathsf{c}_{par}), i) \rightarrow (\mathsf{sk}_{i}, \mathsf{c}_{i})\) :

  • Return \(\mathsf{CKDh}^{\mathsf{Issuance}}((\mathsf{sk}_{par},\mathsf{c}_{par}), i)\)

We use the notation of ZIP 32 6 for shielded HD paths, and define the issuance authorizing key path as \(m_{\mathsf{Issuance}} / \mathit{purpose}' / \mathit{coin\_type}' / \mathit{account}'.\) We fix the path levels as follows:

  • \(\mathit{purpose}\!\) : a constant set to \(227\) (i.e. \(\mathtt{0xe3}\!\) ). \(\mathit{purpose}'\) is thus \(227'\) (or \(\mathtt{0x800000e3}\!\) ) following the BIP 43 recommendation. 21
  • \(\mathit{coin\_type}\!\) : Defined as in ZIP 32 5.
  • \(\mathit{account}\!\) : fixed to index \(0\!\) .

From the generated \((\mathsf{sk}, \mathsf{c})\!\) , we set the issuance authorizing key to be \(\mathsf{isk} := \mathsf{sk}\!\) .

Derivation of issuance validating key

Define \(\mathsf{IssueAuthSig.DerivePublic} \;{\small ⦂}\; (\mathsf{isk} \;{\small ⦂}\; \mathsf{IssueAuthSig.Private}) \to \mathsf{IssueAuthSig.Public}\) as:

  • \(\mathsf{ik} := \textit{PubKey}(\mathsf{isk})\)
  • Return \(\bot\) if the \(\textit{PubKey}\) algorithm invocation fails, otherwise return \(\mathsf{ik}\!\) .

where the \(\textit{PubKey}\) algorithm is defined in BIP 340 22. Note that the byte representation of \(\mathsf{ik}\) is in big-endian order as defined in BIP 340.

It is possible for the \(\textit{PubKey}\) algorithm to fail with very low probability, which means that \(\mathsf{IssueAuthSig.DerivePublic}\) could return \(\bot\) with very low probability. If this happens, discard the keys and repeat with a different \(\mathsf{isk}\!\) .

This allows the issuer to use the same wallet it usually uses to transfer Assets, while keeping a disconnect from the other keys. Specifically, this method is aligned with the requirements and motivation of ZIP 32 2. It provides further anonymity and the ability to delegate issuance of an Asset (or in the future, generate a multi-signature protocol) while the rest of the keys remain in the wallet safe.

Issuance Authorization Signing and Validation

Define \(\mathsf{IssueAuthSig.Sign} \;{\small ⦂}\; (\mathsf{isk} \;{\small ⦂}\; \mathsf{IssueAuthSig.Private}) \times (M \;{\small ⦂}\; \mathsf{IssueAuthSig.Message}) \to \mathsf{IssueAuthSig.Signature}\) as:

  • Let the auxiliary data \(a = [\mathtt{0x00}]^{32}\!\) .
  • Let \(\text{σ} = \mathsf{Sign}(\mathsf{isk}, M)\!\) .
  • Return \(\bot\) if the \(\mathsf{Sign}\) algorithm fails in the previous step, otherwise return \(\text{σ}\!\) .

where the \(\mathsf{Sign}\) algorithm is defined in BIP 340 and \(a\) denotes the auxiliary data used in BIP 340 22. Note that \(\mathsf{IssueAuthSig.Sign}\) could return \(\bot\) with very low probability.

Define \(\mathsf{IssueAuthSig.Validate} \;{\small ⦂}\; (\mathsf{ik} \;{\small ⦂}\; \mathsf{IssueAuthSig.Public}) \times (M \;{\small ⦂}\; \mathsf{IssueAuthSig.Message}) \times (\text{σ} \;{\small ⦂}\; \mathsf{IssueAuthSig.Signature}) \to \mathbb{B}\) as:

  • Return \(0\) if \(\text{σ} = \bot\!\) .
  • Return \(1\) if \(\mathsf{Verify}(\mathsf{ik}, M, \text{σ})\) succeeds, otherwise \(0\!\) .

where the \(\mathsf{Verify}\) algorithm is defined in BIP 340 22.

Specification: Asset Identifier

For every new Asset, there MUST be a new and unique Asset Identifier, denoted \(\mathsf{AssetId}\!\) . We define this to be a globally unique pair \(\mathsf{AssetId} := (\mathsf{ik}, \mathsf{asset\_desc})\!\) , where \(\mathsf{ik}\) is the issuance key and \(\mathsf{asset\_desc}\) is a byte string.

A given Asset Identifier is used across all Zcash protocols that support ZSAs -- that is, the OrchardZSA protocol and potentially future Zcash shielded protocols. For this Asset Identifier, we derive an Asset Digest, \(\mathsf{AssetDigest}\!\) , which is simply is a \(\textsf{BLAKE2b-512}\) hash of the Asset Identifier. From the Asset Digest, we derive a specific Asset Base within each shielded protocol using the applicable hash-to-curve algorithm. This Asset Base is included in shielded notes.

Let

Define \(\mathsf{AssetDigest_{AssetId}} := \textsf{BLAKE2b-512}(\texttt{“ZSA-Asset-Digest”},\; \mathsf{EncodeAssetId}(\mathsf{AssetId}))\!\) , where

Define \(\mathsf{AssetBase_{AssetId}} := \mathsf{ZSAValueBase}(\mathsf{AssetDigest_{AssetId}})\)

In the case of the OrchardZSA protocol, we define \(\mathsf{ZSAValueBase}(\mathsf{AssetDigest_{AssetId}}) := \mathsf{GroupHash}^\mathbb{P}(\texttt{"z.cash:OrchardZSA"}, \mathsf{AssetDigest_{AssetId}})\) where \(\mathsf{GroupHash}^\mathbb{P}\) is defined as in 27.

The relations between the Asset Identifier, Asset Digest, and Asset Base are shown in the following diagram:

Diagram relating the Asset Identifier, Asset Digest, and Asset Base in the OrchardZSA Protocol

Note: To keep notations light and concise, we may omit \(\mathsf{AssetId}\) (resp. \(\mathsf{Protocol}\!\) ) in the subscript (resp. superscript) when the Asset Identifier (resp. Protocol) is clear from the context.

Wallets MUST NOT display just the \(\mathsf{asset\_desc}\) string to their users as the name of the Asset. Some possible alternatives include:

Specification: Issuance Action, Issuance Bundle and Issuance Protocol

Issue Note Description

TODO: Fill this section.

Issuance Action Description

An issuance action, IssueAction, is the instance of issuing a specific Custom Asset, and contains the following fields:

  • assetDescSize: the size of the Asset description, a number between \(0\) and \(512\!\) .
  • asset_desc: the Asset description, a byte string of up to 512 bytes as defined in the Specification: Asset Identifier section.
  • vNotes: an array of Note containing the unencrypted output notes of the recipients of the Asset.
  • flagsIssuance: a byte that stores the \(\mathsf{finalize}\) boolean that defines whether the issuance of that specific Custom Asset is finalized or not.

The \(\mathsf{finalize}\) boolean is set by the Issuer to signal that there will be no further issuance of the specific Custom Asset. As we will see in Specification: Consensus Rule Changes, transactions that attempt to issue further amounts of a Custom Asset that has previously been finalized will be rejected.

The complete encoding of these fields into an IssueAction is defined in ZIP 230 15.

We note that the output note commitment of the recipient's notes are not included in the actual transaction, but when added to the global state of the chain, they will be added to the note commitment tree as a shielded note. This prevents future usage of the note from being linked to the issuance transaction, as the nullifier key is not known to the validators and chain observers.

Issuance Bundle

An issuance bundle is the aggregate of all the issuance-related information. Specifically, contains all the issuance actions and the issuer signature on the transaction SIGHASH that validates the issuance itself. It contains the following fields:

  • \(\mathsf{ik}\!\) : the issuance validating key, that allows the validators to verify that the \(\mathsf{AssetId}\) is properly associated with the issuer.
  • vIssueActions: an array of issuance actions, of type IssueAction.
  • \(\mathsf{issueAuthSig}\!\) : the signature of the transaction SIGHASH, signed by the issuance authorizing key, \(\mathsf{isk}\!\) , that validates the issuance.

The issuance bundle is added within the transaction format as a new bundle. The detailed encoding of the issuance bundle as a part of the V6 transaction format is defined in ZIP 230 16.

Issuance Protocol

The issuer program performs the following operations:

For all actions IssueAction:

  • encode \(\mathsf{asset\_desc}\) as a UTF-8 byte string of size up to 512.
  • compute \(\mathsf{AssetDigest}\) from the issuance validating key \(\mathsf{ik}\) and \(\mathsf{asset\_desc}\) as decribed in the Specification: Asset Identifier section.
  • compute \(\mathsf{AssetBase}\) from \(\mathsf{AssetDigest}\) as decribed in the Specification: Asset Identifier section.
  • set the \(\mathsf{finalize}\) boolean as desired (if more issuance actions are to be created for this \(\mathsf{AssetBase}\!\) , set \(\mathsf{finalize} = 0\!\) , otherwise set \(\mathsf{finalize} = 1\!\) ).
  • for each recipient \(i\!\) :
    • generate a ZSA output note that includes the Asset Base. For an OrchardZSA note this is \(\mathsf{note}_i = (\mathsf{d}_i, \mathsf{pk}_{\mathsf{d}_i}, \mathsf{v}_i, \text{ρ}_i, \mathsf{rseed}_i, \mathsf{AssetBase}, \mathsf{rcm}_i)\!\) .
  • encode the IssueAction into the vector vIssueActions of the bundle.

For the IssueBundle:

  • encode the vIssueActions vector.
  • encode the \(\mathsf{ik}\) as 32 byte-string.
  • sign the SIGHASH transaction hash with the issuance authorizing key, \(\mathsf{isk}\!\) , using the \(\mathsf{IssueAuthSig}\) signature scheme. The signature is then added to the issuance bundle.

Note: that the commitment is not included in the IssuanceAction itself. As explained below, it is computed later by the validators and added to the note commitment tree.

Specification: Global Issuance State

Issuance requires the following additions to the global state:

A map, \(\mathsf{issued\_assets} : \mathbb{P}^* \to \{0 .. \mathsf{MAX\_ISSUE}\} \times \mathbb{B}\!\) , from the Asset Base, \(\mathsf{AssetBase} : \mathbb{P}^*\!\) , to a tuple \((\mathsf{balance}, \mathsf{final})\!\) , for every Asset that has been issued. We use the notation \(\mathsf{issued\_assets}(\mathsf{AssetBase}).\!\mathsf{balance}\) and \(\mathsf{issued\_assets}(\mathsf{AssetBase}).\!\mathsf{final}\) to access, respectively, the elements of the tuple stored in the global state for a given \(\mathsf{AssetBase}\!\) . If \(\mathsf{issued\_assets}(\mathsf{AssetBase}) = \bot\!\) , it is assumed that \(\mathsf{issued\_assets}(\mathsf{AssetBase}).\!\mathsf{balance} = 0\) and \(\mathsf{issued\_assets}(\mathsf{AssetBase}).\!\mathsf{final} = 0\!\) .

For any Asset represented by \(\mathsf{AssetBase}\!\) :

The maximum total supply of any issued Custom Asset is denoted by the constant \(\mathsf{MAX\_ISSUE} := 2^{64} - 1\!\) .

Management of the Global Issuance State

The issuance state, that is, the \(\mathsf{issued\_assets}\) map, MUST be updated by a node during the processing of any transaction that contains burn information, or an issuance bundle. The issuance state is chained as follows:

  • The issuance state for the first block post the activation of the OrchardZSA protocol is the empty map.
  • The input issuance state for the first transaction of a block is the final issuance state of the immediately preceding block.
  • The input issuance state of each subsequent transaction in the block is the output issuance state of the immediately preceding transaction.
  • The final issuance state of a block is the output issuance state of the last transaction in the block.

We describe the consensus rule changes that govern the management of the global issuance state in the Specification: Consensus Rule Changes section. We use \(\mathsf{issued\_assets}_{\mathsf{IN}}\) and \(\mathsf{issued\_assets}_{\mathsf{OUT}}\) to denote the input issuance state and output issuance state for a transaction, respectively.

Specification: Consensus Rule Changes

For every transaction:

Rationale

The following is a list of rationale for different decisions made in the proposal:

Rationale for Global Issuance State

It is necessary to ensure that the balance of any issued Custom Asset never becomes negative within a shielded pool, along the lines of ZIP 209 8. However, unlike for the shielded ZEC pools, there is no individual transaction field that directly corresponds to both the issued and burnt amounts for a given Asset. Therefore, we require that all nodes maintain a record of the current amount in circulation for every issued Custom Asset, and update this record based on the issuance and burn transactions processed. This allows for efficient detection of balance violations for any Asset, in which scenario we specify a consensus rule to reject the transaction or block.

We limit the total issuance of any Asset to a maximum of \(\mathsf{MAX\_ISSUE}\!\) . This is a practical limit that also allows an issuer to issue the complete supply of an Asset in a single transaction.

Nodes also need to reject transactions that issue Custom Assets that have been previously finalized. The \(\mathsf{issued\_assets}\) map allows nodes to store whether or not a given Asset has been finalized.

Concrete Applications

Asset Features

  • By using the \(\mathsf{finalize}\) boolean and the burning mechanism defined in 10, issuers can control the supply production of any Asset associated to their issuer keys. For example,
    • by setting \(\mathsf{finalize} = 1\) from the first issuance action for that Asset Identifier, the issuer is in essence creating a one-time issuance transaction. This is useful when the max supply is capped from the beginning and the distribution is known in advance. All tokens are issued at once and distributed as needed.
  • Issuers can also stop the existing supply production of any Asset associated to their issuer keys. This could be done by
    • issuing a last set of tokens of that specific \(\mathsf{AssetId}\!\) , for which \(\mathsf{finalize} = 1\!\) , or by
    • issuing a transaction with a single note in the issuance action pertaining to that \(\mathsf{AssetId}\!\) , where the note will contain a \(\mathsf{value} = 0\!\) . This can be used for application-specific purposes (NFT collections) or for security purposes to revoke the Asset issuance (see Security and Privacy Considerations).
  • The issuance and burn mechanisms can be used in conjunction to determine the supply of Assets on the Zcash ecosystem. This allows for the bridging of Assets defined on other chains.
  • Furthermore, NFT issuance is enabled by issuing in a single bundle several issuance actions, where each \(\mathsf{AssetId}\) corresponds to \(\mathsf{value} = 1\) at the fundamental unit level. Issuers and users should make sure that \(\mathsf{finalize} = 1\) for each of the actions in this scenario.

TxId Digest - Issuance

This section details the construction of the subtree of hashes in the transaction digest that corresponds to issuance transaction data. Details of the overall changes to the transaction digest due to the OrchardZSA protocol can be found in ZIP 226 13. As in ZIP 244 18, the digests are all personalized BLAKE2b-256 hashes, and in cases where no elements are available for hashing, a personalized hash of the empty byte array is used.

A new issuance transaction digest algorithm is defined that constructs the subtree of the transaction digest tree of hashes for the issuance portion of a transaction. Each branch of the subtree will correspond to a specific subset of issuance transaction data. The overall structure of the hash is as follows; each name referenced here will be described in detail below:

issuance_digest
├── issue_actions_digest
│   ├── issue_notes_digest
│   ├── assetDescription
│   └── flagsIssuance
└── issuanceValidatingKey

In the specification below, nodes of the tree are presented in depth-first order.

T.5: issuance_digest

A BLAKE2b-256 hash of the following values

T.5a: issue_actions_digest    (32-byte hash output)
T.5b: issuanceValidatingKey   (32 bytes)

The personalization field of this hash is set to:

"ZTxIdSAIssueHash"

In case the transaction has no issuance components, ''issuance_digest'' is:

BLAKE2b-256("ZTxIdSAIssueHash", [])

T.5a: issue_actions_digest

A BLAKE2b-256 hash of Issue Action information for all Issuance Actions belonging to the transaction. For each Action, the following elements are included in the hash:

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

The personalization field of this hash is set to:

"ZTxIdIssuActHash"
T.5a.i: issue_notes_digest

A BLAKE2b-256 hash of Note information for all Notes belonging to the Issuance Action. For each Note, the following elements are included in the hash:

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

The personalization field of this hash is set to:

"ZTxIdIAcNoteHash"

In case the transaction has no Issue Notes, ''issue_notes_digest'' is:

BLAKE2b-256("ZTxIdIAcNoteHash", [])
T.5a.i.1: recipient

This is the raw encoding of an Orchard shielded payment address as defined in the protocol specification 28.

T.5a.i.2: value

Note value encoded as little-endian 8-byte representation of 64-bit unsigned integer (e.g. u64 in Rust) raw value.

T.5a.i.3: assetBase

Asset Base encoded as the 32-byte representation of a point on the Pallas curve.

T.5a.i.4: rho

Nullifier encoded as 32-byte representation of a point on the Pallas curve.

T.5a.i.5: rseed

The ZIP 212 32-byte seed randomness for a note.

T.5a.ii: assetDescription

The Asset description byte string.

T.5a.iii: flagsIssuance

An 8-bit value representing a set of flags. Ordered from LSB to MSB:

  • \(\mathsf{finalize}\)
  • The remaining bits are set to 0!.

T.5b: issuanceValidatingKey

A byte encoding of issuance validating key for the bundle as defined in the Issuance Key Derivation section.

Signature Digest

The per-input transaction digest algorithm to generate the signature digest in ZIP 244 19 is modified so that a signature digest is produced for each transparent input, each Sapling input, each Orchard action, and additionally for each Issuance Action. For Issuance Actions, this algorithm has the exact same output as the transaction digest algorithm, thus the txid may be signed directly.

The overall structure of the hash is as follows. We highlight the changes for the OrchardZSA protocol via the [ADDED FOR ZSA] text label, and we omit the descriptions of the sections that do not change for the OrchardZSA protocol:

signature_digest
├── header_digest
├── transparent_sig_digest
├── sapling_digest
├── orchard_digest
└── issuance_digest         [ADDED FOR ZSA]

signature_digest

A BLAKE2b-256 hash of the following 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)  [ADDED FOR ZSA]

The personalization field remains the same as in ZIP 244 18.

S.5: issuance_digest

Identical to that specified for the transaction identifier.

Authorizing Data Commitment - Issuance

This section covers the construction of the subtree of hashes in the authorizing data commitment that corresponds to issuance transaction data. Details of the overall changes to the authorizing data commitment due to the OrchardZSA protocol can be found in ZIP 226 14.

A.4: issuance_auth_digest

In the case that 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"

In the case that the transaction has no Orchard Actions, issuance_auth_digest is

BLAKE2b-256("ZTxAuthZSAOrHash", [])

OrchardZSA Fee Calculation

In addition to the parameters defined in the Fee calculation section of ZIP 317 20, the OrchardZSA protocol upgrade defines the following additional parameters:

Parameter Value
\(issuance\_fee\) \(100 \cdot marginal\_fee\) per issuance action (as defined below)

Wallets implementing this specification SHOULD use a conventional fee, viz. \(zsa\_conventional\_fee\!\) , that is calculated in zatoshis. Additional definitions that are used in the formula for the calculation are in the table below:

Input Units Description
\(nOrchardActions\) number the number of OrchardZSA transfer actions (including ZEC actions)
\(nTotalOutputsZSAIssuance\) number the total number of OrchardZSA issuance outputs (added across issuance actions)
\(nCreateActions\) number the number of OrchardZSA issuance actions that issue a Custom Asset that is not present in the Global Issuance State

The other inputs to this formula are taken from transaction fields defined in the Zcash protocol specification 29 and the global state. They are defined in the Fee calculation section of ZIP 317 20. Note that \(nOrchardActions\!\) , that is used in the computation of \(logical\_actions\!\) , is redefined in the above table, and now combines the actions for native ZEC as well as OrchardZSA transfer actions for Custom Assets.

The formula for the computation of the \(zsa\_logical\_actions\) (with the updated computation of \(logical\_actions\) as described above) is:

\(zsa\_logical\_actions = logical\_actions \;+ nTotalOutputsZSAIssuance\)

The formula for the computation of the \(zsa\_conventional\_fee\) is:

\(\begin{array}{rcl} zsa\_conventional\_fee &=& marginal\_fee \cdot \mathsf{max}(grace\_actions, zsa\_logical\_actions) \;+ \\ & & issuance\_fee \cdot nCreateActions \end{array}\)

It is not a consensus requirement that fees follow this formula; however, wallets SHOULD create transactions that pay this fee, in order to reduce information leakage, unless overridden by the user.

Rationale for OrchardZSA Fee calculation

The OrchardZSA fee calculation accounts for the additions to the Global Issuance State that are required for the OrchardZSA protocol. Every newly created Custom Asset adds a new row to the Global Issuance State. Subsequent issuance, finalization, or burn of existing Custom Assets only changes the values in the corresponding row.

This explains the need for a higher fee for the creation of entirely new Custom Assets, in order to disincentivize the creation of "junk" assets.

OrchardZSA Fee Considerations

We choose to maintain the native ZEC Asset as the primary token for the Zcash blockchain, similar to how ETH is needed for ERC20 transactions to the benefit of the Ethereum ecosystem.

An alternative proposal for the OrchardZSA fee mechanism that was not adopted was to adopt a new type of fee, denominated in the custom Asset being issued or transferred. In the context of transparent transactions, such a fee allows miners to “tap into” the ZSA value of the transactions, rather than the ZEC value of transactions. However when transactions are shielded, any design that lifts value from the transaction would also leak information about it.

Security and Privacy Considerations

Displaying Asset Identifier information to users

Wallets need to communicate the names of the Assets in a non-confusing way to users, since the byte representation of the Asset Identifier would be hard to read for an end user. Possible solutions are provided in the Specification: Asset Identifier section.

Issuance Key Compromise

The design of this protocol does not currently allow for rotation of the issuance validating key that would allow for replacing the key of a specific Asset. In case of compromise, the following actions are recommended:

  • If an issuance validating key is compromised, the \(\mathsf{finalize}\) boolean for all the Assets issued with that key should be set to \(1\) and the issuer should change to a new issuance authorizing key, and issue new Assets, each with a new \(\mathsf{AssetId}\!\) .

Bridging Assets

For bridging purposes, the secure method of off-boarding Assets is to burn an Asset with the burning mechanism in ZIP 226 10. Users should be aware of issuers that demand the Assets be sent to a specific address on the Zcash chain to be redeemed elsewhere, as this may not reflect the real reserve value of the specific Wrapped Asset.

Other Considerations

Implementing Zcash Nodes

Although not enforced in the global state, it is RECOMMENDED that Zcash full validators keep track of the total supply of Assets as a mutable mapping \(\mathsf{issuanceSupplyInfoMap}\) from \(\mathsf{AssetId}\) to \((\mathsf{totalSupply}, \mathsf{finalize})\) in order to properly keep track of the total supply for different Asset Identifiers. This is useful for wallets and other applications that need to keep track of the total supply of Assets.

Fee Structures

The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317, and is described in ZIP 230 17.

Test Vectors

Reference Implementation

Deployment

TBD

References

1 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"
2 ZIP 32: Shielded Hierarchical Deterministic Wallets
3 ZIP 32: Shielded Hierarchical Deterministic Wallets - Specification: Hardened-only key derivation
4 ZIP 32: Shielded Hierarchical Deterministic Wallets - Hardened-only child key derivation
5 ZIP 32: Shielded Hierarchical Deterministic Wallets - Key path levels
6 ZIP 32: Shielded Hierarchical Deterministic Wallets - Orchard key path
7 ZIP 200: Network Upgrade Mechanism
8 ZIP 209: Prohibit Negative Shielded Chain Value Pool Balances
9 ZIP 224: Orchard
10 ZIP 226: Transfer and Burn of Zcash Shielded Assets
11 ZIP 226: Transfer and Burn of Zcash Shielded Assets - Note Structure & Commitment
12 ZIP 226: Transfer and Burn of Zcash Shielded Assets - Additional Consensus Rules for the assetBurn set
13 ZIP 226: Transfer and Burn of Zcash Shielded Assets - TxId Digest
14 ZIP 226: Transfer and Burn of Zcash Shielded Assets - Authorizing Data Commitment
15 ZIP 230: Version 6 Transaction Format: Issuance Action Description (IssueAction)
16 ZIP 230: Version 6 Transaction Format: Transaction Format
17 ZIP 230: Version 6 Transaction Format: OrchardZSA Fee Calculation
18 ZIP 244: Transaction Identifier Non-Malleability
19 ZIP 244: Transaction Identifier Non-Malleability: Signature Digest
20 ZIP 317: Proportional Transfer Fee Mechanism, Fee calculation
21 BIP 43: Purpose Field for Deterministic Wallets
22 BIP 340: Schnorr Signatures for secp256k1
23 Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 2: Notation
24 Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 3.1: Payment Addresses and Keys
25 Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 4.2.3: Orchard Key Components
26 Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 4.10: SIGHASH Transaction Hashing
27 Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 5.4.9.8: Group Hash into Pallas and Vesta
28 Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 5.6.4.2: Orchard Raw Payment Addresses
29 Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 7.1: Transaction Encoding and Consensus