diff --git a/zip-0227.html b/zip-0227.html
index 4e1773218..eafb1de9f 100644
--- a/zip-0227.html
+++ b/zip-0227.html
@@ -26,21 +26,29 @@
The key word "MUST" in this document is to be interpreted as described in RFC 2119 1. The term "network upgrade" in this document is to be interpreted as described in ZIP 200 2. The term "Orchard" in this document is to be interpreted as described in ZIP 224 3. The terms "Asset", "custom Asset", and "Wrapped Asset" in this document are to be interpreted as described in ZIP 226 4. The terms "Orchard" and "Action" in this document are to be interpreted as described in ZIP 224 3. We define the following additional terms: ZIP 226 4 and ZIP 227 7 propose in conjunction the Zcash Shielded Assets (ZSA) protocol, which 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 ZIP 227 7. The transfer and burn of such Assets is defined in ZIP 226 4. This ZIP must only be implemented in conjuction with ZIP 226 4, as the issuance mechanism is only valid for the ZSA transfer protocol, because it produces notes that can only be transferred under ZSA. This ZIP (ZIP 227) proposes the Zcash Shielded Assets (ZSA) protocol, in conjunction with ZIP 226 4. 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 4. This ZIP must only be implemented in conjuction with ZIP 226 4. The proposed issuance mechanism is only valid for the ZSA transfer protocol, because it produces notes that can only be transferred under ZSA. This ZIP is a supporting ZIP for ZIP 226 4, which lays out its motivations, but requires an issuance mechanism to be defined (which is substantial enough to stand on its own) in order to function. This ZIP enables only transparent issuance, since 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 block chain), 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. This ZIP introduces the issuance mechanism for custom Assets on the Zcash chain. While originally part of a same ZSA ZIP (ZIP 226 4) 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 4. 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. The design presented in this ZIP enables issuance of shielded Assets in various modes:Terminology
![]()
+
+
+ Abstract
- ![]()
Motivation
- ![]()
Use Cases
![]()
Requirements
![]()
-
The issuance master key is generated by choosing a bit sequence uniformly at random from \(\mathbb{B}^{\mathbb{Y}[32]}\) - , like the Orchard spending key 20.
+ , like the Orchard spending key 19.The issuance master key is derived using the Orchard master key derivation procedure defined in ZIP 32 13. We reuse the functions defined there in what follows in this section.
+The issuance master key is derived using the Orchard master key derivation procedure defined in ZIP 32 12. We reuse the functions defined there in what follows in this section.
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{MasterKeyGen}(\texttt{"ZIP32ZSAIssue_V1"}, S)\) .
-As in ZIP 32 for Orchard 14, we only use hardened child key derivation for the issuance master key. We reuse the +
As in ZIP 32 for Orchard 13, we only use hardened child key derivation for the issuance master key. We reuse the \(\mathsf{CDKsk}\) function for Orchard child key derivation from ZIP 32.
-We use the notation of ZIP 32 16 for shielded HD paths, and define the issuance master key path as - \(m_\mathsf{Issuance} / purpose / coin\_type' / account'\) +
We use the notation of ZIP 32 15 for shielded HD paths, and define the issuance master key path as + \(m_\mathsf{Issuance} / purpose' / coin\_type' / account'\) . We fix the path levels as follows:
For every new Asset, there must be a new and unique Asset Identifier. We define this to be a globally unique pair - \((\mathsf{ik}, \mathsf{asset\_desc})\) +
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 @@ -182,22 +196,27 @@ , where
Define \(\mathsf{AssetBase^{Protocol}_{\mathsf{AssetId}}} := \mathsf{ZSAValueBase^{Protocol}}(\mathsf{AssetDigest}_{\mathsf{AssetId}})\) , where
In the case of Orchard, we define - \(\mathsf{ZSAValueBase^{Orchard}}(\mathsf{asset\_digest}) := \mathsf{GroupHash}^\mathbb{P}(\texttt{"z.cash:OrchardZSA"}, \mathsf{asset\_digest})\) + \(\mathsf{ZSAValueBase^{Orchard}}(\mathsf{AssetDigest}_{\mathsf{AssetId}}) := \mathsf{GroupHash}^\mathbb{P}(\texttt{"z.cash:OrchardZSA"}, \mathsf{AssetDigest}_{\mathsf{AssetId}})\) where \(\mathsf{GroupHash}^\mathbb{P}\) - is defined as in 19.
+ is defined as in 18.The relations between the Asset Identifier, Asset Digest, and Asset Base are shown in the following diagram:
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.
Issuance requires the following additions to the global state defined at block boundaries:
@@ -223,7 +242,7 @@finalize: a boolean that defines whether the issuance of that specific custom Asset is finalized or notAn asset's @@ -240,7 +259,7 @@
| Size | +Bytes | Name | Data Type | Description | @@ -248,24 +267,16 @@||
|---|---|---|---|---|---|---|
| 2 bytes | -- \(\mathsf{assetDescSize}\) - | +2 | +assetDescSize | byte | -The length of the - \(\mathsf{asset\_desc}\) - string in bytes | +The length of the asset_desc string in bytes |
| Varies | -- \(\mathsf{asset\_desc}\) - | +asset_desc | byte | -UTF-8 encoded string, of size - \(\mathsf{assetDescSize}\) - bytes | +UTF-8 encoded string, of size assetDescSize bytes | |
| Varies | @@ -280,13 +291,14 @@A sequence of note descriptions within the issuance action | |||||
| 1 byte | -flagsIssuance |
+ 1 | +flagsIssuance | byte | -An 8-bit value with the finalize boolean value as the LSB, and the other bits set to 0. |
+ An 8-bit value with the finalize boolean value as the LSB, and the other bits set to 0. (See: T.5a.iii: flagsIssuance) |
, where noteSize is the size, in bytes, of a Note.
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 NoteCommitmentTree 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.
The issuance bundle is then added within the transaction format as a new bundle. That is, issuance requires the addition of the following information to the transaction format 24.
+The issuance bundle is then added within the transaction format as a new bundle. That is, issuance requires the addition of the following information to the transaction format 23.
| The number of issuance actions in the bundle | ||||
| Varies | +IssueActionSize * nIssueActions | vIssueActions | IssueAction[nIssueActions] | A sequence of issuance actions descriptions |
| 32 | -- \(\mathsf{ik}\) - | +ik | byte[32] | The issuance validating key of the issuer, used to validate the signature |
, where IssueActionSize is the size, in bytes, of an IssueAction description.
The issuer program performs the following operations
@@ -361,7 +372,7 @@ from \(\mathsf{AssetDigest}\) as decribed in the Specification: Asset Identifier section. -finalize boolean as desired (if more more issuance actions are to be created for this Asset Identifier, set finalize = 0, otherwise set finalize = 1)finalize boolean as desired (if more issuance actions are to be created for this Asset Identifier, set finalize = 0, otherwise set finalize = 1)NOTE that the commitment is not included in the IssuanceAction itself. As explained below, it is later computed by the validators and added to the NoteCommitmentTree.
+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 NoteCommitmentTree.
Asset Features
finalize boolean and the burning mechanism defined in 4, issuers can control the supply production of any Asset associated to their issuer keys. For example,
+ finalize boolean and the burning mechanism defined in 4, issuers can control the supply production of any Asset associated to their issuer keys. For example,
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.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 ZSA protocol can be found in ZIP 226 6. As in ZIP 244 8, 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.
+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 ZSA protocol can be found in ZIP 226 6. As in ZIP 244 7, 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
@@ -514,10 +525,10 @@
The personalization field of this hash is set to:
"ZTxIdIANoteHash"
T.5a.i.1: recipient 
- This is the raw encoding of an Orchard shielded payment address as defined in the protocol specification 23.
+ This is the raw encoding of an Orchard shielded payment address as defined in the protocol specification 22.
T.5a.i.2: value 
- Note value encoded as little-endian 8-byte representation of u64 raw 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.
@@ -546,7 +557,7 @@
The per-input transaction digest algorithm to generate the signature digest in ZIP 244 9 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 per-input transaction digest algorithm to generate the signature digest in ZIP 244 8 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 ZSA protocol via the [ADDED FOR ZSA] text label, and we omit the descriptions of the sections that do not change for the ZSA protocol:
signature_digest ├── header_digest @@ -561,14 +572,14 @@ 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 8.
+The personalization field remains the same as in ZIP 244 7.
Identical to that specified for the transaction identifier.
For bridging purposes, the secure method of off-boarding Assets is to burn an Asset with the burning mechanism in ZIP 226 4. 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.
+For bridging purposes, the secure method of off-boarding Assets is to burn an Asset with the burning mechanism in ZIP 226 4. 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.
The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317b 11.
+The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317b 10.
In future versions of this ZIP, the protocol may also include a "key rotation" mechanism. This would allow an issuer to change the underlying @@ -687,18 +698,10 @@ -
| 7 | -ZIP 227: Issuance of Zcash Shielded Assets | -
|---|
| 8 | +7 | ZIP 244: Transaction Identifier Non-Malleability |
|---|
| 9 | +8 | ZIP 244: Transaction Identifier Non-Malleability: Signature Digest |
|---|
| 10 | +9 | ZIP 244: Transaction Identifier Non-Malleability: Authorizing Data Commitment |
|---|
| 11 | +10 | ZIP 317b: ZSA Extension Proportional Fee Mechanism |
|---|
| 12 | +11 | ZIP 32: Shielded Hierarchical Deterministic Wallets |
|---|
| 13 | +12 | ZIP 32: Shielded Hierarchical Deterministic Wallets - Orchard master key generation |
|---|
| 14 | +13 | ZIP 32: Shielded Hierarchical Deterministic Wallets - Orchard child key derivation |
|---|
| 15 | +14 | ZIP 32: Shielded Hierarchical Deterministic Wallets - Key path levels |
|---|
| 16 | +15 | ZIP 32: Shielded Hierarchical Deterministic Wallets - Orchard key path |
|---|
| 17 | +16 | ZIP 316: Unified Addresses and Unified Viewing Keys |
|---|
| 18 | +17 | Zcash Protocol Specification, Version 2022.3.8. Section 3.1: Payment Addresses and Keys |
|---|
| 19 | +18 | Zcash Protocol Specification, Version 2022.3.8. Section 5.4.9.8: Group Hash into Pallas and Vesta |
|---|
| 20 | +19 | Zcash Protocol Specification, Version 2022.3.8. Section 4.2.3: Orchard Key Components |
|---|
| 21 | +20 | Zcash Protocol Specification, Version 2022.3.8. Section 4.15: Spend Authorization Signature (Sapling and Orchard) |
|---|
| 22 | +21 | Zcash Protocol Specification, Version 2022.3.8. Section 5.4.7.1: Spend Authorization Signature (Sapling and Orchard) |
|---|
| 23 | +22 | Zcash Protocol Specification, Version 2022.3.8. Section 5.6.4.2: Orchard Raw Payment Addresses |
|---|
| 24 | +23 | Zcash Protocol Specification, Version 2022.3.8. Section 7.1: Transaction Encoding and Consensus (Transaction Version 5) |
|---|