From dbce499baad84f4bd21f586ed06749a6ceaf90f3 Mon Sep 17 00:00:00 2001 From: daniben31 Date: Wed, 13 Jul 2022 23:52:34 +0300 Subject: [PATCH 001/101] initial ZIP drafts for transfer and issuance --- draft-ZIP-0226.html | 523 ++++++++++++++++++++++++++++++++++++++++++++ draft-ZIP-0226.rst | 303 +++++++++++++++++++++++++ draft-ZIP-0227.html | 218 ++++++++++++++++++ draft-ZIP-0227.rst | 184 ++++++++++++++++ 4 files changed, 1228 insertions(+) create mode 100644 draft-ZIP-0226.html create mode 100644 draft-ZIP-0226.rst create mode 100644 draft-ZIP-0227.html create mode 100644 draft-ZIP-0227.rst diff --git a/draft-ZIP-0226.html b/draft-ZIP-0226.html new file mode 100644 index 000000000..aca617ec7 --- /dev/null +++ b/draft-ZIP-0226.html @@ -0,0 +1,523 @@ + + + + Draft ZIP-0226: Transfer and Burn of Zcash Shielded Assets + + + + +
+
ZIP: 226
+Title: Transfer and Burn of Zcash Shielded Assets
+Owners: Daniel Benarroch <daniel@qed-it.com>
+        Pablo Kogan <pablo@qed-it.com>
+        Aurelien Nicolas <aurel@qed-it.com>
+Credits: Daira Hopwood
+         Jack Grigg
+         Shahaf Nacshon
+         Vivek Arte
+Status: Draft
+Category: Consensus
+Created: 2022-05-01
+License: MIT
+Discussions-To: <https://github.com/zcash/zips/issues/618>
+

Terminology

+

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.

+

We define the following additional terms:

+
    +
  • Asset: A type of note that can be transferred on the Zcash block chain. ZEC is the default (and currently the only defined) asset for the Zcash mainnet.
  • +
  • Zcash Shielded Asset: an asset with issuance defined on the Zcash block chain, and, for now, belonging to the Orchard anonymity pool.
  • +
  • Wrapped Asset: a ZSA asset with native issuance defined outside the Zcash block chain.
  • +
+
+

Abstract

+

ZIP 226 and ZIP 227 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 5. The transfer and burn of such assets is defined in ZIP 226 4.

+
+

Motivation

+

The current Orchard protocol does not support custom assets, which is an important aspect for the proper evolution of the Zcash ecosystem. Enabling multi-asset support on the Zcash chain will open the door for a host of applications and enhance the ecosystem with application developers and asset custody institutions for issuance and bridging purposes.

+
+

Overview

+

In order to be able to represent different asset types in Orchard, one needs to define a new data field that uniquely represents the type of the asset in question, which we call + \(\mathsf{type}\) + .

+

The type will be used to enforce the balance of an action description 6 is preserved across assets (see the Orchard Binding Signature 7 , and by extension of an Orchard transaction. Mainly, the sum of all the + \(\mathsf{value^{net}}\) + , as + \(\mathsf{value^{old}-value^{new}}\) + , derived from each action description, must be balanced only with respect to the same asset type. This is specially important since we will allow different action descriptions to transfer notes of different asset types, where the overall balance is checked without revealing which assets (or how many different types) are being transferred.

+

As was initially proposed by Jack Grigg and Daira Hopwood [#initial-zsa-issue]_, we propose to make this happen by changing the value base point, + \(\mathcal{V}^{\mathsf{Orchard}}\) + , in the Homomorphic Pedersen Commitment that generates the value commitment, + \(\mathsf{cv^{net}}\) + , of the net value in an Orchard Action.

+

Because in a single transaction all value commitments are balanced, there must be as many different value base points as there are asset types in the transaction. We propose to make the + \(\mathsf{type}\) + identifier an auxiliary input to the proof, represented already as a point in the Pallas curve. The circuit then should check that the same + \(\mathsf{type}\) + is used in the old note commitment, in the new note commitment and in the value commitment as the base point of the value. This ensures that (1) the input and output notes are of the same type, and (2) that only actions with the same asset type identifier will balance out in the binding and balance signature.

+

In order to ensure the security of the transfers, and as we will explain below, we are replacing input dummy notes for custom assets, as we need to enforce that the type of the output note of that split action is the output of a PRF.

+

Finally, in this ZIP we also describe the burn mechanism, which is a direct extension of the transfer mechanism. The burn process uses a similar mechanism than what is used in Orchard to unshield ZEC, by using the + \(\mathsf{valueBalance}\) + of the asset in question. Burning assets is useful for many purposes, including bridging of wrapped assets and removing supply of native assets.

+
+

Orchard Protocol Changes

+

Most of the protocol is kept the same as the Orchard protocol released with NU5, except the following that will be deployed to mainnet in subsequent network upgrades.

+

Asset Types

+

In the OSA protocol, we include a new variable, the asset type identifier, + \(\mathsf{type}\) + , which is generated as a 32-byte string during issuance (as described in the Issuance ZIP 5). The + \(\mathsf{type}\) + will then be publicly hashed into the corresponding group, in this case the Pallas curve, by using the + \(\mathsf{GroupHash}\) + function. In fact, every ZSA note will contain the group element representation of the asset type identifier. This will enable a much more elegant and simple version of the circuit, as we will see.

+

We denote the string as + \(\mathsf{type}\) + and we denote the equivalent group representation as + \(\mathsf{type}_{\mathbb{G}}\) + when mapped into a specific group, + \(\mathbb{G}\) + . Note that the type of the ZEC asset will be kept as the original value base-point, + \(\mathcal{V}^\mathsf{Orchard}\) +

+

In future network and protocol upgrades, the same asset type string can be carried on, with potentially a mapping into a different curve or group. In that case, the turnstile should know how to transform the asset type from one group to another one.

+
+

Note Structure & Commitment

+

First, we need to adapt the components that define the assets, i.e.: notes. A ZSA note differs from an Orchard note by including the type of asset, + \(\mathsf{type}_\mathbb{P}\) + . So an ZSA note looks like:

+

+ \((\mathsf{g_d, pk_d, v, \rho, \psi, type}_{\mathbb{P}})\) +

+

Where + \(\mathsf{type}_\mathbb{P}\) + is the unique random group element that identifies each asset in the Pallas curve 8, 9 of the Orchard protocol.

+

In this case, the note commitment, + \(\mathsf{NoteCommit^{ZSA}_{rcm}}\) + , will differ from + \(\mathsf{NoteCommit^{Orchard}_{rcm}}\) + in that for non-ZEC assets, the type will be added as an input to the commitment computation. As we will see, the recursive structure of the Sinsemilla-base commitment 10 allows us to add the type as a final recursive step, and hence keep a single instance of the hash function in the circuit for the note commitment verification.

+

Since the commitment output is still indistinguishable with the original Orchard ZEC note commitments, by definition of the Sinsemilla hash, ZSA note commitments will be added to the same Merkle Commitment Tree. In essence, we have

+

+ \(\mathsf{NoteCommit^{ZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, type_\mathbb{P})} \in \{\mathsf{cm},\bot\}\) +

+

The nullifier is generated in the same manner as in the Orchard protocol.

+
+

Value Commitment

+

The Orchard Protocol uses a Sinsemilla-based Homomorphic Pedersen Commitment 11 which is instantiated as

+

+ \(\mathsf{cv^{net}:=ValueCommit^{Orchard}_{rcv}(v^{net})}:= \mathsf{[v^{net}]}\mathcal{V}^{\mathsf{Orchard}}+[\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}}\) +

+

Where + \(\mathsf{v^{net} = v^{old} - v^{new}}\) + and

+

+ \(\mathcal{V}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}(\texttt{"z.cash:Orchard-cv", "v")}\) +

+

+ \(\mathcal{R}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}(\texttt{"z.cash:Orchard-cv", "r")}\) +

+

In the case of the Orchard protocol, we see that the base points + \(\mathcal{V}^{\mathsf{Orchard}}\) + and + \(\mathcal{R}^{\mathsf{Orchard}}\) + are fixed for every value commitment, as the values represent the amount of ZEC being transferred.

+

In the case of the ZSA protocol, the value of different asset types in a given transaction will be committed using a different value base point. This enables the final balance of the transaction to be securely computed, such that each asset type is balanced independently, as the assets are not meant to be fungible. The value commitment then becomes

+

+ \(\mathsf{cv^{net}:=ValueCommit^{ZSA}_{rcv}(v^{net}_{type},\mathcal{V}^{\mathsf{ZSA}}_{\mathsf{type}})}:= \mathsf{[v^{net}_{type}]}\mathcal{V}^{\mathsf{ZSA}}_{\mathsf{type}}+[\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}}\) +

+

where + \(\mathsf{v^{net}_{type}} = \mathsf{v^{old}_{type} - v^{new}_{type}}\) + such that + \(\mathsf{v^*_{type}}\) + is the value of the note of type + \(\mathsf{type}\) + , and

+

+ \(\mathcal{V}^{\mathsf{ZSA}}_{\mathsf{type}}:=\mathsf{type_\mathbb{P}}= \mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv",type\_params)}\) +

+

+ \(\mathcal{R}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv", "r")}\) +

+

Where + \(\mathcal{V}^{\mathsf{ZSA}}_{\mathsf{ZEC}} =\mathcal{V}^{\mathsf{Orchard}}\) + .

+
+

Value Balance Verification

+

In order to verify the balance of the different assets, verifier performs exactly the same the process as for the Orchard protocol 7. The main reason is because no custom assets can be unshielded, so all custom assets are contained within the shielded ZSA pool. This means that the net balance of the input and output values is zero, with only one type of value balance published, that of ZEC, + \(\mathsf{v^{balanceOrchard}}\) + , so no net amount of any type will be revealed, and neither the nnumber of types in the transaction. The only exception to this is in the case that an asset is burnt, as we will see below.

+

For a total of + \(m\) + actions in a transfer, the prover can still sign the SIGHASH of the transaction using the binding signature key

+

+ \(\mathsf{bsk} = \sum_{\mathsf{ \forall i\in \{1,...,m\}}} \mathsf{rcv_{i}}\) +

+

Then we have that the verifier computes

+

+ \(\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} = \sum \mathsf{rcv_{i}^{net}}\mathcal{R}^{\mathsf{Orchard}}\) +

+

And uses it to verify the binding signature, as described in §4.14 of the Zcash Specification 7, by verifying the bindingSignature on the SIGHASH message.

+

As in the Orchard protocol, the binding signature verification key, + \(\mathsf{bvk}\) + , will only be valid (and hence verify the signature correctly, as long as all the value commitments (and corresponding value balances) are equal to zero. In contrast, in this protocol, the value commitments only cancel out per asset type, as the Pedersen commitments add up homomorphically only with respect to the same value base point.

+
+

Split Notes

+

One of the key functionalities in a UTXO based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This is called a 1-to-many (Orchard) transaction. In order to cope with this today, the input note of the second (third and more) Action (which we call split notes and split Actions respectively) is a dummy spend note 12. Basically, the input note is “faked” inside of the proof in order to hide which action contains the real spend note.

+

This, however, brings some issues when it comes to adding multiple asset types, as the output note of the split Actions cannot be of any asset type, it must be enforced to be an actual output of a GroupHash computation (in fact we want it to be of the same type as the original input note, but the binding signature takes care that the proper balancing is performed). If not, then the prover could essentially input a multiple (or linear combination of) an existing type, with the goal to attack the network by overflowing the ZEC value balance and hence counterfeiting ZEC funds.

+

In order to prevent this, we make some modifications to the circuit. Specifically we remove the dummy note functionality for custom assets and we enforce that every input note to an ZSA Action must be proven to exist in the set of note commitments in the Merkle Tree. We then enforce this real note to be “unspendable” in the sense that its value will be zeroed in split Actions and the nullifier will be randomized, making the note not spendable in the specific Action. Then, the proof itself ensures that the output note is of the same type as the input note. In the circuit, the split note functionality will be activated by a boolean private input to the proof.

+

Note that this is enough to create a chain of induction that ensures that all output notes of a transfer are actual outputs of a GroupHash, preventing any malleability attacks, as they originate in the Issuance protocol, which is publicly verified. Furthermore, we do not care about whether the note is owned by the sender, or whether it was nullified before. Wallets and other clients have a choice to make to ensure the asset type is the preserved for the output note of a split Action, for the value balance verification:

+
    +
  1. The split input note could be the same note as the original (non-split) Action,
  2. +
  3. The split input note could be a different unspent note of the same type (note that the note will not actually be spent)
  4. +
  5. The split input note could be an already spent note of the same type (note that by zeroing the value in the circuit, we prevent double spending)
  6. +
+

The specific circuit changes are presented below.

+
+
+

Circuit Statement

+

The advantage of the design described above, with respect to the circuit statement, is that every ZSA Action statement is kept closely similar to the Orchard Action statement 13, except for a few additions that ensure the security of the asset type system.

+

Asset Type Equality: the following constraints must be added to ensure that the input and output note are of the same type:

+
    +
  • The asset type, + \(\mathsf{type_\mathbb{P}}\) + , for the note is witnessed once, as an auxiliary input.
  • +
  • The witnessed asset type, + \(\mathsf{type_\mathbb{P}}\) + , is added to the old note commitment input.
  • +
  • The witnessed asset type, + \(\mathsf{type_\mathbb{P}}\) + , is added to the new note commitment input.
  • +
+

Correct Value Commitment Type: the following constraints must be added to ensure that the value commitment is computed using the witnessed type, as represented in the notes

+
    +
  • The fixed-base multiplication constraints between the value and the value base point of the value commitment,:math:mathsf{cv}, is replaced with a variable-base multiplication between the two
  • +
  • The witness to the value base-point is the auxiliary input + \(\mathsf{type}_\mathbb{P}\) + .
  • +
+

Enforce Secure Type for Split Actions: the following constraints must be added to prevent senders from malling with the asset type for the output note in the consequent actions of the split:

+
    +
  • +
    +
    The Value Commitment Integrity should be changed
    +
    +
      +
    • Replace the input note value by a generic value, v', as + \(\mathsf{cv^net} = \mathsf{ValueCommit_rcv^OrchardType(v’ - v^new, type}_\mathbb{P})\) +
    • +
    +
    +
    +
  • +
  • +
    +
    Add a boolean “split” variable as an auxiliary witness. This variable is to be activated split = 1 if the Action in question is a split and split = 0 if the Action is actually spending an input note:
    +
    +
      +
    • If split = 1 then set v' = 0 otherwise v'=v^old from the auxiliary input
    • +
    +
    +
    +
  • +
  • +
    +
    The Merkle Path Validity should check the existance of the note commitment as usual (and not like with dummy notes):
    +
    +
      +
    • Check that (path, pos) is a valid Merkle path of depth + \(\mathsf{MerkleDepth^Orchard}\) + , from + \(\mathsf{cm^old}\) + to the anchor + \(\mathsf{rt^Orchard}\) + .
    • +
    +
    +
    +
  • +
  • +
    +
    The Nullifier Integrity will be changed to prevent the identification of notes
    +
    +
      +
    • Replace the + \(\psi_{old}\) + value with a generic + \(\psi'\) + as + \(\mathsf{nf_old = DeriveNullifier_nk}(\rho^\mathsf{old}, \psi', \mathsf{cm^old})\) +
    • +
    • if split = 1 set + \(\psi' = \mathsf{randomSample}\) + , otherwise set + \(\psi' = \psi^{old}\) +
    • +
    +
    +
    +
  • +
+

Enabling Backwards Compatibility with ZEC Notes: the following constraints must be added to enable backwards compatibility with the Orchard ZEC notes.

+

The old note commitment is computed using a “rolling-aggregate” sinsemilla commitment. This means that the commitment is computed by adding new chunks or windows to the accumulated value. This method will be used in order to maintain a single commitment instance for the old note commitment, that will be used both for Orchard ZEC notes and for ZSA notes. The original Orchard ZEC notes will be conserved and not actually be converted into ZSA notes, as we will always need to compute them.

+
    +
  • +
    +
    The input note in the old note commitment integrity must either include a type (ZSA note) or not (ZEC-Orchard note)
    +
    +
      +
    • +
      +
      If the type auxiliary input is set + \(\mathsf{type}_\mathbb{P}\) + = + \(\mathcal{V}^\mathsf{Orchard}\) +
      +
      +
        +
      • NoteCommitment has a “compatibility” path that computes the note commitment as in plain Orchard (i.e.: without including the type)
      • +
      • This path also uses the original domain separator for ZEC note commitment
      • +
      +
      +
      +
    • +
    • +
      +
      Else,
      +
      +
        +
      • The NoteCommitment adds the type, + \(\mathsf{type}_\mathbb{P}\) + , as a final “chunk” of the Sinsemilla commitment
      • +
      • The NoteCommitment uses a different domain separator for ZSA note commitment
      • +
      +
      +
      +
    • +
    +
    +
    +
  • +
+

Backward Compatibility

+

In order to have a "clean" backwards compatibility with the ZEC notes, we have designed the circuit to support both ZEC and ZSA notes. As we specify above, there are three main reasons we can do this: - The input notes with a type denote the ZSA custom assets, generating a note commitment that includes the type; whereas the notes without a type, denote the ZEC notes, and generate a note commitment that does not include the type, in order to maintain the referencability to the Merkle tree - The value commitment is abstracted to allow for the value base-point as a variable private input to the proof - The ZEC-based actions will still include dummy input notes, whereas the ZSA-based actions will include split input notes

+
+
+

Burn Mechanism

+

The burn mechanism may be needed for off-boarding the wrapped assets from the chain, or enabling advanced tokenomics on native tokens. It is part of the Issuance/Burn protocol, but given that it can be seen as an extension of the Transfer protocol, we add it here for readability.

+

In essence, the burn mechanism is a transparent / revealing extension to the transfer protocol that enables a specific amount of any asset type to be sent into “oblivion”. Our burn mechanism does NOT send assets to a non-spendable address, it simply reduces the total number of assets in circulation at the consensus level. It is enforced at the consensus level, by using an extension of the value balance mechanism used for ZEC assets.

+

First, contrary to the strict transfer transaction, we allow the sender to include a + \(\mathsf{valueBalvalueBalance_{type}}\) + variable for every asset type that is being burnt. As we will show in the transaction structure, this is separate from the regular + \(\mathsf{valueBalance^Orchard}\) + that is the default transparent value for the ZEC asset.

+

For every custom asset that is burnt, we add to the assetBurn vector the tuple + \((\mathsf{valueBalance_{type}, type}_\mathbb{P})\) + such that the validator of the transaction can compute the value commitment with the corresponding value base point of that asset. This ensures that the values are all balanced out with respect to the asset types in the transfer.

+

+ \(\mathsf{assetBurn = [(v^{type}, type_\mathbb{P})}| \forall \mathsf{type}_\mathbb{P} \textit{ s.t.}\mathsf{v^{type}\neq 0}]\) +

+

The value balances for each asset type in assetBurn represents the amount of that asset type that is being burnt. In the case of ZEC, the value balance represents either the transaction fee, or the amount of ZEC changing anonymity pools (to Sapling or Transparent).

+

Finally, the validator needs to verify the Balance and Binding Signature by adding the value balances for all assets, as committed using their respective types as the value base point of the Pedersen Commitment. This is done as follows

+

+ \(\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} - \sum_{\forall \mathsf{type}\textit{ s.t. }\mathsf{v^{type}\neq 0}} \mathsf{Value Commit_0^{ZSA}(v^{type}type_\mathbb{P}) } = \sum \mathsf{rcv_{i,j}^{net}}\mathcal{R}^{\mathsf{Orchard}}\) +

+

In the case that the balance of all the action values related to a specific asset will be zero, there will be no value added to the vector. This way, the number of assets, nor their types will be revealed, except in the case that an asset is burnt.

+

Note: Even if this mechanism allows having transparent ↔ shielded asset transfers in theory, the transparent protocol will not be changed with this ZIP to adapt to a multiple asset structure. This means that unless future consensus rules changes do allow it, the unshielding is not not be possible for custom assets.

+
+

ZSA Transaction Structure

+

Similar to NU5 transaction structure, with the following modifications to the Orchard bundle, as defined in 14:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BytesNameData TypeDescription
newActionSize * nActionsZSAvActionsZSAActionDescription[nActionOrchard]
variesnAssetBurncompactSizenumber of assets burnt
40*nAssetBurnvAssetBurnbytes[40][nAssetBurn]32 bytes asset type_t, 8 bytes of valueBalance
+
+

Other Considerations

+

Transaction Fees

+

In order to maintain the ZEC economic incentive, the first version of the fees mechanism will be exactly the same as the current Orchard protocol and will always be paid in ZEC denomination. The ECC and GMU team produced a study on fees market on Zcash 15

+
+

Security and Privacy

+
    +
  • Even if the Orchard protocol and ZSA protocol do not share the same anonymity pool (nodes can keep track of the notes that where published with different transaction structures), the migration from one to the other is done automatically and seamlessly. The Orchard bundle will be replaced by the ZSA bundle and all ZEC notes will be fully spendable with the new transaction structure.
  • +
  • When including new assets we would like to maintain the amount and types of assets private, which is achieved with the design
  • +
  • We prevent the "roadblock" attack on the asset type by ensuring the output notes receive a type of an asset that exists on the global state
  • +
+
+
+

Test Vectors

+
    +
  • LINK TBD
  • +
+
+

Reference Implementation

+
    +
  • LINK TBD
  • +
  • LINK TBD
  • +
+
+

Deployment

+

This ZIP is proposed to activate with Network Upgrade 6.

+
+

References

+ + + + + + + +
1RFC 2119: Key words for use in RFCs to Indicate Requirement Levels
+ + + + + + + +
2ZIP 200: Network Upgrade Mechanism
+ + + + + + + +
3ZIP 224: Orchard
+ + + + + + + +
4ZIP 226: Transfer and Burn of Zcash Shielded Assets
+ + + + + + + +
5ZIP 227: Issuance of Zcash Shielded Assets
+ + + + + + + +
6Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 3.7: Action Transfers and their Descriptions
+ + + + + + + +
7Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.14: Balance and Binding Signature (Orchard)
+ + + + + + + +
8Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.9.6: Pallas and Vesta
+ + + + + + + +
9Pallas/Vesta supporting evidence
+ + + + + + + +
10Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.8.4: Sinsemilla commitments
+ + + + + + + +
11Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.8.3: Homomorphic Pedersen commitments (Sapling and Orchard)
+ + + + + + + +
12Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.8.3: Dummy Notes (Orchard)
+ + + + + + + +
13Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.17.4: Action Statement (Orchard)
+ + + + + + + +
14Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 7.1: Transaction Encoding and Consensus (Transaction Version 5)
+ + + + + + + +
15A Study of Decentralized Markets on the Zcash Blockchain
+
+
+
+

Docutils System Messages

+
+

System Message: ERROR/3 (draft-ZIP-0226.rst line 52)

+

Too many autonumbered footnote references: only 0 corresponding footnotes available.

+
+
+

System Message: ERROR/3 (draft-ZIP-0226.rst line 52) id8

+

Unknown target name: "initial-zsa-issue".

+
+
+ + \ No newline at end of file diff --git a/draft-ZIP-0226.rst b/draft-ZIP-0226.rst new file mode 100644 index 000000000..d2c46cc73 --- /dev/null +++ b/draft-ZIP-0226.rst @@ -0,0 +1,303 @@ +:: + + ZIP: 226 + Title: Transfer and Burn of Zcash Shielded Assets + Owners: Daniel Benarroch + Pablo Kogan + Aurelien Nicolas + Credits: Daira Hopwood + Jack Grigg + Shahaf Nacshon + Vivek Arte + Status: Draft + Category: Consensus + Created: 2022-05-01 + License: MIT + Discussions-To: + + +Terminology +=========== + +The key word "MUST" in this document is to be interpreted as described in RFC 2119 [#RFC2119]_. + +The term "network upgrade" in this document is to be interpreted as described in ZIP 200 [#zip-0200]_. + +The term "Orchard" in this document is to be interpreted as described in ZIP 224 [#zip-0224]_. + +We define the following additional terms: + +- Asset: A type of note that can be transferred on the Zcash block chain. ZEC is the default (and currently the only defined) asset for the Zcash mainnet. +- Zcash Shielded Asset: an asset with issuance defined on the Zcash block chain, and, for now, belonging to the Orchard anonymity pool. +- Wrapped Asset: a ZSA asset with native issuance defined outside the Zcash block chain. + +Abstract +======== + +ZIP 226 and ZIP 227 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 [#zip-0227]_. The transfer and burn of such assets is defined in ZIP 226 [#zip-0226]_. + +Motivation +========== + +The current Orchard protocol does not support custom assets, which is an important aspect for the proper evolution of the Zcash ecosystem. Enabling multi-asset support on the Zcash chain will open the door for a host of applications and enhance the ecosystem with application developers and asset custody institutions for issuance and bridging purposes. + +Overview +======== +In order to be able to represent different asset types in Orchard, one needs to define a new data field that uniquely represents the *type* of the asset in question, which we call :math:`\mathsf{type}`. + +The type will be used to enforce the balance of an action description [#protocol-actions]_ is preserved across assets (see the Orchard Binding Signature [#protocol-binding]_ , and by extension of an Orchard transaction. Mainly, the sum of all the :math:`\mathsf{value^{net}}`, as :math:`\mathsf{value^{old}-value^{new}}`, derived from each action description, must be balanced only **with respect to the same asset type**. This is specially important since we will allow different action descriptions to transfer notes of different asset types, where the overall balance is checked without revealing which assets (or how many different types) are being transferred. + +As was initially proposed by Jack Grigg and Daira Hopwood [#initial-zsa-issue]_, we propose to make this happen by changing the value base point, :math:`\mathcal{V}^{\mathsf{Orchard}}`, in the Homomorphic Pedersen Commitment that generates the value commitment, :math:`\mathsf{cv^{net}}`, of the *net value* in an Orchard Action. + +Because in a single transaction all value commitments are balanced, there must be as many different value base points as there are asset types in the transaction. We propose to make the :math:`\mathsf{type}` identifier an auxiliary input to the proof, represented already as a point in the Pallas curve. The circuit then should check that the same :math:`\mathsf{type}` is used in the old note commitment, in the new note commitment **and** in the value commitment as the base point of the value. This ensures that (1) the input and output notes are of the same type, and (2) that only actions with the same asset type identifier will balance out in the binding and balance signature. + +In order to ensure the security of the transfers, and as we will explain below, we are replacing input dummy notes for custom assets, as we need to enforce that the type of the output note of that split action is the output of a PRF. + +Finally, in this ZIP we also describe the *burn* mechanism, which is a direct extension of the transfer mechanism. The burn process uses a similar mechanism than what is used in Orchard to unshield ZEC, by using the :math:`\mathsf{valueBalance}` of the asset in question. Burning assets is useful for many purposes, including bridging of wrapped assets and removing supply of native assets. + +Orchard Protocol Changes +======================== + +Most of the protocol is kept the same as the Orchard protocol released with NU5, except the following that will be deployed to mainnet in subsequent network upgrades. + +Asset Types +----------- + +In the OSA protocol, we include a new variable, the asset type identifier, :math:`\mathsf{type}`, which is generated as a 32-byte string during issuance (as described in the Issuance ZIP [#zip-0227]_). The :math:`\mathsf{type}` will then be publicly hashed into the corresponding group, in this case the Pallas curve, by using the :math:`\mathsf{GroupHash}` +function. In fact, every ZSA note will contain the group element representation of the asset type identifier. This will enable a much more elegant and simple version of the circuit, as we will see. + +We denote the string as :math:`\mathsf{type}` and we denote the equivalent group representation as :math:`\mathsf{type}_{\mathbb{G}}` when mapped into a specific group, :math:`\mathbb{G}`. Note that the type of the ZEC asset will be kept as the original value base-point, :math:`\mathcal{V}^\mathsf{Orchard}` + +In future network and protocol upgrades, the same asset type string can be carried on, with potentially a mapping into a different curve or group. In that case, the turnstile should know how to transform the asset type from one group to another one. + +Note Structure & Commitment +--------------------------- + +First, we need to adapt the components that define the assets, i.e.: *notes*. A ZSA note differs from an Orchard note by including the type of asset, :math:`\mathsf{type}_\mathbb{P}`. So an ZSA note looks like: + + +:math:`(\mathsf{g_d, pk_d, v, \rho, \psi, type}_{\mathbb{P}})` + + +Where :math:`\mathsf{type}_\mathbb{P}` is the unique random group element that identifies each asset in the Pallas curve [#protocol-pallasandvesta]_, [#pasta-evidence]_ of the Orchard protocol. + +In this case, the note commitment, :math:`\mathsf{NoteCommit^{ZSA}_{rcm}}`, will differ from :math:`\mathsf{NoteCommit^{Orchard}_{rcm}}` in that for non-ZEC assets, the type will be added as an input to the commitment computation. As we will see, the recursive structure of the Sinsemilla-base commitment [#protocol-concretesinsemillacommit]_ allows us to add the type as a final recursive step, and hence keep a single instance of the hash function in the circuit for the note commitment verification. + +Since the commitment output is still indistinguishable with the original Orchard ZEC note commitments, by definition of the Sinsemilla hash, ZSA note commitments will be added to the same Merkle Commitment Tree. In essence, we have + + +:math:`\mathsf{NoteCommit^{ZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, type_\mathbb{P})} \in \{\mathsf{cm},\bot\}` + + +The nullifier is generated in the same manner as in the Orchard protocol. + +Value Commitment +---------------- + +The Orchard Protocol uses a Sinsemilla-based Homomorphic Pedersen Commitment [#protocol-concretevaluecommit]_ which is instantiated as + +:math:`\mathsf{cv^{net}:=ValueCommit^{Orchard}_{rcv}(v^{net})}:= \mathsf{[v^{net}]}\mathcal{V}^{\mathsf{Orchard}}+[\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}}` + +Where :math:`\mathsf{v^{net} = v^{old} - v^{new}}` and + +:math:`\mathcal{V}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}(\texttt{"z.cash:Orchard-cv", "v")}` + +:math:`\mathcal{R}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}(\texttt{"z.cash:Orchard-cv", "r")}` + +In the case of the Orchard protocol, we see that the base points :math:`\mathcal{V}^{\mathsf{Orchard}}` and +:math:`\mathcal{R}^{\mathsf{Orchard}}` are fixed for every value commitment, as the values represent the amount of ZEC +being transferred. + +In the case of the ZSA protocol, the value of different asset types in a given transaction will be committed using a **different value base point**. This enables the final balance of the transaction to be securely computed, such that each asset type is balanced independently, as the assets are not meant to be fungible. The value commitment then becomes + + +:math:`\mathsf{cv^{net}:=ValueCommit^{ZSA}_{rcv}(v^{net}_{type},\mathcal{V}^{\mathsf{ZSA}}_{\mathsf{type}})}:= \mathsf{[v^{net}_{type}]}\mathcal{V}^{\mathsf{ZSA}}_{\mathsf{type}}+[\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}}` + + +where :math:`\mathsf{v^{net}_{type}} = \mathsf{v^{old}_{type} - v^{new}_{type}}` such that :math:`\mathsf{v^*_{type}}` is the value of the note of type :math:`\mathsf{type}`, and + + +:math:`\mathcal{V}^{\mathsf{ZSA}}_{\mathsf{type}}:=\mathsf{type_\mathbb{P}}= \mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv",type\_params)}` + +:math:`\mathcal{R}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv", "r")}` + +Where :math:`\mathcal{V}^{\mathsf{ZSA}}_{\mathsf{ZEC}} =\mathcal{V}^{\mathsf{Orchard}}`. + +Value Balance Verification +-------------------------- + +In order to verify the balance of the different assets, verifier performs exactly the same the process as for the Orchard protocol [#protocol-binding]_. The main reason is because no custom assets can be unshielded, so all custom assets are contained within the shielded ZSA pool. This means that the net balance of the input and output values is zero, with only one type of value balance published, that of ZEC, :math:`\mathsf{v^{balanceOrchard}}`, so no net amount of any type will be revealed, and neither the nnumber of types in the transaction. The only exception to this is in the case that an asset is *burnt*, as we will see below. + +For a total of :math:`m` actions in a transfer, the prover can still sign the `SIGHASH` of the transaction using the binding signature key + +:math:`\mathsf{bsk} = \sum_{\mathsf{ \forall i\in \{1,...,m\}}} \mathsf{rcv_{i}}` + +Then we have that the verifier computes + +:math:`\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} = \sum \mathsf{rcv_{i}^{net}}\mathcal{R}^{\mathsf{Orchard}}` + + +And uses it to verify the binding signature, as described in §4.14 of the Zcash Specification [#protocol-binding]_, by verifying the `bindingSignature` on the `SIGHASH` message. + +As in the Orchard protocol, the binding signature verification key, :math:`\mathsf{bvk}`, will only be valid (and hence verify the signature correctly, as long as all the value commitments (and corresponding value balances) are equal to zero. In contrast, in this protocol, the value commitments only cancel out **per asset type**, as the Pedersen commitments add up homomorphically only with respect to the same value base point. + +Split Notes +----------- + +One of the key functionalities in a UTXO based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This is called a 1-to-many (Orchard) transaction. In order to cope with this today, the input note of the second (third and more) Action (which we call split notes and split Actions respectively) is a *dummy spend note* [#protocol-dummynotes]_. Basically, the input note is “faked” inside of the proof in order to hide which action contains the *real* spend note. + +This, however, brings some issues when it comes to adding multiple asset types, as the output note of the split Actions *cannot* be of *any* asset type, it must be enforced to be an actual output of a GroupHash computation (in fact we want it to be of the same type as the original input note, but the binding signature takes care that the proper balancing is performed). If not, then the prover could essentially input a multiple (or linear combination of) an existing type, with the goal to attack the network by overflowing the ZEC value balance and hence counterfeiting ZEC funds. + +In order to prevent this, we make some modifications to the circuit. Specifically we remove the dummy note functionality for custom assets and we enforce that *every* input note to an ZSA Action must be proven to exist in the set of note commitments in the Merkle Tree. We then enforce this real note to be “unspendable” in the sense that its value +will be zeroed in split Actions and the nullifier will be randomized, making the note not spendable in the specific Action. Then, the proof itself ensures that the output note is of the same type as the input note. In the circuit, the split note functionality will be activated by a boolean private input to the proof. + +Note that this is enough to create a chain of induction that ensures that all output notes of a transfer are actual outputs of a GroupHash, preventing any malleability attacks, as they originate in the Issuance protocol, which is publicly verified. Furthermore, we do not care about whether the note is owned by the sender, or whether it was nullified before. Wallets and other clients have a choice to make to ensure the asset type is the preserved for the output note of a split Action, for the value balance verification: + +1. The split input note could be the same note as the original (non-split) Action, +2. The split input note could be a different unspent note of the same type (note that the note will not actually be spent) +3. The split input note could be an already spent note of the same type (note that by zeroing the value in the circuit, we prevent double spending) + +The specific circuit changes are presented below. + +Circuit Statement +================= + +The advantage of the design described above, with respect to the circuit statement, is that every *ZSA Action statement* is kept closely similar to the Orchard Action statement [#protocol-actionstatement]_, except for a few additions that ensure the security of the asset type system. + +**Asset Type Equality:** the following constraints must be added to ensure that the input and output note are of the +same type: + +- The asset type, :math:`\mathsf{type_\mathbb{P}}`, for the note is witnessed once, as an auxiliary input. +- The witnessed asset type, :math:`\mathsf{type_\mathbb{P}}`, is added to the old note commitment input. +- The witnessed asset type, :math:`\mathsf{type_\mathbb{P}}`, is added to the new note commitment input. + +**Correct Value Commitment Type:** the following constraints must be added to ensure that the value commitment is computed using the witnessed type, as represented in the notes + +- The fixed-base multiplication constraints between the value and the value base point of the value commitment,:math:`\mathsf{cv}`, is replaced with a variable-base multiplication between the two +- The witness to the value base-point is the auxiliary input :math:`\mathsf{type}_\mathbb{P}`. + +**Enforce Secure Type for Split Actions:** the following constraints must be added to prevent senders from malling with the asset type for the output note in the consequent actions of the split: + +- The Value Commitment Integrity should be changed + - Replace the input note value by a generic value, `v'`, as :math:`\mathsf{cv^net} = \mathsf{ValueCommit_rcv^OrchardType(v’ - v^new, type}_\mathbb{P})` +- Add a boolean “split” variable as an auxiliary witness. This variable is to be activated `split = 1` if the Action in question is a split and `split = 0` if the Action is actually spending an input note: + - If `split = 1` then set `v' = 0` otherwise `v'=v^old` from the auxiliary input +- The Merkle Path Validity should check the existance of the note commitment as usual (and not like with dummy notes): + - Check that (path, pos) is a valid Merkle path of depth :math:`\mathsf{MerkleDepth^Orchard}`, from :math:`\mathsf{cm^old}` to the anchor :math:`\mathsf{rt^Orchard}`. +- The Nullifier Integrity will be changed to prevent the identification of notes + - Replace the :math:`\psi_{old}` value with a generic :math:`\psi'` as :math:`\mathsf{nf_old = DeriveNullifier_nk}(\rho^\mathsf{old}, \psi', \mathsf{cm^old})` + - if `split = 1` set :math:`\psi' = \mathsf{randomSample}`, otherwise set :math:`\psi' = \psi^{old}` + +**Enabling Backwards Compatibility with ZEC Notes:** the following constraints must be added to enable backwards compatibility with the Orchard ZEC notes. + +The old note commitment is computed using a “rolling-aggregate” sinsemilla commitment. This means that the commitment is computed by adding new chunks or windows to the accumulated value. This method will be used in order to maintain a single commitment instance for the old note commitment, that will be used both for Orchard ZEC notes and for ZSA notes. The original Orchard ZEC notes will be conserved and not actually be converted into ZSA notes, as we will always need to compute them. + +- The input note in the old note commitment integrity must either include a type (ZSA note) or not (ZEC-Orchard note) + - If the type auxiliary input is set :math:`\mathsf{type}_\mathbb{P}` = :math:`\mathcal{V}^\mathsf{Orchard}` + - NoteCommitment has a “compatibility” path that computes the note commitment as in plain Orchard (i.e.: without including the type) + - This path also uses the original domain separator for ZEC note commitment + - Else, + - The NoteCommitment adds the type, :math:`\mathsf{type}_\mathbb{P}`, as a final “chunk” of the Sinsemilla commitment + - The NoteCommitment uses a different domain separator for ZSA note commitment + + +Backward Compatibility +---------------------- + +In order to have a "clean" backwards compatibility with the ZEC notes, we have designed the circuit to support both ZEC and ZSA notes. As we specify above, there are three main reasons we can do this: +- The input notes with a type denote the ZSA custom assets, generating a note commitment that includes the type; whereas the notes without a type, denote the ZEC notes, and generate a note commitment that does not include the type, in order to maintain the referencability to the Merkle tree +- The value commitment is abstracted to allow for the value base-point as a variable private input to the proof +- The ZEC-based actions will still include dummy input notes, whereas the ZSA-based actions will include split input notes + +Burn Mechanism +============== +The burn mechanism may be needed for off-boarding the wrapped assets from the chain, or enabling advanced tokenomics on native tokens. It is part of the Issuance/Burn protocol, but given that it can be seen as an extension of the Transfer protocol, we add it here for readability. + +In essence, the burn mechanism is a transparent / revealing extension to the transfer protocol that enables a specific amount of any asset type to be sent into “oblivion”. Our burn mechanism does NOT send assets to a non-spendable address, it simply reduces the total number of assets in circulation at the consensus level. It is enforced at the consensus level, by using an extension of the value balance mechanism used for ZEC assets. + +First, contrary to the strict transfer transaction, we allow the sender to include a :math:`\mathsf{valueBalvalueBalance_{type}}` variable for every asset type that is being burnt. As we will show in the transaction structure, this is separate from the regular :math:`\mathsf{valueBalance^Orchard}` that is the default transparent value for the ZEC asset. + +For every custom asset that is burnt, we add to the `assetBurn` vector the tuple :math:`(\mathsf{valueBalance_{type}, type}_\mathbb{P})` such that the validator of the transaction can compute the value commitment with the corresponding value base point of that asset. This ensures that the values are all balanced out with respect to the asset types in the transfer. + + +:math:`\mathsf{assetBurn = [(v^{type}, type_\mathbb{P})}| \forall \mathsf{type}_\mathbb{P} \textit{ s.t.}\mathsf{v^{type}\neq 0}]` + +The value balances for each asset type in `assetBurn` represents the amount of that asset type that is being burnt. In the case of ZEC, the value balance represents either the transaction fee, or the amount of ZEC changing anonymity pools (to Sapling or Transparent). + +Finally, the validator needs to verify the Balance and Binding Signature by adding the value balances for all assets, as committed using their respective types as the value base point of the Pedersen Commitment. This is done as follows + +:math:`\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} - \sum_{\forall \mathsf{type}\textit{ s.t. }\mathsf{v^{type}\neq 0}} \mathsf{Value Commit_0^{ZSA}(v^{type}type_\mathbb{P}) } = \sum \mathsf{rcv_{i,j}^{net}}\mathcal{R}^{\mathsf{Orchard}}` + +In the case that the balance of all the action values related to a specific asset will be zero, there will be no value added to the vector. This way, the number of assets, nor their types will be revealed, except in the case that an asset is burnt. + +**Note:** Even if this mechanism allows having transparent ↔  shielded asset transfers in theory, the transparent protocol will not be changed with this ZIP to adapt to a multiple asset structure. This means that unless future consensus rules changes do allow it, the unshielding is not not be possible for custom assets. + +ZSA Transaction Structure +========================= +Similar to NU5 transaction structure, with the following modifications to the Orchard bundle, as defined in [#protocol-transactionstructure]_: + ++-----------------+-------------+-----------------------------------+-------------------------+ +| Bytes | Name | Data Type | Description | ++=================+=============+===================================+=========================+ +| newActionSize * | vActionsZSA | ActionDescription[nActionOrchard] | | +| nActionsZSA | | | | ++-----------------+-------------+-----------------------------------+-------------------------+ +| varies | nAssetBurn | compactSize | number of assets burnt | ++-----------------+-------------+-----------------------------------+-------------------------+ +| 40*nAssetBurn | vAssetBurn | bytes[40][nAssetBurn] | 32 bytes asset type_t, | +| | | | 8 bytes of valueBalance | ++-----------------+-------------+-----------------------------------+-------------------------+ + +Other Considerations +==================== + +Transaction Fees +---------------- + +In order to maintain the ZEC economic incentive, the first version of the fees mechanism will be exactly the same as +the current Orchard protocol and will always be paid in ZEC denomination. The ECC and GMU team produced a study on +fees market on Zcash [#fees-study-GMU]_ + +Security and Privacy +-------------------- + +- Even if the Orchard protocol and ZSA protocol do not share the same anonymity pool (nodes can keep track of the notes that where published with different transaction structures), the migration from one to the other is done automatically and seamlessly. The Orchard bundle will be replaced by the ZSA bundle and all ZEC notes will be fully spendable with the new transaction structure. +- When including new assets we would like to maintain the amount and types of assets private, which is achieved with the design +- We prevent the "roadblock" attack on the asset type by ensuring the output notes receive a type of an asset that exists on the global state + +Test Vectors +============ + +- LINK TBD + +Reference Implementation +======================== + +- LINK TBD +- LINK TBD + +Deployment +========== + +This ZIP is proposed to activate with Network Upgrade 6. + +References +========== + +.. [#RFC2119] `RFC 2119: Key words for use in RFCs to Indicate Requirement Levels `_ +.. [#zip-0200] `ZIP 200: Network Upgrade Mechanism `_ +.. [#zip-0224] `ZIP 224: Orchard `_ +.. [#zip-0226] `ZIP 226: Transfer and Burn of Zcash Shielded Assets `_ +.. [#zip-0227] `ZIP 227: Issuance of Zcash Shielded Assets `_ +.. [#protocol-actions] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 3.7: Action Transfers and their Descriptions `_ +.. [#protocol-binding] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.14: Balance and Binding Signature (Orchard) `_ +.. [#protocol-pallasandvesta] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.9.6: Pallas and Vesta `_ +.. [#pasta-evidence] `Pallas/Vesta supporting evidence `_ +.. [#protocol-concretesinsemillacommit] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.8.4: Sinsemilla commitments `_ +.. [#protocol-concretevaluecommit] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.8.3: Homomorphic Pedersen commitments (Sapling and Orchard) `_ +.. [#protocol-dummynotes] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.8.3: Dummy Notes (Orchard) `_ +.. [#protocol-actionstatement] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.17.4: Action Statement (Orchard) `_ +.. [#protocol-transactionstructure] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 7.1: Transaction Encoding and Consensus (Transaction Version 5) `_ +.. [#fees-study-GMU] `A Study of Decentralized Markets on the Zcash Blockchain `_ diff --git a/draft-ZIP-0227.html b/draft-ZIP-0227.html new file mode 100644 index 000000000..8acd51d27 --- /dev/null +++ b/draft-ZIP-0227.html @@ -0,0 +1,218 @@ + + + + Draft ZIP-0227: Issuance of Zcash Shielded Assets + + + + +
+
ZIP: 227
+Title: Issuance of Zcash Shielded Assets
+Owners: Daniel Benarroch <daniel@qed-it.com>
+        Pablo Kogan <pablo@qed-it.com>
+        Aurelien Nicolas <aurel@qed-it.com>
+Credits: Daira Hopwood
+         Jack Grigg
+         Shahaf Nacshon
+         Vivek Arte
+Status: Draft
+Category: Consensus
+Created: 2022-05-01
+License: MIT
+Discussions-To: <https://github.com/zcash/zips/issues/618>
+

Terminology

+

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.

+

We define the following additional terms:

+
    +
  • Asset: A type of note that can be transferred on the Zcash block chain. ZEC is the default (and currently the only defined) asset for the Zcash mainnet.
  • +
  • Zcash Shielded Asset: an asset with issuance defined on the Zcash block chain, and, for now, belonging to the Orchard anonymity pool.
  • +
  • Wrapped Asset: a ZSA asset with native issuance defined outside the Zcash block chain.
  • +
+
+

Abstract

+

ZIP 226 4 and ZIP 227 5 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 5. The transfer and burn of such assets is defined in ZIP 226 4.

+
+

Motivation

+

The current Orchard protocol does not support custom assets, which is an important aspect for the proper evolution of the Zcash ecosystem. Enabling multi-asset support on the Zcash chain will open the door for a host of applications and enhance the ecosystem with application developers and asset custody institutions for issuance and bridging purposes.

+
+

Overview & Rationale

+

This ZIP specifies the issuance mechanism of the Zcash Shielded Assets (ZSA) protocol and must work conjunction with ZIP 226 4, as the issuance mechanism is only valid for the ZSA transfer protocol, as it produces notes that can only be transferred under ZSA.

+

In short, we are going to enable only transparent issuance, since we believe that as a first step, transparency is important to properly test the applications that will be most used in the Zcash ecosystem, while enabling tracking of supply of assets. In essence, any user of the blockchain can issue new asset types, yet only a single issuer (a set of keys) can issue that specific asset type, as the asset identifiers are tied to the issuer keys.

+

We have designed the protocol such that at the time of issuance, the issuer can already allocate all the tokens to the corresponding owners by creating the corresponding (shielded) output notes to the corresponding addresses. As is implied, the issuance mechanism is itself transparent, but the allocation is totally private. Furthermore, in a single issuance transaction, the issuer can create multiple asset types (and allocate all of those too). Finally, a key component of our design is the finiteIssuance boolean that defines whether a specific asset type can have more tokens issued or not.

+

The issuance mechanism is broad enough for issuers to either create native 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. In fact, the protocol described below enables, what we hope will be a useful set of, applications:

+
    +
  • By setting the finiteIssuance = 1 from the first issuance instance of that asset type, 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.
  • +
  • When the finiteIssuance = 0, the issuer can keep creating tokens of that type (in a transparent manner). The boolean value can be changed with any new issuance transaction, and could be set to 1 either when the issuer keys have been compromised, and hence stopping all issuances of that asset type (the boolean cannot be reversed), or whenever the issuer decides that the max supply has been reached.
  • +
  • Note that this mechanism can be used with the burning process to control and affect the supply of any custom asset.
  • +
+
+

Asset Identifier Generation

+

For every new asset, there must be a new and unique identifier of the asset. Our design decision is not to have a chosen name for the asset type, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”. From this asset identifier, which is a global byte string (valid across all Zcash protocols), we derive the specific type used within the notes, as defined by the specific protocol (e.g.: for now Orchard-style, using Pallas curve)

+

The main requirement for the asset identifier is for it to be collision-free, as two different issuers should not be able to issue the same asset type. As such we need the asset identifier to be:

+
    +
  • pseudorandom
  • +
  • deterministic
  • +
  • dependent on the issuer ID
  • +
+

We define the asset identifier assetID (represented as a string) as

+

+ \(\mathsf{assetID := GroupHash^{\mathbb{P}}}\mathsf{(issuerID || assetDesc)}\) +

+

where

+
    +
  • assetDesc is the asset description, which includes any information pertaining to the issuance.
  • +
  • issuerID is the public key of the issuer, used to verify the signature on the transaction and is defined as ik (issuer key or issuer verification key):
  • +
+

+ \(\mathsf{ik := SpendAuthSig^{Orchard}.DerivePublic(isk)}\) +

+

which uses the same signature as the spend authorization signature, where isk is the issuer secret key. The verification key is derived from isk. In order to differentiate the isk and ik keys from the actual spend authorization key, we derive another branch of keys from the main spending key sk as such:

+

+ \(\mathsf{isk := ToScalar^{Orchard}(︀ PRF^{expand}_{sk} ([10])}\) +

+

This allows the issuer to use the same wallet it usually uses to transfer assets, while keeping a disconnect from the other keys. 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 in the wallet safe.

+

Then we let issuanceInfo := (assetID, finiteSupply), where

+
    +
  • assetID is as defined above.
  • +
  • +
    +
    finiteSupply is a boolean variable that defines whether this issuance transaction of the specific asset type is the final issuance of tokens or not. Once finiteSupply is set, it cannot be unset. This allows expanding the functionality of the issuance mechanism:
    +
    +
      +
    • Provides assetID revocation in case of compromise (issue last issuance with 0 token value)
    • +
    • Supports NFT issuance (where the first issuance with value of 1 is also the last)
    • +
    +
    +
    +
  • +
+
+

Issuance Protocol

+

The issuance protocol allows for a single issuance to be sent to many receivers, as the issuerID does not have to match the address ownership of the notes output. Furthermore, every transaction can contain many issuance instances. The design presented in this ZIP enables several use cases for issuance of shielded assets.

+
    +
  • The issuer knows in advance the receivers of the issued asset.
  • +
  • The asset is of non-fungible type, where each asset type can be made part of a single “series”
  • +
  • The supply of the asset is limited or not
  • +
  • The assets can be wrapped versions of assets in other chains (as long as there is a bridge that supports it)
  • +
+

The protocol is as follows:

+
    +
  • +
    +
    For each asset type issued, generate a sequence of output notes, each with the following fields:
    +
    +
      +
    • ZSA output note + \(\mathsf{ note =(d, pkd, v, \rho, \psi, \mathsf{type}_\mathbb{P}, rcm)}\) + , where + \(\mathsf{type}_\mathbb{P} := \mathsf{GroupHash^{\mathbb{P}}}\mathsf{(assetID)}\) +
    • +
    +
    +
    +
  • +
  • Generate commitment of the note. cm as
  • +
+

+ \(cm = \mathsf{NoteCommit^{ZSA}_{rcm}}(\mathsf{repr\mathbb{_P}(g_d)}, \mathsf{repr\mathbb{_P}(pk_d)}, v, \rho, \psi,\mathsf{type}_\mathbb{P})\) +

+
    +
  • Sign the issuance note with the issuerID as the signing key, using RedPallas as its signature scheme, on the SIGHASH of the transaction. Note that the SIGHASH will change as we include a new bundle in the Zcash transaction to enable this issuance mechanism on chain.
  • +
+

Consensus Changes

+

Issuance requires the following additions to the global state:

+

First, Zcash clients must keep a mapping issuanceSupplyInfos from assetID to issuanceSupplyInfo := (totalSupply, finiteSupply).

+

Consensus rules

+

For each issuance instance,

+
    +
  • Check that assetID is properly constructed,
  • +
  • Check that each commitment cm is properly constructed from each “output” note,
  • +
  • Check that the issuance instance has a valid signature based on the issuerID,
  • +
  • Check that + \(\mathsf{type}_\mathbb{P}\) + is properly projected into the correct curve from assetID. That is, that + \(\mathsf{type}_\mathbb{P} := \mathsf{GroupHash^{\mathbb{P}}}\mathsf{(assetID)}\) +
  • +
  • If issuanceSupplyInfo[assetID].finiteSupply`is true, reject. Otherwise, set `issuanceSupplyInfo[assetID].finiteSupply = finiteSupply .
  • +
  • Add the sum of all the values in all output notes per assetID to issuanceSupplyInfo[assetID].totalSupply
  • +
  • After verification, add note commitment to the merkle tree.
  • +
+
+
+

Other Considerations

+

Fee Structures

+

The fee mechanism described in this ZIP may be replaced by a future “Fee Mechanism” ZIP proposal. However, we do need to have some basic fees for the Issuance protocol, as it differs from the usual transfer mechanism in that it adds a whole new structure to the transaction bundle, it adds a new global structure for validators to keep in memory and in turn it adds new consensus rules that are independent of previous structures.

+

There are two main factors that will affect the fee mechanism:

+
    +
  • The transaction size, which may take a big part of the block
  • +
  • The computational power needed to verify and mine the transaction
  • +
+

There is a single parameter that defines both, as there is no privacy or ZKP involved at this stage - the number of output notes in the issuance bundle:

+
    +
  • it trivially defines the bundle size
  • +
  • it defines the computational power as the validator must compute as many note commitments as there are output notes
  • +
+
+
+

Test Vectors

+
    +
  • LINK TBD
  • +
+
+

Reference Implementation

+
    +
  • LINK TBD
  • +
  • LINK TBD
  • +
+
+

Deployment

+

This ZIP is proposed to activate with Network Upgrade 6.

+
+

References

+ + + + + + + +
1RFC 2119: Key words for use in RFCs to Indicate Requirement Levels
+ + + + + + + +
2ZIP 200: Network Upgrade Mechanism
+ + + + + + + +
3ZIP 224: Orchard
+ + + + + + + +
4ZIP 226: Transfer and Burn of Zcash Shielded Assets
+ + + + + + + +
5ZIP 227: Issuance of Zcash Shielded Assets
+
+
+ + \ No newline at end of file diff --git a/draft-ZIP-0227.rst b/draft-ZIP-0227.rst new file mode 100644 index 000000000..559d1ee8d --- /dev/null +++ b/draft-ZIP-0227.rst @@ -0,0 +1,184 @@ +:: + + ZIP: 227 + Title: Issuance of Zcash Shielded Assets + Owners: Daniel Benarroch + Pablo Kogan + Aurelien Nicolas + Credits: Daira Hopwood + Jack Grigg + Shahaf Nacshon + Vivek Arte + Status: Draft + Category: Consensus + Created: 2022-05-01 + License: MIT + Discussions-To: + + +Terminology +=========== + +The key word "MUST" in this document is to be interpreted as described in RFC 2119 [#RFC2119]_. + +The term "network upgrade" in this document is to be interpreted as described in ZIP 200 [#zip-0200]_. + +The term "Orchard" in this document is to be interpreted as described in ZIP 224 [#zip-0224]_. + +We define the following additional terms: + +- Asset: A type of note that can be transferred on the Zcash block chain. ZEC is the default (and currently the only defined) asset for the Zcash mainnet. +- Zcash Shielded Asset: an asset with issuance defined on the Zcash block chain, and, for now, belonging to the Orchard anonymity pool. +- Wrapped Asset: a ZSA asset with native issuance defined outside the Zcash block chain. + +Abstract +======== + +ZIP 226 [#zip-0226]_ and ZIP 227 [#zip-0227]_ 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 [#zip-0227]_. The transfer and burn of such assets is defined in ZIP 226 [#zip-0226]_. + +Motivation +========== + +The current Orchard protocol does not support custom assets, which is an important aspect for the proper +evolution of the Zcash ecosystem. Enabling multi-asset support on the Zcash chain will open the door for a host of +applications and enhance the ecosystem with application developers and asset custody institutions for issuance and +bridging purposes. + +Overview & Rationale +==================== + +This ZIP specifies the issuance mechanism of the Zcash Shielded Assets (ZSA) protocol and must work conjunction with ZIP 226 [#zip-0226]_, as the issuance mechanism is only valid for the ZSA transfer protocol, as it produces notes that can only be transferred under ZSA. + +In short, we are going to enable only *transparent* issuance, since we believe that as a first step, transparency is important to properly test the applications that will be most used in the Zcash ecosystem, while enabling tracking of supply of assets. In essence, any user of the blockchain can issue new asset types, yet only a single issuer (a set of keys) can issue that specific asset type, as the asset identifiers are tied to the issuer keys. + +We have designed the protocol such that at the time of issuance, the issuer can already allocate all the tokens to the corresponding owners by creating the corresponding (shielded) output notes to the corresponding addresses. As is implied, the issuance mechanism is itself transparent, but the allocation is totally private. Furthermore, in a single issuance transaction, the issuer can create multiple asset types (and allocate all of those too). Finally, a key component of our design is the `finiteIssuance` boolean that defines whether a specific asset type can have more tokens issued or not. + +The issuance mechanism is broad enough for issuers to either create native 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. In fact, the protocol described below enables, what we hope will be a useful set of, applications: + +- By setting the `finiteIssuance = 1` from the first issuance instance of that asset type, 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. +- When the `finiteIssuance = 0`, the issuer can keep creating tokens of that type (in a transparent manner). The boolean value can be changed with any new issuance transaction, and could be set to `1` either when the issuer keys have been compromised, and hence stopping all issuances of that asset type (the boolean cannot be reversed), or whenever the issuer decides that the max supply has been reached. +- Note that this mechanism can be used with the burning process to control and affect the supply of any custom asset. + + +Asset Identifier Generation +=========================== + +For every new asset, there must be a new and unique identifier of the asset. Our design decision is not to have a chosen name for the asset type, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”. From this asset identifier, which is a global byte string (valid across all Zcash protocols), we derive the specific type used within the notes, as defined by the specific protocol (e.g.: for now Orchard-style, using Pallas curve) + +The main requirement for the asset identifier is for it to be collision-free, as two different issuers should not be able to issue the same asset type. As such we need the asset identifier to be: + +- pseudorandom +- deterministic +- dependent on the issuer ID + +We define the asset identifier `assetID` (represented as a string) as + +:math:`\mathsf{assetID := GroupHash^{\mathbb{P}}}\mathsf{(issuerID || assetDesc)}` + +where + +- `assetDesc` is the asset description, which includes any information pertaining to the issuance. +- `issuerID` is the public key of the issuer, used to verify the signature on the transaction and is defined as `ik` (issuer key or issuer verification key): + + +:math:`\mathsf{ik := SpendAuthSig^{Orchard}.DerivePublic(isk)}` + + +which uses the same signature as the spend authorization signature, where `isk` is the issuer secret key. The verification key is derived from `isk`. In order to differentiate the `isk` and `ik` keys from the actual spend authorization key, we derive another branch of keys from the main spending key `sk` as such: + +:math:`\mathsf{isk := ToScalar^{Orchard}(︀ PRF^{expand}_{sk} ([10])}` + +This allows the issuer to use the same wallet it usually uses to transfer assets, while keeping a disconnect from the other keys. 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 in the wallet safe. + +Then we let `issuanceInfo := (assetID, finiteSupply)`, where + +- `assetID` is as defined above. +- `finiteSupply` is a boolean variable that defines whether this issuance transaction of the specific asset type is the final issuance of tokens or not. Once `finiteSupply` is set, it cannot be unset. This allows expanding the functionality of the issuance mechanism: + - Provides `assetID` revocation in case of compromise (issue last issuance with 0 token value) + - Supports NFT issuance (where the first issuance with value of 1 is also the last) + + +Issuance Protocol +================= + +The issuance protocol allows for a single issuance to be sent to many receivers, as the issuerID does not have to match the address ownership of the notes output. Furthermore, every transaction can contain many issuance instances. The design presented in this ZIP enables several use cases for issuance of shielded assets. + +- The issuer knows in advance the receivers of the issued asset. +- The asset is of non-fungible type, where each asset type can be made part of a single “series” +- The supply of the asset is limited or not +- The assets can be wrapped versions of assets in other chains (as long as there is a bridge that supports it) + +The protocol is as follows: + +- For each asset type issued, generate a sequence of output notes, each with the following fields: + - ZSA output note :math:`\mathsf{ note =(d, pkd, v, \rho, \psi, \mathsf{type}_\mathbb{P}, rcm)}`, where :math:`\mathsf{type}_\mathbb{P} := \mathsf{GroupHash^{\mathbb{P}}}\mathsf{(assetID)}` +- Generate commitment of the note. `cm` as + +:math:`cm = \mathsf{NoteCommit^{ZSA}_{rcm}}(\mathsf{repr\mathbb{_P}(g_d)}, \mathsf{repr\mathbb{_P}(pk_d)}, v, \rho, \psi,\mathsf{type}_\mathbb{P})` + +- Sign the issuance note with the `issuerID` as the signing key, using RedPallas as its signature scheme, on the `SIGHASH` of the transaction. Note that the `SIGHASH` will change as we include a new bundle in the Zcash transaction to enable this issuance mechanism on chain. + +Consensus Changes +----------------- + +Issuance requires the following additions to the global state: + +First, Zcash clients must keep a mapping `issuanceSupplyInfos` from `assetID` to `issuanceSupplyInfo := (totalSupply, finiteSupply)`. + +**Consensus rules** + +For each issuance instance, + +- Check that `assetID` is properly constructed, +- Check that each commitment `cm` is properly constructed from each “output” note, +- Check that the issuance instance has a valid signature based on the `issuerID`, +- Check that :math:`\mathsf{type}_\mathbb{P}` is properly projected into the correct curve from `assetID`. That is, that :math:`\mathsf{type}_\mathbb{P} := \mathsf{GroupHash^{\mathbb{P}}}\mathsf{(assetID)}` +- If `issuanceSupplyInfo[assetID].finiteSupply`is true, reject. Otherwise, set `issuanceSupplyInfo[assetID].finiteSupply = finiteSupply` . +- Add the sum of all the values in all output notes per `assetID` to `issuanceSupplyInfo[assetID].totalSupply` +- After verification, add note commitment to the merkle tree. + +Other Considerations +==================== + +Fee Structures +-------------- + +The fee mechanism described in this ZIP may be replaced by a future “Fee Mechanism” ZIP proposal. However, we do need to have some basic fees for the Issuance protocol, as it differs from the usual transfer mechanism in that it adds a whole new structure to the transaction bundle, it adds a new global structure for validators to keep in memory and in turn it adds new consensus rules that are independent of previous structures. + +There are two main factors that will affect the fee mechanism: + +- The transaction size, which may take a big part of the block +- The computational power needed to verify and mine the transaction + +There is a single parameter that defines both, as there is no privacy or ZKP involved at this stage - the number of output notes in the issuance bundle: + +- it trivially defines the bundle size +- it defines the computational power as the validator must compute as many note commitments as there are output notes + + +Test Vectors +============ + +- LINK TBD + +Reference Implementation +======================== + +- LINK TBD +- LINK TBD + +Deployment +========== + +This ZIP is proposed to activate with Network Upgrade 6. + +References +========== + +.. [#RFC2119] `RFC 2119: Key words for use in RFCs to Indicate Requirement Levels `_ +.. [#zip-0200] `ZIP 200: Network Upgrade Mechanism `_ +.. [#zip-0224] `ZIP 224: Orchard `_ +.. [#zip-0226] `ZIP 226: Transfer and Burn of Zcash Shielded Assets `_ +.. [#zip-0227] `ZIP 227: Issuance of Zcash Shielded Assets `_ \ No newline at end of file From 5e8583588e75bef483de9028c158e1a9827a50e2 Mon Sep 17 00:00:00 2001 From: Daniel Benarroch Date: Tue, 18 Oct 2022 11:00:12 +0200 Subject: [PATCH 002/101] Update draft-ZIP-0226.rst Co-authored-by: Deirdre Connolly --- draft-ZIP-0226.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/draft-ZIP-0226.rst b/draft-ZIP-0226.rst index d2c46cc73..ea8350974 100644 --- a/draft-ZIP-0226.rst +++ b/draft-ZIP-0226.rst @@ -27,7 +27,10 @@ The term "Orchard" in this document is to be interpreted as described in ZIP 224 We define the following additional terms: -- Asset: A type of note that can be transferred on the Zcash block chain. ZEC is the default (and currently the only defined) asset for the Zcash mainnet. +- Asset: A type of note that can be transferred on the Zcash block chain. + + - ZEC is the default (and currently the only defined) asset for the Zcash mainnet. + - Zcash Shielded Asset: an asset with issuance defined on the Zcash block chain, and, for now, belonging to the Orchard anonymity pool. - Wrapped Asset: a ZSA asset with native issuance defined outside the Zcash block chain. From f68d5037cc3802a0a8260654877739dea5e794c6 Mon Sep 17 00:00:00 2001 From: Daniel Benarroch Date: Tue, 18 Oct 2022 11:02:58 +0200 Subject: [PATCH 003/101] Update draft-ZIP-0226.rst Co-authored-by: Deirdre Connolly --- draft-ZIP-0226.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/draft-ZIP-0226.rst b/draft-ZIP-0226.rst index ea8350974..d0913ffca 100644 --- a/draft-ZIP-0226.rst +++ b/draft-ZIP-0226.rst @@ -31,7 +31,7 @@ We define the following additional terms: - ZEC is the default (and currently the only defined) asset for the Zcash mainnet. -- Zcash Shielded Asset: an asset with issuance defined on the Zcash block chain, and, for now, belonging to the Orchard anonymity pool. +- Zcash Shielded Asset: an Asset with issuance defined on the Zcash block chain, and, for now, belonging to the Orchard shielded pool. - Wrapped Asset: a ZSA asset with native issuance defined outside the Zcash block chain. Abstract From 10188a42480a2f64d87d827752c014bb361b51ee Mon Sep 17 00:00:00 2001 From: Daniel Benarroch Date: Tue, 18 Oct 2022 11:03:20 +0200 Subject: [PATCH 004/101] Update draft-ZIP-0226.rst Co-authored-by: Deirdre Connolly --- draft-ZIP-0226.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/draft-ZIP-0226.rst b/draft-ZIP-0226.rst index d0913ffca..9ef73c504 100644 --- a/draft-ZIP-0226.rst +++ b/draft-ZIP-0226.rst @@ -32,7 +32,7 @@ We define the following additional terms: - ZEC is the default (and currently the only defined) asset for the Zcash mainnet. - Zcash Shielded Asset: an Asset with issuance defined on the Zcash block chain, and, for now, belonging to the Orchard shielded pool. -- Wrapped Asset: a ZSA asset with native issuance defined outside the Zcash block chain. +- Wrapped Asset: a Zcash Shielded Asset with native issuance defined outside the Zcash block chain. Abstract ======== From 1fcd4e09b135a72c7cbff04608936985b6c10c4a Mon Sep 17 00:00:00 2001 From: Daniel Benarroch Date: Tue, 18 Oct 2022 11:04:32 +0200 Subject: [PATCH 005/101] Update draft-ZIP-0226.rst Co-authored-by: Deirdre Connolly --- draft-ZIP-0226.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/draft-ZIP-0226.rst b/draft-ZIP-0226.rst index 9ef73c504..a68a12c2d 100644 --- a/draft-ZIP-0226.rst +++ b/draft-ZIP-0226.rst @@ -38,7 +38,7 @@ Abstract ======== ZIP 226 and ZIP 227 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 +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 [#zip-0227]_. The transfer and burn of such assets is defined in ZIP 226 [#zip-0226]_. Motivation From 879741dc024432b380ba1b21737cc8df1f322786 Mon Sep 17 00:00:00 2001 From: Daniel Benarroch Date: Tue, 18 Oct 2022 11:04:53 +0200 Subject: [PATCH 006/101] Update draft-ZIP-0226.rst Co-authored-by: Deirdre Connolly --- draft-ZIP-0226.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/draft-ZIP-0226.rst b/draft-ZIP-0226.rst index a68a12c2d..b04024535 100644 --- a/draft-ZIP-0226.rst +++ b/draft-ZIP-0226.rst @@ -44,7 +44,7 @@ in ZIP 227 [#zip-0227]_. The transfer and burn of such assets is defined in ZIP Motivation ========== -The current Orchard protocol does not support custom assets, which is an important aspect for the proper evolution of the Zcash ecosystem. Enabling multi-asset support on the Zcash chain will open the door for a host of applications and enhance the ecosystem with application developers and asset custody institutions for issuance and bridging purposes. +The current Orchard protocol does not support custom assets. Enabling multi-asset support on the Zcash chain will open the door for a host of applications and enhance the ecosystem with application developers and asset custody institutions for issuance and bridging purposes. Overview ======== From c95d801fc97cc31bafbad2bd8eedbdec28df16b8 Mon Sep 17 00:00:00 2001 From: Daniel Benarroch Date: Tue, 18 Oct 2022 11:05:22 +0200 Subject: [PATCH 007/101] Update draft-ZIP-0226.rst Co-authored-by: Deirdre Connolly --- draft-ZIP-0226.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/draft-ZIP-0226.rst b/draft-ZIP-0226.rst index b04024535..abe7e916e 100644 --- a/draft-ZIP-0226.rst +++ b/draft-ZIP-0226.rst @@ -48,7 +48,7 @@ The current Orchard protocol does not support custom assets. Enabling multi-asse Overview ======== -In order to be able to represent different asset types in Orchard, one needs to define a new data field that uniquely represents the *type* of the asset in question, which we call :math:`\mathsf{type}`. +In order to be able to represent different Asset types in Orchard, we need to define a new data field that uniquely represents the *type* of the Asset in question, which we call :math:`\mathsf{type}`. The type will be used to enforce the balance of an action description [#protocol-actions]_ is preserved across assets (see the Orchard Binding Signature [#protocol-binding]_ , and by extension of an Orchard transaction. Mainly, the sum of all the :math:`\mathsf{value^{net}}`, as :math:`\mathsf{value^{old}-value^{new}}`, derived from each action description, must be balanced only **with respect to the same asset type**. This is specially important since we will allow different action descriptions to transfer notes of different asset types, where the overall balance is checked without revealing which assets (or how many different types) are being transferred. From 31f931c03c7a99620dc8fb68294bde95ee9414ce Mon Sep 17 00:00:00 2001 From: Daniel Benarroch Date: Tue, 18 Oct 2022 11:06:25 +0200 Subject: [PATCH 008/101] Update draft-ZIP-0226.rst Co-authored-by: Deirdre Connolly --- draft-ZIP-0226.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/draft-ZIP-0226.rst b/draft-ZIP-0226.rst index abe7e916e..270869cdb 100644 --- a/draft-ZIP-0226.rst +++ b/draft-ZIP-0226.rst @@ -50,7 +50,7 @@ Overview ======== In order to be able to represent different Asset types in Orchard, we need to define a new data field that uniquely represents the *type* of the Asset in question, which we call :math:`\mathsf{type}`. -The type will be used to enforce the balance of an action description [#protocol-actions]_ is preserved across assets (see the Orchard Binding Signature [#protocol-binding]_ , and by extension of an Orchard transaction. Mainly, the sum of all the :math:`\mathsf{value^{net}}`, as :math:`\mathsf{value^{old}-value^{new}}`, derived from each action description, must be balanced only **with respect to the same asset type**. This is specially important since we will allow different action descriptions to transfer notes of different asset types, where the overall balance is checked without revealing which assets (or how many different types) are being transferred. +The type will be used to enforce the balance of an Action Description [#protocol-actions]_ is preserved across Assets (see the Orchard Binding Signature [#protocol-binding]_), and by extension the balance of an Orchard transaction. That is, the sum of all the :math:`\mathsf{value^{net}}` from each Action Description, computed as :math:`\mathsf{value^{old}-value^{new}}`, must be balanced **only with respect to the same Asset type**. This is specially important since we will allow different Action Descriptions to transfer notes of different Asset types, where the overall balance is checked without revealing which Assets (or how many different types) are being transferred. As was initially proposed by Jack Grigg and Daira Hopwood [#initial-zsa-issue]_, we propose to make this happen by changing the value base point, :math:`\mathcal{V}^{\mathsf{Orchard}}`, in the Homomorphic Pedersen Commitment that generates the value commitment, :math:`\mathsf{cv^{net}}`, of the *net value* in an Orchard Action. From c9267958904793ef90c6a05a7c82f4f6fcd0f0cf Mon Sep 17 00:00:00 2001 From: Daniel Benarroch Date: Tue, 18 Oct 2022 12:19:07 +0200 Subject: [PATCH 009/101] Apply suggestions from code review of transfer and burn zip Co-authored-by: Deirdre Connolly Co-authored-by: Daira Hopwood --- draft-ZIP-0226.rst | 73 +++++++++++++++++++++++----------------------- 1 file changed, 37 insertions(+), 36 deletions(-) diff --git a/draft-ZIP-0226.rst b/draft-ZIP-0226.rst index 270869cdb..b8ba7b4aa 100644 --- a/draft-ZIP-0226.rst +++ b/draft-ZIP-0226.rst @@ -54,44 +54,44 @@ The type will be used to enforce the balance of an Action Description [#protocol As was initially proposed by Jack Grigg and Daira Hopwood [#initial-zsa-issue]_, we propose to make this happen by changing the value base point, :math:`\mathcal{V}^{\mathsf{Orchard}}`, in the Homomorphic Pedersen Commitment that generates the value commitment, :math:`\mathsf{cv^{net}}`, of the *net value* in an Orchard Action. -Because in a single transaction all value commitments are balanced, there must be as many different value base points as there are asset types in the transaction. We propose to make the :math:`\mathsf{type}` identifier an auxiliary input to the proof, represented already as a point in the Pallas curve. The circuit then should check that the same :math:`\mathsf{type}` is used in the old note commitment, in the new note commitment **and** in the value commitment as the base point of the value. This ensures that (1) the input and output notes are of the same type, and (2) that only actions with the same asset type identifier will balance out in the binding and balance signature. +Because in a single transaction all value commitments are balanced, there must be as many different value base points as there are Asset types in the transaction. We propose to make the :math:`\mathsf{type}` identifier an auxiliary input to the proof for each Action, represented already as a point on the Pallas curve. The circuit then should check that the same :math:`\mathsf{type}` is used in the old note commitment, in the new note commitment, **and** as the base point :math:`\mathcal{V}^\mathsf{Orchard}` in the value commitment. This ensures (1) that the input and output notes are of the same type, and (2) that only Actions with the same Asset type identifier will balance out in the binding and balance signatures. -In order to ensure the security of the transfers, and as we will explain below, we are replacing input dummy notes for custom assets, as we need to enforce that the type of the output note of that split action is the output of a PRF. +In order to ensure the security of the transfers, and as we will explain below, we are redefining input dummy notes for custom Assets, as we need to enforce that the type of the output note of that split Action is the output of a PRF. -Finally, in this ZIP we also describe the *burn* mechanism, which is a direct extension of the transfer mechanism. The burn process uses a similar mechanism than what is used in Orchard to unshield ZEC, by using the :math:`\mathsf{valueBalance}` of the asset in question. Burning assets is useful for many purposes, including bridging of wrapped assets and removing supply of native assets. +Finally, in this ZIP we also describe the *burn* mechanism, which is a direct extension of the transfer mechanism. The burn process uses a similar mechanism to what is used in Orchard to unshield ZEC, by using the :math:`\mathsf{valueBalance}` of the Asset in question. Burning Assets is useful for many purposes, including bridging of Wrapped Assets and removing supply of Native Assets. Orchard Protocol Changes ======================== -Most of the protocol is kept the same as the Orchard protocol released with NU5, except the following that will be deployed to mainnet in subsequent network upgrades. +Most of the protocol is kept the same as the Orchard protocol released with NU5, except the following, that will be deployed to Mainnet in subsequent network upgrades. Asset Types ----------- -In the OSA protocol, we include a new variable, the asset type identifier, :math:`\mathsf{type}`, which is generated as a 32-byte string during issuance (as described in the Issuance ZIP [#zip-0227]_). The :math:`\mathsf{type}` will then be publicly hashed into the corresponding group, in this case the Pallas curve, by using the :math:`\mathsf{GroupHash}` -function. In fact, every ZSA note will contain the group element representation of the asset type identifier. This will enable a much more elegant and simple version of the circuit, as we will see. +In the ZSA protocol, we include a new variable, the Asset type identifier, :math:`\mathsf{type}`, which is generated as a 32-byte string during issuance (as described in the Issuance ZIP [#zip-0227]_). The :math:`\mathsf{type}` will then be publicly hashed into the corresponding group, in this case the group of points defined on the Pallas curve, by using the :math:`\mathsf{GroupHash}` +function. In fact, every ZSA note will contain the group element representation of the Asset type identifier. This will enable a more elegant and simple version of the circuit, as we will see. -We denote the string as :math:`\mathsf{type}` and we denote the equivalent group representation as :math:`\mathsf{type}_{\mathbb{G}}` when mapped into a specific group, :math:`\mathbb{G}`. Note that the type of the ZEC asset will be kept as the original value base-point, :math:`\mathcal{V}^\mathsf{Orchard}` +We denote the string as :math:`\mathsf{type}` and we denote the equivalent group representation as :math:`\mathsf{type}_{\mathbb{G}}` when mapped into a specific group, :math:`\mathbb{G}`. Note that the type of the ZEC asset will be kept as the original value base point, :math:`\mathcal{V}^\mathsf{Orchard}` -In future network and protocol upgrades, the same asset type string can be carried on, with potentially a mapping into a different curve or group. In that case, the turnstile should know how to transform the asset type from one group to another one. +In future network and protocol upgrades, the same Asset type string can be carried on, with potentially a mapping into a different shielded protocol. In that case, the turnstile should know how to transform the Asset type from one shielded protocol to another. Note Structure & Commitment --------------------------- -First, we need to adapt the components that define the assets, i.e.: *notes*. A ZSA note differs from an Orchard note by including the type of asset, :math:`\mathsf{type}_\mathbb{P}`. So an ZSA note looks like: +First, we need to adapt the components that define the Assets, i.e.: *notes*. A ZSA note differs from an Orchard note by including the type of Asset, :math:`\mathsf{type}_\mathbb{P}`. So an ZSA note looks like: :math:`(\mathsf{g_d, pk_d, v, \rho, \psi, type}_{\mathbb{P}})` -Where :math:`\mathsf{type}_\mathbb{P}` is the unique random group element that identifies each asset in the Pallas curve [#protocol-pallasandvesta]_, [#pasta-evidence]_ of the Orchard protocol. +Where :math:`\mathsf{type}_\mathbb{P}` is the unique random element of the Pallas group [#protocol-pallasandvesta]_, that identifies each Asset in the Orchard protocol. -In this case, the note commitment, :math:`\mathsf{NoteCommit^{ZSA}_{rcm}}`, will differ from :math:`\mathsf{NoteCommit^{Orchard}_{rcm}}` in that for non-ZEC assets, the type will be added as an input to the commitment computation. As we will see, the recursive structure of the Sinsemilla-base commitment [#protocol-concretesinsemillacommit]_ allows us to add the type as a final recursive step, and hence keep a single instance of the hash function in the circuit for the note commitment verification. +In this case, the note commitment scheme, :math:`\mathsf{NoteCommit^{ZSA}_{rcm}}`, will differ from :math:`\mathsf{NoteCommit^{Orchard}_{rcm}}` in that for non-ZEC Assets, the type will be added as an input to the commitment computation. As we will see, the nested structure of the Sinsemilla-base commitment [#protocol-concretesinsemillacommit]_ allows us to add the type as a final step, and hence keep a single instance of the Sinsemilla hash function in the circuit for the note commitment verification. -Since the commitment output is still indistinguishable with the original Orchard ZEC note commitments, by definition of the Sinsemilla hash, ZSA note commitments will be added to the same Merkle Commitment Tree. In essence, we have +The commitment output is still indistinguishable from the original Orchard ZEC note commitments, by definition of the Sinsemilla hash. ZSA note commitments will therefore be added to the same Orchard Note Commitment Tree. In essence, we have -:math:`\mathsf{NoteCommit^{ZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, type_\mathbb{P})} \in \{\mathsf{cm},\bot\}` +:math:`\mathsf{NoteCommit^{ZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, type_\mathbb{P})} \in \mathsf{NoteCommit^{Orchard}.Output} \union \{\bot\}` The nullifier is generated in the same manner as in the Orchard protocol. @@ -113,7 +113,7 @@ In the case of the Orchard protocol, we see that the base points :math:`\mathcal :math:`\mathcal{R}^{\mathsf{Orchard}}` are fixed for every value commitment, as the values represent the amount of ZEC being transferred. -In the case of the ZSA protocol, the value of different asset types in a given transaction will be committed using a **different value base point**. This enables the final balance of the transaction to be securely computed, such that each asset type is balanced independently, as the assets are not meant to be fungible. The value commitment then becomes +In the case of the ZSA protocol, the value of different Asset types in a given transaction will be committed using a **different value base point**. This enables the final balance of the transaction to be securely computed, such that each Asset type is balanced independently, as Assets of different types are not meant to be mutually fungible. The value commitment then becomes :math:`\mathsf{cv^{net}:=ValueCommit^{ZSA}_{rcv}(v^{net}_{type},\mathcal{V}^{\mathsf{ZSA}}_{\mathsf{type}})}:= \mathsf{[v^{net}_{type}]}\mathcal{V}^{\mathsf{ZSA}}_{\mathsf{type}}+[\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}}` @@ -131,29 +131,29 @@ Where :math:`\mathcal{V}^{\mathsf{ZSA}}_{\mathsf{ZEC}} =\mathcal{V}^{\mathsf{Orc Value Balance Verification -------------------------- -In order to verify the balance of the different assets, verifier performs exactly the same the process as for the Orchard protocol [#protocol-binding]_. The main reason is because no custom assets can be unshielded, so all custom assets are contained within the shielded ZSA pool. This means that the net balance of the input and output values is zero, with only one type of value balance published, that of ZEC, :math:`\mathsf{v^{balanceOrchard}}`, so no net amount of any type will be revealed, and neither the nnumber of types in the transaction. The only exception to this is in the case that an asset is *burnt*, as we will see below. +In order to verify the balance of the different Assets, the verifier MUST perform exactly the same the process as for the Orchard protocol [#protocol-binding]_. The main reason why no changes are needed is that no custom Assets can be unshielded, so all custom Assets are contained within the shielded pool. This means that the net balance of the input and output values is zero, with only one type of value balance published, that of ZEC, :math:`\mathsf{v^{balanceOrchard}}`. Therefore no net amount of any type will be revealed, and neither will the number of types in the transaction. The only exception to this is in the case that an Asset is *burnt*, as we will see below. -For a total of :math:`m` actions in a transfer, the prover can still sign the `SIGHASH` of the transaction using the binding signature key +For a total of :math:`m` Actions in a transfer, the prover MUST still sign the `SIGHASH` of the transaction using the binding signature key :math:`\mathsf{bsk} = \sum_{\mathsf{ \forall i\in \{1,...,m\}}} \mathsf{rcv_{i}}` -Then we have that the verifier computes +Then the verifier MUST compute :math:`\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} = \sum \mathsf{rcv_{i}^{net}}\mathcal{R}^{\mathsf{Orchard}}` And uses it to verify the binding signature, as described in §4.14 of the Zcash Specification [#protocol-binding]_, by verifying the `bindingSignature` on the `SIGHASH` message. -As in the Orchard protocol, the binding signature verification key, :math:`\mathsf{bvk}`, will only be valid (and hence verify the signature correctly, as long as all the value commitments (and corresponding value balances) are equal to zero. In contrast, in this protocol, the value commitments only cancel out **per asset type**, as the Pedersen commitments add up homomorphically only with respect to the same value base point. +As in the Orchard protocol, the binding signature verification key, :math:`\mathsf{bvk}`, will only be valid (and hence verify the signature correctly), as long as the committed values sum to zero. In contrast, in this protocol, the committed values only sum to zero **per Asset type**, as the Pedersen commitments add up homomorphically only with respect to the same value base point. Split Notes ----------- -One of the key functionalities in a UTXO based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This is called a 1-to-many (Orchard) transaction. In order to cope with this today, the input note of the second (third and more) Action (which we call split notes and split Actions respectively) is a *dummy spend note* [#protocol-dummynotes]_. Basically, the input note is “faked” inside of the proof in order to hide which action contains the *real* spend note. +One of the key functionalities in a UTXO-based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This requires a 1-to-many (Orchard) transaction. However, because each Action represents and input and an output, the resulting transaction must have multiple inputs. In order to cope with this today, the Actions that have not been assigned input notes are instead given *dummy spend notes* [#protocol-dummynotes]_, which we call split Actions and split notes respectively. Basically, the input note is “faked” inside of the proof in order to hide which Action contains the *real* spend note. -This, however, brings some issues when it comes to adding multiple asset types, as the output note of the split Actions *cannot* be of *any* asset type, it must be enforced to be an actual output of a GroupHash computation (in fact we want it to be of the same type as the original input note, but the binding signature takes care that the proper balancing is performed). If not, then the prover could essentially input a multiple (or linear combination of) an existing type, with the goal to attack the network by overflowing the ZEC value balance and hence counterfeiting ZEC funds. +This, however, brings some issues when it comes to adding multiple Asset types, as the output note of the split Actions *cannot* be of *any* Asset type, it must be enforced to be an actual output of a GroupHash computation (in fact we want it to be of the same type as the original input note, but the binding signature takes care that the proper balancing is performed). If not, then the prover could essentially input a multiple (or linear combination) of an existing type, with the goal to attack the network by overflowing the ZEC value balance and hence counterfeiting ZEC funds. -In order to prevent this, we make some modifications to the circuit. Specifically we remove the dummy note functionality for custom assets and we enforce that *every* input note to an ZSA Action must be proven to exist in the set of note commitments in the Merkle Tree. We then enforce this real note to be “unspendable” in the sense that its value +In order to prevent this, we make some modifications to the circuit. Specifically we remove the dummy note functionality for custom Assets and we enforce that *every* input note to an ZSA Action must be proven to exist in the set of note commitments in the note commitment tree. We then enforce this real note to be “unspendable” in the sense that its value will be zeroed in split Actions and the nullifier will be randomized, making the note not spendable in the specific Action. Then, the proof itself ensures that the output note is of the same type as the input note. In the circuit, the split note functionality will be activated by a boolean private input to the proof. Note that this is enough to create a chain of induction that ensures that all output notes of a transfer are actual outputs of a GroupHash, preventing any malleability attacks, as they originate in the Issuance protocol, which is publicly verified. Furthermore, we do not care about whether the note is owned by the sender, or whether it was nullified before. Wallets and other clients have a choice to make to ensure the asset type is the preserved for the output note of a split Action, for the value balance verification: @@ -167,35 +167,36 @@ The specific circuit changes are presented below. Circuit Statement ================= -The advantage of the design described above, with respect to the circuit statement, is that every *ZSA Action statement* is kept closely similar to the Orchard Action statement [#protocol-actionstatement]_, except for a few additions that ensure the security of the asset type system. +The advantage of the design described above, with respect to the circuit statement, is that every *ZSA Action statement* is kept closely similar to the Orchard Action statement [#protocol-actionstatement]_, except for a few additions that ensure the security of the Asset type system. -**Asset Type Equality:** the following constraints must be added to ensure that the input and output note are of the -same type: +**Asset Type Equality:** the following constraints must be added to ensure that +the input and output note are of the same Asset type: -- The asset type, :math:`\mathsf{type_\mathbb{P}}`, for the note is witnessed once, as an auxiliary input. -- The witnessed asset type, :math:`\mathsf{type_\mathbb{P}}`, is added to the old note commitment input. -- The witnessed asset type, :math:`\mathsf{type_\mathbb{P}}`, is added to the new note commitment input. +- The Asset type, :math:`\mathsf{type_\mathbb{P}}`, for the note is witnessed once, as an auxiliary input. +- The witnessed Asset type, :math:`\mathsf{type_\mathbb{P}}`, is added to the old note commitment input. +- The witnessed Asset type, :math:`\mathsf{type_\mathbb{P}}`, is added to the new note commitment input. -**Correct Value Commitment Type:** the following constraints must be added to ensure that the value commitment is computed using the witnessed type, as represented in the notes +**Correct Value Commitment Type:** the following constraints must be added to ensure that the value commitment is computed using the witnessed type, as represented in the notes: - The fixed-base multiplication constraints between the value and the value base point of the value commitment,:math:`\mathsf{cv}`, is replaced with a variable-base multiplication between the two - The witness to the value base-point is the auxiliary input :math:`\mathsf{type}_\mathbb{P}`. -**Enforce Secure Type for Split Actions:** the following constraints must be added to prevent senders from malling with the asset type for the output note in the consequent actions of the split: +**Enforce Secure Type for Split Actions:** the following constraints MUST be added to prevent senders from malling with the Asset type for the output note in the consequent actions of the split: - The Value Commitment Integrity should be changed - Replace the input note value by a generic value, `v'`, as :math:`\mathsf{cv^net} = \mathsf{ValueCommit_rcv^OrchardType(v’ - v^new, type}_\mathbb{P})` - Add a boolean “split” variable as an auxiliary witness. This variable is to be activated `split = 1` if the Action in question is a split and `split = 0` if the Action is actually spending an input note: - - If `split = 1` then set `v' = 0` otherwise `v'=v^old` from the auxiliary input -- The Merkle Path Validity should check the existance of the note commitment as usual (and not like with dummy notes): + - If :math:`split = 1` then constrain :math:`v' = 0` otherwise constrain :math:`v'=v^old` from the auxiliary input. + - If :math:`split = 1` then constrain :math:`v^{old} \neq 0`. +- The Merkle Path Validity should check the existence of the note commitment as usual (and not like with dummy notes): - Check that (path, pos) is a valid Merkle path of depth :math:`\mathsf{MerkleDepth^Orchard}`, from :math:`\mathsf{cm^old}` to the anchor :math:`\mathsf{rt^Orchard}`. - The Nullifier Integrity will be changed to prevent the identification of notes - Replace the :math:`\psi_{old}` value with a generic :math:`\psi'` as :math:`\mathsf{nf_old = DeriveNullifier_nk}(\rho^\mathsf{old}, \psi', \mathsf{cm^old})` - - if `split = 1` set :math:`\psi' = \mathsf{randomSample}`, otherwise set :math:`\psi' = \psi^{old}` + - If :math:`split = 0` then constrain :math:`\psi' = \psi^\mathsf{old}`. (Otherwise :math:`\psi'` should be sampled randomly.) **Enabling Backwards Compatibility with ZEC Notes:** the following constraints must be added to enable backwards compatibility with the Orchard ZEC notes. -The old note commitment is computed using a “rolling-aggregate” sinsemilla commitment. This means that the commitment is computed by adding new chunks or windows to the accumulated value. This method will be used in order to maintain a single commitment instance for the old note commitment, that will be used both for Orchard ZEC notes and for ZSA notes. The original Orchard ZEC notes will be conserved and not actually be converted into ZSA notes, as we will always need to compute them. +The old note commitment is computed using a “rolling-aggregate” Sinsemilla commitment. This means that the commitment is computed by adding new chunks or windows to the accumulated value. This method will be used in order to maintain a single commitment instance for the old note commitment, that will be used both for Orchard ZEC notes and for ZSA notes. The original Orchard ZEC notes will be conserved and not actually be converted into ZSA notes, as we will always need to compute them. - The input note in the old note commitment integrity must either include a type (ZSA note) or not (ZEC-Orchard note) - If the type auxiliary input is set :math:`\mathsf{type}_\mathbb{P}` = :math:`\mathcal{V}^\mathsf{Orchard}` @@ -218,9 +219,9 @@ Burn Mechanism ============== The burn mechanism may be needed for off-boarding the wrapped assets from the chain, or enabling advanced tokenomics on native tokens. It is part of the Issuance/Burn protocol, but given that it can be seen as an extension of the Transfer protocol, we add it here for readability. -In essence, the burn mechanism is a transparent / revealing extension to the transfer protocol that enables a specific amount of any asset type to be sent into “oblivion”. Our burn mechanism does NOT send assets to a non-spendable address, it simply reduces the total number of assets in circulation at the consensus level. It is enforced at the consensus level, by using an extension of the value balance mechanism used for ZEC assets. +In essence, the burn mechanism is a transparent / revealing extension to the transfer protocol that enables a specific amount of any Asset type to be sent into “oblivion”. Our burn mechanism does NOT send Assets to a non-spendable address, it simply reduces the total number of units of a given Asset in circulation at the consensus level. It is enforced at the consensus level, by using an extension of the value balance mechanism used for ZEC Assets. -First, contrary to the strict transfer transaction, we allow the sender to include a :math:`\mathsf{valueBalvalueBalance_{type}}` variable for every asset type that is being burnt. As we will show in the transaction structure, this is separate from the regular :math:`\mathsf{valueBalance^Orchard}` that is the default transparent value for the ZEC asset. +First, contrary to the strict transfer transaction, we allow the sender to include a :math:`\mathsf{valueBalance_{type}}` variable for every Asset type that is being burnt. As we will show in the transaction structure, this is separate from the regular :math:`\mathsf{valueBalance^Orchard}` that is the default transparent value for the ZEC Asset. For every custom asset that is burnt, we add to the `assetBurn` vector the tuple :math:`(\mathsf{valueBalance_{type}, type}_\mathbb{P})` such that the validator of the transaction can compute the value commitment with the corresponding value base point of that asset. This ensures that the values are all balanced out with respect to the asset types in the transfer. @@ -235,7 +236,7 @@ Finally, the validator needs to verify the Balance and Binding Signature by addi In the case that the balance of all the action values related to a specific asset will be zero, there will be no value added to the vector. This way, the number of assets, nor their types will be revealed, except in the case that an asset is burnt. -**Note:** Even if this mechanism allows having transparent ↔  shielded asset transfers in theory, the transparent protocol will not be changed with this ZIP to adapt to a multiple asset structure. This means that unless future consensus rules changes do allow it, the unshielding is not not be possible for custom assets. +**Note:** Even if this mechanism allows having transparent ↔ shielded asset transfers in theory, the transparent protocol will not be changed with this ZIP to adapt to a multiple asset structure. This means that unless future consensus rules changes do allow it, unshielding will not be possible for custom assets. ZSA Transaction Structure ========================= From 4da0b83a3bfa954ac65a5dd416fdcca192bd62b9 Mon Sep 17 00:00:00 2001 From: Daniel Benarroch Date: Tue, 18 Oct 2022 12:25:24 +0200 Subject: [PATCH 010/101] adds comments from initial review - split note definition - 'n' actions as per the specification (not 'm') - internal references --- draft-ZIP-0226.rst | 96 ++++++++++++++++++++++++---------------------- 1 file changed, 50 insertions(+), 46 deletions(-) diff --git a/draft-ZIP-0226.rst b/draft-ZIP-0226.rst index b8ba7b4aa..f3b01838e 100644 --- a/draft-ZIP-0226.rst +++ b/draft-ZIP-0226.rst @@ -33,6 +33,9 @@ We define the following additional terms: - Zcash Shielded Asset: an Asset with issuance defined on the Zcash block chain, and, for now, belonging to the Orchard shielded pool. - Wrapped Asset: a Zcash Shielded Asset with native issuance defined outside the Zcash block chain. +- Native Asset: a Zcash Shielded Asset created uniquely within the Zcash block chain. +- Split Note: a Zcash Shielded Asset spend note that is used within an Action to ensure the output note of that Action is of a specific type. The Split Note is not spent in the transaction. +- Split Action: a Zcash Shielded Asset Action that contains a Split Note. Abstract ======== @@ -54,44 +57,44 @@ The type will be used to enforce the balance of an Action Description [#protocol As was initially proposed by Jack Grigg and Daira Hopwood [#initial-zsa-issue]_, we propose to make this happen by changing the value base point, :math:`\mathcal{V}^{\mathsf{Orchard}}`, in the Homomorphic Pedersen Commitment that generates the value commitment, :math:`\mathsf{cv^{net}}`, of the *net value* in an Orchard Action. -Because in a single transaction all value commitments are balanced, there must be as many different value base points as there are Asset types in the transaction. We propose to make the :math:`\mathsf{type}` identifier an auxiliary input to the proof for each Action, represented already as a point on the Pallas curve. The circuit then should check that the same :math:`\mathsf{type}` is used in the old note commitment, in the new note commitment, **and** as the base point :math:`\mathcal{V}^\mathsf{Orchard}` in the value commitment. This ensures (1) that the input and output notes are of the same type, and (2) that only Actions with the same Asset type identifier will balance out in the binding and balance signatures. +Because in a single transaction all value commitments are balanced, there must be as many different value base points as there are asset types in the transaction. We propose to make the :math:`\mathsf{type}` identifier an auxiliary input to the proof, represented already as a point in the Pallas curve. The circuit then should check that the same :math:`\mathsf{type}` is used in the old note commitment, in the new note commitment **and** in the value commitment as the base point of the value. This ensures that (1) the input and output notes are of the same type, and (2) that only actions with the same asset type identifier will balance out in the binding and balance signature. -In order to ensure the security of the transfers, and as we will explain below, we are redefining input dummy notes for custom Assets, as we need to enforce that the type of the output note of that split Action is the output of a PRF. +In order to ensure the security of the transfers, and as we will explain below, we are replacing input dummy notes for custom assets, as we need to enforce that the type of the output note of that split action is the output of a PRF. -Finally, in this ZIP we also describe the *burn* mechanism, which is a direct extension of the transfer mechanism. The burn process uses a similar mechanism to what is used in Orchard to unshield ZEC, by using the :math:`\mathsf{valueBalance}` of the Asset in question. Burning Assets is useful for many purposes, including bridging of Wrapped Assets and removing supply of Native Assets. +Finally, in this ZIP we also describe the *burn* mechanism, which is a direct extension of the transfer mechanism. The burn process uses a similar mechanism than what is used in Orchard to unshield ZEC, by using the :math:`\mathsf{valueBalance}` of the asset in question. Burning assets is useful for many purposes, including bridging of wrapped assets and removing supply of native assets. -Orchard Protocol Changes -======================== +Specification +============= -Most of the protocol is kept the same as the Orchard protocol released with NU5, except the following, that will be deployed to Mainnet in subsequent network upgrades. +Most of the protocol is kept the same as the Orchard protocol released with NU5, except for the following. Asset Types ----------- -In the ZSA protocol, we include a new variable, the Asset type identifier, :math:`\mathsf{type}`, which is generated as a 32-byte string during issuance (as described in the Issuance ZIP [#zip-0227]_). The :math:`\mathsf{type}` will then be publicly hashed into the corresponding group, in this case the group of points defined on the Pallas curve, by using the :math:`\mathsf{GroupHash}` -function. In fact, every ZSA note will contain the group element representation of the Asset type identifier. This will enable a more elegant and simple version of the circuit, as we will see. +In the OSA protocol, we include a new variable, the asset type identifier, :math:`\mathsf{type}`, which is generated as a 32-byte string during issuance (as described in the Issuance ZIP [#zip-0227]_). The :math:`\mathsf{type}` will then be publicly hashed into the corresponding group, in this case the Pallas curve, by using the :math:`\mathsf{GroupHash}` +function. In fact, every ZSA note will contain the group element representation of the asset type identifier. This will enable a much more elegant and simple version of the circuit, as we will see. -We denote the string as :math:`\mathsf{type}` and we denote the equivalent group representation as :math:`\mathsf{type}_{\mathbb{G}}` when mapped into a specific group, :math:`\mathbb{G}`. Note that the type of the ZEC asset will be kept as the original value base point, :math:`\mathcal{V}^\mathsf{Orchard}` +We denote the string as :math:`\mathsf{type}` and we denote the equivalent group representation as :math:`\mathsf{type}_{\mathbb{G}}` when mapped into a specific group, :math:`\mathbb{G}`. Note that the type of the ZEC asset will be kept as the original value base-point, :math:`\mathcal{V}^\mathsf{Orchard}` -In future network and protocol upgrades, the same Asset type string can be carried on, with potentially a mapping into a different shielded protocol. In that case, the turnstile should know how to transform the Asset type from one shielded protocol to another. +In future network and protocol upgrades, the same asset type string can be carried on, with potentially a mapping into a different curve or group. In that case, the turnstile should know how to transform the asset type from one group to another one. Note Structure & Commitment --------------------------- -First, we need to adapt the components that define the Assets, i.e.: *notes*. A ZSA note differs from an Orchard note by including the type of Asset, :math:`\mathsf{type}_\mathbb{P}`. So an ZSA note looks like: +First, we need to adapt the components that define the assets, i.e.: *notes*. A ZSA note differs from an Orchard note by including the type of asset, :math:`\mathsf{type}_\mathbb{P}`. So an ZSA note looks like: :math:`(\mathsf{g_d, pk_d, v, \rho, \psi, type}_{\mathbb{P}})` -Where :math:`\mathsf{type}_\mathbb{P}` is the unique random element of the Pallas group [#protocol-pallasandvesta]_, that identifies each Asset in the Orchard protocol. +Where :math:`\mathsf{type}_\mathbb{P}` is the unique random group element that identifies each asset in the Pallas curve [#protocol-pallasandvesta]_, [#pasta-evidence]_ of the Orchard protocol. -In this case, the note commitment scheme, :math:`\mathsf{NoteCommit^{ZSA}_{rcm}}`, will differ from :math:`\mathsf{NoteCommit^{Orchard}_{rcm}}` in that for non-ZEC Assets, the type will be added as an input to the commitment computation. As we will see, the nested structure of the Sinsemilla-base commitment [#protocol-concretesinsemillacommit]_ allows us to add the type as a final step, and hence keep a single instance of the Sinsemilla hash function in the circuit for the note commitment verification. +In this case, the note commitment, :math:`\mathsf{NoteCommit^{ZSA}_{rcm}}`, will differ from :math:`\mathsf{NoteCommit^{Orchard}_{rcm}}` in that for non-ZEC assets, the type will be added as an input to the commitment computation. As we will see, the recursive structure of the Sinsemilla-base commitment [#protocol-concretesinsemillacommit]_ allows us to add the type as a final recursive step, and hence keep a single instance of the hash function in the circuit for the note commitment verification. -The commitment output is still indistinguishable from the original Orchard ZEC note commitments, by definition of the Sinsemilla hash. ZSA note commitments will therefore be added to the same Orchard Note Commitment Tree. In essence, we have +Since the commitment output is still indistinguishable with the original Orchard ZEC note commitments, by definition of the Sinsemilla hash, ZSA note commitments will be added to the same Merkle Commitment Tree. In essence, we have -:math:`\mathsf{NoteCommit^{ZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, type_\mathbb{P})} \in \mathsf{NoteCommit^{Orchard}.Output} \union \{\bot\}` +:math:`\mathsf{NoteCommit^{ZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, type_\mathbb{P})} \in \{\mathsf{cm},\bot\}` The nullifier is generated in the same manner as in the Orchard protocol. @@ -113,7 +116,7 @@ In the case of the Orchard protocol, we see that the base points :math:`\mathcal :math:`\mathcal{R}^{\mathsf{Orchard}}` are fixed for every value commitment, as the values represent the amount of ZEC being transferred. -In the case of the ZSA protocol, the value of different Asset types in a given transaction will be committed using a **different value base point**. This enables the final balance of the transaction to be securely computed, such that each Asset type is balanced independently, as Assets of different types are not meant to be mutually fungible. The value commitment then becomes +In the case of the ZSA protocol, the value of different asset types in a given transaction will be committed using a **different value base point**. This enables the final balance of the transaction to be securely computed, such that each asset type is balanced independently, as the assets are not meant to be fungible. The value commitment then becomes :math:`\mathsf{cv^{net}:=ValueCommit^{ZSA}_{rcv}(v^{net}_{type},\mathcal{V}^{\mathsf{ZSA}}_{\mathsf{type}})}:= \mathsf{[v^{net}_{type}]}\mathcal{V}^{\mathsf{ZSA}}_{\mathsf{type}}+[\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}}` @@ -121,6 +124,7 @@ In the case of the ZSA protocol, the value of different Asset types in a given t where :math:`\mathsf{v^{net}_{type}} = \mathsf{v^{old}_{type} - v^{new}_{type}}` such that :math:`\mathsf{v^*_{type}}` is the value of the note of type :math:`\mathsf{type}`, and +.. _valuebase: :math:`\mathcal{V}^{\mathsf{ZSA}}_{\mathsf{type}}:=\mathsf{type_\mathbb{P}}= \mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv",type\_params)}` @@ -131,29 +135,29 @@ Where :math:`\mathcal{V}^{\mathsf{ZSA}}_{\mathsf{ZEC}} =\mathcal{V}^{\mathsf{Orc Value Balance Verification -------------------------- -In order to verify the balance of the different Assets, the verifier MUST perform exactly the same the process as for the Orchard protocol [#protocol-binding]_. The main reason why no changes are needed is that no custom Assets can be unshielded, so all custom Assets are contained within the shielded pool. This means that the net balance of the input and output values is zero, with only one type of value balance published, that of ZEC, :math:`\mathsf{v^{balanceOrchard}}`. Therefore no net amount of any type will be revealed, and neither will the number of types in the transaction. The only exception to this is in the case that an Asset is *burnt*, as we will see below. +In order to verify the balance of the different assets, verifier performs exactly the same the process as for the Orchard protocol [#protocol-binding]_. The main reason is because no custom assets can be unshielded, so all custom assets are contained within the shielded ZSA pool. This means that the net balance of the input and output values is zero, with only one type of value balance published, that of ZEC, :math:`\mathsf{v^{balanceOrchard}}`, so no net amount of any type will be revealed, and neither the nnumber of types in the transaction. The only exception to this is in the case that an asset is *burnt*, as we will see below in burnmechanism_. -For a total of :math:`m` Actions in a transfer, the prover MUST still sign the `SIGHASH` of the transaction using the binding signature key +For a total of :math:`n` actions in a transfer, the prover can still sign the `SIGHASH` of the transaction using the binding signature key -:math:`\mathsf{bsk} = \sum_{\mathsf{ \forall i\in \{1,...,m\}}} \mathsf{rcv_{i}}` +:math:`\mathsf{bsk} = \sum_{\mathsf{ \forall i\in \{1,...,n\}}} \mathsf{rcv_{i}}` -Then the verifier MUST compute +Then we have that the verifier computes :math:`\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} = \sum \mathsf{rcv_{i}^{net}}\mathcal{R}^{\mathsf{Orchard}}` And uses it to verify the binding signature, as described in §4.14 of the Zcash Specification [#protocol-binding]_, by verifying the `bindingSignature` on the `SIGHASH` message. -As in the Orchard protocol, the binding signature verification key, :math:`\mathsf{bvk}`, will only be valid (and hence verify the signature correctly), as long as the committed values sum to zero. In contrast, in this protocol, the committed values only sum to zero **per Asset type**, as the Pedersen commitments add up homomorphically only with respect to the same value base point. +As in the Orchard protocol, the binding signature verification key, :math:`\mathsf{bvk}`, will only be valid (and hence verify the signature correctly, as long as all the value commitments (and corresponding value balances) are equal to zero. In contrast, in this protocol, the value commitments only cancel out **per asset type**, as the Pedersen commitments add up homomorphically only with respect to the same value base point. Split Notes ----------- -One of the key functionalities in a UTXO-based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This requires a 1-to-many (Orchard) transaction. However, because each Action represents and input and an output, the resulting transaction must have multiple inputs. In order to cope with this today, the Actions that have not been assigned input notes are instead given *dummy spend notes* [#protocol-dummynotes]_, which we call split Actions and split notes respectively. Basically, the input note is “faked” inside of the proof in order to hide which Action contains the *real* spend note. +One of the key functionalities in a UTXO based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This is called a 1-to-many (Orchard) transaction. In order to cope with this today, the input note of the second (third and more) Action (which we call split notes and split Actions respectively) is a *dummy spend note* [#protocol-dummynotes]_. Basically, the input note is “faked” inside of the proof in order to hide which action contains the *real* spend note. -This, however, brings some issues when it comes to adding multiple Asset types, as the output note of the split Actions *cannot* be of *any* Asset type, it must be enforced to be an actual output of a GroupHash computation (in fact we want it to be of the same type as the original input note, but the binding signature takes care that the proper balancing is performed). If not, then the prover could essentially input a multiple (or linear combination) of an existing type, with the goal to attack the network by overflowing the ZEC value balance and hence counterfeiting ZEC funds. +This, however, brings some issues when it comes to adding multiple asset types, as the output note of the split Actions *cannot* be of *any* asset type, it must be enforced to be an actual output of a GroupHash computation (in fact we want it to be of the same type as the original input note, but the binding signature takes care that the proper balancing is performed). If not, then the prover could essentially input a multiple (or linear combination of) an existing type, with the goal to attack the network by overflowing the ZEC value balance and hence counterfeiting ZEC funds. -In order to prevent this, we make some modifications to the circuit. Specifically we remove the dummy note functionality for custom Assets and we enforce that *every* input note to an ZSA Action must be proven to exist in the set of note commitments in the note commitment tree. We then enforce this real note to be “unspendable” in the sense that its value +In order to prevent this, we make some modifications to the circuit. Specifically we remove the dummy note functionality for custom assets and we enforce that *every* input note to an ZSA Action must be proven to exist in the set of note commitments in the Merkle Tree. We then enforce this real note to be “unspendable” in the sense that its value will be zeroed in split Actions and the nullifier will be randomized, making the note not spendable in the specific Action. Then, the proof itself ensures that the output note is of the same type as the input note. In the circuit, the split note functionality will be activated by a boolean private input to the proof. Note that this is enough to create a chain of induction that ensures that all output notes of a transfer are actual outputs of a GroupHash, preventing any malleability attacks, as they originate in the Issuance protocol, which is publicly verified. Furthermore, we do not care about whether the note is owned by the sender, or whether it was nullified before. Wallets and other clients have a choice to make to ensure the asset type is the preserved for the output note of a split Action, for the value balance verification: @@ -167,36 +171,35 @@ The specific circuit changes are presented below. Circuit Statement ================= -The advantage of the design described above, with respect to the circuit statement, is that every *ZSA Action statement* is kept closely similar to the Orchard Action statement [#protocol-actionstatement]_, except for a few additions that ensure the security of the Asset type system. +The advantage of the design described above, with respect to the circuit statement, is that every *ZSA Action statement* is kept closely similar to the Orchard Action statement [#protocol-actionstatement]_, except for a few additions that ensure the security of the asset type system. -**Asset Type Equality:** the following constraints must be added to ensure that -the input and output note are of the same Asset type: +**Asset Type Equality:** the following constraints must be added to ensure that the input and output note are of the +same type: -- The Asset type, :math:`\mathsf{type_\mathbb{P}}`, for the note is witnessed once, as an auxiliary input. -- The witnessed Asset type, :math:`\mathsf{type_\mathbb{P}}`, is added to the old note commitment input. -- The witnessed Asset type, :math:`\mathsf{type_\mathbb{P}}`, is added to the new note commitment input. +- The asset type, :math:`\mathsf{type_\mathbb{P}}`, for the note is witnessed once, as an auxiliary input. +- The witnessed asset type, :math:`\mathsf{type_\mathbb{P}}`, is added to the old note commitment input. +- The witnessed asset type, :math:`\mathsf{type_\mathbb{P}}`, is added to the new note commitment input. -**Correct Value Commitment Type:** the following constraints must be added to ensure that the value commitment is computed using the witnessed type, as represented in the notes: +**Correct Value Commitment Type:** the following constraints must be added to ensure that the value commitment is computed using the witnessed type, as represented in the notes - The fixed-base multiplication constraints between the value and the value base point of the value commitment,:math:`\mathsf{cv}`, is replaced with a variable-base multiplication between the two -- The witness to the value base-point is the auxiliary input :math:`\mathsf{type}_\mathbb{P}`. +- The witness to the value base-point, as defined in valuebase_ is the auxiliary input :math:`\mathsf{type}_\mathbb{P}`. -**Enforce Secure Type for Split Actions:** the following constraints MUST be added to prevent senders from malling with the Asset type for the output note in the consequent actions of the split: +**Enforce Secure Type for Split Actions:** the following constraints must be added to prevent senders from changing the asset type for the output note in the Split Actions: - The Value Commitment Integrity should be changed - Replace the input note value by a generic value, `v'`, as :math:`\mathsf{cv^net} = \mathsf{ValueCommit_rcv^OrchardType(v’ - v^new, type}_\mathbb{P})` - Add a boolean “split” variable as an auxiliary witness. This variable is to be activated `split = 1` if the Action in question is a split and `split = 0` if the Action is actually spending an input note: - - If :math:`split = 1` then constrain :math:`v' = 0` otherwise constrain :math:`v'=v^old` from the auxiliary input. - - If :math:`split = 1` then constrain :math:`v^{old} \neq 0`. -- The Merkle Path Validity should check the existence of the note commitment as usual (and not like with dummy notes): + - If `split = 1` then set `v' = 0` otherwise `v'=v^old` from the auxiliary input +- The Merkle Path Validity should check the existance of the note commitment as usual (and not like with dummy notes): - Check that (path, pos) is a valid Merkle path of depth :math:`\mathsf{MerkleDepth^Orchard}`, from :math:`\mathsf{cm^old}` to the anchor :math:`\mathsf{rt^Orchard}`. - The Nullifier Integrity will be changed to prevent the identification of notes - Replace the :math:`\psi_{old}` value with a generic :math:`\psi'` as :math:`\mathsf{nf_old = DeriveNullifier_nk}(\rho^\mathsf{old}, \psi', \mathsf{cm^old})` - - If :math:`split = 0` then constrain :math:`\psi' = \psi^\mathsf{old}`. (Otherwise :math:`\psi'` should be sampled randomly.) + - if `split = 1` set :math:`\psi' = \mathsf{randomSample}`, otherwise set :math:`\psi' = \psi^{old}` **Enabling Backwards Compatibility with ZEC Notes:** the following constraints must be added to enable backwards compatibility with the Orchard ZEC notes. -The old note commitment is computed using a “rolling-aggregate” Sinsemilla commitment. This means that the commitment is computed by adding new chunks or windows to the accumulated value. This method will be used in order to maintain a single commitment instance for the old note commitment, that will be used both for Orchard ZEC notes and for ZSA notes. The original Orchard ZEC notes will be conserved and not actually be converted into ZSA notes, as we will always need to compute them. +The old note commitment is computed using a “rolling-aggregate” sinsemilla commitment. This means that the commitment is computed by adding new chunks or windows to the accumulated value. This method will be used in order to maintain a single commitment instance for the old note commitment, that will be used both for Orchard ZEC notes and for ZSA notes. The original Orchard ZEC notes will be conserved and not actually be converted into ZSA notes, as we will always need to compute them. - The input note in the old note commitment integrity must either include a type (ZSA note) or not (ZEC-Orchard note) - If the type auxiliary input is set :math:`\mathsf{type}_\mathbb{P}` = :math:`\mathcal{V}^\mathsf{Orchard}` @@ -215,13 +218,15 @@ In order to have a "clean" backwards compatibility with the ZEC notes, we have d - The value commitment is abstracted to allow for the value base-point as a variable private input to the proof - The ZEC-based actions will still include dummy input notes, whereas the ZSA-based actions will include split input notes +.. _burnmechanism: + Burn Mechanism ============== The burn mechanism may be needed for off-boarding the wrapped assets from the chain, or enabling advanced tokenomics on native tokens. It is part of the Issuance/Burn protocol, but given that it can be seen as an extension of the Transfer protocol, we add it here for readability. -In essence, the burn mechanism is a transparent / revealing extension to the transfer protocol that enables a specific amount of any Asset type to be sent into “oblivion”. Our burn mechanism does NOT send Assets to a non-spendable address, it simply reduces the total number of units of a given Asset in circulation at the consensus level. It is enforced at the consensus level, by using an extension of the value balance mechanism used for ZEC Assets. +In essence, the burn mechanism is a transparent / revealing extension to the transfer protocol that enables a specific amount of any asset type to be sent into “oblivion”. Our burn mechanism does NOT send assets to a non-spendable address, it simply reduces the total number of assets in circulation at the consensus level. It is enforced at the consensus level, by using an extension of the value balance mechanism used for ZEC assets. -First, contrary to the strict transfer transaction, we allow the sender to include a :math:`\mathsf{valueBalance_{type}}` variable for every Asset type that is being burnt. As we will show in the transaction structure, this is separate from the regular :math:`\mathsf{valueBalance^Orchard}` that is the default transparent value for the ZEC Asset. +First, contrary to the strict transfer transaction, we allow the sender to include a :math:`\mathsf{valueBalvalueBalance_{type}}` variable for every asset type that is being burnt. As we will show in the transaction structure, this is separate from the regular :math:`\mathsf{valueBalance^Orchard}` that is the default transparent value for the ZEC asset. For every custom asset that is burnt, we add to the `assetBurn` vector the tuple :math:`(\mathsf{valueBalance_{type}, type}_\mathbb{P})` such that the validator of the transaction can compute the value commitment with the corresponding value base point of that asset. This ensures that the values are all balanced out with respect to the asset types in the transfer. @@ -236,7 +241,7 @@ Finally, the validator needs to verify the Balance and Binding Signature by addi In the case that the balance of all the action values related to a specific asset will be zero, there will be no value added to the vector. This way, the number of assets, nor their types will be revealed, except in the case that an asset is burnt. -**Note:** Even if this mechanism allows having transparent ↔ shielded asset transfers in theory, the transparent protocol will not be changed with this ZIP to adapt to a multiple asset structure. This means that unless future consensus rules changes do allow it, unshielding will not be possible for custom assets. +**Note:** Even if this mechanism allows having transparent ↔  shielded asset transfers in theory, the transparent protocol will not be changed with this ZIP to adapt to a multiple asset structure. This means that unless future consensus rules changes do allow it, the unshielding is not not be possible for custom assets. ZSA Transaction Structure ========================= @@ -271,6 +276,10 @@ Security and Privacy - When including new assets we would like to maintain the amount and types of assets private, which is achieved with the design - We prevent the "roadblock" attack on the asset type by ensuring the output notes receive a type of an asset that exists on the global state +Deplopyment +----------- +The Zcash Shielded Assets protocol should be deployed by replacing the Orchard protocol in a subsequent Network Upgrade. The design of this protocol ensures that there is no need to use any turnstile mechanism, being that Orchard-based ZEC notes can be used directly within the ZSA Actions. + Test Vectors ============ @@ -282,11 +291,6 @@ Reference Implementation - LINK TBD - LINK TBD -Deployment -========== - -This ZIP is proposed to activate with Network Upgrade 6. - References ========== From 01feec42d5b9abce6d4fe0ddce5b294ef649a58e Mon Sep 17 00:00:00 2001 From: daniben31 Date: Mon, 28 Nov 2022 12:48:02 +0100 Subject: [PATCH 011/101] fixes issuance zip and removes draft- prefix --- draft-ZIP-0226.html | 523 -------------------------------------------- draft-ZIP-0226.rst | 311 -------------------------- draft-ZIP-0227.html | 218 ------------------ draft-ZIP-0227.rst | 184 ---------------- zip-0226.html | 519 ++++++++++++++++++++++++++++++++++++++++++- zip-0226.rst | 310 +++++++++++++++++++++++++- zip-0227.html | 239 +++++++++++++++++++- zip-0227.rst | 214 +++++++++++++++++- 8 files changed, 1266 insertions(+), 1252 deletions(-) delete mode 100644 draft-ZIP-0226.html delete mode 100644 draft-ZIP-0226.rst delete mode 100644 draft-ZIP-0227.html delete mode 100644 draft-ZIP-0227.rst diff --git a/draft-ZIP-0226.html b/draft-ZIP-0226.html deleted file mode 100644 index aca617ec7..000000000 --- a/draft-ZIP-0226.html +++ /dev/null @@ -1,523 +0,0 @@ - - - - Draft ZIP-0226: Transfer and Burn of Zcash Shielded Assets - - - - -
-
ZIP: 226
-Title: Transfer and Burn of Zcash Shielded Assets
-Owners: Daniel Benarroch <daniel@qed-it.com>
-        Pablo Kogan <pablo@qed-it.com>
-        Aurelien Nicolas <aurel@qed-it.com>
-Credits: Daira Hopwood
-         Jack Grigg
-         Shahaf Nacshon
-         Vivek Arte
-Status: Draft
-Category: Consensus
-Created: 2022-05-01
-License: MIT
-Discussions-To: <https://github.com/zcash/zips/issues/618>
-

Terminology

-

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.

-

We define the following additional terms:

-
    -
  • Asset: A type of note that can be transferred on the Zcash block chain. ZEC is the default (and currently the only defined) asset for the Zcash mainnet.
  • -
  • Zcash Shielded Asset: an asset with issuance defined on the Zcash block chain, and, for now, belonging to the Orchard anonymity pool.
  • -
  • Wrapped Asset: a ZSA asset with native issuance defined outside the Zcash block chain.
  • -
-
-

Abstract

-

ZIP 226 and ZIP 227 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 5. The transfer and burn of such assets is defined in ZIP 226 4.

-
-

Motivation

-

The current Orchard protocol does not support custom assets, which is an important aspect for the proper evolution of the Zcash ecosystem. Enabling multi-asset support on the Zcash chain will open the door for a host of applications and enhance the ecosystem with application developers and asset custody institutions for issuance and bridging purposes.

-
-

Overview

-

In order to be able to represent different asset types in Orchard, one needs to define a new data field that uniquely represents the type of the asset in question, which we call - \(\mathsf{type}\) - .

-

The type will be used to enforce the balance of an action description 6 is preserved across assets (see the Orchard Binding Signature 7 , and by extension of an Orchard transaction. Mainly, the sum of all the - \(\mathsf{value^{net}}\) - , as - \(\mathsf{value^{old}-value^{new}}\) - , derived from each action description, must be balanced only with respect to the same asset type. This is specially important since we will allow different action descriptions to transfer notes of different asset types, where the overall balance is checked without revealing which assets (or how many different types) are being transferred.

-

As was initially proposed by Jack Grigg and Daira Hopwood [#initial-zsa-issue]_, we propose to make this happen by changing the value base point, - \(\mathcal{V}^{\mathsf{Orchard}}\) - , in the Homomorphic Pedersen Commitment that generates the value commitment, - \(\mathsf{cv^{net}}\) - , of the net value in an Orchard Action.

-

Because in a single transaction all value commitments are balanced, there must be as many different value base points as there are asset types in the transaction. We propose to make the - \(\mathsf{type}\) - identifier an auxiliary input to the proof, represented already as a point in the Pallas curve. The circuit then should check that the same - \(\mathsf{type}\) - is used in the old note commitment, in the new note commitment and in the value commitment as the base point of the value. This ensures that (1) the input and output notes are of the same type, and (2) that only actions with the same asset type identifier will balance out in the binding and balance signature.

-

In order to ensure the security of the transfers, and as we will explain below, we are replacing input dummy notes for custom assets, as we need to enforce that the type of the output note of that split action is the output of a PRF.

-

Finally, in this ZIP we also describe the burn mechanism, which is a direct extension of the transfer mechanism. The burn process uses a similar mechanism than what is used in Orchard to unshield ZEC, by using the - \(\mathsf{valueBalance}\) - of the asset in question. Burning assets is useful for many purposes, including bridging of wrapped assets and removing supply of native assets.

-
-

Orchard Protocol Changes

-

Most of the protocol is kept the same as the Orchard protocol released with NU5, except the following that will be deployed to mainnet in subsequent network upgrades.

-

Asset Types

-

In the OSA protocol, we include a new variable, the asset type identifier, - \(\mathsf{type}\) - , which is generated as a 32-byte string during issuance (as described in the Issuance ZIP 5). The - \(\mathsf{type}\) - will then be publicly hashed into the corresponding group, in this case the Pallas curve, by using the - \(\mathsf{GroupHash}\) - function. In fact, every ZSA note will contain the group element representation of the asset type identifier. This will enable a much more elegant and simple version of the circuit, as we will see.

-

We denote the string as - \(\mathsf{type}\) - and we denote the equivalent group representation as - \(\mathsf{type}_{\mathbb{G}}\) - when mapped into a specific group, - \(\mathbb{G}\) - . Note that the type of the ZEC asset will be kept as the original value base-point, - \(\mathcal{V}^\mathsf{Orchard}\) -

-

In future network and protocol upgrades, the same asset type string can be carried on, with potentially a mapping into a different curve or group. In that case, the turnstile should know how to transform the asset type from one group to another one.

-
-

Note Structure & Commitment

-

First, we need to adapt the components that define the assets, i.e.: notes. A ZSA note differs from an Orchard note by including the type of asset, - \(\mathsf{type}_\mathbb{P}\) - . So an ZSA note looks like:

-

- \((\mathsf{g_d, pk_d, v, \rho, \psi, type}_{\mathbb{P}})\) -

-

Where - \(\mathsf{type}_\mathbb{P}\) - is the unique random group element that identifies each asset in the Pallas curve 8, 9 of the Orchard protocol.

-

In this case, the note commitment, - \(\mathsf{NoteCommit^{ZSA}_{rcm}}\) - , will differ from - \(\mathsf{NoteCommit^{Orchard}_{rcm}}\) - in that for non-ZEC assets, the type will be added as an input to the commitment computation. As we will see, the recursive structure of the Sinsemilla-base commitment 10 allows us to add the type as a final recursive step, and hence keep a single instance of the hash function in the circuit for the note commitment verification.

-

Since the commitment output is still indistinguishable with the original Orchard ZEC note commitments, by definition of the Sinsemilla hash, ZSA note commitments will be added to the same Merkle Commitment Tree. In essence, we have

-

- \(\mathsf{NoteCommit^{ZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, type_\mathbb{P})} \in \{\mathsf{cm},\bot\}\) -

-

The nullifier is generated in the same manner as in the Orchard protocol.

-
-

Value Commitment

-

The Orchard Protocol uses a Sinsemilla-based Homomorphic Pedersen Commitment 11 which is instantiated as

-

- \(\mathsf{cv^{net}:=ValueCommit^{Orchard}_{rcv}(v^{net})}:= \mathsf{[v^{net}]}\mathcal{V}^{\mathsf{Orchard}}+[\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}}\) -

-

Where - \(\mathsf{v^{net} = v^{old} - v^{new}}\) - and

-

- \(\mathcal{V}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}(\texttt{"z.cash:Orchard-cv", "v")}\) -

-

- \(\mathcal{R}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}(\texttt{"z.cash:Orchard-cv", "r")}\) -

-

In the case of the Orchard protocol, we see that the base points - \(\mathcal{V}^{\mathsf{Orchard}}\) - and - \(\mathcal{R}^{\mathsf{Orchard}}\) - are fixed for every value commitment, as the values represent the amount of ZEC being transferred.

-

In the case of the ZSA protocol, the value of different asset types in a given transaction will be committed using a different value base point. This enables the final balance of the transaction to be securely computed, such that each asset type is balanced independently, as the assets are not meant to be fungible. The value commitment then becomes

-

- \(\mathsf{cv^{net}:=ValueCommit^{ZSA}_{rcv}(v^{net}_{type},\mathcal{V}^{\mathsf{ZSA}}_{\mathsf{type}})}:= \mathsf{[v^{net}_{type}]}\mathcal{V}^{\mathsf{ZSA}}_{\mathsf{type}}+[\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}}\) -

-

where - \(\mathsf{v^{net}_{type}} = \mathsf{v^{old}_{type} - v^{new}_{type}}\) - such that - \(\mathsf{v^*_{type}}\) - is the value of the note of type - \(\mathsf{type}\) - , and

-

- \(\mathcal{V}^{\mathsf{ZSA}}_{\mathsf{type}}:=\mathsf{type_\mathbb{P}}= \mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv",type\_params)}\) -

-

- \(\mathcal{R}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv", "r")}\) -

-

Where - \(\mathcal{V}^{\mathsf{ZSA}}_{\mathsf{ZEC}} =\mathcal{V}^{\mathsf{Orchard}}\) - .

-
-

Value Balance Verification

-

In order to verify the balance of the different assets, verifier performs exactly the same the process as for the Orchard protocol 7. The main reason is because no custom assets can be unshielded, so all custom assets are contained within the shielded ZSA pool. This means that the net balance of the input and output values is zero, with only one type of value balance published, that of ZEC, - \(\mathsf{v^{balanceOrchard}}\) - , so no net amount of any type will be revealed, and neither the nnumber of types in the transaction. The only exception to this is in the case that an asset is burnt, as we will see below.

-

For a total of - \(m\) - actions in a transfer, the prover can still sign the SIGHASH of the transaction using the binding signature key

-

- \(\mathsf{bsk} = \sum_{\mathsf{ \forall i\in \{1,...,m\}}} \mathsf{rcv_{i}}\) -

-

Then we have that the verifier computes

-

- \(\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} = \sum \mathsf{rcv_{i}^{net}}\mathcal{R}^{\mathsf{Orchard}}\) -

-

And uses it to verify the binding signature, as described in §4.14 of the Zcash Specification 7, by verifying the bindingSignature on the SIGHASH message.

-

As in the Orchard protocol, the binding signature verification key, - \(\mathsf{bvk}\) - , will only be valid (and hence verify the signature correctly, as long as all the value commitments (and corresponding value balances) are equal to zero. In contrast, in this protocol, the value commitments only cancel out per asset type, as the Pedersen commitments add up homomorphically only with respect to the same value base point.

-
-

Split Notes

-

One of the key functionalities in a UTXO based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This is called a 1-to-many (Orchard) transaction. In order to cope with this today, the input note of the second (third and more) Action (which we call split notes and split Actions respectively) is a dummy spend note 12. Basically, the input note is “faked” inside of the proof in order to hide which action contains the real spend note.

-

This, however, brings some issues when it comes to adding multiple asset types, as the output note of the split Actions cannot be of any asset type, it must be enforced to be an actual output of a GroupHash computation (in fact we want it to be of the same type as the original input note, but the binding signature takes care that the proper balancing is performed). If not, then the prover could essentially input a multiple (or linear combination of) an existing type, with the goal to attack the network by overflowing the ZEC value balance and hence counterfeiting ZEC funds.

-

In order to prevent this, we make some modifications to the circuit. Specifically we remove the dummy note functionality for custom assets and we enforce that every input note to an ZSA Action must be proven to exist in the set of note commitments in the Merkle Tree. We then enforce this real note to be “unspendable” in the sense that its value will be zeroed in split Actions and the nullifier will be randomized, making the note not spendable in the specific Action. Then, the proof itself ensures that the output note is of the same type as the input note. In the circuit, the split note functionality will be activated by a boolean private input to the proof.

-

Note that this is enough to create a chain of induction that ensures that all output notes of a transfer are actual outputs of a GroupHash, preventing any malleability attacks, as they originate in the Issuance protocol, which is publicly verified. Furthermore, we do not care about whether the note is owned by the sender, or whether it was nullified before. Wallets and other clients have a choice to make to ensure the asset type is the preserved for the output note of a split Action, for the value balance verification:

-
    -
  1. The split input note could be the same note as the original (non-split) Action,
  2. -
  3. The split input note could be a different unspent note of the same type (note that the note will not actually be spent)
  4. -
  5. The split input note could be an already spent note of the same type (note that by zeroing the value in the circuit, we prevent double spending)
  6. -
-

The specific circuit changes are presented below.

-
-
-

Circuit Statement

-

The advantage of the design described above, with respect to the circuit statement, is that every ZSA Action statement is kept closely similar to the Orchard Action statement 13, except for a few additions that ensure the security of the asset type system.

-

Asset Type Equality: the following constraints must be added to ensure that the input and output note are of the same type:

-
    -
  • The asset type, - \(\mathsf{type_\mathbb{P}}\) - , for the note is witnessed once, as an auxiliary input.
  • -
  • The witnessed asset type, - \(\mathsf{type_\mathbb{P}}\) - , is added to the old note commitment input.
  • -
  • The witnessed asset type, - \(\mathsf{type_\mathbb{P}}\) - , is added to the new note commitment input.
  • -
-

Correct Value Commitment Type: the following constraints must be added to ensure that the value commitment is computed using the witnessed type, as represented in the notes

-
    -
  • The fixed-base multiplication constraints between the value and the value base point of the value commitment,:math:mathsf{cv}, is replaced with a variable-base multiplication between the two
  • -
  • The witness to the value base-point is the auxiliary input - \(\mathsf{type}_\mathbb{P}\) - .
  • -
-

Enforce Secure Type for Split Actions: the following constraints must be added to prevent senders from malling with the asset type for the output note in the consequent actions of the split:

-
    -
  • -
    -
    The Value Commitment Integrity should be changed
    -
    -
      -
    • Replace the input note value by a generic value, v', as - \(\mathsf{cv^net} = \mathsf{ValueCommit_rcv^OrchardType(v’ - v^new, type}_\mathbb{P})\) -
    • -
    -
    -
    -
  • -
  • -
    -
    Add a boolean “split” variable as an auxiliary witness. This variable is to be activated split = 1 if the Action in question is a split and split = 0 if the Action is actually spending an input note:
    -
    -
      -
    • If split = 1 then set v' = 0 otherwise v'=v^old from the auxiliary input
    • -
    -
    -
    -
  • -
  • -
    -
    The Merkle Path Validity should check the existance of the note commitment as usual (and not like with dummy notes):
    -
    -
      -
    • Check that (path, pos) is a valid Merkle path of depth - \(\mathsf{MerkleDepth^Orchard}\) - , from - \(\mathsf{cm^old}\) - to the anchor - \(\mathsf{rt^Orchard}\) - .
    • -
    -
    -
    -
  • -
  • -
    -
    The Nullifier Integrity will be changed to prevent the identification of notes
    -
    -
      -
    • Replace the - \(\psi_{old}\) - value with a generic - \(\psi'\) - as - \(\mathsf{nf_old = DeriveNullifier_nk}(\rho^\mathsf{old}, \psi', \mathsf{cm^old})\) -
    • -
    • if split = 1 set - \(\psi' = \mathsf{randomSample}\) - , otherwise set - \(\psi' = \psi^{old}\) -
    • -
    -
    -
    -
  • -
-

Enabling Backwards Compatibility with ZEC Notes: the following constraints must be added to enable backwards compatibility with the Orchard ZEC notes.

-

The old note commitment is computed using a “rolling-aggregate” sinsemilla commitment. This means that the commitment is computed by adding new chunks or windows to the accumulated value. This method will be used in order to maintain a single commitment instance for the old note commitment, that will be used both for Orchard ZEC notes and for ZSA notes. The original Orchard ZEC notes will be conserved and not actually be converted into ZSA notes, as we will always need to compute them.

-
    -
  • -
    -
    The input note in the old note commitment integrity must either include a type (ZSA note) or not (ZEC-Orchard note)
    -
    -
      -
    • -
      -
      If the type auxiliary input is set - \(\mathsf{type}_\mathbb{P}\) - = - \(\mathcal{V}^\mathsf{Orchard}\) -
      -
      -
        -
      • NoteCommitment has a “compatibility” path that computes the note commitment as in plain Orchard (i.e.: without including the type)
      • -
      • This path also uses the original domain separator for ZEC note commitment
      • -
      -
      -
      -
    • -
    • -
      -
      Else,
      -
      -
        -
      • The NoteCommitment adds the type, - \(\mathsf{type}_\mathbb{P}\) - , as a final “chunk” of the Sinsemilla commitment
      • -
      • The NoteCommitment uses a different domain separator for ZSA note commitment
      • -
      -
      -
      -
    • -
    -
    -
    -
  • -
-

Backward Compatibility

-

In order to have a "clean" backwards compatibility with the ZEC notes, we have designed the circuit to support both ZEC and ZSA notes. As we specify above, there are three main reasons we can do this: - The input notes with a type denote the ZSA custom assets, generating a note commitment that includes the type; whereas the notes without a type, denote the ZEC notes, and generate a note commitment that does not include the type, in order to maintain the referencability to the Merkle tree - The value commitment is abstracted to allow for the value base-point as a variable private input to the proof - The ZEC-based actions will still include dummy input notes, whereas the ZSA-based actions will include split input notes

-
-
-

Burn Mechanism

-

The burn mechanism may be needed for off-boarding the wrapped assets from the chain, or enabling advanced tokenomics on native tokens. It is part of the Issuance/Burn protocol, but given that it can be seen as an extension of the Transfer protocol, we add it here for readability.

-

In essence, the burn mechanism is a transparent / revealing extension to the transfer protocol that enables a specific amount of any asset type to be sent into “oblivion”. Our burn mechanism does NOT send assets to a non-spendable address, it simply reduces the total number of assets in circulation at the consensus level. It is enforced at the consensus level, by using an extension of the value balance mechanism used for ZEC assets.

-

First, contrary to the strict transfer transaction, we allow the sender to include a - \(\mathsf{valueBalvalueBalance_{type}}\) - variable for every asset type that is being burnt. As we will show in the transaction structure, this is separate from the regular - \(\mathsf{valueBalance^Orchard}\) - that is the default transparent value for the ZEC asset.

-

For every custom asset that is burnt, we add to the assetBurn vector the tuple - \((\mathsf{valueBalance_{type}, type}_\mathbb{P})\) - such that the validator of the transaction can compute the value commitment with the corresponding value base point of that asset. This ensures that the values are all balanced out with respect to the asset types in the transfer.

-

- \(\mathsf{assetBurn = [(v^{type}, type_\mathbb{P})}| \forall \mathsf{type}_\mathbb{P} \textit{ s.t.}\mathsf{v^{type}\neq 0}]\) -

-

The value balances for each asset type in assetBurn represents the amount of that asset type that is being burnt. In the case of ZEC, the value balance represents either the transaction fee, or the amount of ZEC changing anonymity pools (to Sapling or Transparent).

-

Finally, the validator needs to verify the Balance and Binding Signature by adding the value balances for all assets, as committed using their respective types as the value base point of the Pedersen Commitment. This is done as follows

-

- \(\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} - \sum_{\forall \mathsf{type}\textit{ s.t. }\mathsf{v^{type}\neq 0}} \mathsf{Value Commit_0^{ZSA}(v^{type}type_\mathbb{P}) } = \sum \mathsf{rcv_{i,j}^{net}}\mathcal{R}^{\mathsf{Orchard}}\) -

-

In the case that the balance of all the action values related to a specific asset will be zero, there will be no value added to the vector. This way, the number of assets, nor their types will be revealed, except in the case that an asset is burnt.

-

Note: Even if this mechanism allows having transparent ↔ shielded asset transfers in theory, the transparent protocol will not be changed with this ZIP to adapt to a multiple asset structure. This means that unless future consensus rules changes do allow it, the unshielding is not not be possible for custom assets.

-
-

ZSA Transaction Structure

-

Similar to NU5 transaction structure, with the following modifications to the Orchard bundle, as defined in 14:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
BytesNameData TypeDescription
newActionSize * nActionsZSAvActionsZSAActionDescription[nActionOrchard]
variesnAssetBurncompactSizenumber of assets burnt
40*nAssetBurnvAssetBurnbytes[40][nAssetBurn]32 bytes asset type_t, 8 bytes of valueBalance
-
-

Other Considerations

-

Transaction Fees

-

In order to maintain the ZEC economic incentive, the first version of the fees mechanism will be exactly the same as the current Orchard protocol and will always be paid in ZEC denomination. The ECC and GMU team produced a study on fees market on Zcash 15

-
-

Security and Privacy

-
    -
  • Even if the Orchard protocol and ZSA protocol do not share the same anonymity pool (nodes can keep track of the notes that where published with different transaction structures), the migration from one to the other is done automatically and seamlessly. The Orchard bundle will be replaced by the ZSA bundle and all ZEC notes will be fully spendable with the new transaction structure.
  • -
  • When including new assets we would like to maintain the amount and types of assets private, which is achieved with the design
  • -
  • We prevent the "roadblock" attack on the asset type by ensuring the output notes receive a type of an asset that exists on the global state
  • -
-
-
-

Test Vectors

-
    -
  • LINK TBD
  • -
-
-

Reference Implementation

-
    -
  • LINK TBD
  • -
  • LINK TBD
  • -
-
-

Deployment

-

This ZIP is proposed to activate with Network Upgrade 6.

-
-

References

- - - - - - - -
1RFC 2119: Key words for use in RFCs to Indicate Requirement Levels
- - - - - - - -
2ZIP 200: Network Upgrade Mechanism
- - - - - - - -
3ZIP 224: Orchard
- - - - - - - -
4ZIP 226: Transfer and Burn of Zcash Shielded Assets
- - - - - - - -
5ZIP 227: Issuance of Zcash Shielded Assets
- - - - - - - -
6Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 3.7: Action Transfers and their Descriptions
- - - - - - - -
7Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.14: Balance and Binding Signature (Orchard)
- - - - - - - -
8Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.9.6: Pallas and Vesta
- - - - - - - -
9Pallas/Vesta supporting evidence
- - - - - - - -
10Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.8.4: Sinsemilla commitments
- - - - - - - -
11Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.8.3: Homomorphic Pedersen commitments (Sapling and Orchard)
- - - - - - - -
12Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.8.3: Dummy Notes (Orchard)
- - - - - - - -
13Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.17.4: Action Statement (Orchard)
- - - - - - - -
14Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 7.1: Transaction Encoding and Consensus (Transaction Version 5)
- - - - - - - -
15A Study of Decentralized Markets on the Zcash Blockchain
-
-
-
-

Docutils System Messages

-
-

System Message: ERROR/3 (draft-ZIP-0226.rst line 52)

-

Too many autonumbered footnote references: only 0 corresponding footnotes available.

-
-
-

System Message: ERROR/3 (draft-ZIP-0226.rst line 52) id8

-

Unknown target name: "initial-zsa-issue".

-
-
- - \ No newline at end of file diff --git a/draft-ZIP-0226.rst b/draft-ZIP-0226.rst deleted file mode 100644 index f3b01838e..000000000 --- a/draft-ZIP-0226.rst +++ /dev/null @@ -1,311 +0,0 @@ -:: - - ZIP: 226 - Title: Transfer and Burn of Zcash Shielded Assets - Owners: Daniel Benarroch - Pablo Kogan - Aurelien Nicolas - Credits: Daira Hopwood - Jack Grigg - Shahaf Nacshon - Vivek Arte - Status: Draft - Category: Consensus - Created: 2022-05-01 - License: MIT - Discussions-To: - - -Terminology -=========== - -The key word "MUST" in this document is to be interpreted as described in RFC 2119 [#RFC2119]_. - -The term "network upgrade" in this document is to be interpreted as described in ZIP 200 [#zip-0200]_. - -The term "Orchard" in this document is to be interpreted as described in ZIP 224 [#zip-0224]_. - -We define the following additional terms: - -- Asset: A type of note that can be transferred on the Zcash block chain. - - - ZEC is the default (and currently the only defined) asset for the Zcash mainnet. - -- Zcash Shielded Asset: an Asset with issuance defined on the Zcash block chain, and, for now, belonging to the Orchard shielded pool. -- Wrapped Asset: a Zcash Shielded Asset with native issuance defined outside the Zcash block chain. -- Native Asset: a Zcash Shielded Asset created uniquely within the Zcash block chain. -- Split Note: a Zcash Shielded Asset spend note that is used within an Action to ensure the output note of that Action is of a specific type. The Split Note is not spent in the transaction. -- Split Action: a Zcash Shielded Asset Action that contains a Split Note. - -Abstract -======== - -ZIP 226 and ZIP 227 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 [#zip-0227]_. The transfer and burn of such assets is defined in ZIP 226 [#zip-0226]_. - -Motivation -========== - -The current Orchard protocol does not support custom assets. Enabling multi-asset support on the Zcash chain will open the door for a host of applications and enhance the ecosystem with application developers and asset custody institutions for issuance and bridging purposes. - -Overview -======== -In order to be able to represent different Asset types in Orchard, we need to define a new data field that uniquely represents the *type* of the Asset in question, which we call :math:`\mathsf{type}`. - -The type will be used to enforce the balance of an Action Description [#protocol-actions]_ is preserved across Assets (see the Orchard Binding Signature [#protocol-binding]_), and by extension the balance of an Orchard transaction. That is, the sum of all the :math:`\mathsf{value^{net}}` from each Action Description, computed as :math:`\mathsf{value^{old}-value^{new}}`, must be balanced **only with respect to the same Asset type**. This is specially important since we will allow different Action Descriptions to transfer notes of different Asset types, where the overall balance is checked without revealing which Assets (or how many different types) are being transferred. - -As was initially proposed by Jack Grigg and Daira Hopwood [#initial-zsa-issue]_, we propose to make this happen by changing the value base point, :math:`\mathcal{V}^{\mathsf{Orchard}}`, in the Homomorphic Pedersen Commitment that generates the value commitment, :math:`\mathsf{cv^{net}}`, of the *net value* in an Orchard Action. - -Because in a single transaction all value commitments are balanced, there must be as many different value base points as there are asset types in the transaction. We propose to make the :math:`\mathsf{type}` identifier an auxiliary input to the proof, represented already as a point in the Pallas curve. The circuit then should check that the same :math:`\mathsf{type}` is used in the old note commitment, in the new note commitment **and** in the value commitment as the base point of the value. This ensures that (1) the input and output notes are of the same type, and (2) that only actions with the same asset type identifier will balance out in the binding and balance signature. - -In order to ensure the security of the transfers, and as we will explain below, we are replacing input dummy notes for custom assets, as we need to enforce that the type of the output note of that split action is the output of a PRF. - -Finally, in this ZIP we also describe the *burn* mechanism, which is a direct extension of the transfer mechanism. The burn process uses a similar mechanism than what is used in Orchard to unshield ZEC, by using the :math:`\mathsf{valueBalance}` of the asset in question. Burning assets is useful for many purposes, including bridging of wrapped assets and removing supply of native assets. - -Specification -============= - -Most of the protocol is kept the same as the Orchard protocol released with NU5, except for the following. - -Asset Types ------------ - -In the OSA protocol, we include a new variable, the asset type identifier, :math:`\mathsf{type}`, which is generated as a 32-byte string during issuance (as described in the Issuance ZIP [#zip-0227]_). The :math:`\mathsf{type}` will then be publicly hashed into the corresponding group, in this case the Pallas curve, by using the :math:`\mathsf{GroupHash}` -function. In fact, every ZSA note will contain the group element representation of the asset type identifier. This will enable a much more elegant and simple version of the circuit, as we will see. - -We denote the string as :math:`\mathsf{type}` and we denote the equivalent group representation as :math:`\mathsf{type}_{\mathbb{G}}` when mapped into a specific group, :math:`\mathbb{G}`. Note that the type of the ZEC asset will be kept as the original value base-point, :math:`\mathcal{V}^\mathsf{Orchard}` - -In future network and protocol upgrades, the same asset type string can be carried on, with potentially a mapping into a different curve or group. In that case, the turnstile should know how to transform the asset type from one group to another one. - -Note Structure & Commitment ---------------------------- - -First, we need to adapt the components that define the assets, i.e.: *notes*. A ZSA note differs from an Orchard note by including the type of asset, :math:`\mathsf{type}_\mathbb{P}`. So an ZSA note looks like: - - -:math:`(\mathsf{g_d, pk_d, v, \rho, \psi, type}_{\mathbb{P}})` - - -Where :math:`\mathsf{type}_\mathbb{P}` is the unique random group element that identifies each asset in the Pallas curve [#protocol-pallasandvesta]_, [#pasta-evidence]_ of the Orchard protocol. - -In this case, the note commitment, :math:`\mathsf{NoteCommit^{ZSA}_{rcm}}`, will differ from :math:`\mathsf{NoteCommit^{Orchard}_{rcm}}` in that for non-ZEC assets, the type will be added as an input to the commitment computation. As we will see, the recursive structure of the Sinsemilla-base commitment [#protocol-concretesinsemillacommit]_ allows us to add the type as a final recursive step, and hence keep a single instance of the hash function in the circuit for the note commitment verification. - -Since the commitment output is still indistinguishable with the original Orchard ZEC note commitments, by definition of the Sinsemilla hash, ZSA note commitments will be added to the same Merkle Commitment Tree. In essence, we have - - -:math:`\mathsf{NoteCommit^{ZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, type_\mathbb{P})} \in \{\mathsf{cm},\bot\}` - - -The nullifier is generated in the same manner as in the Orchard protocol. - -Value Commitment ----------------- - -The Orchard Protocol uses a Sinsemilla-based Homomorphic Pedersen Commitment [#protocol-concretevaluecommit]_ which is instantiated as - -:math:`\mathsf{cv^{net}:=ValueCommit^{Orchard}_{rcv}(v^{net})}:= \mathsf{[v^{net}]}\mathcal{V}^{\mathsf{Orchard}}+[\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}}` - -Where :math:`\mathsf{v^{net} = v^{old} - v^{new}}` and - -:math:`\mathcal{V}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}(\texttt{"z.cash:Orchard-cv", "v")}` - -:math:`\mathcal{R}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}(\texttt{"z.cash:Orchard-cv", "r")}` - -In the case of the Orchard protocol, we see that the base points :math:`\mathcal{V}^{\mathsf{Orchard}}` and -:math:`\mathcal{R}^{\mathsf{Orchard}}` are fixed for every value commitment, as the values represent the amount of ZEC -being transferred. - -In the case of the ZSA protocol, the value of different asset types in a given transaction will be committed using a **different value base point**. This enables the final balance of the transaction to be securely computed, such that each asset type is balanced independently, as the assets are not meant to be fungible. The value commitment then becomes - - -:math:`\mathsf{cv^{net}:=ValueCommit^{ZSA}_{rcv}(v^{net}_{type},\mathcal{V}^{\mathsf{ZSA}}_{\mathsf{type}})}:= \mathsf{[v^{net}_{type}]}\mathcal{V}^{\mathsf{ZSA}}_{\mathsf{type}}+[\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}}` - - -where :math:`\mathsf{v^{net}_{type}} = \mathsf{v^{old}_{type} - v^{new}_{type}}` such that :math:`\mathsf{v^*_{type}}` is the value of the note of type :math:`\mathsf{type}`, and - -.. _valuebase: - -:math:`\mathcal{V}^{\mathsf{ZSA}}_{\mathsf{type}}:=\mathsf{type_\mathbb{P}}= \mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv",type\_params)}` - -:math:`\mathcal{R}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv", "r")}` - -Where :math:`\mathcal{V}^{\mathsf{ZSA}}_{\mathsf{ZEC}} =\mathcal{V}^{\mathsf{Orchard}}`. - -Value Balance Verification --------------------------- - -In order to verify the balance of the different assets, verifier performs exactly the same the process as for the Orchard protocol [#protocol-binding]_. The main reason is because no custom assets can be unshielded, so all custom assets are contained within the shielded ZSA pool. This means that the net balance of the input and output values is zero, with only one type of value balance published, that of ZEC, :math:`\mathsf{v^{balanceOrchard}}`, so no net amount of any type will be revealed, and neither the nnumber of types in the transaction. The only exception to this is in the case that an asset is *burnt*, as we will see below in burnmechanism_. - -For a total of :math:`n` actions in a transfer, the prover can still sign the `SIGHASH` of the transaction using the binding signature key - -:math:`\mathsf{bsk} = \sum_{\mathsf{ \forall i\in \{1,...,n\}}} \mathsf{rcv_{i}}` - -Then we have that the verifier computes - -:math:`\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} = \sum \mathsf{rcv_{i}^{net}}\mathcal{R}^{\mathsf{Orchard}}` - - -And uses it to verify the binding signature, as described in §4.14 of the Zcash Specification [#protocol-binding]_, by verifying the `bindingSignature` on the `SIGHASH` message. - -As in the Orchard protocol, the binding signature verification key, :math:`\mathsf{bvk}`, will only be valid (and hence verify the signature correctly, as long as all the value commitments (and corresponding value balances) are equal to zero. In contrast, in this protocol, the value commitments only cancel out **per asset type**, as the Pedersen commitments add up homomorphically only with respect to the same value base point. - -Split Notes ------------ - -One of the key functionalities in a UTXO based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This is called a 1-to-many (Orchard) transaction. In order to cope with this today, the input note of the second (third and more) Action (which we call split notes and split Actions respectively) is a *dummy spend note* [#protocol-dummynotes]_. Basically, the input note is “faked” inside of the proof in order to hide which action contains the *real* spend note. - -This, however, brings some issues when it comes to adding multiple asset types, as the output note of the split Actions *cannot* be of *any* asset type, it must be enforced to be an actual output of a GroupHash computation (in fact we want it to be of the same type as the original input note, but the binding signature takes care that the proper balancing is performed). If not, then the prover could essentially input a multiple (or linear combination of) an existing type, with the goal to attack the network by overflowing the ZEC value balance and hence counterfeiting ZEC funds. - -In order to prevent this, we make some modifications to the circuit. Specifically we remove the dummy note functionality for custom assets and we enforce that *every* input note to an ZSA Action must be proven to exist in the set of note commitments in the Merkle Tree. We then enforce this real note to be “unspendable” in the sense that its value -will be zeroed in split Actions and the nullifier will be randomized, making the note not spendable in the specific Action. Then, the proof itself ensures that the output note is of the same type as the input note. In the circuit, the split note functionality will be activated by a boolean private input to the proof. - -Note that this is enough to create a chain of induction that ensures that all output notes of a transfer are actual outputs of a GroupHash, preventing any malleability attacks, as they originate in the Issuance protocol, which is publicly verified. Furthermore, we do not care about whether the note is owned by the sender, or whether it was nullified before. Wallets and other clients have a choice to make to ensure the asset type is the preserved for the output note of a split Action, for the value balance verification: - -1. The split input note could be the same note as the original (non-split) Action, -2. The split input note could be a different unspent note of the same type (note that the note will not actually be spent) -3. The split input note could be an already spent note of the same type (note that by zeroing the value in the circuit, we prevent double spending) - -The specific circuit changes are presented below. - -Circuit Statement -================= - -The advantage of the design described above, with respect to the circuit statement, is that every *ZSA Action statement* is kept closely similar to the Orchard Action statement [#protocol-actionstatement]_, except for a few additions that ensure the security of the asset type system. - -**Asset Type Equality:** the following constraints must be added to ensure that the input and output note are of the -same type: - -- The asset type, :math:`\mathsf{type_\mathbb{P}}`, for the note is witnessed once, as an auxiliary input. -- The witnessed asset type, :math:`\mathsf{type_\mathbb{P}}`, is added to the old note commitment input. -- The witnessed asset type, :math:`\mathsf{type_\mathbb{P}}`, is added to the new note commitment input. - -**Correct Value Commitment Type:** the following constraints must be added to ensure that the value commitment is computed using the witnessed type, as represented in the notes - -- The fixed-base multiplication constraints between the value and the value base point of the value commitment,:math:`\mathsf{cv}`, is replaced with a variable-base multiplication between the two -- The witness to the value base-point, as defined in valuebase_ is the auxiliary input :math:`\mathsf{type}_\mathbb{P}`. - -**Enforce Secure Type for Split Actions:** the following constraints must be added to prevent senders from changing the asset type for the output note in the Split Actions: - -- The Value Commitment Integrity should be changed - - Replace the input note value by a generic value, `v'`, as :math:`\mathsf{cv^net} = \mathsf{ValueCommit_rcv^OrchardType(v’ - v^new, type}_\mathbb{P})` -- Add a boolean “split” variable as an auxiliary witness. This variable is to be activated `split = 1` if the Action in question is a split and `split = 0` if the Action is actually spending an input note: - - If `split = 1` then set `v' = 0` otherwise `v'=v^old` from the auxiliary input -- The Merkle Path Validity should check the existance of the note commitment as usual (and not like with dummy notes): - - Check that (path, pos) is a valid Merkle path of depth :math:`\mathsf{MerkleDepth^Orchard}`, from :math:`\mathsf{cm^old}` to the anchor :math:`\mathsf{rt^Orchard}`. -- The Nullifier Integrity will be changed to prevent the identification of notes - - Replace the :math:`\psi_{old}` value with a generic :math:`\psi'` as :math:`\mathsf{nf_old = DeriveNullifier_nk}(\rho^\mathsf{old}, \psi', \mathsf{cm^old})` - - if `split = 1` set :math:`\psi' = \mathsf{randomSample}`, otherwise set :math:`\psi' = \psi^{old}` - -**Enabling Backwards Compatibility with ZEC Notes:** the following constraints must be added to enable backwards compatibility with the Orchard ZEC notes. - -The old note commitment is computed using a “rolling-aggregate” sinsemilla commitment. This means that the commitment is computed by adding new chunks or windows to the accumulated value. This method will be used in order to maintain a single commitment instance for the old note commitment, that will be used both for Orchard ZEC notes and for ZSA notes. The original Orchard ZEC notes will be conserved and not actually be converted into ZSA notes, as we will always need to compute them. - -- The input note in the old note commitment integrity must either include a type (ZSA note) or not (ZEC-Orchard note) - - If the type auxiliary input is set :math:`\mathsf{type}_\mathbb{P}` = :math:`\mathcal{V}^\mathsf{Orchard}` - - NoteCommitment has a “compatibility” path that computes the note commitment as in plain Orchard (i.e.: without including the type) - - This path also uses the original domain separator for ZEC note commitment - - Else, - - The NoteCommitment adds the type, :math:`\mathsf{type}_\mathbb{P}`, as a final “chunk” of the Sinsemilla commitment - - The NoteCommitment uses a different domain separator for ZSA note commitment - - -Backward Compatibility ----------------------- - -In order to have a "clean" backwards compatibility with the ZEC notes, we have designed the circuit to support both ZEC and ZSA notes. As we specify above, there are three main reasons we can do this: -- The input notes with a type denote the ZSA custom assets, generating a note commitment that includes the type; whereas the notes without a type, denote the ZEC notes, and generate a note commitment that does not include the type, in order to maintain the referencability to the Merkle tree -- The value commitment is abstracted to allow for the value base-point as a variable private input to the proof -- The ZEC-based actions will still include dummy input notes, whereas the ZSA-based actions will include split input notes - -.. _burnmechanism: - -Burn Mechanism -============== -The burn mechanism may be needed for off-boarding the wrapped assets from the chain, or enabling advanced tokenomics on native tokens. It is part of the Issuance/Burn protocol, but given that it can be seen as an extension of the Transfer protocol, we add it here for readability. - -In essence, the burn mechanism is a transparent / revealing extension to the transfer protocol that enables a specific amount of any asset type to be sent into “oblivion”. Our burn mechanism does NOT send assets to a non-spendable address, it simply reduces the total number of assets in circulation at the consensus level. It is enforced at the consensus level, by using an extension of the value balance mechanism used for ZEC assets. - -First, contrary to the strict transfer transaction, we allow the sender to include a :math:`\mathsf{valueBalvalueBalance_{type}}` variable for every asset type that is being burnt. As we will show in the transaction structure, this is separate from the regular :math:`\mathsf{valueBalance^Orchard}` that is the default transparent value for the ZEC asset. - -For every custom asset that is burnt, we add to the `assetBurn` vector the tuple :math:`(\mathsf{valueBalance_{type}, type}_\mathbb{P})` such that the validator of the transaction can compute the value commitment with the corresponding value base point of that asset. This ensures that the values are all balanced out with respect to the asset types in the transfer. - - -:math:`\mathsf{assetBurn = [(v^{type}, type_\mathbb{P})}| \forall \mathsf{type}_\mathbb{P} \textit{ s.t.}\mathsf{v^{type}\neq 0}]` - -The value balances for each asset type in `assetBurn` represents the amount of that asset type that is being burnt. In the case of ZEC, the value balance represents either the transaction fee, or the amount of ZEC changing anonymity pools (to Sapling or Transparent). - -Finally, the validator needs to verify the Balance and Binding Signature by adding the value balances for all assets, as committed using their respective types as the value base point of the Pedersen Commitment. This is done as follows - -:math:`\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} - \sum_{\forall \mathsf{type}\textit{ s.t. }\mathsf{v^{type}\neq 0}} \mathsf{Value Commit_0^{ZSA}(v^{type}type_\mathbb{P}) } = \sum \mathsf{rcv_{i,j}^{net}}\mathcal{R}^{\mathsf{Orchard}}` - -In the case that the balance of all the action values related to a specific asset will be zero, there will be no value added to the vector. This way, the number of assets, nor their types will be revealed, except in the case that an asset is burnt. - -**Note:** Even if this mechanism allows having transparent ↔  shielded asset transfers in theory, the transparent protocol will not be changed with this ZIP to adapt to a multiple asset structure. This means that unless future consensus rules changes do allow it, the unshielding is not not be possible for custom assets. - -ZSA Transaction Structure -========================= -Similar to NU5 transaction structure, with the following modifications to the Orchard bundle, as defined in [#protocol-transactionstructure]_: - -+-----------------+-------------+-----------------------------------+-------------------------+ -| Bytes | Name | Data Type | Description | -+=================+=============+===================================+=========================+ -| newActionSize * | vActionsZSA | ActionDescription[nActionOrchard] | | -| nActionsZSA | | | | -+-----------------+-------------+-----------------------------------+-------------------------+ -| varies | nAssetBurn | compactSize | number of assets burnt | -+-----------------+-------------+-----------------------------------+-------------------------+ -| 40*nAssetBurn | vAssetBurn | bytes[40][nAssetBurn] | 32 bytes asset type_t, | -| | | | 8 bytes of valueBalance | -+-----------------+-------------+-----------------------------------+-------------------------+ - -Other Considerations -==================== - -Transaction Fees ----------------- - -In order to maintain the ZEC economic incentive, the first version of the fees mechanism will be exactly the same as -the current Orchard protocol and will always be paid in ZEC denomination. The ECC and GMU team produced a study on -fees market on Zcash [#fees-study-GMU]_ - -Security and Privacy --------------------- - -- Even if the Orchard protocol and ZSA protocol do not share the same anonymity pool (nodes can keep track of the notes that where published with different transaction structures), the migration from one to the other is done automatically and seamlessly. The Orchard bundle will be replaced by the ZSA bundle and all ZEC notes will be fully spendable with the new transaction structure. -- When including new assets we would like to maintain the amount and types of assets private, which is achieved with the design -- We prevent the "roadblock" attack on the asset type by ensuring the output notes receive a type of an asset that exists on the global state - -Deplopyment ------------ -The Zcash Shielded Assets protocol should be deployed by replacing the Orchard protocol in a subsequent Network Upgrade. The design of this protocol ensures that there is no need to use any turnstile mechanism, being that Orchard-based ZEC notes can be used directly within the ZSA Actions. - -Test Vectors -============ - -- LINK TBD - -Reference Implementation -======================== - -- LINK TBD -- LINK TBD - -References -========== - -.. [#RFC2119] `RFC 2119: Key words for use in RFCs to Indicate Requirement Levels `_ -.. [#zip-0200] `ZIP 200: Network Upgrade Mechanism `_ -.. [#zip-0224] `ZIP 224: Orchard `_ -.. [#zip-0226] `ZIP 226: Transfer and Burn of Zcash Shielded Assets `_ -.. [#zip-0227] `ZIP 227: Issuance of Zcash Shielded Assets `_ -.. [#protocol-actions] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 3.7: Action Transfers and their Descriptions `_ -.. [#protocol-binding] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.14: Balance and Binding Signature (Orchard) `_ -.. [#protocol-pallasandvesta] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.9.6: Pallas and Vesta `_ -.. [#pasta-evidence] `Pallas/Vesta supporting evidence `_ -.. [#protocol-concretesinsemillacommit] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.8.4: Sinsemilla commitments `_ -.. [#protocol-concretevaluecommit] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.8.3: Homomorphic Pedersen commitments (Sapling and Orchard) `_ -.. [#protocol-dummynotes] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.8.3: Dummy Notes (Orchard) `_ -.. [#protocol-actionstatement] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.17.4: Action Statement (Orchard) `_ -.. [#protocol-transactionstructure] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 7.1: Transaction Encoding and Consensus (Transaction Version 5) `_ -.. [#fees-study-GMU] `A Study of Decentralized Markets on the Zcash Blockchain `_ diff --git a/draft-ZIP-0227.html b/draft-ZIP-0227.html deleted file mode 100644 index 8acd51d27..000000000 --- a/draft-ZIP-0227.html +++ /dev/null @@ -1,218 +0,0 @@ - - - - Draft ZIP-0227: Issuance of Zcash Shielded Assets - - - - -
-
ZIP: 227
-Title: Issuance of Zcash Shielded Assets
-Owners: Daniel Benarroch <daniel@qed-it.com>
-        Pablo Kogan <pablo@qed-it.com>
-        Aurelien Nicolas <aurel@qed-it.com>
-Credits: Daira Hopwood
-         Jack Grigg
-         Shahaf Nacshon
-         Vivek Arte
-Status: Draft
-Category: Consensus
-Created: 2022-05-01
-License: MIT
-Discussions-To: <https://github.com/zcash/zips/issues/618>
-

Terminology

-

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.

-

We define the following additional terms:

-
    -
  • Asset: A type of note that can be transferred on the Zcash block chain. ZEC is the default (and currently the only defined) asset for the Zcash mainnet.
  • -
  • Zcash Shielded Asset: an asset with issuance defined on the Zcash block chain, and, for now, belonging to the Orchard anonymity pool.
  • -
  • Wrapped Asset: a ZSA asset with native issuance defined outside the Zcash block chain.
  • -
-
-

Abstract

-

ZIP 226 4 and ZIP 227 5 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 5. The transfer and burn of such assets is defined in ZIP 226 4.

-
-

Motivation

-

The current Orchard protocol does not support custom assets, which is an important aspect for the proper evolution of the Zcash ecosystem. Enabling multi-asset support on the Zcash chain will open the door for a host of applications and enhance the ecosystem with application developers and asset custody institutions for issuance and bridging purposes.

-
-

Overview & Rationale

-

This ZIP specifies the issuance mechanism of the Zcash Shielded Assets (ZSA) protocol and must work conjunction with ZIP 226 4, as the issuance mechanism is only valid for the ZSA transfer protocol, as it produces notes that can only be transferred under ZSA.

-

In short, we are going to enable only transparent issuance, since we believe that as a first step, transparency is important to properly test the applications that will be most used in the Zcash ecosystem, while enabling tracking of supply of assets. In essence, any user of the blockchain can issue new asset types, yet only a single issuer (a set of keys) can issue that specific asset type, as the asset identifiers are tied to the issuer keys.

-

We have designed the protocol such that at the time of issuance, the issuer can already allocate all the tokens to the corresponding owners by creating the corresponding (shielded) output notes to the corresponding addresses. As is implied, the issuance mechanism is itself transparent, but the allocation is totally private. Furthermore, in a single issuance transaction, the issuer can create multiple asset types (and allocate all of those too). Finally, a key component of our design is the finiteIssuance boolean that defines whether a specific asset type can have more tokens issued or not.

-

The issuance mechanism is broad enough for issuers to either create native 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. In fact, the protocol described below enables, what we hope will be a useful set of, applications:

-
    -
  • By setting the finiteIssuance = 1 from the first issuance instance of that asset type, 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.
  • -
  • When the finiteIssuance = 0, the issuer can keep creating tokens of that type (in a transparent manner). The boolean value can be changed with any new issuance transaction, and could be set to 1 either when the issuer keys have been compromised, and hence stopping all issuances of that asset type (the boolean cannot be reversed), or whenever the issuer decides that the max supply has been reached.
  • -
  • Note that this mechanism can be used with the burning process to control and affect the supply of any custom asset.
  • -
-
-

Asset Identifier Generation

-

For every new asset, there must be a new and unique identifier of the asset. Our design decision is not to have a chosen name for the asset type, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”. From this asset identifier, which is a global byte string (valid across all Zcash protocols), we derive the specific type used within the notes, as defined by the specific protocol (e.g.: for now Orchard-style, using Pallas curve)

-

The main requirement for the asset identifier is for it to be collision-free, as two different issuers should not be able to issue the same asset type. As such we need the asset identifier to be:

-
    -
  • pseudorandom
  • -
  • deterministic
  • -
  • dependent on the issuer ID
  • -
-

We define the asset identifier assetID (represented as a string) as

-

- \(\mathsf{assetID := GroupHash^{\mathbb{P}}}\mathsf{(issuerID || assetDesc)}\) -

-

where

-
    -
  • assetDesc is the asset description, which includes any information pertaining to the issuance.
  • -
  • issuerID is the public key of the issuer, used to verify the signature on the transaction and is defined as ik (issuer key or issuer verification key):
  • -
-

- \(\mathsf{ik := SpendAuthSig^{Orchard}.DerivePublic(isk)}\) -

-

which uses the same signature as the spend authorization signature, where isk is the issuer secret key. The verification key is derived from isk. In order to differentiate the isk and ik keys from the actual spend authorization key, we derive another branch of keys from the main spending key sk as such:

-

- \(\mathsf{isk := ToScalar^{Orchard}(︀ PRF^{expand}_{sk} ([10])}\) -

-

This allows the issuer to use the same wallet it usually uses to transfer assets, while keeping a disconnect from the other keys. 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 in the wallet safe.

-

Then we let issuanceInfo := (assetID, finiteSupply), where

-
    -
  • assetID is as defined above.
  • -
  • -
    -
    finiteSupply is a boolean variable that defines whether this issuance transaction of the specific asset type is the final issuance of tokens or not. Once finiteSupply is set, it cannot be unset. This allows expanding the functionality of the issuance mechanism:
    -
    -
      -
    • Provides assetID revocation in case of compromise (issue last issuance with 0 token value)
    • -
    • Supports NFT issuance (where the first issuance with value of 1 is also the last)
    • -
    -
    -
    -
  • -
-
-

Issuance Protocol

-

The issuance protocol allows for a single issuance to be sent to many receivers, as the issuerID does not have to match the address ownership of the notes output. Furthermore, every transaction can contain many issuance instances. The design presented in this ZIP enables several use cases for issuance of shielded assets.

-
    -
  • The issuer knows in advance the receivers of the issued asset.
  • -
  • The asset is of non-fungible type, where each asset type can be made part of a single “series”
  • -
  • The supply of the asset is limited or not
  • -
  • The assets can be wrapped versions of assets in other chains (as long as there is a bridge that supports it)
  • -
-

The protocol is as follows:

-
    -
  • -
    -
    For each asset type issued, generate a sequence of output notes, each with the following fields:
    -
    -
      -
    • ZSA output note - \(\mathsf{ note =(d, pkd, v, \rho, \psi, \mathsf{type}_\mathbb{P}, rcm)}\) - , where - \(\mathsf{type}_\mathbb{P} := \mathsf{GroupHash^{\mathbb{P}}}\mathsf{(assetID)}\) -
    • -
    -
    -
    -
  • -
  • Generate commitment of the note. cm as
  • -
-

- \(cm = \mathsf{NoteCommit^{ZSA}_{rcm}}(\mathsf{repr\mathbb{_P}(g_d)}, \mathsf{repr\mathbb{_P}(pk_d)}, v, \rho, \psi,\mathsf{type}_\mathbb{P})\) -

-
    -
  • Sign the issuance note with the issuerID as the signing key, using RedPallas as its signature scheme, on the SIGHASH of the transaction. Note that the SIGHASH will change as we include a new bundle in the Zcash transaction to enable this issuance mechanism on chain.
  • -
-

Consensus Changes

-

Issuance requires the following additions to the global state:

-

First, Zcash clients must keep a mapping issuanceSupplyInfos from assetID to issuanceSupplyInfo := (totalSupply, finiteSupply).

-

Consensus rules

-

For each issuance instance,

-
    -
  • Check that assetID is properly constructed,
  • -
  • Check that each commitment cm is properly constructed from each “output” note,
  • -
  • Check that the issuance instance has a valid signature based on the issuerID,
  • -
  • Check that - \(\mathsf{type}_\mathbb{P}\) - is properly projected into the correct curve from assetID. That is, that - \(\mathsf{type}_\mathbb{P} := \mathsf{GroupHash^{\mathbb{P}}}\mathsf{(assetID)}\) -
  • -
  • If issuanceSupplyInfo[assetID].finiteSupply`is true, reject. Otherwise, set `issuanceSupplyInfo[assetID].finiteSupply = finiteSupply .
  • -
  • Add the sum of all the values in all output notes per assetID to issuanceSupplyInfo[assetID].totalSupply
  • -
  • After verification, add note commitment to the merkle tree.
  • -
-
-
-

Other Considerations

-

Fee Structures

-

The fee mechanism described in this ZIP may be replaced by a future “Fee Mechanism” ZIP proposal. However, we do need to have some basic fees for the Issuance protocol, as it differs from the usual transfer mechanism in that it adds a whole new structure to the transaction bundle, it adds a new global structure for validators to keep in memory and in turn it adds new consensus rules that are independent of previous structures.

-

There are two main factors that will affect the fee mechanism:

-
    -
  • The transaction size, which may take a big part of the block
  • -
  • The computational power needed to verify and mine the transaction
  • -
-

There is a single parameter that defines both, as there is no privacy or ZKP involved at this stage - the number of output notes in the issuance bundle:

-
    -
  • it trivially defines the bundle size
  • -
  • it defines the computational power as the validator must compute as many note commitments as there are output notes
  • -
-
-
-

Test Vectors

-
    -
  • LINK TBD
  • -
-
-

Reference Implementation

-
    -
  • LINK TBD
  • -
  • LINK TBD
  • -
-
-

Deployment

-

This ZIP is proposed to activate with Network Upgrade 6.

-
-

References

- - - - - - - -
1RFC 2119: Key words for use in RFCs to Indicate Requirement Levels
- - - - - - - -
2ZIP 200: Network Upgrade Mechanism
- - - - - - - -
3ZIP 224: Orchard
- - - - - - - -
4ZIP 226: Transfer and Burn of Zcash Shielded Assets
- - - - - - - -
5ZIP 227: Issuance of Zcash Shielded Assets
-
-
- - \ No newline at end of file diff --git a/draft-ZIP-0227.rst b/draft-ZIP-0227.rst deleted file mode 100644 index 559d1ee8d..000000000 --- a/draft-ZIP-0227.rst +++ /dev/null @@ -1,184 +0,0 @@ -:: - - ZIP: 227 - Title: Issuance of Zcash Shielded Assets - Owners: Daniel Benarroch - Pablo Kogan - Aurelien Nicolas - Credits: Daira Hopwood - Jack Grigg - Shahaf Nacshon - Vivek Arte - Status: Draft - Category: Consensus - Created: 2022-05-01 - License: MIT - Discussions-To: - - -Terminology -=========== - -The key word "MUST" in this document is to be interpreted as described in RFC 2119 [#RFC2119]_. - -The term "network upgrade" in this document is to be interpreted as described in ZIP 200 [#zip-0200]_. - -The term "Orchard" in this document is to be interpreted as described in ZIP 224 [#zip-0224]_. - -We define the following additional terms: - -- Asset: A type of note that can be transferred on the Zcash block chain. ZEC is the default (and currently the only defined) asset for the Zcash mainnet. -- Zcash Shielded Asset: an asset with issuance defined on the Zcash block chain, and, for now, belonging to the Orchard anonymity pool. -- Wrapped Asset: a ZSA asset with native issuance defined outside the Zcash block chain. - -Abstract -======== - -ZIP 226 [#zip-0226]_ and ZIP 227 [#zip-0227]_ 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 [#zip-0227]_. The transfer and burn of such assets is defined in ZIP 226 [#zip-0226]_. - -Motivation -========== - -The current Orchard protocol does not support custom assets, which is an important aspect for the proper -evolution of the Zcash ecosystem. Enabling multi-asset support on the Zcash chain will open the door for a host of -applications and enhance the ecosystem with application developers and asset custody institutions for issuance and -bridging purposes. - -Overview & Rationale -==================== - -This ZIP specifies the issuance mechanism of the Zcash Shielded Assets (ZSA) protocol and must work conjunction with ZIP 226 [#zip-0226]_, as the issuance mechanism is only valid for the ZSA transfer protocol, as it produces notes that can only be transferred under ZSA. - -In short, we are going to enable only *transparent* issuance, since we believe that as a first step, transparency is important to properly test the applications that will be most used in the Zcash ecosystem, while enabling tracking of supply of assets. In essence, any user of the blockchain can issue new asset types, yet only a single issuer (a set of keys) can issue that specific asset type, as the asset identifiers are tied to the issuer keys. - -We have designed the protocol such that at the time of issuance, the issuer can already allocate all the tokens to the corresponding owners by creating the corresponding (shielded) output notes to the corresponding addresses. As is implied, the issuance mechanism is itself transparent, but the allocation is totally private. Furthermore, in a single issuance transaction, the issuer can create multiple asset types (and allocate all of those too). Finally, a key component of our design is the `finiteIssuance` boolean that defines whether a specific asset type can have more tokens issued or not. - -The issuance mechanism is broad enough for issuers to either create native 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. In fact, the protocol described below enables, what we hope will be a useful set of, applications: - -- By setting the `finiteIssuance = 1` from the first issuance instance of that asset type, 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. -- When the `finiteIssuance = 0`, the issuer can keep creating tokens of that type (in a transparent manner). The boolean value can be changed with any new issuance transaction, and could be set to `1` either when the issuer keys have been compromised, and hence stopping all issuances of that asset type (the boolean cannot be reversed), or whenever the issuer decides that the max supply has been reached. -- Note that this mechanism can be used with the burning process to control and affect the supply of any custom asset. - - -Asset Identifier Generation -=========================== - -For every new asset, there must be a new and unique identifier of the asset. Our design decision is not to have a chosen name for the asset type, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”. From this asset identifier, which is a global byte string (valid across all Zcash protocols), we derive the specific type used within the notes, as defined by the specific protocol (e.g.: for now Orchard-style, using Pallas curve) - -The main requirement for the asset identifier is for it to be collision-free, as two different issuers should not be able to issue the same asset type. As such we need the asset identifier to be: - -- pseudorandom -- deterministic -- dependent on the issuer ID - -We define the asset identifier `assetID` (represented as a string) as - -:math:`\mathsf{assetID := GroupHash^{\mathbb{P}}}\mathsf{(issuerID || assetDesc)}` - -where - -- `assetDesc` is the asset description, which includes any information pertaining to the issuance. -- `issuerID` is the public key of the issuer, used to verify the signature on the transaction and is defined as `ik` (issuer key or issuer verification key): - - -:math:`\mathsf{ik := SpendAuthSig^{Orchard}.DerivePublic(isk)}` - - -which uses the same signature as the spend authorization signature, where `isk` is the issuer secret key. The verification key is derived from `isk`. In order to differentiate the `isk` and `ik` keys from the actual spend authorization key, we derive another branch of keys from the main spending key `sk` as such: - -:math:`\mathsf{isk := ToScalar^{Orchard}(︀ PRF^{expand}_{sk} ([10])}` - -This allows the issuer to use the same wallet it usually uses to transfer assets, while keeping a disconnect from the other keys. 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 in the wallet safe. - -Then we let `issuanceInfo := (assetID, finiteSupply)`, where - -- `assetID` is as defined above. -- `finiteSupply` is a boolean variable that defines whether this issuance transaction of the specific asset type is the final issuance of tokens or not. Once `finiteSupply` is set, it cannot be unset. This allows expanding the functionality of the issuance mechanism: - - Provides `assetID` revocation in case of compromise (issue last issuance with 0 token value) - - Supports NFT issuance (where the first issuance with value of 1 is also the last) - - -Issuance Protocol -================= - -The issuance protocol allows for a single issuance to be sent to many receivers, as the issuerID does not have to match the address ownership of the notes output. Furthermore, every transaction can contain many issuance instances. The design presented in this ZIP enables several use cases for issuance of shielded assets. - -- The issuer knows in advance the receivers of the issued asset. -- The asset is of non-fungible type, where each asset type can be made part of a single “series” -- The supply of the asset is limited or not -- The assets can be wrapped versions of assets in other chains (as long as there is a bridge that supports it) - -The protocol is as follows: - -- For each asset type issued, generate a sequence of output notes, each with the following fields: - - ZSA output note :math:`\mathsf{ note =(d, pkd, v, \rho, \psi, \mathsf{type}_\mathbb{P}, rcm)}`, where :math:`\mathsf{type}_\mathbb{P} := \mathsf{GroupHash^{\mathbb{P}}}\mathsf{(assetID)}` -- Generate commitment of the note. `cm` as - -:math:`cm = \mathsf{NoteCommit^{ZSA}_{rcm}}(\mathsf{repr\mathbb{_P}(g_d)}, \mathsf{repr\mathbb{_P}(pk_d)}, v, \rho, \psi,\mathsf{type}_\mathbb{P})` - -- Sign the issuance note with the `issuerID` as the signing key, using RedPallas as its signature scheme, on the `SIGHASH` of the transaction. Note that the `SIGHASH` will change as we include a new bundle in the Zcash transaction to enable this issuance mechanism on chain. - -Consensus Changes ------------------ - -Issuance requires the following additions to the global state: - -First, Zcash clients must keep a mapping `issuanceSupplyInfos` from `assetID` to `issuanceSupplyInfo := (totalSupply, finiteSupply)`. - -**Consensus rules** - -For each issuance instance, - -- Check that `assetID` is properly constructed, -- Check that each commitment `cm` is properly constructed from each “output” note, -- Check that the issuance instance has a valid signature based on the `issuerID`, -- Check that :math:`\mathsf{type}_\mathbb{P}` is properly projected into the correct curve from `assetID`. That is, that :math:`\mathsf{type}_\mathbb{P} := \mathsf{GroupHash^{\mathbb{P}}}\mathsf{(assetID)}` -- If `issuanceSupplyInfo[assetID].finiteSupply`is true, reject. Otherwise, set `issuanceSupplyInfo[assetID].finiteSupply = finiteSupply` . -- Add the sum of all the values in all output notes per `assetID` to `issuanceSupplyInfo[assetID].totalSupply` -- After verification, add note commitment to the merkle tree. - -Other Considerations -==================== - -Fee Structures --------------- - -The fee mechanism described in this ZIP may be replaced by a future “Fee Mechanism” ZIP proposal. However, we do need to have some basic fees for the Issuance protocol, as it differs from the usual transfer mechanism in that it adds a whole new structure to the transaction bundle, it adds a new global structure for validators to keep in memory and in turn it adds new consensus rules that are independent of previous structures. - -There are two main factors that will affect the fee mechanism: - -- The transaction size, which may take a big part of the block -- The computational power needed to verify and mine the transaction - -There is a single parameter that defines both, as there is no privacy or ZKP involved at this stage - the number of output notes in the issuance bundle: - -- it trivially defines the bundle size -- it defines the computational power as the validator must compute as many note commitments as there are output notes - - -Test Vectors -============ - -- LINK TBD - -Reference Implementation -======================== - -- LINK TBD -- LINK TBD - -Deployment -========== - -This ZIP is proposed to activate with Network Upgrade 6. - -References -========== - -.. [#RFC2119] `RFC 2119: Key words for use in RFCs to Indicate Requirement Levels `_ -.. [#zip-0200] `ZIP 200: Network Upgrade Mechanism `_ -.. [#zip-0224] `ZIP 224: Orchard `_ -.. [#zip-0226] `ZIP 226: Transfer and Burn of Zcash Shielded Assets `_ -.. [#zip-0227] `ZIP 227: Issuance of Zcash Shielded Assets `_ \ No newline at end of file diff --git a/zip-0226.html b/zip-0226.html index ba83a8095..a8b569eab 100644 --- a/zip-0226.html +++ b/zip-0226.html @@ -1,17 +1,528 @@ - ZIP 226: Zcash Shielded Assets - Transfers and Burns + ZIP 226: Transfer and Burn of Zcash Shielded Assets +
ZIP: 226
-Title: Zcash Shielded Assets - Transfers and Burns
-Owners: Daniel Bennaroch
-Status: Reserved
+Title: Transfer and Burn of Zcash Shielded Assets
+Owners: Daniel Benarroch <daniel@qed-it.com>
+        Pablo Kogan <pablo@qed-it.com>
+        Aurelien Nicolas <aurel@qed-it.com>
+Credits: Daira Hopwood
+         Jack Grigg
+         Shahaf Nacshon
+         Vivek Arte
+Status: Draft
 Category: Consensus
+Created: 2022-05-01
+License: MIT
 Discussions-To: <https://github.com/zcash/zips/issues/618>
+

Terminology

+

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.

+

We define the following additional terms:

+
    +
  • Asset: A type of note that can be transferred on the Zcash block chain. +
      +
    • ZEC is the default (and currently the only defined) asset for the Zcash mainnet.
    • +
    +
  • +
  • Zcash Shielded Asset: an Asset with issuance defined on the Zcash block chain, and, for now, belonging to the Orchard shielded pool.
  • +
  • Wrapped Asset: a Zcash Shielded Asset with native issuance defined outside the Zcash block chain.
  • +
  • Native Asset: a Zcash Shielded Asset created uniquely within the Zcash block chain.
  • +
  • Split Note: a Zcash Shielded Asset spend note that is used within an Action to ensure the output note of that Action is of a specific type. The Split Note is not spent in the transaction.
  • +
  • Split Action: a Zcash Shielded Asset Action that contains a Split Note.
  • +
+
+

Abstract

+

ZIP 226 and ZIP 227 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 5. The transfer and burn of such assets is defined in ZIP 226 4.

+
+

Motivation

+

The current Orchard protocol does not support custom assets. Enabling multi-asset support on the Zcash chain will open the door for a host of applications and enhance the ecosystem with application developers and asset custody institutions for issuance and bridging purposes.

+
+

Overview

+

In order to be able to represent different Asset types in Orchard, we need to define a new data field that uniquely represents the type of the Asset in question, which we call + \(\mathsf{type}\) + .

+

The type will be used to enforce the balance of an Action Description 6 is preserved across Assets (see the Orchard Binding Signature 7), and by extension the balance of an Orchard transaction. That is, the sum of all the + \(\mathsf{value^{net}}\) + from each Action Description, computed as + \(\mathsf{value^{old}-value^{new}}\) + , must be balanced only with respect to the same Asset type. This is specially important since we will allow different Action Descriptions to transfer notes of different Asset types, where the overall balance is checked without revealing which Assets (or how many different types) are being transferred.

+

As was initially proposed by Jack Grigg and Daira Hopwood 16, we propose to make this happen by changing the value base point, + \(\mathcal{V}^{\mathsf{Orchard}}\) + , in the Homomorphic Pedersen Commitment that generates the value commitment, + \(\mathsf{cv^{net}}\) + , of the net value in an Orchard Action.

+

Because in a single transaction all value commitments are balanced, there must be as many different value base points as there are asset types in the transaction. We propose to make the + \(\mathsf{type}\) + identifier an auxiliary input to the proof, represented already as a point in the Pallas curve. The circuit then should check that the same + \(\mathsf{type}\) + is used in the old note commitment, in the new note commitment and in the value commitment as the base point of the value. This ensures that (1) the input and output notes are of the same type, and (2) that only actions with the same asset type identifier will balance out in the binding and balance signature.

+

In order to ensure the security of the transfers, and as we will explain below, we are replacing input dummy notes for custom assets, as we need to enforce that the type of the output note of that split action is the output of a PRF.

+

Finally, in this ZIP we also describe the burn mechanism, which is a direct extension of the transfer mechanism. The burn process uses a similar mechanism than what is used in Orchard to unshield ZEC, by using the + \(\mathsf{valueBalance}\) + of the asset in question. Burning assets is useful for many purposes, including bridging of wrapped assets and removing supply of native assets.

+
+

Specification

+

Most of the protocol is kept the same as the Orchard protocol released with NU5, except for the following.

+

Asset Types

+

In the OSA protocol, we include a new variable, the asset type identifier, + \(\mathsf{type}\) + , which is generated as a 32-byte string during issuance (as described in the Issuance ZIP 5). The + \(\mathsf{type}\) + will then be publicly hashed into the corresponding group, in this case the Pallas curve, by using the + \(\mathsf{GroupHash}\) + function. In fact, every ZSA note will contain the group element representation of the asset type identifier. This will enable a much more elegant and simple version of the circuit, as we will see.

+

We denote the string as + \(\mathsf{type}\) + and we denote the equivalent group representation as + \(\mathsf{type}_{\mathbb{G}}\) + when mapped into a specific group, + \(\mathbb{G}\) + . Note that the type of the ZEC asset will be kept as the original value base-point, + \(\mathcal{V}^\mathsf{Orchard}\) +

+

In future network and protocol upgrades, the same asset type string can be carried on, with potentially a mapping into a different curve or group. In that case, the turnstile should know how to transform the asset type from one group to another one.

+
+

Note Structure & Commitment

+

First, we need to adapt the components that define the assets, i.e.: notes. A ZSA note differs from an Orchard note by including the type of asset, + \(\mathsf{type}_\mathbb{P}\) + . So an ZSA note looks like:

+

+ \((\mathsf{g_d, pk_d, v, \rho, \psi, type}_{\mathbb{P}})\) +

+

Where + \(\mathsf{type}_\mathbb{P}\) + is the unique random group element that identifies each asset in the Pallas curve 8, 9 of the Orchard protocol.

+

In this case, the note commitment, + \(\mathsf{NoteCommit^{ZSA}_{rcm}}\) + , will differ from + \(\mathsf{NoteCommit^{Orchard}_{rcm}}\) + in that for non-ZEC assets, the type will be added as an input to the commitment computation. As we will see, the recursive structure of the Sinsemilla-base commitment 10 allows us to add the type as a final recursive step, and hence keep a single instance of the hash function in the circuit for the note commitment verification.

+

Since the commitment output is still indistinguishable with the original Orchard ZEC note commitments, by definition of the Sinsemilla hash, ZSA note commitments will be added to the same Merkle Commitment Tree. In essence, we have

+

+ \(\mathsf{NoteCommit^{ZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, type_\mathbb{P})} \in \{\mathsf{cm},\bot\}\) +

+

The nullifier is generated in the same manner as in the Orchard protocol.

+
+

Value Commitment

+

The Orchard Protocol uses a Sinsemilla-based Homomorphic Pedersen Commitment 11 which is instantiated as

+

+ \(\mathsf{cv^{net}:=ValueCommit^{Orchard}_{rcv}(v^{net})}:= \mathsf{[v^{net}]}\mathcal{V}^{\mathsf{Orchard}}+[\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}}\) +

+

Where + \(\mathsf{v^{net} = v^{old} - v^{new}}\) + and

+

+ \(\mathcal{V}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}(\texttt{"z.cash:Orchard-cv", "v")}\) +

+

+ \(\mathcal{R}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}(\texttt{"z.cash:Orchard-cv", "r")}\) +

+

In the case of the Orchard protocol, we see that the base points + \(\mathcal{V}^{\mathsf{Orchard}}\) + and + \(\mathcal{R}^{\mathsf{Orchard}}\) + are fixed for every value commitment, as the values represent the amount of ZEC being transferred.

+

In the case of the ZSA protocol, the value of different asset types in a given transaction will be committed using a different value base point. This enables the final balance of the transaction to be securely computed, such that each asset type is balanced independently, as the assets are not meant to be fungible. The value commitment then becomes

+

+ \(\mathsf{cv^{net}:=ValueCommit^{ZSA}_{rcv}(v^{net}_{type},\mathcal{V}^{\mathsf{ZSA}}_{\mathsf{type}})}:= \mathsf{[v^{net}_{type}]}\mathcal{V}^{\mathsf{ZSA}}_{\mathsf{type}}+[\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}}\) +

+

where + \(\mathsf{v^{net}_{type}} = \mathsf{v^{old}_{type} - v^{new}_{type}}\) + such that + \(\mathsf{v^*_{type}}\) + is the value of the note of type + \(\mathsf{type}\) + , and

+

+ \(\mathcal{V}^{\mathsf{ZSA}}_{\mathsf{type}}:=\mathsf{type_\mathbb{P}}= \mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv", "a" || type\_params)}\) +

+

+ \(\mathcal{R}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv", "r")}\) +

+

Where + \(\mathcal{V}^{\mathsf{ZSA}}_{\mathsf{ZEC}} =\mathcal{V}^{\mathsf{Orchard}}\) + .

+
+

Value Balance Verification

+

In order to verify the balance of the different assets, verifier performs exactly the same the process as for the Orchard protocol 7. The main reason is because no custom assets can be unshielded, so all custom assets are contained within the shielded ZSA pool. This means that the net balance of the input and output values is zero, with only one type of value balance published, that of ZEC, + \(\mathsf{v^{balanceOrchard}}\) + , so no net amount of any type will be revealed, and neither the nnumber of types in the transaction. The only exception to this is in the case that an asset is burnt, as we will see below in burnmechanism.

+

For a total of + \(n\) + actions in a transfer, the prover can still sign the SIGHASH of the transaction using the binding signature key

+

+ \(\mathsf{bsk} = \sum_{\mathsf{ \forall i\in \{1,...,n\}}} \mathsf{rcv_{i}}\) +

+

Then we have that the verifier computes

+

+ \(\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} = \sum \mathsf{rcv_{i}^{net}}\mathcal{R}^{\mathsf{Orchard}}\) +

+

And uses it to verify the binding signature, as described in §4.14 of the Zcash Specification 7, by verifying the bindingSignature on the SIGHASH message.

+

As in the Orchard protocol, the binding signature verification key, + \(\mathsf{bvk}\) + , will only be valid (and hence verify the signature correctly, as long as all the value commitments (and corresponding value balances) are equal to zero. In contrast, in this protocol, the value commitments only cancel out per asset type, as the Pedersen commitments add up homomorphically only with respect to the same value base point.

+
+

Split Notes

+

One of the key functionalities in a UTXO based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This is called a 1-to-many (Orchard) transaction. In order to cope with this today, the input note of the second (third and more) Action (which we call split notes and split Actions respectively) is a dummy spend note 12. Basically, the input note is “faked” inside of the proof in order to hide which action contains the real spend note.

+

This, however, brings some issues when it comes to adding multiple asset types, as the output note of the split Actions cannot be of any asset type, it must be enforced to be an actual output of a GroupHash computation (in fact we want it to be of the same type as the original input note, but the binding signature takes care that the proper balancing is performed). If not, then the prover could essentially input a multiple (or linear combination of) an existing type, with the goal to attack the network by overflowing the ZEC value balance and hence counterfeiting ZEC funds.

+

In order to prevent this, we make some modifications to the circuit. Specifically we remove the dummy note functionality for custom assets and we enforce that every input note to an ZSA Action must be proven to exist in the set of note commitments in the Merkle Tree. We then enforce this real note to be “unspendable” in the sense that its value will be zeroed in split Actions and the nullifier will be randomized, making the note not spendable in the specific Action. Then, the proof itself ensures that the output note is of the same type as the input note. In the circuit, the split note functionality will be activated by a boolean private input to the proof.

+

Note that this is enough to create a chain of induction that ensures that all output notes of a transfer are actual outputs of a GroupHash, preventing any malleability attacks, as they originate in the Issuance protocol, which is publicly verified. Furthermore, we do not care about whether the note is owned by the sender, or whether it was nullified before. Wallets and other clients have a choice to make to ensure the asset type is the preserved for the output note of a split Action, for the value balance verification:

+
    +
  1. The split input note could be the same note as the original (non-split) Action,
  2. +
  3. The split input note could be a different unspent note of the same type (note that the note will not actually be spent)
  4. +
  5. The split input note could be an already spent note of the same type (note that by zeroing the value in the circuit, we prevent double spending)
  6. +
+

The specific circuit changes are presented below.

+
+
+

Circuit Statement

+

The advantage of the design described above, with respect to the circuit statement, is that every ZSA Action statement is kept closely similar to the Orchard Action statement 13, except for a few additions that ensure the security of the asset type system.

+

Asset Type Equality: the following constraints must be added to ensure that the input and output note are of the same type:

+
    +
  • The asset type, + \(\mathsf{type_\mathbb{P}}\) + , for the note is witnessed once, as an auxiliary input.
  • +
  • The witnessed asset type, + \(\mathsf{type_\mathbb{P}}\) + , is added to the old note commitment input.
  • +
  • The witnessed asset type, + \(\mathsf{type_\mathbb{P}}\) + , is added to the new note commitment input.
  • +
+

Correct Value Commitment Type: the following constraints must be added to ensure that the value commitment is computed using the witnessed type, as represented in the notes

+
    +
  • The fixed-base multiplication constraints between the value and the value base point of the value commitment,:math:mathsf{cv}, is replaced with a variable-base multiplication between the two
  • +
  • The witness to the value base-point, as defined in valuebase is the auxiliary input + \(\mathsf{type}_\mathbb{P}\) + .
  • +
+

Enforce Secure Type for Split Actions: the following constraints must be added to prevent senders from changing the asset type for the output note in the Split Actions:

+
    +
  • +
    +
    The Value Commitment Integrity should be changed
    +
    +
      +
    • Replace the input note value by a generic value, v', as + \(\mathsf{cv^net} = \mathsf{ValueCommit_rcv^OrchardType(v’ - v^new, type}_\mathbb{P})\) +
    • +
    +
    +
    +
  • +
  • +
    +
    Add a boolean “split” variable as an auxiliary witness. This variable is to be activated split = 1 if the Action in question is a split and split = 0 if the Action is actually spending an input note:
    +
    +
      +
    • If split = 1 then set v' = 0 otherwise v'=v^old from the auxiliary input
    • +
    +
    +
    +
  • +
  • +
    +
    The Merkle Path Validity should check the existance of the note commitment as usual (and not like with dummy notes):
    +
    +
      +
    • Check that (path, pos) is a valid Merkle path of depth + \(\mathsf{MerkleDepth^Orchard}\) + , from + \(\mathsf{cm^old}\) + to the anchor + \(\mathsf{rt^Orchard}\) + .
    • +
    +
    +
    +
  • +
  • +
    +
    The Nullifier Integrity will be changed to prevent the identification of notes
    +
    +
      +
    • Replace the + \(\psi_{old}\) + value with a generic + \(\psi'\) + as + \(\mathsf{nf_old = DeriveNullifier_nk}(\rho^\mathsf{old}, \psi', \mathsf{cm^old})\) +
    • +
    • if split = 1 set + \(\psi' = \mathsf{randomSample}\) + , otherwise set + \(\psi' = \psi^{old}\) +
    • +
    +
    +
    +
  • +
+

Enabling Backwards Compatibility with ZEC Notes: the following constraints must be added to enable backwards compatibility with the Orchard ZEC notes.

+

The old note commitment is computed using a “rolling-aggregate” sinsemilla commitment. This means that the commitment is computed by adding new chunks or windows to the accumulated value. This method will be used in order to maintain a single commitment instance for the old note commitment, that will be used both for Orchard ZEC notes and for ZSA notes. The original Orchard ZEC notes will be conserved and not actually be converted into ZSA notes, as we will always need to compute them.

+
    +
  • +
    +
    The input note in the old note commitment integrity must either include a type (ZSA note) or not (ZEC-Orchard note)
    +
    +
      +
    • +
      +
      If the type auxiliary input is set + \(\mathsf{type}_\mathbb{P}\) + = + \(\mathcal{V}^\mathsf{Orchard}\) +
      +
      +
        +
      • NoteCommitment has a “compatibility” path that computes the note commitment as in plain Orchard (i.e.: without including the type)
      • +
      • This path also uses the original domain separator for ZEC note commitment
      • +
      +
      +
      +
    • +
    • +
      +
      Else,
      +
      +
        +
      • The NoteCommitment adds the type, + \(\mathsf{type}_\mathbb{P}\) + , as a final “chunk” of the Sinsemilla commitment
      • +
      • The NoteCommitment uses a different domain separator for ZSA note commitment
      • +
      +
      +
      +
    • +
    +
    +
    +
  • +
+

Backward Compatibility

+

In order to have a "clean" backwards compatibility with the ZEC notes, we have designed the circuit to support both ZEC and ZSA notes. As we specify above, there are three main reasons we can do this: - The input notes with a type denote the ZSA custom assets, generating a note commitment that includes the type; whereas the notes without a type, denote the ZEC notes, and generate a note commitment that does not include the type, in order to maintain the referencability to the Merkle tree - The value commitment is abstracted to allow for the value base-point as a variable private input to the proof - The ZEC-based actions will still include dummy input notes, whereas the ZSA-based actions will include split input notes

+
+
+ +

Burn Mechanism

+

The burn mechanism may be needed for off-boarding the wrapped assets from the chain, or enabling advanced tokenomics on native tokens. It is part of the Issuance/Burn protocol, but given that it can be seen as an extension of the Transfer protocol, we add it here for readability.

+

In essence, the burn mechanism is a transparent / revealing extension to the transfer protocol that enables a specific amount of any asset type to be sent into “oblivion”. Our burn mechanism does NOT send assets to a non-spendable address, it simply reduces the total number of assets in circulation at the consensus level. It is enforced at the consensus level, by using an extension of the value balance mechanism used for ZEC assets.

+

First, contrary to the strict transfer transaction, we allow the sender to include a + \(\mathsf{valueBalvalueBalance_{type}}\) + variable for every asset type that is being burnt. As we will show in the transaction structure, this is separate from the regular + \(\mathsf{valueBalance^Orchard}\) + that is the default transparent value for the ZEC asset.

+

For every custom asset that is burnt, we add to the assetBurn vector the tuple + \((\mathsf{valueBalance_{type}, type}_\mathbb{P})\) + such that the validator of the transaction can compute the value commitment with the corresponding value base point of that asset. This ensures that the values are all balanced out with respect to the asset types in the transfer.

+

+ \(\mathsf{assetBurn = [(v^{type}, type_\mathbb{P})}| \forall \mathsf{type}_\mathbb{P} \textit{ s.t.}\mathsf{v^{type}\neq 0}]\) +

+

The value balances for each asset type in assetBurn represents the amount of that asset type that is being burnt. In the case of ZEC, the value balance represents either the transaction fee, or the amount of ZEC changing anonymity pools (to Sapling or Transparent).

+

Finally, the validator needs to verify the Balance and Binding Signature by adding the value balances for all assets, as committed using their respective types as the value base point of the Pedersen Commitment. This is done as follows

+

+ \(\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} - \sum_{\forall \mathsf{type}\textit{ s.t. }\mathsf{v^{type}\neq 0}} \mathsf{Value Commit_0^{ZSA}(v^{type}type_\mathbb{P}) } = \sum \mathsf{rcv_{i,j}^{net}}\mathcal{R}^{\mathsf{Orchard}}\) +

+

In the case that the balance of all the action values related to a specific asset will be zero, there will be no value added to the vector. This way, the number of assets, nor their types will be revealed, except in the case that an asset is burnt.

+

Note: Even if this mechanism allows having transparent ↔ shielded asset transfers in theory, the transparent protocol will not be changed with this ZIP to adapt to a multiple asset structure. This means that unless future consensus rules changes do allow it, the unshielding is not not be possible for custom assets.

+
+

ZSA Transaction Structure

+

Similar to NU5 transaction structure, with the following modifications to the Orchard bundle, as defined in 14:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BytesNameData TypeDescription
newActionSize * nActionsZSAvActionsZSAActionDescription[nActionOrchard]
variesnAssetBurncompactSizenumber of assets burnt
40*nAssetBurnvAssetBurnbytes[40][nAssetBurn]32 bytes asset type_t, 8 bytes of valueBalance
+
+

Other Considerations

+

Transaction Fees

+

In order to maintain the ZEC economic incentive, the first version of the fees mechanism will be exactly the same as the current Orchard protocol and will always be paid in ZEC denomination. The ECC and GMU team produced a study on fees market on Zcash 15

+
+

Security and Privacy

+
    +
  • Even if the Orchard protocol and ZSA protocol do not share the same anonymity pool (nodes can keep track of the notes that where published with different transaction structures), the migration from one to the other is done automatically and seamlessly. The Orchard bundle will be replaced by the ZSA bundle and all ZEC notes will be fully spendable with the new transaction structure.
  • +
  • When including new assets we would like to maintain the amount and types of assets private, which is achieved with the design
  • +
  • We prevent the "roadblock" attack on the asset type by ensuring the output notes receive a type of an asset that exists on the global state
  • +
+
+

Deplopyment

+

The Zcash Shielded Assets protocol should be deployed by replacing the Orchard protocol in a subsequent Network Upgrade. The design of this protocol ensures that there is no need to use any turnstile mechanism, being that Orchard-based ZEC notes can be used directly within the ZSA Actions.

+
+
+

Test Vectors

+
    +
  • LINK TBD
  • +
+
+

Reference Implementation

+
    +
  • LINK TBD
  • +
  • LINK TBD
  • +
+
+

References

+ + + + + + + +
1RFC 2119: Key words for use in RFCs to Indicate Requirement Levels
+ + + + + + + +
2ZIP 200: Network Upgrade Mechanism
+ + + + + + + +
3ZIP 224: Orchard
+ + + + + + + +
4ZIP 226: Transfer and Burn of Zcash Shielded Assets
+ + + + + + + +
5ZIP 227: Issuance of Zcash Shielded Assets
+ + + + + + + +
6Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 3.7: Action Transfers and their Descriptions
+ + + + + + + +
7Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.14: Balance and Binding Signature (Orchard)
+ + + + + + + +
8Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.9.6: Pallas and Vesta
+ + + + + + + +
9Pallas/Vesta supporting evidence
+ + + + + + + +
10Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.8.4: Sinsemilla commitments
+ + + + + + + +
11Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.8.3: Homomorphic Pedersen commitments (Sapling and Orchard)
+ + + + + + + +
12Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.8.3: Dummy Notes (Orchard)
+ + + + + + + +
13Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.17.4: Action Statement (Orchard)
+ + + + + + + +
14Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 7.1: Transaction Encoding and Consensus (Transaction Version 5)
+ + + + + + + +
15A Study of Decentralized Markets on the Zcash Blockchain
+ + + + + + + +
16User-Defined Assets and Wrapped Assets
+
\ No newline at end of file diff --git a/zip-0226.rst b/zip-0226.rst index 685191a53..f5e8e2320 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -1,8 +1,312 @@ :: ZIP: 226 - Title: Zcash Shielded Assets - Transfers and Burns - Owners: Daniel Bennaroch - Status: Reserved + Title: Transfer and Burn of Zcash Shielded Assets + Owners: Daniel Benarroch + Pablo Kogan + Aurelien Nicolas + Credits: Daira Hopwood + Jack Grigg + Shahaf Nacshon + Vivek Arte + Status: Draft Category: Consensus + Created: 2022-05-01 + License: MIT Discussions-To: + + +Terminology +=========== + +The key word "MUST" in this document is to be interpreted as described in RFC 2119 [#RFC2119]_. + +The term "network upgrade" in this document is to be interpreted as described in ZIP 200 [#zip-0200]_. + +The term "Orchard" in this document is to be interpreted as described in ZIP 224 [#zip-0224]_. + +We define the following additional terms: + +- Asset: A type of note that can be transferred on the Zcash block chain. + + - ZEC is the default (and currently the only defined) asset for the Zcash mainnet. + +- Zcash Shielded Asset: an Asset with issuance defined on the Zcash block chain, and, for now, belonging to the Orchard shielded pool. +- Wrapped Asset: a Zcash Shielded Asset with native issuance defined outside the Zcash block chain. +- Native Asset: a Zcash Shielded Asset created uniquely within the Zcash block chain. +- Split Note: a Zcash Shielded Asset spend note that is used within an Action to ensure the output note of that Action is of a specific type. The Split Note is not spent in the transaction. +- Split Action: a Zcash Shielded Asset Action that contains a Split Note. + +Abstract +======== + +ZIP 226 and ZIP 227 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 [#zip-0227]_. The transfer and burn of such assets is defined in ZIP 226 [#zip-0226]_. + +Motivation +========== + +The current Orchard protocol does not support custom assets. Enabling multi-asset support on the Zcash chain will open the door for a host of applications and enhance the ecosystem with application developers and asset custody institutions for issuance and bridging purposes. + +Overview +======== +In order to be able to represent different Asset types in Orchard, we need to define a new data field that uniquely represents the *type* of the Asset in question, which we call :math:`\mathsf{type}`. + +The type will be used to enforce the balance of an Action Description [#protocol-actions]_ is preserved across Assets (see the Orchard Binding Signature [#protocol-binding]_), and by extension the balance of an Orchard transaction. That is, the sum of all the :math:`\mathsf{value^{net}}` from each Action Description, computed as :math:`\mathsf{value^{old}-value^{new}}`, must be balanced **only with respect to the same Asset type**. This is specially important since we will allow different Action Descriptions to transfer notes of different Asset types, where the overall balance is checked without revealing which Assets (or how many different types) are being transferred. + +As was initially proposed by Jack Grigg and Daira Hopwood [#initial-zsa-issue]_, we propose to make this happen by changing the value base point, :math:`\mathcal{V}^{\mathsf{Orchard}}`, in the Homomorphic Pedersen Commitment that generates the value commitment, :math:`\mathsf{cv^{net}}`, of the *net value* in an Orchard Action. + +Because in a single transaction all value commitments are balanced, there must be as many different value base points as there are asset types in the transaction. We propose to make the :math:`\mathsf{type}` identifier an auxiliary input to the proof, represented already as a point in the Pallas curve. The circuit then should check that the same :math:`\mathsf{type}` is used in the old note commitment, in the new note commitment **and** in the value commitment as the base point of the value. This ensures that (1) the input and output notes are of the same type, and (2) that only actions with the same asset type identifier will balance out in the binding and balance signature. + +In order to ensure the security of the transfers, and as we will explain below, we are replacing input dummy notes for custom assets, as we need to enforce that the type of the output note of that split action is the output of a PRF. + +Finally, in this ZIP we also describe the *burn* mechanism, which is a direct extension of the transfer mechanism. The burn process uses a similar mechanism than what is used in Orchard to unshield ZEC, by using the :math:`\mathsf{valueBalance}` of the asset in question. Burning assets is useful for many purposes, including bridging of wrapped assets and removing supply of native assets. + +Specification +============= + +Most of the protocol is kept the same as the Orchard protocol released with NU5, except for the following. + +Asset Types +----------- + +In the OSA protocol, we include a new variable, the asset type identifier, :math:`\mathsf{type}`, which is generated as a 32-byte string during issuance (as described in the Issuance ZIP [#zip-0227]_). The :math:`\mathsf{type}` will then be publicly hashed into the corresponding group, in this case the Pallas curve, by using the :math:`\mathsf{GroupHash}` +function. In fact, every ZSA note will contain the group element representation of the asset type identifier. This will enable a much more elegant and simple version of the circuit, as we will see. + +We denote the string as :math:`\mathsf{type}` and we denote the equivalent group representation as :math:`\mathsf{type}_{\mathbb{G}}` when mapped into a specific group, :math:`\mathbb{G}`. Note that the type of the ZEC asset will be kept as the original value base-point, :math:`\mathcal{V}^\mathsf{Orchard}` + +In future network and protocol upgrades, the same asset type string can be carried on, with potentially a mapping into a different curve or group. In that case, the turnstile should know how to transform the asset type from one group to another one. + +Note Structure & Commitment +--------------------------- + +First, we need to adapt the components that define the assets, i.e.: *notes*. A ZSA note differs from an Orchard note by including the type of asset, :math:`\mathsf{type}_\mathbb{P}`. So an ZSA note looks like: + + +:math:`(\mathsf{g_d, pk_d, v, \rho, \psi, type}_{\mathbb{P}})` + + +Where :math:`\mathsf{type}_\mathbb{P}` is the unique random group element that identifies each asset in the Pallas curve [#protocol-pallasandvesta]_, [#pasta-evidence]_ of the Orchard protocol. + +In this case, the note commitment, :math:`\mathsf{NoteCommit^{ZSA}_{rcm}}`, will differ from :math:`\mathsf{NoteCommit^{Orchard}_{rcm}}` in that for non-ZEC assets, the type will be added as an input to the commitment computation. As we will see, the recursive structure of the Sinsemilla-base commitment [#protocol-concretesinsemillacommit]_ allows us to add the type as a final recursive step, and hence keep a single instance of the hash function in the circuit for the note commitment verification. + +Since the commitment output is still indistinguishable with the original Orchard ZEC note commitments, by definition of the Sinsemilla hash, ZSA note commitments will be added to the same Merkle Commitment Tree. In essence, we have + + +:math:`\mathsf{NoteCommit^{ZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, type_\mathbb{P})} \in \{\mathsf{cm},\bot\}` + + +The nullifier is generated in the same manner as in the Orchard protocol. + +Value Commitment +---------------- + +The Orchard Protocol uses a Sinsemilla-based Homomorphic Pedersen Commitment [#protocol-concretevaluecommit]_ which is instantiated as + +:math:`\mathsf{cv^{net}:=ValueCommit^{Orchard}_{rcv}(v^{net})}:= \mathsf{[v^{net}]}\mathcal{V}^{\mathsf{Orchard}}+[\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}}` + +Where :math:`\mathsf{v^{net} = v^{old} - v^{new}}` and + +:math:`\mathcal{V}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}(\texttt{"z.cash:Orchard-cv", "v")}` + +:math:`\mathcal{R}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}(\texttt{"z.cash:Orchard-cv", "r")}` + +In the case of the Orchard protocol, we see that the base points :math:`\mathcal{V}^{\mathsf{Orchard}}` and +:math:`\mathcal{R}^{\mathsf{Orchard}}` are fixed for every value commitment, as the values represent the amount of ZEC +being transferred. + +In the case of the ZSA protocol, the value of different asset types in a given transaction will be committed using a **different value base point**. This enables the final balance of the transaction to be securely computed, such that each asset type is balanced independently, as the assets are not meant to be fungible. The value commitment then becomes + + +:math:`\mathsf{cv^{net}:=ValueCommit^{ZSA}_{rcv}(v^{net}_{type},\mathcal{V}^{\mathsf{ZSA}}_{\mathsf{type}})}:= \mathsf{[v^{net}_{type}]}\mathcal{V}^{\mathsf{ZSA}}_{\mathsf{type}}+[\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}}` + + +where :math:`\mathsf{v^{net}_{type}} = \mathsf{v^{old}_{type} - v^{new}_{type}}` such that :math:`\mathsf{v^*_{type}}` is the value of the note of type :math:`\mathsf{type}`, and + +.. _valuebase: + +:math:`\mathcal{V}^{\mathsf{ZSA}}_{\mathsf{type}}:=\mathsf{type_\mathbb{P}}= \mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv", "a" || type\_params)}` + +:math:`\mathcal{R}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv", "r")}` + +Where :math:`\mathcal{V}^{\mathsf{ZSA}}_{\mathsf{ZEC}} =\mathcal{V}^{\mathsf{Orchard}}`. + +Value Balance Verification +-------------------------- + +In order to verify the balance of the different assets, verifier performs exactly the same the process as for the Orchard protocol [#protocol-binding]_. The main reason is because no custom assets can be unshielded, so all custom assets are contained within the shielded ZSA pool. This means that the net balance of the input and output values is zero, with only one type of value balance published, that of ZEC, :math:`\mathsf{v^{balanceOrchard}}`, so no net amount of any type will be revealed, and neither the nnumber of types in the transaction. The only exception to this is in the case that an asset is *burnt*, as we will see below in burnmechanism_. + +For a total of :math:`n` actions in a transfer, the prover can still sign the `SIGHASH` of the transaction using the binding signature key + +:math:`\mathsf{bsk} = \sum_{\mathsf{ \forall i\in \{1,...,n\}}} \mathsf{rcv_{i}}` + +Then we have that the verifier computes + +:math:`\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} = \sum \mathsf{rcv_{i}^{net}}\mathcal{R}^{\mathsf{Orchard}}` + + +And uses it to verify the binding signature, as described in §4.14 of the Zcash Specification [#protocol-binding]_, by verifying the `bindingSignature` on the `SIGHASH` message. + +As in the Orchard protocol, the binding signature verification key, :math:`\mathsf{bvk}`, will only be valid (and hence verify the signature correctly, as long as all the value commitments (and corresponding value balances) are equal to zero. In contrast, in this protocol, the value commitments only cancel out **per asset type**, as the Pedersen commitments add up homomorphically only with respect to the same value base point. + +Split Notes +----------- + +One of the key functionalities in a UTXO based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This is called a 1-to-many (Orchard) transaction. In order to cope with this today, the input note of the second (third and more) Action (which we call split notes and split Actions respectively) is a *dummy spend note* [#protocol-dummynotes]_. Basically, the input note is “faked” inside of the proof in order to hide which action contains the *real* spend note. + +This, however, brings some issues when it comes to adding multiple asset types, as the output note of the split Actions *cannot* be of *any* asset type, it must be enforced to be an actual output of a GroupHash computation (in fact we want it to be of the same type as the original input note, but the binding signature takes care that the proper balancing is performed). If not, then the prover could essentially input a multiple (or linear combination of) an existing type, with the goal to attack the network by overflowing the ZEC value balance and hence counterfeiting ZEC funds. + +In order to prevent this, we make some modifications to the circuit. Specifically we remove the dummy note functionality for custom assets and we enforce that *every* input note to an ZSA Action must be proven to exist in the set of note commitments in the Merkle Tree. We then enforce this real note to be “unspendable” in the sense that its value +will be zeroed in split Actions and the nullifier will be randomized, making the note not spendable in the specific Action. Then, the proof itself ensures that the output note is of the same type as the input note. In the circuit, the split note functionality will be activated by a boolean private input to the proof. + +Note that this is enough to create a chain of induction that ensures that all output notes of a transfer are actual outputs of a GroupHash, preventing any malleability attacks, as they originate in the Issuance protocol, which is publicly verified. Furthermore, we do not care about whether the note is owned by the sender, or whether it was nullified before. Wallets and other clients have a choice to make to ensure the asset type is the preserved for the output note of a split Action, for the value balance verification: + +1. The split input note could be the same note as the original (non-split) Action, +2. The split input note could be a different unspent note of the same type (note that the note will not actually be spent) +3. The split input note could be an already spent note of the same type (note that by zeroing the value in the circuit, we prevent double spending) + +The specific circuit changes are presented below. + +Circuit Statement +================= + +The advantage of the design described above, with respect to the circuit statement, is that every *ZSA Action statement* is kept closely similar to the Orchard Action statement [#protocol-actionstatement]_, except for a few additions that ensure the security of the asset type system. + +**Asset Type Equality:** the following constraints must be added to ensure that the input and output note are of the +same type: + +- The asset type, :math:`\mathsf{type_\mathbb{P}}`, for the note is witnessed once, as an auxiliary input. +- The witnessed asset type, :math:`\mathsf{type_\mathbb{P}}`, is added to the old note commitment input. +- The witnessed asset type, :math:`\mathsf{type_\mathbb{P}}`, is added to the new note commitment input. + +**Correct Value Commitment Type:** the following constraints must be added to ensure that the value commitment is computed using the witnessed type, as represented in the notes + +- The fixed-base multiplication constraints between the value and the value base point of the value commitment,:math:`\mathsf{cv}`, is replaced with a variable-base multiplication between the two +- The witness to the value base-point, as defined in valuebase_ is the auxiliary input :math:`\mathsf{type}_\mathbb{P}`. + +**Enforce Secure Type for Split Actions:** the following constraints must be added to prevent senders from changing the asset type for the output note in the Split Actions: + +- The Value Commitment Integrity should be changed + - Replace the input note value by a generic value, `v'`, as :math:`\mathsf{cv^net} = \mathsf{ValueCommit_rcv^OrchardType(v’ - v^new, type}_\mathbb{P})` +- Add a boolean “split” variable as an auxiliary witness. This variable is to be activated `split = 1` if the Action in question is a split and `split = 0` if the Action is actually spending an input note: + - If `split = 1` then set `v' = 0` otherwise `v'=v^old` from the auxiliary input +- The Merkle Path Validity should check the existance of the note commitment as usual (and not like with dummy notes): + - Check that (path, pos) is a valid Merkle path of depth :math:`\mathsf{MerkleDepth^Orchard}`, from :math:`\mathsf{cm^old}` to the anchor :math:`\mathsf{rt^Orchard}`. +- The Nullifier Integrity will be changed to prevent the identification of notes + - Replace the :math:`\psi_{old}` value with a generic :math:`\psi'` as :math:`\mathsf{nf_old = DeriveNullifier_nk}(\rho^\mathsf{old}, \psi', \mathsf{cm^old})` + - if `split = 1` set :math:`\psi' = \mathsf{randomSample}`, otherwise set :math:`\psi' = \psi^{old}` + +**Enabling Backwards Compatibility with ZEC Notes:** the following constraints must be added to enable backwards compatibility with the Orchard ZEC notes. + +The old note commitment is computed using a “rolling-aggregate” sinsemilla commitment. This means that the commitment is computed by adding new chunks or windows to the accumulated value. This method will be used in order to maintain a single commitment instance for the old note commitment, that will be used both for Orchard ZEC notes and for ZSA notes. The original Orchard ZEC notes will be conserved and not actually be converted into ZSA notes, as we will always need to compute them. + +- The input note in the old note commitment integrity must either include a type (ZSA note) or not (ZEC-Orchard note) + - If the type auxiliary input is set :math:`\mathsf{type}_\mathbb{P}` = :math:`\mathcal{V}^\mathsf{Orchard}` + - NoteCommitment has a “compatibility” path that computes the note commitment as in plain Orchard (i.e.: without including the type) + - This path also uses the original domain separator for ZEC note commitment + - Else, + - The NoteCommitment adds the type, :math:`\mathsf{type}_\mathbb{P}`, as a final “chunk” of the Sinsemilla commitment + - The NoteCommitment uses a different domain separator for ZSA note commitment + + +Backward Compatibility +---------------------- + +In order to have a "clean" backwards compatibility with the ZEC notes, we have designed the circuit to support both ZEC and ZSA notes. As we specify above, there are three main reasons we can do this: +- The input notes with a type denote the ZSA custom assets, generating a note commitment that includes the type; whereas the notes without a type, denote the ZEC notes, and generate a note commitment that does not include the type, in order to maintain the referencability to the Merkle tree +- The value commitment is abstracted to allow for the value base-point as a variable private input to the proof +- The ZEC-based actions will still include dummy input notes, whereas the ZSA-based actions will include split input notes + +.. _burnmechanism: + +Burn Mechanism +============== +The burn mechanism may be needed for off-boarding the wrapped assets from the chain, or enabling advanced tokenomics on native tokens. It is part of the Issuance/Burn protocol, but given that it can be seen as an extension of the Transfer protocol, we add it here for readability. + +In essence, the burn mechanism is a transparent / revealing extension to the transfer protocol that enables a specific amount of any asset type to be sent into “oblivion”. Our burn mechanism does NOT send assets to a non-spendable address, it simply reduces the total number of assets in circulation at the consensus level. It is enforced at the consensus level, by using an extension of the value balance mechanism used for ZEC assets. + +First, contrary to the strict transfer transaction, we allow the sender to include a :math:`\mathsf{valueBalvalueBalance_{type}}` variable for every asset type that is being burnt. As we will show in the transaction structure, this is separate from the regular :math:`\mathsf{valueBalance^Orchard}` that is the default transparent value for the ZEC asset. + +For every custom asset that is burnt, we add to the `assetBurn` vector the tuple :math:`(\mathsf{valueBalance_{type}, type}_\mathbb{P})` such that the validator of the transaction can compute the value commitment with the corresponding value base point of that asset. This ensures that the values are all balanced out with respect to the asset types in the transfer. + + +:math:`\mathsf{assetBurn = [(v^{type}, type_\mathbb{P})}| \forall \mathsf{type}_\mathbb{P} \textit{ s.t.}\mathsf{v^{type}\neq 0}]` + +The value balances for each asset type in `assetBurn` represents the amount of that asset type that is being burnt. In the case of ZEC, the value balance represents either the transaction fee, or the amount of ZEC changing anonymity pools (to Sapling or Transparent). + +Finally, the validator needs to verify the Balance and Binding Signature by adding the value balances for all assets, as committed using their respective types as the value base point of the Pedersen Commitment. This is done as follows + +:math:`\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} - \sum_{\forall \mathsf{type}\textit{ s.t. }\mathsf{v^{type}\neq 0}} \mathsf{Value Commit_0^{ZSA}(v^{type}type_\mathbb{P}) } = \sum \mathsf{rcv_{i,j}^{net}}\mathcal{R}^{\mathsf{Orchard}}` + +In the case that the balance of all the action values related to a specific asset will be zero, there will be no value added to the vector. This way, the number of assets, nor their types will be revealed, except in the case that an asset is burnt. + +**Note:** Even if this mechanism allows having transparent ↔  shielded asset transfers in theory, the transparent protocol will not be changed with this ZIP to adapt to a multiple asset structure. This means that unless future consensus rules changes do allow it, the unshielding is not not be possible for custom assets. + +ZSA Transaction Structure +========================= +Similar to NU5 transaction structure, with the following modifications to the Orchard bundle, as defined in [#protocol-transactionstructure]_: + ++-----------------+-------------+-----------------------------------+-------------------------+ +| Bytes | Name | Data Type | Description | ++=================+=============+===================================+=========================+ +| newActionSize * | vActionsZSA | ActionDescription[nActionOrchard] | | +| nActionsZSA | | | | ++-----------------+-------------+-----------------------------------+-------------------------+ +| varies | nAssetBurn | compactSize | number of assets burnt | ++-----------------+-------------+-----------------------------------+-------------------------+ +| 40*nAssetBurn | vAssetBurn | bytes[40][nAssetBurn] | 32 bytes asset type_t, | +| | | | 8 bytes of valueBalance | ++-----------------+-------------+-----------------------------------+-------------------------+ + +Other Considerations +==================== + +Transaction Fees +---------------- + +In order to maintain the ZEC economic incentive, the first version of the fees mechanism will be exactly the same as +the current Orchard protocol and will always be paid in ZEC denomination. The ECC and GMU team produced a study on +fees market on Zcash [#fees-study-GMU]_ + +Security and Privacy +-------------------- + +- Even if the Orchard protocol and ZSA protocol do not share the same anonymity pool (nodes can keep track of the notes that where published with different transaction structures), the migration from one to the other is done automatically and seamlessly. The Orchard bundle will be replaced by the ZSA bundle and all ZEC notes will be fully spendable with the new transaction structure. +- When including new assets we would like to maintain the amount and types of assets private, which is achieved with the design +- We prevent the "roadblock" attack on the asset type by ensuring the output notes receive a type of an asset that exists on the global state + +Deplopyment +----------- +The Zcash Shielded Assets protocol should be deployed by replacing the Orchard protocol in a subsequent Network Upgrade. The design of this protocol ensures that there is no need to use any turnstile mechanism, being that Orchard-based ZEC notes can be used directly within the ZSA Actions. + +Test Vectors +============ + +- LINK TBD + +Reference Implementation +======================== + +- LINK TBD +- LINK TBD + +References +========== + +.. [#RFC2119] `RFC 2119: Key words for use in RFCs to Indicate Requirement Levels `_ +.. [#zip-0200] `ZIP 200: Network Upgrade Mechanism `_ +.. [#zip-0224] `ZIP 224: Orchard `_ +.. [#zip-0226] `ZIP 226: Transfer and Burn of Zcash Shielded Assets `_ +.. [#zip-0227] `ZIP 227: Issuance of Zcash Shielded Assets `_ +.. [#protocol-actions] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 3.7: Action Transfers and their Descriptions `_ +.. [#protocol-binding] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.14: Balance and Binding Signature (Orchard) `_ +.. [#protocol-pallasandvesta] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.9.6: Pallas and Vesta `_ +.. [#pasta-evidence] `Pallas/Vesta supporting evidence `_ +.. [#protocol-concretesinsemillacommit] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.8.4: Sinsemilla commitments `_ +.. [#protocol-concretevaluecommit] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.8.3: Homomorphic Pedersen commitments (Sapling and Orchard) `_ +.. [#protocol-dummynotes] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.8.3: Dummy Notes (Orchard) `_ +.. [#protocol-actionstatement] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.17.4: Action Statement (Orchard) `_ +.. [#protocol-transactionstructure] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 7.1: Transaction Encoding and Consensus (Transaction Version 5) `_ +.. [#fees-study-GMU] `A Study of Decentralized Markets on the Zcash Blockchain `_ +.. [#initial-zsa-issue] `User-Defined Assets and Wrapped Assets `_ diff --git a/zip-0227.html b/zip-0227.html index 0fb3b24e0..990b12deb 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -1,17 +1,246 @@ - ZIP 227: Zcash Shielded Assets - Issuance + ZIP 227: Issuance of Zcash Shielded Assets +
-
ZIP: 226
-Title: Zcash Shielded Assets - Issuance
-Owners: Daniel Bennaroch
-Status: Reserved
+        
ZIP: 227
+Title: Issuance of Zcash Shielded Assets
+Owners: Daniel Benarroch <daniel@qed-it.com>
+        Pablo Kogan <pablo@qed-it.com>
+        Aurelien Nicolas <aurel@qed-it.com>
+Credits: Daira Hopwood
+         Jack Grigg
+         Shahaf Nacshon
+         Vivek Arte
+Status: Draft
 Category: Consensus
+Created: 2022-05-01
+License: MIT
 Discussions-To: <https://github.com/zcash/zips/issues/618>
+

TODO

+
    +
  • [x] change all issuerID to issuanceValidatingKey
  • +
  • [x] add definition of IssuanceAction & IssuanceBundle
  • +
  • [ ] Add a section on the security model of the shielded assets
  • +
  • [ ] review definitions of assets / zsa
  • +
  • [ ] finish going through math derivation of assets
  • +
+
+

Terminology

+

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.

+

We define the following additional terms:

+
    +
  • Custom Asset: A type of note that can be transferred on the Zcash block chain. ZEC is the default (and currently the only defined) asset for the Zcash mainnet. Different custom assets are defined and differentiated by their identifier (asset_id).
  • +
  • Zcash Shielded Asset: an asset with issuance defined on the Zcash block chain, and, with this ZIP, belonging to the Orchard anonymity pool.
  • +
  • Wrapped Asset: a ZSA asset with native issuance defined outside the Zcash block chain.
  • +
  • Issuance Action: an instance of a single issuance of a Zcash Shielded Asset. It defines the issuance of a single asset identifier.
  • +
  • Issuance Bundle: the bundle in the transaction that contains all the issuance actions of that transaction.
  • +
+
+

Abstract

+

ZIP 226 4 and ZIP 227 5 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 5. The transfer and burn of such assets is defined in ZIP 226 4.

+
+

Motivation

+

The current Orchard protocol does not support custom assets. Enabling multi-asset support on the Zcash chain will open the door for a host of applications and enhance the ecosystem with application developers and asset custody institutions for issuance and bridging purposes.

+
+

Overview & Rationale

+

This ZIP specifies the issuance mechanism of the Zcash Shielded Assets (ZSA) protocol and must work in conjunction with ZIP 226 4, as the issuance mechanism is only valid for the ZSA transfer protocol, as it produces notes that can only be transferred under ZSA.

+

In short, this ZIP enables only transparent issuance, since as a first step, transparency is important to properly test the applications that will be most used in the Zcash ecosystem, while enabling tracking of supply of assets. In essence, any user of the blockchain can issue new asset types, yet only a single issuer (a set of keys) can issue that specific asset type, as the asset identifiers are tied to the issuer keys.

+

We have designed the protocol such that at the time of issuance, the issuer can already allocate all the tokens to the corresponding owners by creating the corresponding (shielded) output notes to the corresponding addresses. As is implied, the issuance mechanism is itself transparent, but the allocation is totally private. Furthermore, in a single issuance transaction, the issuer can create multiple custom assets. Finally, a key component of our design is the finiteIssuance boolean that defines whether a specific custom asset can have further tokens issued or not.

+

The issuance mechanism is broad enough for issuers to either create native 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. In fact, the protocol described below enables, what we hope will be a useful set of, applications. The design decision is not to have a chosen name to describe the custom asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”.

+
+

Issuance keys

+

There are two keys relevant to the Issuer:

+
    +
  1. The issuanceAuthorizingKey, denoted as isk, is the key that is used to sign the issuance transaction. This key is used to authorize the issuance of a specific asset type, and is only used by the issuer.
  2. +
  3. The issuanceValidatingKey, denoted as ik, is the key that is used to validate the issuance transaction. This key is used to validate the issuance of a specific asset type, and is used by all blockchain users (specifically the asset owners) to associate the asset in question with the issuer.
  4. +
+

The two keys are derived in an analogous manner to the spendAuthorizingKey and spendValidatingKey keys, as described in ZIP 32 7. Specifically, we derive

+
    +
  • The issuanceAuthorizingKey is derived directly from the spendingKey, sk, as a private signature key:
  • +
+

+ \(\mathsf{isk := ToScalar^{Orchard}(︀ PRF^{expand}_{sk} ([10])}\) +

+
    +
  • The issuanceValidatingKey is derived from the issuanceAuthorizingKey, isk, as a public verification key:
  • +
+

+ \(\mathsf{ik := SpendAuthSig^{Orchard}.DerivePublic(isk)}\) +

+

This allows the issuer to use the same wallet it usually uses to transfer assets, while keeping a disconnect from the other keys. It provides further anonymity and the ability to delegate issuance of an asset (or in the future, generate a multi-signature protocol) while keeping the rest of the keys in the wallet safe.

+
+

Asset Identifier Generation

+

For every new asset, there must be a new and unique identifier of the asset. Every asset is defined by the asset description, asset_desc, which is a global byte string (valid across all -future- Zcash protocols), of 256 bytes in size. From this asset descritpion, we derive the specific asset identifier, AssetId, used within the notes, as defined by the specific protocol (e.g.: for now Orchard-style, using Pallas curve).

+

The main requirement for the asset identifier is for it to be collision-free, as two different issuers MUST not be able to issue the same asset type. One way to achieve this is to make the identifier dependent on the issuer keys, as the issuer keys are unique to each issuer. We achieve this by deriving the asset identifier, asset_id as follows:

+

+ \(\mathsf{asset_id := GroupHash^{\mathbb{P}}}\mathsf{(ik || asset_desc)}\) +

+

where

+
    +
  • asset_desc is the asset description, a UTF-8 encoded string of up to 512 bytes, which includes any information pertaining to the issuance. the asset description
  • +
  • issuanceValidatingKey is the public key of the issuer, used to verify the signature on the transaction and is defined as ik (issuer key or issuer verification key):
  • +
+

Then we let issuanceInfo := (assetID, finiteSupply), where

+
    +
  • assetID is as defined above.
  • +
  • +
    +
    finiteSupply is a boolean variable that defines whether this issuance transaction of the specific asset type is the final issuance of tokens or not. Once finiteSupply is set, it cannot be unset. This allows expanding the functionality of the issuance mechanism:
    +
    +
      +
    • Provides assetID revocation in case of compromise (issue last issuance with 0 token value)
    • +
    • Supports NFT issuance (where the first issuance with value of 1 is also the last)
    • +
    +
    +
    +
  • +
+
+

Issuance Protocol

+

The issuance protocol allows for a single issuance to be sent to many receivers, as the issuanceValidatingKey does not have to match the address ownership of the notes output. Furthermore, every transaction can contain many issuance instances. The design presented in this ZIP enables several use cases for issuance of shielded assets.

+
    +
  • The issuer knows in advance the receivers of the issued asset.
  • +
  • The asset is of non-fungible type, where each asset type can be made part of a single “series”
  • +
  • The supply of the asset is limited or not
  • +
  • The assets can be wrapped versions of assets in other chains (as long as there is a bridge that supports it)
  • +
+

TODO: define IssueBundle as - ik - actions: - authorization: signature of the SIGHASH using the IssuanceSignatureKey

+

TODO: define IssueAction as - asset_desc - notes - finalize boolean

+

The protocol is as follows:

+
    +
  • +
    +
    For each asset type issued, generate a sequence of output notes, each with the following fields:
    +
    +
      +
    • ZSA output note + \(\mathsf{ note =(d, pkd, v, \rho, \psi, \mathsf{type}_\mathbb{P}, rcm)}\) + , where + \(\mathsf{type}_\mathbb{P} := \mathsf{GroupHash^{\mathbb{P}}}\mathsf{(assetID)}\) +
    • +
    +
    +
    +
  • +
  • Generate commitment of the note. cm as
  • +
+

NOTE that the commitment is not included in the IssuanceAction, but a computation done by the validators of the chain.

+

+ \(cm = \mathsf{NoteCommit^{ZSA}_{rcm}}(\mathsf{repr\mathbb{_P}(g_d)}, \mathsf{repr\mathbb{_P}(pk_d)}, v, \rho, \psi,\mathsf{type}_\mathbb{P})\) +

+
    +
  • Sign the issuance note with the issuanceValidatingKey as the signing key, using RedPallas as its signature scheme, on the SIGHASH of the transaction. Note that the SIGHASH will change as we include a new bundle in the Zcash transaction to enable this issuance mechanism on chain.
  • +
+

Consensus Changes

+

Issuance requires the following additions to the global state: - previously_finalized, a set of asset_id that have been finalized (i.e.: the finalize flag has been set to 1).

+

Consensus rules

+

For the IssueBudnele, - Verify the signature on SIGHASH is valid, based on VerifySig.IssueAuthorization(ik, SIGHASH)

+

For each IssueAction in a loop,

+
    +
  • check that asset_desc is properly constructed (not too short and not exceeding 512 bytes)
  • +
  • retrieve asset_id from first note and check that asset_id is properly constructed from asset_desc and ik, by checking the GroupHash of (ik, asset_desc)
  • +
  • check that the asset_id does not exist in the previously_finalized set
  • +
  • check that every note in the`IssueAction`` contains the same asset_id, and also that every note is properly constructed as note = (recipient, value, note(asset, rho, rseed)
  • +
  • If all of the above checks pass, do the following
  • +
  • For each note, compute the noteCommitment and
  • +
  • add noteCommitment to the Merkle tree of note commitments.
  • +
+
+

Example applications

+
    +
  • By setting the finiteIssuance = 1 from the first issuance instance of that asset type, 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.
  • +
  • When the finiteIssuance = 0, the issuer can keep creating tokens of that type (in a transparent manner). The boolean value can be changed with any new issuance transaction, and could be set to 1 either when the issuer keys have been compromised, and hence stopping all issuances of that asset type (the boolean cannot be reversed), or whenever the issuer decides that the max supply has been reached.
  • +
  • Note that this mechanism can be used with the burning process to control and affect the supply of any custom asset.
  • +
+
+
+

Other Considerations

+

Implementing Zcash clients

+

It is recommended that Zcash clients keep a mapping issuanceSupplyInfos from asset_id to issuanceSupplyInfo := (totalSupply, finalize) in order to properly keep track of the total supply for different asset types. This will be implemented in the Zcashd client.

+
+

Fee Structures

+

The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317b 6.

+
+
+

Test Vectors

+
    +
  • LINK TBD
  • +
+
+

Reference Implementation

+
    +
  • LINK TBD
  • +
  • LINK TBD
  • +
+
+

Deployment

+

This ZIP is proposed to activate with Network Upgrade 6.

+
+

References

+ + + + + + + +
1RFC 2119: Key words for use in RFCs to Indicate Requirement Levels
+ + + + + + + +
2ZIP 200: Network Upgrade Mechanism
+ + + + + + + +
3ZIP 224: Orchard
+ + + + + + + +
4ZIP 226: Transfer and Burn of Zcash Shielded Assets
+ + + + + + + +
5ZIP 227: Issuance of Zcash Shielded Assets
+ + + + + + + +
6ZIP 317b: ZSA Extension Proportional Fee Mechanism
+ + + + + + + +
7ZIP 32: Shielded Hierarchical Deterministic Wallets
+
\ No newline at end of file diff --git a/zip-0227.rst b/zip-0227.rst index 0640d7039..dc29264c1 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -1,8 +1,214 @@ :: - ZIP: 226 - Title: Zcash Shielded Assets - Issuance - Owners: Daniel Bennaroch - Status: Reserved + ZIP: 227 + Title: Issuance of Zcash Shielded Assets + Owners: Daniel Benarroch + Pablo Kogan + Aurelien Nicolas + Credits: Daira Hopwood + Jack Grigg + Shahaf Nacshon + Vivek Arte + Status: Draft Category: Consensus + Created: 2022-05-01 + License: MIT Discussions-To: + + + +TODO +===== +- [x] change all issuerID to issuanceValidatingKey +- [x] add definition of IssuanceAction & IssuanceBundle +- [ ] Add a section on the security model of the shielded assets +- [ ] review definitions of assets / zsa +- [ ] finish going through math derivation of assets + +Terminology +=========== + +The key word "MUST" in this document is to be interpreted as described in RFC 2119 [#RFC2119]_. + +The term "network upgrade" in this document is to be interpreted as described in ZIP 200 [#zip-0200]_. + +The term "Orchard" in this document is to be interpreted as described in ZIP 224 [#zip-0224]_. + +We define the following additional terms: + +- Custom Asset: A type of note that can be transferred on the Zcash block chain. ZEC is the default (and currently the only defined) asset for the Zcash mainnet. Different custom assets are defined and differentiated by their identifier (`asset_id`). +- Zcash Shielded Asset: an asset with issuance defined on the Zcash block chain, and, with this ZIP, belonging to the Orchard anonymity pool. +- Wrapped Asset: a ZSA asset with native issuance defined outside the Zcash block chain. +- Issuance Action: an instance of a single issuance of a Zcash Shielded Asset. It defines the issuance of a single asset identifier. +- Issuance Bundle: the bundle in the transaction that contains all the issuance actions of that transaction. + +Abstract +======== + +ZIP 226 [#zip-0226]_ and ZIP 227 [#zip-0227]_ 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 [#zip-0227]_. The transfer and burn of such assets is defined in ZIP 226 [#zip-0226]_. + +Motivation +========== + +The current Orchard protocol does not support custom assets. Enabling multi-asset support on the Zcash chain will open the door for a host of applications and enhance the ecosystem with application developers and asset custody institutions for issuance and +bridging purposes. + +Overview & Rationale +==================== + +This ZIP specifies the issuance mechanism of the Zcash Shielded Assets (ZSA) protocol and must work in conjunction with ZIP 226 [#zip-0226]_, as the issuance mechanism is only valid for the ZSA transfer protocol, as it produces notes that can only be transferred under ZSA. + +In short, this ZIP enables only *transparent* issuance, since as a first step, transparency is important to properly test the applications that will be most used in the Zcash ecosystem, while enabling tracking of supply of assets. In essence, any user of the blockchain can issue new asset types, yet only a single issuer (a set of keys) can issue that specific asset type, as the asset identifiers are tied to the issuer keys. + +We have designed the protocol such that at the time of issuance, the issuer can already allocate all the tokens to the corresponding owners by creating the corresponding (shielded) output notes to the corresponding addresses. As is implied, the issuance mechanism is itself transparent, but the allocation is totally private. Furthermore, in a single issuance transaction, the issuer can create multiple custom assets. Finally, a key component of our design is the `finiteIssuance` boolean that defines whether a specific custom asset can have further tokens issued or not. + +The issuance mechanism is broad enough for issuers to either create native 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. In fact, the protocol described below enables, what we hope will be a useful set of, applications. The design decision is not to have a chosen name to describe the custom asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”. + + +Issuance keys +============= + +There are two keys relevant to the Issuer: + +1. The `issuanceAuthorizingKey`, denoted as `isk`, is the key that is used to sign the issuance transaction. This key is used to authorize the issuance of a specific asset type, and is only used by the issuer. + +2. The `issuanceValidatingKey`, denoted as `ik`, is the key that is used to validate the issuance transaction. This key is used to validate the issuance of a specific asset type, and is used by all blockchain users (specifically the asset owners) to associate the asset in question with the issuer. + +The two keys are derived in an analogous manner to the `spendAuthorizingKey` and `spendValidatingKey` keys, as described in ZIP 32 [#zip-0032]_. Specifically, we derive + +- The `issuanceAuthorizingKey` is derived directly from the `spendingKey`, `sk`, as a private signature key: + +:math:`\mathsf{isk := ToScalar^{Orchard}(︀ PRF^{expand}_{sk} ([10])}` + +- The `issuanceValidatingKey` is derived from the `issuanceAuthorizingKey`, `isk`, as a public verification key: + +:math:`\mathsf{ik := SpendAuthSig^{Orchard}.DerivePublic(isk)}` + +This allows the issuer to use the same wallet it usually uses to transfer assets, while keeping a disconnect from the other keys. It provides further anonymity and the ability to delegate issuance of an asset (or in the future, generate a multi-signature protocol) while keeping the rest of the keys in the wallet safe. + +Asset Identifier Generation +=========================== + +For every new asset, there must be a new and unique identifier of the asset. Every asset is defined by the asset description, `asset_desc`, which is a global byte string (valid across all -future- Zcash protocols), of 256 bytes in size. From this asset descritpion, we derive the specific asset identifier, `AssetId`, used within the notes, as defined by the specific protocol (e.g.: for now Orchard-style, using Pallas curve). + +The main requirement for the asset identifier is for it to be collision-free, as two different issuers MUST not be able to issue the same asset type. One way to achieve this is to make the identifier dependent on the issuer keys, as the issuer keys are unique to each issuer. We achieve this by deriving the asset identifier, `asset_id` as follows: + +:math:`\mathsf{asset_id := GroupHash^{\mathbb{P}}}\mathsf{(ik || asset_desc)}` + +where + +- `asset_desc` is the asset description, a UTF-8 encoded string of up to 512 bytes, which includes any information pertaining to the issuance. the asset description +- `issuanceValidatingKey` is the public key of the issuer, used to verify the signature on the transaction and is defined as `ik` (issuer key or issuer verification key): + + +Then we let `issuanceInfo := (assetID, finiteSupply)`, where + +- `assetID` is as defined above. +- `finiteSupply` is a boolean variable that defines whether this issuance transaction of the specific asset type is the final issuance of tokens or not. Once `finiteSupply` is set, it cannot be unset. This allows expanding the functionality of the issuance mechanism: + - Provides `assetID` revocation in case of compromise (issue last issuance with 0 token value) + - Supports NFT issuance (where the first issuance with value of 1 is also the last) + + +Issuance Protocol +================= + +The issuance protocol allows for a single issuance to be sent to many receivers, as the issuanceValidatingKey does not have to match the address ownership of the notes output. Furthermore, every transaction can contain many issuance instances. The design presented in this ZIP enables several use cases for issuance of shielded assets. + +- The issuer knows in advance the receivers of the issued asset. +- The asset is of non-fungible type, where each asset type can be made part of a single “series” +- The supply of the asset is limited or not +- The assets can be wrapped versions of assets in other chains (as long as there is a bridge that supports it) + +TODO: define IssueBundle as +- ik +- actions: +- authorization: signature of the SIGHASH using the IssuanceSignatureKey + +TODO: define IssueAction as +- asset_desc +- notes +- finalize boolean + + +The protocol is as follows: + +- For each asset type issued, generate a sequence of output notes, each with the following fields: + - ZSA output note :math:`\mathsf{ note =(d, pkd, v, \rho, \psi, \mathsf{type}_\mathbb{P}, rcm)}`, where :math:`\mathsf{type}_\mathbb{P} := \mathsf{GroupHash^{\mathbb{P}}}\mathsf{(assetID)}` +- Generate commitment of the note. `cm` as + +NOTE that the commitment is not included in the IssuanceAction, but a computation done by the validators of the chain. + +:math:`cm = \mathsf{NoteCommit^{ZSA}_{rcm}}(\mathsf{repr\mathbb{_P}(g_d)}, \mathsf{repr\mathbb{_P}(pk_d)}, v, \rho, \psi,\mathsf{type}_\mathbb{P})` + +- Sign the issuance note with the `issuanceValidatingKey` as the signing key, using RedPallas as its signature scheme, on the `SIGHASH` of the transaction. Note that the `SIGHASH` will change as we include a new bundle in the Zcash transaction to enable this issuance mechanism on chain. + + +Consensus Changes +----------------- + +Issuance requires the following additions to the global state: +- `previously_finalized`, a set of `asset_id` that have been finalized (i.e.: the `finalize` flag has been set to `1`). + +**Consensus rules** + +For the IssueBudnele, +- Verify the signature on SIGHASH is valid, based on VerifySig.IssueAuthorization(ik, SIGHASH) + +For each IssueAction in a loop, + +- check that asset_desc is properly constructed (not too short and not exceeding 512 bytes) +- retrieve asset_id from first note and check that `asset_id` is properly constructed from asset_desc and ik, by checking the GroupHash of (ik, asset_desc) +- check that the `asset_id` does not exist in the `previously_finalized` set +- check that every note in the`IssueAction`` contains the same asset_id, and also that every note is properly constructed as `note = (recipient, value, note(asset, rho, rseed)` +- If all of the above checks pass, do the following + +- For each note, compute the `noteCommitment` and +- add `noteCommitment` to the Merkle tree of note commitments. + + +Example applications +-------------------- + +- By setting the `finiteIssuance = 1` from the first issuance instance of that asset type, 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. +- When the `finiteIssuance = 0`, the issuer can keep creating tokens of that type (in a transparent manner). The boolean value can be changed with any new issuance transaction, and could be set to `1` either when the issuer keys have been compromised, and hence stopping all issuances of that asset type (the boolean cannot be reversed), or whenever the issuer decides that the max supply has been reached. +- Note that this mechanism can be used with the burning process to control and affect the supply of any custom asset. + +Other Considerations +==================== + +Implementing Zcash clients +-------------------------- + +It is recommended that Zcash clients keep a mapping `issuanceSupplyInfos` from `asset_id` to `issuanceSupplyInfo := (totalSupply, finalize)` in order to properly keep track of the total supply for different asset types. This will be implemented in the Zcashd client. + +Fee Structures +-------------- + +The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317b [#zip-0317b]_. + +Test Vectors +============ + +- LINK TBD + +Reference Implementation +======================== + +- LINK TBD +- LINK TBD + +Deployment +========== + +This ZIP is proposed to activate with Network Upgrade 6. + +References +========== + +.. [#RFC2119] `RFC 2119: Key words for use in RFCs to Indicate Requirement Levels `_ +.. [#zip-0200] `ZIP 200: Network Upgrade Mechanism `_ +.. [#zip-0224] `ZIP 224: Orchard `_ +.. [#zip-0226] `ZIP 226: Transfer and Burn of Zcash Shielded Assets `_ +.. [#zip-0227] `ZIP 227: Issuance of Zcash Shielded Assets `_ +.. [#zip-0317b] `ZIP 317b: ZSA Extension Proportional Fee Mechanism `_ +.. [#zip-0032] `ZIP 32: Shielded Hierarchical Deterministic Wallets `_ \ No newline at end of file From 93a881f98978eb1d846cb807fef6c1ab2397d4e7 Mon Sep 17 00:00:00 2001 From: daniben31 Date: Wed, 30 Nov 2022 14:29:48 +0100 Subject: [PATCH 012/101] commits to create new branch --- zip-0226.rst | 8 +-- zip-0227.rst | 190 +++++++++++++++++++++++++++++++++++---------------- 2 files changed, 133 insertions(+), 65 deletions(-) diff --git a/zip-0226.rst b/zip-0226.rst index f5e8e2320..bc4ab4d1c 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -7,7 +7,6 @@ Aurelien Nicolas Credits: Daira Hopwood Jack Grigg - Shahaf Nacshon Vivek Arte Status: Draft Category: Consensus @@ -245,20 +244,19 @@ In the case that the balance of all the action values related to a specific asse ZSA Transaction Structure ========================= -Similar to NU5 transaction structure, with the following modifications to the Orchard bundle, as defined in [#protocol-transactionstructure]_: +Similar to version 5 transaction format, with the following modifications to the Orchard bundle, as defined in [#protocol-transactionstructure]_: +-----------------+-------------+-----------------------------------+-------------------------+ | Bytes | Name | Data Type | Description | +=================+=============+===================================+=========================+ -| newActionSize * | vActionsZSA | ActionDescription[nActionOrchard] | | -| nActionsZSA | | | | -+-----------------+-------------+-----------------------------------+-------------------------+ | varies | nAssetBurn | compactSize | number of assets burnt | +-----------------+-------------+-----------------------------------+-------------------------+ | 40*nAssetBurn | vAssetBurn | bytes[40][nAssetBurn] | 32 bytes asset type_t, | | | | | 8 bytes of valueBalance | +-----------------+-------------+-----------------------------------+-------------------------+ +And in terms of the action size, the ZSA action size differs from the Orchard action size by 32 bytes (given by the addition of the `AssetId`). This implies that the size goes from 820 bytes in the Orchard action to 852 bytes in the ZSA action. + Other Considerations ==================== diff --git a/zip-0227.rst b/zip-0227.rst index dc29264c1..4d9551f42 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -7,7 +7,6 @@ Aurelien Nicolas Credits: Daira Hopwood Jack Grigg - Shahaf Nacshon Vivek Arte Status: Draft Category: Consensus @@ -22,9 +21,11 @@ TODO - [x] change all issuerID to issuanceValidatingKey - [x] add definition of IssuanceAction & IssuanceBundle - [ ] Add a section on the security model of the shielded assets -- [ ] review definitions of assets / zsa -- [ ] finish going through math derivation of assets - +- [x] review definitions of assets / zsa +- [x] finish going through math derivation of assets +- [ ] add requirement: If you don't know the private key of the issuer of the asset type you should not be able to issue more notes of an asset type or change its finite issuance flag +- [ ] + Terminology =========== @@ -36,7 +37,7 @@ The term "Orchard" in this document is to be interpreted as described in ZIP 224 We define the following additional terms: -- Custom Asset: A type of note that can be transferred on the Zcash block chain. ZEC is the default (and currently the only defined) asset for the Zcash mainnet. Different custom assets are defined and differentiated by their identifier (`asset_id`). +- Custom Asset: A type of note that can be transferred on the Zcash block chain. ZEC is the default (and currently the only defined) asset for the Zcash mainnet. Different custom assets are defined and differentiated by their identifier (`AssetId`). - Zcash Shielded Asset: an asset with issuance defined on the Zcash block chain, and, with this ZIP, belonging to the Orchard anonymity pool. - Wrapped Asset: a ZSA asset with native issuance defined outside the Zcash block chain. - Issuance Action: an instance of a single issuance of a Zcash Shielded Asset. It defines the issuance of a single asset identifier. @@ -53,32 +54,50 @@ Motivation The current Orchard protocol does not support custom assets. Enabling multi-asset support on the Zcash chain will open the door for a host of applications and enhance the ecosystem with application developers and asset custody institutions for issuance and bridging purposes. -Overview & Rationale -==================== +Use Cases +========= + +The design presented in this ZIP enables several use cases for issuance of shielded assets. + +- The issuer knows in advance the receivers of the issued asset. +- The asset is of non-fungible type, where each asset type can be made part of a single “series” +- The supply of the asset is limited or not +- The assets can be wrapped versions of assets in other chains (as long as there is a bridge that supports it) + +Specification +============= + +As explained, the issuance protocol allows for a single issuance action to be sent to many receivers by mean of generating as many output notes as distinct recipients. Furthermore, every bundle can contain many issuance actions. Thus we divide the protocol spec in two sections. + +Overview +-------- This ZIP specifies the issuance mechanism of the Zcash Shielded Assets (ZSA) protocol and must work in conjunction with ZIP 226 [#zip-0226]_, as the issuance mechanism is only valid for the ZSA transfer protocol, as it produces notes that can only be transferred under ZSA. -In short, this ZIP enables only *transparent* issuance, since as a first step, transparency is important to properly test the applications that will be most used in the Zcash ecosystem, while enabling tracking of supply of assets. In essence, any user of the blockchain can issue new asset types, yet only a single issuer (a set of keys) can issue that specific asset type, as the asset identifiers are tied to the issuer keys. +In short, this ZIP enables only *transparent* issuance, since as a first step, transparency is important to properly test the applications that will be most used in the Zcash ecosystem, while enabling tracking of supply of assets. Any user of the blockchain can issue new asset types, yet only a single issuer (a set of keys) can issue that specific asset type, as the asset identifiers are tied to the issuer keys. -We have designed the protocol such that at the time of issuance, the issuer can already allocate all the tokens to the corresponding owners by creating the corresponding (shielded) output notes to the corresponding addresses. As is implied, the issuance mechanism is itself transparent, but the allocation is totally private. Furthermore, in a single issuance transaction, the issuer can create multiple custom assets. Finally, a key component of our design is the `finiteIssuance` boolean that defines whether a specific custom asset can have further tokens issued or not. +The protocol was designed with three main properties in mind: +- at the time of issuance, the issuer can already allocate all the tokens to the corresponding owners by creating the corresponding (shielded) output notes to the respective addresses. As is implied, the issuance mechanism is itself transparent, but the allocation is totally private +- in a single issuance bundle, the issuer can publish many issuance actions, or in other words, create multiple custom assets +- every issuance action contains the `finiteIssuance` boolean that defines whether that specific custom asset can have further tokens issued or not The issuance mechanism is broad enough for issuers to either create native 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. In fact, the protocol described below enables, what we hope will be a useful set of, applications. The design decision is not to have a chosen name to describe the custom asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”. -Issuance keys -============= +Issuance Keys +------------- There are two keys relevant to the Issuer: 1. The `issuanceAuthorizingKey`, denoted as `isk`, is the key that is used to sign the issuance transaction. This key is used to authorize the issuance of a specific asset type, and is only used by the issuer. -2. The `issuanceValidatingKey`, denoted as `ik`, is the key that is used to validate the issuance transaction. This key is used to validate the issuance of a specific asset type, and is used by all blockchain users (specifically the asset owners) to associate the asset in question with the issuer. +2. The `issuanceValidatingKey`, denoted as `ik`, is the key that is used to validate the issuance transaction. This key is used to validate the issuance of a specific asset type, and is used by all blockchain users (specifically the asset owners) to associate the asset in question with the issuer. We loosely call this key the "Issuer ID" -The two keys are derived in an analogous manner to the `spendAuthorizingKey` and `spendValidatingKey` keys, as described in ZIP 32 [#zip-0032]_. Specifically, we derive +The two keys are derived in an analogous manner to the `spendAuthorizingKey` and `spendValidatingKey` keys, as described in ZIP 32 [#zip-0032]_ and in accordance with ZIP 316 [#zip-0316]_. Specifically, - The `issuanceAuthorizingKey` is derived directly from the `spendingKey`, `sk`, as a private signature key: -:math:`\mathsf{isk := ToScalar^{Orchard}(︀ PRF^{expand}_{sk} ([10])}` +:math:`\mathsf{isk := ToScalar^{Orchard}(︀ PRF^{expand}_{sk} ([0x0a])}` - The `issuanceValidatingKey` is derived from the `issuanceAuthorizingKey`, `isk`, as a public verification key: @@ -86,55 +105,81 @@ The two keys are derived in an analogous manner to the `spendAuthorizingKey` and This allows the issuer to use the same wallet it usually uses to transfer assets, while keeping a disconnect from the other keys. It provides further anonymity and the ability to delegate issuance of an asset (or in the future, generate a multi-signature protocol) while keeping the rest of the keys in the wallet safe. -Asset Identifier Generation -=========================== +Asset Identifier +---------------- -For every new asset, there must be a new and unique identifier of the asset. Every asset is defined by the asset description, `asset_desc`, which is a global byte string (valid across all -future- Zcash protocols), of 256 bytes in size. From this asset descritpion, we derive the specific asset identifier, `AssetId`, used within the notes, as defined by the specific protocol (e.g.: for now Orchard-style, using Pallas curve). +For every new asset, there must be a new and unique identifier of the asset. Every asset is defined by the asset description, `asset_desc`, which is a global byte string (valid across all -future- Zcash protocols). From this asset descritpion, the specific asset identifier, `AssetId`, is derived with a `GroupHash` and used within the output notes, as defined by the specific protocol (e.g.: for now Orchard-style, using Pallas curve). -The main requirement for the asset identifier is for it to be collision-free, as two different issuers MUST not be able to issue the same asset type. One way to achieve this is to make the identifier dependent on the issuer keys, as the issuer keys are unique to each issuer. We achieve this by deriving the asset identifier, `asset_id` as follows: +The main requirement for the asset identifier is for it to be collision-free, as two different issuers MUST not be able to issue the same asset type. One way to achieve this is to make the identifier dependent on the issuer keys, as the issuer keys are unique to each issuer. We achieve this by deriving the asset identifier, `AssetId` as follows: -:math:`\mathsf{asset_id := GroupHash^{\mathbb{P}}}\mathsf{(ik || asset_desc)}` +:math:`\mathsf{AssetId := GroupHash^{\mathbb{P}}}\mathsf{(ik || asset_desc)}` where -- `asset_desc` is the asset description, a UTF-8 encoded string of up to 512 bytes, which includes any information pertaining to the issuance. the asset description -- `issuanceValidatingKey` is the public key of the issuer, used to verify the signature on the transaction and is defined as `ik` (issuer key or issuer verification key): +- `asset_desc` is the asset description, a UTF-8 encoded string of up to 512 bytes, which includes any information pertaining to the issuance +- `issuanceValidatingKey` is the public key of the issuer, used to verify the signature on the transaction SIGHASH and is defined as `ik` +Global Issuance State +--------------------- -Then we let `issuanceInfo := (assetID, finiteSupply)`, where +Issuance requires the following additions to the global state: +- `previously_finalized`, a set of `AssetId` that have been finalized (i.e.: the `finalize` flag has been set to `1`). -- `assetID` is as defined above. -- `finiteSupply` is a boolean variable that defines whether this issuance transaction of the specific asset type is the final issuance of tokens or not. Once `finiteSupply` is set, it cannot be unset. This allows expanding the functionality of the issuance mechanism: - - Provides `assetID` revocation in case of compromise (issue last issuance with 0 token value) - - Supports NFT issuance (where the first issuance with value of 1 is also the last) +Issuance Action Description +--------------------------- +An issuance action, `IssueAction`, is the instance of issuing a specific custom asset, and contains the following fields: +- `asset_desc`: the asset description, a UTF-8 encoded string of up to 512 bytes +- `notes`: an array containing the unencrypted output notes of the recipients of the asset, of type `Note` +- `finalize`: a boolean that defines whether the issuance of that specific custom asset is finalized or not -Issuance Protocol -================= +For assets whose `finalize = 1`, no further tokens can be issued, so as seen below, the validators will reject the transaction. For assets whose `finalize = 0`, new issuance actions can be issued in future transactions. These must use the same asset description, `asset_desc`, and can either maintain `finalize = 0` or change it to `1`, denoting the last transaction containing issuance of such custom asset. + +================= ================== ========================== ======================================================================== +Size Name Data Type Description +================= ================== ========================== ======================================================================== +Varies asset_desc byte Uni-code encoded string of varied size, up to 512 bytes +Varies nNotes compactSize The number of notes in the issuance action +noteSize * nNotes vNotes Note[nNotes] A sequence of note descriptions within the issuance action +1 bit finalize boolean The boolean that determines the finality of the issuance of that asset +================= ================== ========================== ======================================================================== -The issuance protocol allows for a single issuance to be sent to many receivers, as the issuanceValidatingKey does not have to match the address ownership of the notes output. Furthermore, every transaction can contain many issuance instances. The design presented in this ZIP enables several use cases for issuance of shielded assets. +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 issuer knows in advance the receivers of the issued asset. -- The asset is of non-fungible type, where each asset type can be made part of a single “series” -- The supply of the asset is limited or not -- The assets can be wrapped versions of assets in other chains (as long as there is a bridge that supports it) -TODO: define IssueBundle as -- ik -- actions: -- authorization: signature of the SIGHASH using the IssuanceSignatureKey -TODO: define IssueAction as -- asset_desc -- notes -- finalize boolean +Issuance Bundle +--------------- +An issuance bundle, `IssueBundle`, 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: -The protocol is as follows: +- `ik`: the `issuanceValidatingKey`, that allows the validators to verify that the `AssetId` is properly associated with the issuer +- `actions`: an array of issuance actions, of type `IssueAction` +- `authorization`: the signature of the transaction SIGHASH, signed by the `issuanceAuthorizingKey`, `isk`, that validates the issuance + +The issuance bundle is then added within the transaction format as a new bundle. This structure will be added to the v6 transaction format. + +======= ================== ========================== ======================================================================== +Bytes Name Data Type Description +======= ================== ========================== ======================================================================== +Varies nIssueActions compactSize The number of issuance actions in the bundle +Varies vIssueActions IssueAction[nIssueActions] A sequence of issuance actions descriptions +32 ik byte[32] The public key of the issuer +64 authorization byte[64] The signature of the transaction SIGHASH, signed by the issuer +======= ================== ========================== ======================================================================== + + + +Issuance Protocol +----------------- +The issuer program performs the following operations + +For all actions `IssueAction`: +- encode `asset_desc` as 512 byte-string +- compute `AssetId` as :math:`GroupHash^{\mathbb{P}}(ik || asset_desc)` +- For each recipient `i`: + - generate a ZSA output note as :math:`\mathsf{ note_i =(d_i, pkd_i, v_i, \rho_i, \psi_i, \mathsf{AssetId}, rcm_i)}` -- For each asset type issued, generate a sequence of output notes, each with the following fields: - - ZSA output note :math:`\mathsf{ note =(d, pkd, v, \rho, \psi, \mathsf{type}_\mathbb{P}, rcm)}`, where :math:`\mathsf{type}_\mathbb{P} := \mathsf{GroupHash^{\mathbb{P}}}\mathsf{(assetID)}` -- Generate commitment of the note. `cm` as NOTE that the commitment is not included in the IssuanceAction, but a computation done by the validators of the chain. @@ -142,21 +187,30 @@ NOTE that the commitment is not included in the IssuanceAction, but a computatio - Sign the issuance note with the `issuanceValidatingKey` as the signing key, using RedPallas as its signature scheme, on the `SIGHASH` of the transaction. Note that the `SIGHASH` will change as we include a new bundle in the Zcash transaction to enable this issuance mechanism on chain. +Concrete applications +--------------------- -Consensus Changes ------------------ +**Bridging Assets** +Issuers can wrap assets defined in other chains and issue them at once in a single transaction. The specifics of the bridge are not implemented in the protocol, but there are several ways we conceive issuers can build these bridges (at least centralized bridges): +- First, the issuance and burn mechanism can be used in conjunction to determine the -Issuance requires the following additions to the global state: -- `previously_finalized`, a set of `asset_id` that have been finalized (i.e.: the `finalize` flag has been set to `1`). +Once `finiteSupply` is set, it cannot be unset. This allows expanding the functionality of the issuance mechanism: + - Provides `AssetId` revocation in case of compromise (issue last issuance with a single output note of `value = 0`) + - Supports NFT issuance (where the first issuance with value of 1 is also the last) -**Consensus rules** +Here are some examples for how to use this protocol within an application: +- By setting the `finiteIssuance = 1` from the first issuance instance of that asset type, 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. +- When the `finiteIssuance = 0`, the issuer can keep creating tokens of that type (in a transparent manner). The boolean value can be changed with any new issuance transaction, and could be set to `1` either when the issuer keys have been compromised, and hence stopping all issuances of that asset type (the boolean cannot be reversed), or whenever the issuer decides that the max supply has been reached. +- Note that this mechanism can be used with the burning process to control and affect the supply of any custom asset. -For the IssueBudnele, -- Verify the signature on SIGHASH is valid, based on VerifySig.IssueAuthorization(ik, SIGHASH) +Consensus Rule Changes +---------------------- -For each IssueAction in a loop, +For the IssueBundle, +- Verify the signature on SIGHASH is valid, based on `VerifySig.IssueAuthorization(ik, SIGHASH)` -- check that asset_desc is properly constructed (not too short and not exceeding 512 bytes) +For each `IssueAction` in `IssueBundle`: +- check that `asset_desc` is properly constructed: byte size > 0 exceeding 512 bytes) - retrieve asset_id from first note and check that `asset_id` is properly constructed from asset_desc and ik, by checking the GroupHash of (ik, asset_desc) - check that the `asset_id` does not exist in the `previously_finalized` set - check that every note in the`IssueAction`` contains the same asset_id, and also that every note is properly constructed as `note = (recipient, value, note(asset, rho, rseed)` @@ -165,17 +219,32 @@ For each IssueAction in a loop, - For each note, compute the `noteCommitment` and - add `noteCommitment` to the Merkle tree of note commitments. +Rationale +========= +The following is a list of rationale for different decisions made in the proposal: -Example applications --------------------- +- The issuance key structure was kept aligned to the original key tree in order to ease issuance integration with wallets and to prevent users from having to manage multiple keys and secrets. +- the `asset_desc` is a general byte string in order to allow for a wide range of information type to be included that may be associated with the assets. Some are: + - links for storage such as for NFTs + - other metadata for native assets + - bridging information for wrapped assets (chain of origin, issuer name, etc) + - information to be committed by the issuer, though not enforceable by the protocol +- -- By setting the `finiteIssuance = 1` from the first issuance instance of that asset type, 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. -- When the `finiteIssuance = 0`, the issuer can keep creating tokens of that type (in a transparent manner). The boolean value can be changed with any new issuance transaction, and could be set to `1` either when the issuer keys have been compromised, and hence stopping all issuances of that asset type (the boolean cannot be reversed), or whenever the issuer decides that the max supply has been reached. -- Note that this mechanism can be used with the burning process to control and affect the supply of any custom asset. +Security and Privacy Considerations +=================================== + + we did not include a design that would allow for replacing the key of a specific asset. In case of compromise, the following actions are recommended: + - If an asset ID is compromised, the finalization boolean should be put to `0` and a new asset ID generated. + - If an issuer verification key is compromised, the finalization boolean should be put to `0` and the issuer should change to a new spending key altogether (for the purpose of issuance). + +We note that for bridging purposes, the secure method of doing it is to burn an asset with the burning mechanism. 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 ==================== +When issuing assets on the Zcash block chain for a specific application in mind (i.e.: NFTs), the issuer should consider the full ZSA protocol to ensure + Implementing Zcash clients -------------------------- @@ -211,4 +280,5 @@ References .. [#zip-0226] `ZIP 226: Transfer and Burn of Zcash Shielded Assets `_ .. [#zip-0227] `ZIP 227: Issuance of Zcash Shielded Assets `_ .. [#zip-0317b] `ZIP 317b: ZSA Extension Proportional Fee Mechanism `_ -.. [#zip-0032] `ZIP 32: Shielded Hierarchical Deterministic Wallets `_ \ No newline at end of file +.. [#zip-0032] `ZIP 32: Shielded Hierarchical Deterministic Wallets `_ +.. [#zip-0316] `ZIP 316: Unified Addresses and Unified Viewing Keys `_ \ No newline at end of file From 7a22ab3d57a0fd09b5f911279f0232c822eebec6 Mon Sep 17 00:00:00 2001 From: daniben31 Date: Wed, 30 Nov 2022 16:41:02 +0100 Subject: [PATCH 013/101] final isuance zip --- zip-0226.html | 10 +- zip-0227.html | 329 +++++++++++++++++++++++++++++++++----------------- zip-0227.rst | 124 +++++++++---------- 3 files changed, 281 insertions(+), 182 deletions(-) diff --git a/zip-0226.html b/zip-0226.html index a8b569eab..c1e4c008a 100644 --- a/zip-0226.html +++ b/zip-0226.html @@ -14,7 +14,6 @@ Aurelien Nicolas <aurel@qed-it.com> Credits: Daira Hopwood Jack Grigg - Shahaf Nacshon Vivek Arte Status: Draft Category: Consensus @@ -335,7 +334,7 @@

Note: Even if this mechanism allows having transparent ↔ shielded asset transfers in theory, the transparent protocol will not be changed with this ZIP to adapt to a multiple asset structure. This means that unless future consensus rules changes do allow it, the unshielding is not not be possible for custom assets.

ZSA Transaction Structure

-

Similar to NU5 transaction structure, with the following modifications to the Orchard bundle, as defined in 14:

+

Similar to version 5 transaction format, with the following modifications to the Orchard bundle, as defined in 14:

@@ -346,12 +345,6 @@ - - - - - - @@ -366,6 +359,7 @@
newActionSize * nActionsZSAvActionsZSAActionDescription[nActionOrchard]
varies nAssetBurn
+

And in terms of the action size, the ZSA action size differs from the Orchard action size by 32 bytes (given by the addition of the AssetId). This implies that the size goes from 820 bytes in the Orchard action to 852 bytes in the ZSA action.

Other Considerations

Transaction Fees

diff --git a/zip-0227.html b/zip-0227.html index 990b12deb..449571265 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -14,29 +14,19 @@ Aurelien Nicolas <aurel@qed-it.com> Credits: Daira Hopwood Jack Grigg - Shahaf Nacshon Vivek Arte Status: Draft Category: Consensus Created: 2022-05-01 License: MIT Discussions-To: <https://github.com/zcash/zips/issues/618> -

TODO

-
    -
  • [x] change all issuerID to issuanceValidatingKey
  • -
  • [x] add definition of IssuanceAction & IssuanceBundle
  • -
  • [ ] Add a section on the security model of the shielded assets
  • -
  • [ ] review definitions of assets / zsa
  • -
  • [ ] finish going through math derivation of assets
  • -
-

Terminology

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.

We define the following additional terms:

    -
  • Custom Asset: A type of note that can be transferred on the Zcash block chain. ZEC is the default (and currently the only defined) asset for the Zcash mainnet. Different custom assets are defined and differentiated by their identifier (asset_id).
  • +
  • Custom Asset: A type of note that can be transferred on the Zcash block chain. ZEC is the default (and currently the only defined) asset for the Zcash mainnet. Different custom assets are defined and differentiated by their identifier (AssetId).
  • Zcash Shielded Asset: an asset with issuance defined on the Zcash block chain, and, with this ZIP, belonging to the Orchard anonymity pool.
  • Wrapped Asset: a ZSA asset with native issuance defined outside the Zcash block chain.
  • Issuance Action: an instance of a single issuance of a Zcash Shielded Asset. It defines the issuance of a single asset identifier.
  • @@ -44,129 +34,236 @@

Abstract

-

ZIP 226 4 and ZIP 227 5 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 5. The transfer and burn of such assets is defined in ZIP 226 4.

+

ZIP 226 4 and ZIP 227 5 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 5. 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, as it produces notes that can only be transferred under ZSA.

Motivation

The current Orchard protocol does not support custom assets. Enabling multi-asset support on the Zcash chain will open the door for a host of applications and enhance the ecosystem with application developers and asset custody institutions for issuance and bridging purposes.

-

Overview & Rationale

-

This ZIP specifies the issuance mechanism of the Zcash Shielded Assets (ZSA) protocol and must work in conjunction with ZIP 226 4, as the issuance mechanism is only valid for the ZSA transfer protocol, as it produces notes that can only be transferred under ZSA.

-

In short, this ZIP enables only transparent issuance, since as a first step, transparency is important to properly test the applications that will be most used in the Zcash ecosystem, while enabling tracking of supply of assets. In essence, any user of the blockchain can issue new asset types, yet only a single issuer (a set of keys) can issue that specific asset type, as the asset identifiers are tied to the issuer keys.

-

We have designed the protocol such that at the time of issuance, the issuer can already allocate all the tokens to the corresponding owners by creating the corresponding (shielded) output notes to the corresponding addresses. As is implied, the issuance mechanism is itself transparent, but the allocation is totally private. Furthermore, in a single issuance transaction, the issuer can create multiple custom assets. Finally, a key component of our design is the finiteIssuance boolean that defines whether a specific custom asset can have further tokens issued or not.

-

The issuance mechanism is broad enough for issuers to either create native 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. In fact, the protocol described below enables, what we hope will be a useful set of, applications. The design decision is not to have a chosen name to describe the custom asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”.

-
-

Issuance keys

-

There are two keys relevant to the Issuer:

-
    -
  1. The issuanceAuthorizingKey, denoted as isk, is the key that is used to sign the issuance transaction. This key is used to authorize the issuance of a specific asset type, and is only used by the issuer.
  2. -
  3. The issuanceValidatingKey, denoted as ik, is the key that is used to validate the issuance transaction. This key is used to validate the issuance of a specific asset type, and is used by all blockchain users (specifically the asset owners) to associate the asset in question with the issuer.
  4. -
-

The two keys are derived in an analogous manner to the spendAuthorizingKey and spendValidatingKey keys, as described in ZIP 32 7. Specifically, we derive

-
    -
  • The issuanceAuthorizingKey is derived directly from the spendingKey, sk, as a private signature key:
  • -
-

- \(\mathsf{isk := ToScalar^{Orchard}(︀ PRF^{expand}_{sk} ([10])}\) -

-
    -
  • The issuanceValidatingKey is derived from the issuanceAuthorizingKey, isk, as a public verification key:
  • -
-

- \(\mathsf{ik := SpendAuthSig^{Orchard}.DerivePublic(isk)}\) -

-

This allows the issuer to use the same wallet it usually uses to transfer assets, while keeping a disconnect from the other keys. It provides further anonymity and the ability to delegate issuance of an asset (or in the future, generate a multi-signature protocol) while keeping the rest of the keys in the wallet safe.

-
-

Asset Identifier Generation

-

For every new asset, there must be a new and unique identifier of the asset. Every asset is defined by the asset description, asset_desc, which is a global byte string (valid across all -future- Zcash protocols), of 256 bytes in size. From this asset descritpion, we derive the specific asset identifier, AssetId, used within the notes, as defined by the specific protocol (e.g.: for now Orchard-style, using Pallas curve).

-

The main requirement for the asset identifier is for it to be collision-free, as two different issuers MUST not be able to issue the same asset type. One way to achieve this is to make the identifier dependent on the issuer keys, as the issuer keys are unique to each issuer. We achieve this by deriving the asset identifier, asset_id as follows:

-

- \(\mathsf{asset_id := GroupHash^{\mathbb{P}}}\mathsf{(ik || asset_desc)}\) -

-

where

-
    -
  • asset_desc is the asset description, a UTF-8 encoded string of up to 512 bytes, which includes any information pertaining to the issuance. the asset description
  • -
  • issuanceValidatingKey is the public key of the issuer, used to verify the signature on the transaction and is defined as ik (issuer key or issuer verification key):
  • -
-

Then we let issuanceInfo := (assetID, finiteSupply), where

-
    -
  • assetID is as defined above.
  • -
  • -
    -
    finiteSupply is a boolean variable that defines whether this issuance transaction of the specific asset type is the final issuance of tokens or not. Once finiteSupply is set, it cannot be unset. This allows expanding the functionality of the issuance mechanism:
    -
    -
      -
    • Provides assetID revocation in case of compromise (issue last issuance with 0 token value)
    • -
    • Supports NFT issuance (where the first issuance with value of 1 is also the last)
    • -
    -
    -
    -
  • -
-
-

Issuance Protocol

-

The issuance protocol allows for a single issuance to be sent to many receivers, as the issuanceValidatingKey does not have to match the address ownership of the notes output. Furthermore, every transaction can contain many issuance instances. The design presented in this ZIP enables several use cases for issuance of shielded assets.

+

Use Cases

+

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

  • The issuer knows in advance the receivers of the issued asset.
  • The asset is of non-fungible type, where each asset type can be made part of a single “series”
  • The supply of the asset is limited or not
  • The assets can be wrapped versions of assets in other chains (as long as there is a bridge that supports it)
-

TODO: define IssueBundle as - ik - actions: - authorization: signature of the SIGHASH using the IssuanceSignatureKey

-

TODO: define IssueAction as - asset_desc - notes - finalize boolean

-

The protocol is as follows:

-
    -
  • -
    -
    For each asset type issued, generate a sequence of output notes, each with the following fields:
    -
    -
      -
    • ZSA output note - \(\mathsf{ note =(d, pkd, v, \rho, \psi, \mathsf{type}_\mathbb{P}, rcm)}\) - , where - \(\mathsf{type}_\mathbb{P} := \mathsf{GroupHash^{\mathbb{P}}}\mathsf{(assetID)}\) -
    • -
    -
    -
    -
  • -
  • Generate commitment of the note. cm as
  • -
-

NOTE that the commitment is not included in the IssuanceAction, but a computation done by the validators of the chain.

-

- \(cm = \mathsf{NoteCommit^{ZSA}_{rcm}}(\mathsf{repr\mathbb{_P}(g_d)}, \mathsf{repr\mathbb{_P}(pk_d)}, v, \rho, \psi,\mathsf{type}_\mathbb{P})\) -

+

See the Concrete Applications section for more details.

+
+

Requirements

    -
  • Sign the issuance note with the issuanceValidatingKey as the signing key, using RedPallas as its signature scheme, on the SIGHASH of the transaction. Note that the SIGHASH will change as we include a new bundle in the Zcash transaction to enable this issuance mechanism on chain.
  • +
  • Any user of the Zcash block chain can issue custom assets on chain
  • +
  • The issuance mechanism should enable tracking publicly the supply of the assets on the Zcash block chain
  • +
  • A user without knowledge of the private key of the issuer of a specific asset should not be able to issue that asset or change the attributes of such asset
  • +
  • The asset identification should be unique and different issuer keys should not be able to generate the same asset identifier
-

Consensus Changes

-

Issuance requires the following additions to the global state: - previously_finalized, a set of asset_id that have been finalized (i.e.: the finalize flag has been set to 1).

-

Consensus rules

-

For the IssueBudnele, - Verify the signature on SIGHASH is valid, based on VerifySig.IssueAuthorization(ik, SIGHASH)

-

For each IssueAction in a loop,

+
+

Specification

+

As explained, the issuance protocol allows for a single issuance action to be sent to many receivers by mean of generating as many output notes as distinct recipients. Furthermore, every bundle can contain many issuance actions. Thus we divide the protocol spec in two sections.

+

Overview

+

In short, this specification enables only transparent issuance, since as a first step, transparency is important to properly test the applications that will be most used in the Zcash ecosystem, while enabling tracking of supply of assets. Any user of the blockchain can issue new asset types, yet only a single issuer (a set of keys) can issue that specific asset type, as the asset identifiers are tied to the issuer keys.

+

The protocol was designed with three main properties in mind: - at the time of issuance, the issuer can already allocate all the tokens to the corresponding owners by creating the corresponding (shielded) output notes to the respective addresses. As is implied, the issuance mechanism is itself transparent, but the allocation is totally private - in a single issuance bundle, the issuer can publish many issuance actions, or in other words, create multiple custom assets - every issuance action contains the finiteIssuance boolean that defines whether that specific custom asset can have further tokens issued or not

+

The issuance mechanism is broad enough for issuers to either create native 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. In fact, the protocol described below enables, what we hope will be a useful set of, applications. The design decision is not to have a chosen name to describe the custom asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”.

+
+

Issuance Keys

+

There are two keys relevant to the Issuer:

+
    +
  1. The issuanceAuthorizingKey, denoted as isk, is the key that is used to sign the issuance transaction. This key is used to authorize the issuance of a specific asset type, and is only used by the issuer. Throughout we also call this key the issuer signature key.
  2. +
  3. The issuanceValidatingKey, denoted as ik, is the key that is used to validate the issuance transaction. This key is used to validate the issuance of a specific asset type, and is used by all blockchain users (specifically the asset owners and consensus validators) to associate the asset in question with the issuer. Throughout we also call this key the issuer verification key.
  4. +
+

The two keys are derived in an analogous manner to the spendAuthorizingKey and spendValidatingKey keys, using the same signature scheme, as described in ZIP 32 7 and in accordance with ZIP 316 8. Specifically,

    -
  • check that asset_desc is properly constructed (not too short and not exceeding 512 bytes)
  • -
  • retrieve asset_id from first note and check that asset_id is properly constructed from asset_desc and ik, by checking the GroupHash of (ik, asset_desc)
  • -
  • check that the asset_id does not exist in the previously_finalized set
  • -
  • check that every note in the`IssueAction`` contains the same asset_id, and also that every note is properly constructed as note = (recipient, value, note(asset, rho, rseed)
  • -
  • If all of the above checks pass, do the following
  • -
  • For each note, compute the noteCommitment and
  • -
  • add noteCommitment to the Merkle tree of note commitments.
  • +
  • The issuanceAuthorizingKey is derived directly from the spendingKey, sk, as a private signature key:
+

+ \(\mathsf{isk := ToScalar^{Orchard}(︀ PRF^{expand}_{sk} ([0x0a])}\) +

+
    +
  • The issuanceValidatingKey is derived from the issuanceAuthorizingKey, isk, as a public verification key:
  • +
+

+ \(\mathsf{ik := SpendAuthSig^{Orchard}.DerivePublic(isk)}\) +

+

This allows the issuer to use the same wallet it usually uses to transfer assets, while keeping a disconnect from the other keys. 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.

-

Example applications

+

Asset Identifier

+

For every new asset, there must be a new and unique identifier of the asset. Every asset is defined by the asset description, asset_desc, which is a global byte string (valid across all -future- Zcash protocols). From this asset descritpion, the specific asset identifier, AssetId, is derived with a GroupHash and used within the output notes, as defined by the specific protocol (e.g.: for now Orchard-style, using Pallas curve).

+

The main requirement for the asset identifier is for it to be collision-free, as two different issuers MUST not be able to issue the same asset type. One way to achieve this is to make the identifier dependent on the issuer keys, as the issuer keys are unique to each issuer. We achieve this by deriving the asset identifier, AssetId as follows:

+

+ \(\mathsf{AssetId := GroupHash^{\mathbb{P}}}\mathsf{(ik || asset_desc)}\) +

+

where

    -
  • By setting the finiteIssuance = 1 from the first issuance instance of that asset type, 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.
  • -
  • When the finiteIssuance = 0, the issuer can keep creating tokens of that type (in a transparent manner). The boolean value can be changed with any new issuance transaction, and could be set to 1 either when the issuer keys have been compromised, and hence stopping all issuances of that asset type (the boolean cannot be reversed), or whenever the issuer decides that the max supply has been reached.
  • -
  • Note that this mechanism can be used with the burning process to control and affect the supply of any custom asset.
  • +
  • asset_desc is the asset description, a UTF-8 encoded string of up to 512 bytes, which includes any information pertaining to the issuance
  • +
  • issuanceValidatingKey is the public key of the issuer, used to verify the signature on the transaction SIGHASH and is defined as ik
+

Global Issuance State

+

Issuance requires the following additions to the global state: - previously_finalized, a set of AssetId that have been finalized (i.e.: the finalize flag has been set to 1).

+
+

Issuance Action Description

+

An issuance action, IssueAction, is the instance of issuing a specific custom asset, and contains the following fields: - asset_desc: the asset description, a UTF-8 encoded string of up to 512 bytes - notes: an array containing the unencrypted output notes of the recipients of the asset, of type Note - finalize: a boolean that defines whether the issuance of that specific custom asset is finalized or not

+

Once finiteSupply is set to 1, it cannot be unset. For assets whose finalize = 1, no further tokens can be issued, so as seen below, the validators will reject the transaction. For assets whose finalize = 0, new issuance actions can be issued in future transactions. These must use the same asset description, asset_desc, and can either maintain finalize = 0 or change it to 1, denoting the last transaction containing issuance of such custom asset.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SizeNameData TypeDescription
Variesasset_descbyteUni-code encoded string of varied size, up to 512 bytes
VariesnNotescompactSizeThe number of notes in the issuance action
noteSize * nNotesvNotesNote[nNotes]A sequence of note descriptions within the issuance action
1 bitfinalizebooleanThe boolean that determines the finality of the issuance of that asset
+

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.

+
+

Issuance Bundle

+

An issuance bundle, IssueBundle, 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:

+
    +
  • ik: the issuanceValidatingKey, that allows the validators to verify that the AssetId is properly associated with the issuer
  • +
  • actions: an array of issuance actions, of type IssueAction
  • +
  • authorization: the signature of the transaction SIGHASH, signed by the issuanceAuthorizingKey, isk, that validates the issuance
  • +
+

The issuance bundle is then added within the transaction format as a new bundle. This structure will be added to the v6 transaction format.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BytesNameData TypeDescription
VariesnIssueActionscompactSizeThe number of issuance actions in the bundle
VariesvIssueActionsIssueAction[nIssueActions]A sequence of issuance actions descriptions
32ikbyte[32]The public verification key of the issuer, used to validate the signature
64authorizationbyte[64]The signature of the transaction SIGHASH, signed by the issuer
+
+

Issuance Protocol

+

The issuer program performs the following operations

+

For all actions IssueAction: - encode asset_desc as 512 byte-string - compute AssetId as + \(GroupHash^{\mathbb{P}}(ik || asset_desc)\) + - set the finalize boolean as desired (if more more issuance actions are to be created for this asset identifier, set finalize = 0, otherwise set finalize = 1) - For each recipient i:

+
+

System Message: ERROR/3 (zip-0227.rst line 174)

+

Unexpected indentation.

+
+
+
    +
  • generate a ZSA output note as + \(\mathsf{ note_i =(d_i, {pk_d}_i, v_i, \rho_i, \psi_i, \mathsf{AssetId}, rcm_i)}\) +
  • +
+
+
+

System Message: WARNING/2 (zip-0227.rst line 175)

+

Block quote ends without a blank line; unexpected unindent.

+
+
    +
  • encode the IssueAction into the vector vIssueActions of the bundle
  • +
+

For the IssueBundle: - encode the vIssueActions vector - encode the ik as 32 byte-string - sign the SIGHASH of the transaction with the issuanceAuthorizingKey, isk, using the RedPallas signature scheme. The signature is then added to the issuance bundle.

+

NOTE that the commitment is not included in the IssuanceAction itsefl. As explained below, it is later computed by the validators and added to the NoteCommitmentTree.

+
+

Concrete applications

+

Bridging Assets Issuers can wrap assets defined in other chains and issue them at once in a single transaction. The specifics of the bridge are not implemented in the protocol, but there are several ways we conceive issuers can build these bridges (at least centralized bridges): - First, the issuance and burn mechanism can be used in conjunction to determine the

+

Asset Features - By using the 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,

+
+

System Message: ERROR/3 (zip-0227.rst line 194)

+

Unexpected indentation.

+
+
+
    +
  • by setting finalize = 1 from the first issuance action for that asset type, 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.
  • +
+
+
+

System Message: WARNING/2 (zip-0227.rst line 195)

+

Block quote ends without a blank line; unexpected unindent.

+
+
    +
  • 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 AssetId, while at the same time setting finalize = 1, or by - issuing a transaction with a single note in the issuance action pertaining to that AssetId, where the note will contain a 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).
  • +
  • Furthermore, NFT issuance is enabled by issuing in a single bundle several issuance actions, where each AssetId corresponds to value = 1 at the fundamental unit level. Issuers and users should make sure that finalize = 1 for each of the actions in this scenario.
  • +
+
+

Consensus Rule Changes

+

For the IssueBundle, - Verify the RedPallas-based issuance authorization signature on SIGHASH, authorization is valid, based on authorization.VerifySig(ik, SIGHASH)

+

For each IssueAction in IssueBundle: - check that asset_desc is a string with 0 < byte size <= 512 - retrieve AssetId from the first note in the sequence and check that AssetId = GroupHash^{mathbb{P}}(ik || asset_desc) is properly derived - check that the AssetId does not exist in the previously_finalized set in the global state - check that every note in the IssueAction contains the same AssetId and also that every note is of type Note and is properly constructed as + \(note = (\mathsf{g_d, pk_d, v, \rho, \psi, AssetId})\) +

+

If all of the above checks pass, do the following: - For each note, compute the note commitment as + \(cm = \mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, AssetId)}\) + and - add cm to the Merkle tree of note commitments, NoteCommitmentTree - If finalize = 1, add AssetId to the previously_finalized set in the global state

+
+
+

Rationale

+

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

+
    +
  • The issuance key structure was kept aligned to the original key tree in order to ease issuance integration with wallets and to prevent users from having to manage multiple keys and secrets.
  • +
  • the asset_desc is a general byte string in order to allow for a wide range of information type to be included that may be associated with the assets. Some are: - links for storage such as for NFTs - other metadata for native assets - bridging information for wrapped assets (chain of origin, issuer name, etc) - information to be committed by the issuer, though not enforceable by the protocol
  • +
+
+

Security and Privacy Considerations

+

Issuer Key or AssetId Compromise

+

The design of this protocol does not allow for a rotation of the issuerValidatingKey, that would allow for replacing the key of a specific asset (see Future Work). In case of compromise, the following actions are recommended: - If an asset ID is compromised (and not the issuer verification key), the finalize boolean for that asset should be set to 0 and a new AssetId generated instead. - If an issuer verification key is compromised, the finalize boolean for all the assets issued with that key should be set to 0 and the issuer should change to a new spending key altogether (for the purpose of issuance), and issue new assets, each with a new AssetId.

+

Briding Assets 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.

Other Considerations

-

Implementing Zcash clients

-

It is recommended that Zcash clients keep a mapping issuanceSupplyInfos from asset_id to issuanceSupplyInfo := (totalSupply, finalize) in order to properly keep track of the total supply for different asset types. This will be implemented in the Zcashd client.

+

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 issuanceSupplyInfoMap from AssetId to issuanceSupplyInfoMap := (totalSupply, finalize) in order to properly keep track of the total supply for different asset types. 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 317b 6.

+

The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317b 6.

+
+

Future Work

+

In future versions of this ZIP, the protocol may also include a "key rotation" mechanism. This would allow an issuer to change the underlying ik of a given asset, in case the original one was compromised, without having to chance the asset identifier altogether.

Test Vectors

@@ -240,6 +337,14 @@ + + + + + + + +
8ZIP 316: Unified Addresses and Unified Viewing Keys
diff --git a/zip-0227.rst b/zip-0227.rst index 4d9551f42..489968002 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -13,18 +13,6 @@ Created: 2022-05-01 License: MIT Discussions-To: - - - -TODO -===== -- [x] change all issuerID to issuanceValidatingKey -- [x] add definition of IssuanceAction & IssuanceBundle -- [ ] Add a section on the security model of the shielded assets -- [x] review definitions of assets / zsa -- [x] finish going through math derivation of assets -- [ ] add requirement: If you don't know the private key of the issuer of the asset type you should not be able to issue more notes of an asset type or change its finite issuance flag -- [ ] Terminology =========== @@ -46,7 +34,7 @@ We define the following additional terms: Abstract ======== -ZIP 226 [#zip-0226]_ and ZIP 227 [#zip-0227]_ 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 [#zip-0227]_. The transfer and burn of such assets is defined in ZIP 226 [#zip-0226]_. +ZIP 226 [#zip-0226]_ and ZIP 227 [#zip-0227]_ 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 [#zip-0227]_. The transfer and burn of such assets is defined in ZIP 226 [#zip-0226]_. This ZIP must only be implemented in conjuction with ZIP 226 [#zip-0226]_, as the issuance mechanism is only valid for the ZSA transfer protocol, as it produces notes that can only be transferred under ZSA. Motivation ========== @@ -57,13 +45,24 @@ bridging purposes. Use Cases ========= -The design presented in this ZIP enables several use cases for issuance of shielded assets. +The design presented in this ZIP enables issuance of shielded assets in various modes: - The issuer knows in advance the receivers of the issued asset. - The asset is of non-fungible type, where each asset type can be made part of a single “series” - The supply of the asset is limited or not - The assets can be wrapped versions of assets in other chains (as long as there is a bridge that supports it) +See the Concrete Applications section for more details. + +Requirements +============ + +- Any user of the Zcash block chain can issue custom assets on chain +- The issuance mechanism should enable tracking publicly the supply of the assets on the Zcash block chain +- A user without knowledge of the private key of the issuer of a specific asset should not be able to issue that asset or change the attributes of such asset +- The asset identification should be unique and different issuer keys should not be able to generate the same asset identifier + + Specification ============= @@ -72,9 +71,7 @@ As explained, the issuance protocol allows for a single issuance action to be se Overview -------- -This ZIP specifies the issuance mechanism of the Zcash Shielded Assets (ZSA) protocol and must work in conjunction with ZIP 226 [#zip-0226]_, as the issuance mechanism is only valid for the ZSA transfer protocol, as it produces notes that can only be transferred under ZSA. - -In short, this ZIP enables only *transparent* issuance, since as a first step, transparency is important to properly test the applications that will be most used in the Zcash ecosystem, while enabling tracking of supply of assets. Any user of the blockchain can issue new asset types, yet only a single issuer (a set of keys) can issue that specific asset type, as the asset identifiers are tied to the issuer keys. +In short, this specification enables only *transparent* issuance, since as a first step, transparency is important to properly test the applications that will be most used in the Zcash ecosystem, while enabling tracking of supply of assets. Any user of the blockchain can issue new asset types, yet only a single issuer (a set of keys) can issue that specific asset type, as the asset identifiers are tied to the issuer keys. The protocol was designed with three main properties in mind: - at the time of issuance, the issuer can already allocate all the tokens to the corresponding owners by creating the corresponding (shielded) output notes to the respective addresses. As is implied, the issuance mechanism is itself transparent, but the allocation is totally private @@ -83,17 +80,16 @@ The protocol was designed with three main properties in mind: The issuance mechanism is broad enough for issuers to either create native 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. In fact, the protocol described below enables, what we hope will be a useful set of, applications. The design decision is not to have a chosen name to describe the custom asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”. - Issuance Keys ------------- There are two keys relevant to the Issuer: -1. The `issuanceAuthorizingKey`, denoted as `isk`, is the key that is used to sign the issuance transaction. This key is used to authorize the issuance of a specific asset type, and is only used by the issuer. +1. The `issuanceAuthorizingKey`, denoted as `isk`, is the key that is used to sign the issuance transaction. This key is used to authorize the issuance of a specific asset type, and is only used by the issuer. Throughout we also call this key the issuer signature key. -2. The `issuanceValidatingKey`, denoted as `ik`, is the key that is used to validate the issuance transaction. This key is used to validate the issuance of a specific asset type, and is used by all blockchain users (specifically the asset owners) to associate the asset in question with the issuer. We loosely call this key the "Issuer ID" +2. The `issuanceValidatingKey`, denoted as `ik`, is the key that is used to validate the issuance transaction. This key is used to validate the issuance of a specific asset type, and is used by all blockchain users (specifically the asset owners and consensus validators) to associate the asset in question with the issuer. Throughout we also call this key the issuer verification key. -The two keys are derived in an analogous manner to the `spendAuthorizingKey` and `spendValidatingKey` keys, as described in ZIP 32 [#zip-0032]_ and in accordance with ZIP 316 [#zip-0316]_. Specifically, +The two keys are derived in an analogous manner to the `spendAuthorizingKey` and `spendValidatingKey` keys, using the same signature scheme, as described in ZIP 32 [#zip-0032]_ and in accordance with ZIP 316 [#zip-0316]_. - The `issuanceAuthorizingKey` is derived directly from the `spendingKey`, `sk`, as a private signature key: @@ -103,7 +99,7 @@ The two keys are derived in an analogous manner to the `spendAuthorizingKey` and :math:`\mathsf{ik := SpendAuthSig^{Orchard}.DerivePublic(isk)}` -This allows the issuer to use the same wallet it usually uses to transfer assets, while keeping a disconnect from the other keys. It provides further anonymity and the ability to delegate issuance of an asset (or in the future, generate a multi-signature protocol) while keeping the rest of the keys in the wallet safe. +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 [#zip-0032]_, and can further be in 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. Asset Identifier ---------------- @@ -133,7 +129,7 @@ An issuance action, `IssueAction`, is the instance of issuing a specific custom - `notes`: an array containing the unencrypted output notes of the recipients of the asset, of type `Note` - `finalize`: a boolean that defines whether the issuance of that specific custom asset is finalized or not -For assets whose `finalize = 1`, no further tokens can be issued, so as seen below, the validators will reject the transaction. For assets whose `finalize = 0`, new issuance actions can be issued in future transactions. These must use the same asset description, `asset_desc`, and can either maintain `finalize = 0` or change it to `1`, denoting the last transaction containing issuance of such custom asset. +Once `finiteSupply` is set to 1, it cannot be unset. For assets whose `finalize = 1`, no further tokens can be issued, so as seen below, the validators will reject the transaction. For assets whose `finalize = 0`, new issuance actions can be issued in future transactions. These must use the same asset description, `asset_desc`, and can either maintain `finalize = 0` or change it to `1`, denoting the last transaction containing issuance of such custom asset. ================= ================== ========================== ======================================================================== Size Name Data Type Description @@ -146,8 +142,6 @@ noteSize * nNotes vNotes Note[nNotes] A sequence of no 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. - - Issuance Bundle --------------- @@ -159,16 +153,14 @@ An issuance bundle, `IssueBundle`, is the aggregate of all the issuance-related The issuance bundle is then added within the transaction format as a new bundle. This structure will be added to the v6 transaction format. -======= ================== ========================== ======================================================================== +======= ================== ========================== ========================================================================= Bytes Name Data Type Description -======= ================== ========================== ======================================================================== +======= ================== ========================== ========================================================================= Varies nIssueActions compactSize The number of issuance actions in the bundle Varies vIssueActions IssueAction[nIssueActions] A sequence of issuance actions descriptions -32 ik byte[32] The public key of the issuer +32 ik byte[32] The public verification key of the issuer, used to validate the signature 64 authorization byte[64] The signature of the transaction SIGHASH, signed by the issuer -======= ================== ========================== ======================================================================== - - +======= ================== ========================== ========================================================================= Issuance Protocol ----------------- @@ -177,15 +169,18 @@ The issuer program performs the following operations For all actions `IssueAction`: - encode `asset_desc` as 512 byte-string - compute `AssetId` as :math:`GroupHash^{\mathbb{P}}(ik || asset_desc)` +- set the `finalize` boolean as desired (if more more issuance actions are to be created for this asset identifier, set `finalize = 0`, otherwise set `finalize = 1`) - For each recipient `i`: - - generate a ZSA output note as :math:`\mathsf{ note_i =(d_i, pkd_i, v_i, \rho_i, \psi_i, \mathsf{AssetId}, rcm_i)}` - + - generate a ZSA output note as :math:`\mathsf{ note_i =(d_i, {pk_d}_i, v_i, \rho_i, \psi_i, \mathsf{AssetId}, rcm_i)}` +- encode the `IssueAction` into the vector `vIssueActions` of the bundle -NOTE that the commitment is not included in the IssuanceAction, but a computation done by the validators of the chain. +For the `IssueBundle`: +- encode the `vIssueActions` vector +- encode the `ik` as 32 byte-string +- sign the `SIGHASH` of the transaction with the `issuanceAuthorizingKey`, `isk`, using the RedPallas signature scheme. The signature is then added to the issuance bundle. -:math:`cm = \mathsf{NoteCommit^{ZSA}_{rcm}}(\mathsf{repr\mathbb{_P}(g_d)}, \mathsf{repr\mathbb{_P}(pk_d)}, v, \rho, \psi,\mathsf{type}_\mathbb{P})` -- Sign the issuance note with the `issuanceValidatingKey` as the signing key, using RedPallas as its signature scheme, on the `SIGHASH` of the transaction. Note that the `SIGHASH` will change as we include a new bundle in the Zcash transaction to enable this issuance mechanism on chain. +NOTE that the commitment is not included in the `IssuanceAction` itsefl. As explained below, it is later computed by the validators and added to the `NoteCommitmentTree`. Concrete applications --------------------- @@ -194,30 +189,30 @@ Concrete applications Issuers can wrap assets defined in other chains and issue them at once in a single transaction. The specifics of the bridge are not implemented in the protocol, but there are several ways we conceive issuers can build these bridges (at least centralized bridges): - First, the issuance and burn mechanism can be used in conjunction to determine the -Once `finiteSupply` is set, it cannot be unset. This allows expanding the functionality of the issuance mechanism: - - Provides `AssetId` revocation in case of compromise (issue last issuance with a single output note of `value = 0`) - - Supports NFT issuance (where the first issuance with value of 1 is also the last) - -Here are some examples for how to use this protocol within an application: -- By setting the `finiteIssuance = 1` from the first issuance instance of that asset type, 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. -- When the `finiteIssuance = 0`, the issuer can keep creating tokens of that type (in a transparent manner). The boolean value can be changed with any new issuance transaction, and could be set to `1` either when the issuer keys have been compromised, and hence stopping all issuances of that asset type (the boolean cannot be reversed), or whenever the issuer decides that the max supply has been reached. -- Note that this mechanism can be used with the burning process to control and affect the supply of any custom asset. +**Asset Features** +- By using the `finalize` boolean and the burning mechanism defined in [#zip-0226]_, issuers can control the supply production of any asset associated to their issuer keys. For example, + - by setting `finalize = 1` from the first issuance action for that asset type, 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 `AssetId`, while at the same time setting `finalize = 1`, or by + - issuing a transaction with a single note in the issuance action pertaining to that `AssetId`, where the note will contain a `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). +- Furthermore, NFT issuance is enabled by issuing in a single bundle several issuance actions, where each `AssetId` corresponds to `value = 1` at the fundamental unit level. Issuers and users should make sure that `finalize = 1` for each of the actions in this scenario. Consensus Rule Changes ---------------------- For the IssueBundle, -- Verify the signature on SIGHASH is valid, based on `VerifySig.IssueAuthorization(ik, SIGHASH)` +- Verify the RedPallas-based issuance authorization signature on `SIGHASH`, `authorization` is valid, based on `authorization.VerifySig(ik, SIGHASH)` For each `IssueAction` in `IssueBundle`: -- check that `asset_desc` is properly constructed: byte size > 0 exceeding 512 bytes) -- retrieve asset_id from first note and check that `asset_id` is properly constructed from asset_desc and ik, by checking the GroupHash of (ik, asset_desc) -- check that the `asset_id` does not exist in the `previously_finalized` set -- check that every note in the`IssueAction`` contains the same asset_id, and also that every note is properly constructed as `note = (recipient, value, note(asset, rho, rseed)` -- If all of the above checks pass, do the following +- check that `asset_desc` is a string with `0 < byte size <= 512` +- retrieve `AssetId` from the first note in the sequence and check that `AssetId = GroupHash^{\mathbb{P}}(ik || asset_desc)` is properly derived +- check that the `AssetId` does not exist in the `previously_finalized` set in the global state +- check that every note in the `IssueAction` contains the same `AssetId` and also that every note is of type `Note` and is properly constructed as :math:`note = (\mathsf{g_d, pk_d, v, \rho, \psi, AssetId})` -- For each note, compute the `noteCommitment` and -- add `noteCommitment` to the Merkle tree of note commitments. +If all of the above checks pass, do the following: +- For each note, compute the note commitment as :math:`cm = \mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, AssetId)}` and +- add `cm` to the Merkle tree of note commitments, `NoteCommitmentTree` +- If `finalize = 1`, add `AssetId` to the `previously_finalized` set in the global state Rationale ========= @@ -229,32 +224,37 @@ The following is a list of rationale for different decisions made in the proposa - other metadata for native assets - bridging information for wrapped assets (chain of origin, issuer name, etc) - information to be committed by the issuer, though not enforceable by the protocol -- Security and Privacy Considerations =================================== - we did not include a design that would allow for replacing the key of a specific asset. In case of compromise, the following actions are recommended: - - If an asset ID is compromised, the finalization boolean should be put to `0` and a new asset ID generated. - - If an issuer verification key is compromised, the finalization boolean should be put to `0` and the issuer should change to a new spending key altogether (for the purpose of issuance). +**Issuer Key or AssetId Compromise** + +The design of this protocol does not allow for a rotation of the `issuerValidatingKey`, that would allow for replacing the key of a specific asset (see Future Work). In case of compromise, the following actions are recommended: +- If an asset ID is compromised (and not the issuer verification key), the `finalize` boolean for that asset should be set to `0` and a new `AssetId` generated instead. +- If an issuer verification key is compromised, the `finalize` boolean for all the assets issued with that key should be set to `0` and the issuer should change to a new spending key altogether (for the purpose of issuance), and issue new assets, each with a new `AssetId`. -We note that for bridging purposes, the secure method of doing it is to burn an asset with the burning mechanism. 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. +**Briding Assets** +For bridging purposes, the secure method of off-boarding assets is to burn an asset with the burning mechanism in ZIP 226 [#zip-0226]_. 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 ==================== -When issuing assets on the Zcash block chain for a specific application in mind (i.e.: NFTs), the issuer should consider the full ZSA protocol to ensure - -Implementing Zcash clients --------------------------- +Implementing Zcash Nodes +------------------------ -It is recommended that Zcash clients keep a mapping `issuanceSupplyInfos` from `asset_id` to `issuanceSupplyInfo := (totalSupply, finalize)` in order to properly keep track of the total supply for different asset types. This will be implemented in the Zcashd client. +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 `issuanceSupplyInfoMap` from `AssetId` to `issuanceSupplyInfoMap := (totalSupply, finalize)` in order to properly keep track of the total supply for different asset types. 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 317b [#zip-0317b]_. +Future Work +----------- + +In future versions of this ZIP, the protocol may also include a "key rotation" mechanism. This would allow an issuer to change the underlying `ik` of a given asset, in case the original one was compromised, without having to chance the asset identifier altogether. + Test Vectors ============ From f4fbd5723c3214e80be168faebb8b63a23d5e859 Mon Sep 17 00:00:00 2001 From: daniben31 Date: Wed, 30 Nov 2022 16:50:22 +0100 Subject: [PATCH 014/101] issuance zip includes txid generation --- zip-0227.rst | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/zip-0227.rst b/zip-0227.rst index 489968002..e4625cff6 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -225,6 +225,81 @@ The following is a list of rationale for different decisions made in the proposa - bridging information for wrapped assets (chain of origin, issuer name, etc) - information to be committed by the issuer, though not enforceable by the protocol +TxId Digest +=========== +A new issuance transaction digest algorithm is defined that constructs the identifier for an issuance transaction. Each branch of the tree of hashes will correspond to a specific subset of transaction data. The overall structure of the hash is as follows; each name referenced here will be described in detail below:: + + issuance_txid_digest + ├── issueActions + └── issuerVerificationKey + +In the specification below, nodes of the tree are presented in depth-first order. + +issuance_txid_digest +-------------------- +A BLAKE2b-256 hash of the following values :: + + T.1: issueActions (field encoding bytes) + T.2: issuerVerificationKey (field encoding bytes) + +The personalization field of this hash is set to:: + + "ZTxIdOrcZSAIssue" + +T.1 issueActions +```````````````` +A byte encoding of Issue Action information for all Issue Actions belonging to the transaction. For each Action, the following elements are included in the hash:: + + T.1a: notes (field encoding bytes) + T.1b: assetDescription (field encoding bytes) + T.1c: isFinalized (1 byte) + + +T.1a: notes +''''''''''' +A byte encoding of Note information for all Notes belonging to the Action. For each Note, the following elements are included in the hash:: + + T.1a.1: recipient (field encoding bytes) + T.1a.2: value (field encoding bytes) + T.1a.3: asset (field encoding bytes) + T.1a.4: rho (field encoding bytes) + T.1a.5: rseed (field encoding bytes) + + +T.1a.1: recipient +................. +Raw Address encoded as specified in [Zcash Protocol Spec § 5.6.4.2: Orchard Raw Payment Addresses]. + +T.1a.2: value +............. +Note value encoded as little-endian 8-byte representation of u64 raw value. + +T.1a.3: asset +............. +Asset ID encoded as 32-byte representation of Pallas point. + +T.1a.4: rho +........... +Nullifier encoded as 32-byte representation of Pallas point. + +T.1a.5: rseed +............. +The ZIP 212 32-byte seed randomness for a note. + +T.1b: assetDescription +'''''''''''''''''''''' +UTF-8 encoding of the asset description string. + +T.1c: isFinalized +''''''''''''''''' +1-byte representation of a boolean flag that is set to 'true' if the asset type was finalized in this action and 'false' otherwise. 'True' is represented as 1, 'false' as 0. + + +T.2 issuerVerificationKey +````````````````````````` +A byte encoding of issuer verification key for the bundle as defined in [Zcash Protocol Spec § 4.2.3: Orchard Key Components]. + + Security and Privacy Considerations =================================== From e6c6ad2e058bbcd3f558335b69bce02702d0328b Mon Sep 17 00:00:00 2001 From: daniben31 Date: Wed, 30 Nov 2022 17:33:58 +0100 Subject: [PATCH 015/101] final version of transfer zip --- zip-0226.rst | 111 +++++++++++++++++++++++++-------------------------- 1 file changed, 55 insertions(+), 56 deletions(-) diff --git a/zip-0226.rst b/zip-0226.rst index bc4ab4d1c..1f40daa5e 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -26,14 +26,14 @@ The term "Orchard" in this document is to be interpreted as described in ZIP 224 We define the following additional terms: -- Asset: A type of note that can be transferred on the Zcash block chain. +- Asset: A type of note that can be transferred on the Zcash block chain, identified by the `AssetId` parameter. - ZEC is the default (and currently the only defined) asset for the Zcash mainnet. - Zcash Shielded Asset: an Asset with issuance defined on the Zcash block chain, and, for now, belonging to the Orchard shielded pool. - Wrapped Asset: a Zcash Shielded Asset with native issuance defined outside the Zcash block chain. - Native Asset: a Zcash Shielded Asset created uniquely within the Zcash block chain. -- Split Note: a Zcash Shielded Asset spend note that is used within an Action to ensure the output note of that Action is of a specific type. The Split Note is not spent in the transaction. +- Split Note: a Zcash Shielded Asset spend note that is used within an Action to ensure the output note of that Action is of a specific `AssetId`. The Split Note is not spent in the transaction. - Split Action: a Zcash Shielded Asset Action that contains a Split Note. Abstract @@ -50,15 +50,15 @@ The current Orchard protocol does not support custom assets. Enabling multi-asse Overview ======== -In order to be able to represent different Asset types in Orchard, we need to define a new data field that uniquely represents the *type* of the Asset in question, which we call :math:`\mathsf{type}`. +In order to be able to represent different Asset identifiers in Orchard, we need to define a new data field that uniquely represents the `AssetId` of the Asset in question, which we call :math:`\mathsf{AssetId}`. -The type will be used to enforce the balance of an Action Description [#protocol-actions]_ is preserved across Assets (see the Orchard Binding Signature [#protocol-binding]_), and by extension the balance of an Orchard transaction. That is, the sum of all the :math:`\mathsf{value^{net}}` from each Action Description, computed as :math:`\mathsf{value^{old}-value^{new}}`, must be balanced **only with respect to the same Asset type**. This is specially important since we will allow different Action Descriptions to transfer notes of different Asset types, where the overall balance is checked without revealing which Assets (or how many different types) are being transferred. +The asset identifier will be used to enforce the balance of an Action Description [#protocol-actions]_ is preserved across Assets (see the Orchard Binding Signature [#protocol-binding]_), and by extension the balance of an Orchard transaction. That is, the sum of all the :math:`\mathsf{value^{net}}` from each Action Description, computed as :math:`\mathsf{value^{old}-value^{new}}`, must be balanced **only with respect to the same Asset identifier**. This is specially important since we will allow different Action Descriptions to transfer notes of different Asset identifiers, where the overall balance is checked without revealing which Assets (or how many different identifiers) are being transferred. As was initially proposed by Jack Grigg and Daira Hopwood [#initial-zsa-issue]_, we propose to make this happen by changing the value base point, :math:`\mathcal{V}^{\mathsf{Orchard}}`, in the Homomorphic Pedersen Commitment that generates the value commitment, :math:`\mathsf{cv^{net}}`, of the *net value* in an Orchard Action. -Because in a single transaction all value commitments are balanced, there must be as many different value base points as there are asset types in the transaction. We propose to make the :math:`\mathsf{type}` identifier an auxiliary input to the proof, represented already as a point in the Pallas curve. The circuit then should check that the same :math:`\mathsf{type}` is used in the old note commitment, in the new note commitment **and** in the value commitment as the base point of the value. This ensures that (1) the input and output notes are of the same type, and (2) that only actions with the same asset type identifier will balance out in the binding and balance signature. +Because in a single transaction all value commitments are balanced, there must be as many different value base points as there are asset identifiers in the transaction. We propose to make the :math:`\mathsf{AssetId}` identifier an auxiliary input to the proof, represented already as a point in the Pallas curve. The circuit then should check that the same :math:`\mathsf{AssetId}` is used in the old note commitment, in the new note commitment **and** in the value commitment as the base point of the value. This ensures that (1) the input and output notes are of the same `AssetId`, and (2) that only actions with the same asset identifier will balance out in the binding and balance signature. -In order to ensure the security of the transfers, and as we will explain below, we are replacing input dummy notes for custom assets, as we need to enforce that the type of the output note of that split action is the output of a PRF. +In order to ensure the security of the transfers, and as we will explain below, we are replacing input dummy notes for custom assets, as we need to enforce that the `AssetId` of the output note of that split action is the output of a PRF. Finally, in this ZIP we also describe the *burn* mechanism, which is a direct extension of the transfer mechanism. The burn process uses a similar mechanism than what is used in Orchard to unshield ZEC, by using the :math:`\mathsf{valueBalance}` of the asset in question. Burning assets is useful for many purposes, including bridging of wrapped assets and removing supply of native assets. @@ -67,33 +67,32 @@ Specification Most of the protocol is kept the same as the Orchard protocol released with NU5, except for the following. -Asset Types ------------ +Asset Identifiers +----------------- -In the OSA protocol, we include a new variable, the asset type identifier, :math:`\mathsf{type}`, which is generated as a 32-byte string during issuance (as described in the Issuance ZIP [#zip-0227]_). The :math:`\mathsf{type}` will then be publicly hashed into the corresponding group, in this case the Pallas curve, by using the :math:`\mathsf{GroupHash}` -function. In fact, every ZSA note will contain the group element representation of the asset type identifier. This will enable a much more elegant and simple version of the circuit, as we will see. +For every new asset, there must be a new and unique identifier of the asset. Every asset is defined by the asset description, `asset_desc`, which is a global byte string (valid across all -future- Zcash protocols). From this asset descritpion, the specific asset identifier, :math:`\mathsf{AssetId}`, is derived with a `GroupHash` and used within the output notes, as defined by the specific protocol (e.g.: for now Orchard-style, using Pallas curve). -We denote the string as :math:`\mathsf{type}` and we denote the equivalent group representation as :math:`\mathsf{type}_{\mathbb{G}}` when mapped into a specific group, :math:`\mathbb{G}`. Note that the type of the ZEC asset will be kept as the original value base-point, :math:`\mathcal{V}^\mathsf{Orchard}` +This :math:`\mathsf{AssetId}` will be the base point of the value commitment for the specific custom asset. Note that the :math:`\mathsf{AssetId}` of the ZEC asset will be kept as the original value base-point, :math:`\mathcal{V}^\mathsf{Orchard}`. -In future network and protocol upgrades, the same asset type string can be carried on, with potentially a mapping into a different curve or group. In that case, the turnstile should know how to transform the asset type from one group to another one. +In future network and protocol upgrades, the same asset description string can be carried on, with potentially a mapping into a different curve or group. In that case, the turnstile should know how to transform the asset identifier, :math:`\mathsf{AssetId}`, from one group to another one. Note Structure & Commitment --------------------------- -First, we need to adapt the components that define the assets, i.e.: *notes*. A ZSA note differs from an Orchard note by including the type of asset, :math:`\mathsf{type}_\mathbb{P}`. So an ZSA note looks like: +First, we need to adapt the components that define the assets, i.e.: *notes*. A ZSA note differs from an Orchard note by including the identifier of asset, :math:`\mathsf{AssetId}`. So an ZSA note looks like: -:math:`(\mathsf{g_d, pk_d, v, \rho, \psi, type}_{\mathbb{P}})` +:math:`(\mathsf{g_d, pk_d, v, \rho, \psi, AssetId})` -Where :math:`\mathsf{type}_\mathbb{P}` is the unique random group element that identifies each asset in the Pallas curve [#protocol-pallasandvesta]_, [#pasta-evidence]_ of the Orchard protocol. +Where :math:`\mathsf{AssetId}` is the unique random group element that identifies each asset in the Pallas curve [#protocol-pallasandvesta]_, [#pasta-evidence]_ of the Orchard protocol. -In this case, the note commitment, :math:`\mathsf{NoteCommit^{ZSA}_{rcm}}`, will differ from :math:`\mathsf{NoteCommit^{Orchard}_{rcm}}` in that for non-ZEC assets, the type will be added as an input to the commitment computation. As we will see, the recursive structure of the Sinsemilla-base commitment [#protocol-concretesinsemillacommit]_ allows us to add the type as a final recursive step, and hence keep a single instance of the hash function in the circuit for the note commitment verification. +In this case, the instance of the note commitment scheme, :math:`\mathsf{NoteCommit^{OrchardZSA}_{rcm}}`, will differ from :math:`\mathsf{NoteCommit^{Orchard}_{rcm}}` in that for non-ZEC assets, the asset identifier will be added as an input to the commitment computation. As we will see, the recursive structure of the Sinsemilla-base commitment [#protocol-concretesinsemillacommit]_ allows us to add the asset identifier as a final recursive step, and hence keep a single instance of the Sinsemilla hash function in the circuit for the note commitment verification. Since the commitment output is still indistinguishable with the original Orchard ZEC note commitments, by definition of the Sinsemilla hash, ZSA note commitments will be added to the same Merkle Commitment Tree. In essence, we have -:math:`\mathsf{NoteCommit^{ZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, type_\mathbb{P})} \in \{\mathsf{cm},\bot\}` +:math:`\mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, AssetId)} \in \{\mathsf{cm},\bot\}` The nullifier is generated in the same manner as in the Orchard protocol. @@ -115,79 +114,79 @@ In the case of the Orchard protocol, we see that the base points :math:`\mathcal :math:`\mathcal{R}^{\mathsf{Orchard}}` are fixed for every value commitment, as the values represent the amount of ZEC being transferred. -In the case of the ZSA protocol, the value of different asset types in a given transaction will be committed using a **different value base point**. This enables the final balance of the transaction to be securely computed, such that each asset type is balanced independently, as the assets are not meant to be fungible. The value commitment then becomes +In the case of the ZSA protocol, the value of different asset identifiers in a given transaction will be committed using a **different value base point**. This enables the final balance of the transaction to be securely computed, such that each asset identifier is balanced independently, as the assets are not meant to be fungible. The value commitment then becomes -:math:`\mathsf{cv^{net}:=ValueCommit^{ZSA}_{rcv}(v^{net}_{type},\mathcal{V}^{\mathsf{ZSA}}_{\mathsf{type}})}:= \mathsf{[v^{net}_{type}]}\mathcal{V}^{\mathsf{ZSA}}_{\mathsf{type}}+[\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}}` +:math:`\mathsf{cv^{net}:=ValueCommit^{OrchardZSA}_{rcv}(v^{net}_{AssetId},\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}})}:= \mathsf{[v^{net}_{AssetId}]}\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}}+[\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}}` -where :math:`\mathsf{v^{net}_{type}} = \mathsf{v^{old}_{type} - v^{new}_{type}}` such that :math:`\mathsf{v^*_{type}}` is the value of the note of type :math:`\mathsf{type}`, and +where :math:`\mathsf{v^{net}_{AssetId}} = \mathsf{v^{old}_{AssetId} - v^{new}_{AssetId}}` such that :math:`\mathsf{v^*_{AssetId}}` is the value of the note of identifier :math:`\mathsf{AssetId}`, and .. _valuebase: -:math:`\mathcal{V}^{\mathsf{ZSA}}_{\mathsf{type}}:=\mathsf{type_\mathbb{P}}= \mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv", "a" || type\_params)}` +:math:`\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}}:=\mathsf{AssetId}= \mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv", "a" || ik || \mathsf{asset_desc})}` :math:`\mathcal{R}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv", "r")}` -Where :math:`\mathcal{V}^{\mathsf{ZSA}}_{\mathsf{ZEC}} =\mathcal{V}^{\mathsf{Orchard}}`. +Where :math:`\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{ZEC}} =\mathcal{V}^{\mathsf{Orchard}}`. Value Balance Verification -------------------------- -In order to verify the balance of the different assets, verifier performs exactly the same the process as for the Orchard protocol [#protocol-binding]_. The main reason is because no custom assets can be unshielded, so all custom assets are contained within the shielded ZSA pool. This means that the net balance of the input and output values is zero, with only one type of value balance published, that of ZEC, :math:`\mathsf{v^{balanceOrchard}}`, so no net amount of any type will be revealed, and neither the nnumber of types in the transaction. The only exception to this is in the case that an asset is *burnt*, as we will see below in burnmechanism_. +In order to verify the balance of the different assets, verifier performs exactly the same the process as for the Orchard protocol [#protocol-binding]_. The main reason is because no custom assets can be unshielded, so all custom assets are contained within the shielded ZSA pool. This means that the net balance of the input and output values is zero, with only one asset identifier of value balance published, that of ZEC, :math:`\mathsf{v^{balanceOrchard}}`, so no net amount of any asset identifier will be revealed, and neither the nnumber of asset identifiers in the transaction. The only exception to this is in the case that an asset is *burnt*, as we will see below in burnmechanism_. For a total of :math:`n` actions in a transfer, the prover can still sign the `SIGHASH` of the transaction using the binding signature key :math:`\mathsf{bsk} = \sum_{\mathsf{ \forall i\in \{1,...,n\}}} \mathsf{rcv_{i}}` -Then we have that the verifier computes +Then the verifier MUST compute :math:`\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} = \sum \mathsf{rcv_{i}^{net}}\mathcal{R}^{\mathsf{Orchard}}` And uses it to verify the binding signature, as described in §4.14 of the Zcash Specification [#protocol-binding]_, by verifying the `bindingSignature` on the `SIGHASH` message. -As in the Orchard protocol, the binding signature verification key, :math:`\mathsf{bvk}`, will only be valid (and hence verify the signature correctly, as long as all the value commitments (and corresponding value balances) are equal to zero. In contrast, in this protocol, the value commitments only cancel out **per asset type**, as the Pedersen commitments add up homomorphically only with respect to the same value base point. +As in the Orchard protocol, the binding signature verification key, :math:`\mathsf{bvk}`, will only be valid (and hence verify the signature correctly), as long as the committed values sum to zero. In contrast, in this protocol, the committed values only sum to zero **per Asset identifier**, as the Pedersen commitments add up homomorphically only with respect to the same value base point. Split Notes ----------- -One of the key functionalities in a UTXO based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This is called a 1-to-many (Orchard) transaction. In order to cope with this today, the input note of the second (third and more) Action (which we call split notes and split Actions respectively) is a *dummy spend note* [#protocol-dummynotes]_. Basically, the input note is “faked” inside of the proof in order to hide which action contains the *real* spend note. +One of the key functionalities in a UTXO-based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This requires a 1-to-many (Orchard) transaction. However, because each Action represents and input and an output, the resulting transaction must have multiple inputs. In order to cope with this today, the Actions that have not been assigned input notes are instead given *dummy spend notes* [#protocol-dummynotes]_, which we call split Actions and split notes respectively. Basically, the input note is “faked” inside of the proof in order to hide which Action contains the *real* spend note. -This, however, brings some issues when it comes to adding multiple asset types, as the output note of the split Actions *cannot* be of *any* asset type, it must be enforced to be an actual output of a GroupHash computation (in fact we want it to be of the same type as the original input note, but the binding signature takes care that the proper balancing is performed). If not, then the prover could essentially input a multiple (or linear combination of) an existing type, with the goal to attack the network by overflowing the ZEC value balance and hence counterfeiting ZEC funds. +This, however, brings some issues when it comes to adding multiple asset identifiers, as the output note of the split Actions *cannot* be of *any* asset identifier, it must be enforced to be an actual output of a GroupHash computation (in fact we want it to be of the same identifier as the original input note, but the binding signature takes care that the proper balancing is performed). If not, then the prover could essentially input a multiple (or linear combination of) an existing identifier, with the goal to attack the network by overflowing the ZEC value balance and hence counterfeiting ZEC funds. In order to prevent this, we make some modifications to the circuit. Specifically we remove the dummy note functionality for custom assets and we enforce that *every* input note to an ZSA Action must be proven to exist in the set of note commitments in the Merkle Tree. We then enforce this real note to be “unspendable” in the sense that its value -will be zeroed in split Actions and the nullifier will be randomized, making the note not spendable in the specific Action. Then, the proof itself ensures that the output note is of the same type as the input note. In the circuit, the split note functionality will be activated by a boolean private input to the proof. +will be zeroed in split Actions and the nullifier will be randomized, making the note not spendable in the specific Action. Then, the proof itself ensures that the output note is of the same identifier as the input note. In the circuit, the split note functionality will be activated by a boolean private input to the proof. -Note that this is enough to create a chain of induction that ensures that all output notes of a transfer are actual outputs of a GroupHash, preventing any malleability attacks, as they originate in the Issuance protocol, which is publicly verified. Furthermore, we do not care about whether the note is owned by the sender, or whether it was nullified before. Wallets and other clients have a choice to make to ensure the asset type is the preserved for the output note of a split Action, for the value balance verification: +Note that this is enough to create a chain of induction that ensures that all output notes of a transfer are actual outputs of a GroupHash, preventing any malleability attacks, as they originate in the Issuance protocol, which is publicly verified. Furthermore, we do not care about whether the note is owned by the sender, or whether it was nullified before. Wallets and other clients have a choice to make to ensure the asset identifier is the preserved for the output note of a split Action, for the value balance verification: 1. The split input note could be the same note as the original (non-split) Action, -2. The split input note could be a different unspent note of the same type (note that the note will not actually be spent) -3. The split input note could be an already spent note of the same type (note that by zeroing the value in the circuit, we prevent double spending) +2. The split input note could be a different unspent note of the same `AssetId` (note that the note will not actually be spent) +3. The split input note could be an already spent note of the same `AssetId` (note that by zeroing the value in the circuit, we prevent double spending) The specific circuit changes are presented below. Circuit Statement ================= -The advantage of the design described above, with respect to the circuit statement, is that every *ZSA Action statement* is kept closely similar to the Orchard Action statement [#protocol-actionstatement]_, except for a few additions that ensure the security of the asset type system. +The advantage of the design described above, with respect to the circuit statement, is that every *ZSA Action statement* is kept closely similar to the Orchard Action statement [#protocol-actionstatement]_, except for a few additions that ensure the security of the asset identifier system. -**Asset Type Equality:** the following constraints must be added to ensure that the input and output note are of the -same type: +**Asset Identifier Equality:** the following constraints must be added to ensure that the input and output note are of the +same `AssetId`: -- The asset type, :math:`\mathsf{type_\mathbb{P}}`, for the note is witnessed once, as an auxiliary input. -- The witnessed asset type, :math:`\mathsf{type_\mathbb{P}}`, is added to the old note commitment input. -- The witnessed asset type, :math:`\mathsf{type_\mathbb{P}}`, is added to the new note commitment input. +- The asset identifier, :math:`\mathsf{AssetId}`, for the note is witnessed once, as an auxiliary input. +- The witnessed asset identifier, :math:`\mathsf{AssetId}`, is added to the old note commitment input. +- The witnessed asset identifier, :math:`\mathsf{AssetId}`, is added to the new note commitment input. -**Correct Value Commitment Type:** the following constraints must be added to ensure that the value commitment is computed using the witnessed type, as represented in the notes +**Correct Value Commitment:** the following constraints must be added to ensure that the value commitment is computed using the witnessed identifier, as represented in the notes - The fixed-base multiplication constraints between the value and the value base point of the value commitment,:math:`\mathsf{cv}`, is replaced with a variable-base multiplication between the two -- The witness to the value base-point, as defined in valuebase_ is the auxiliary input :math:`\mathsf{type}_\mathbb{P}`. +- The witness to the value base-point, as defined in valuebase_ is the auxiliary input :math:`\mathsf{AssetId}`. -**Enforce Secure Type for Split Actions:** the following constraints must be added to prevent senders from changing the asset type for the output note in the Split Actions: +**Enforce Secure Identifier for Split Actions:** the following constraints must be added to prevent senders from changing the asset identifier for the output note in the Split Actions: - The Value Commitment Integrity should be changed - - Replace the input note value by a generic value, `v'`, as :math:`\mathsf{cv^net} = \mathsf{ValueCommit_rcv^OrchardType(v’ - v^new, type}_\mathbb{P})` + - Replace the input note value by a generic value, `v'`, as :math:`\mathsf{cv^net} = \mathsf{ValueCommit_rcv^OrchardZSA(v’ - v^new, AssetId)}` - Add a boolean “split” variable as an auxiliary witness. This variable is to be activated `split = 1` if the Action in question is a split and `split = 0` if the Action is actually spending an input note: - If `split = 1` then set `v' = 0` otherwise `v'=v^old` from the auxiliary input - The Merkle Path Validity should check the existance of the note commitment as usual (and not like with dummy notes): @@ -200,12 +199,12 @@ same type: The old note commitment is computed using a “rolling-aggregate” sinsemilla commitment. This means that the commitment is computed by adding new chunks or windows to the accumulated value. This method will be used in order to maintain a single commitment instance for the old note commitment, that will be used both for Orchard ZEC notes and for ZSA notes. The original Orchard ZEC notes will be conserved and not actually be converted into ZSA notes, as we will always need to compute them. -- The input note in the old note commitment integrity must either include a type (ZSA note) or not (ZEC-Orchard note) - - If the type auxiliary input is set :math:`\mathsf{type}_\mathbb{P}` = :math:`\mathcal{V}^\mathsf{Orchard}` - - NoteCommitment has a “compatibility” path that computes the note commitment as in plain Orchard (i.e.: without including the type) +- The input note in the old note commitment integrity must either include an asset identifier (ZSA note) or not (ZEC-Orchard note) + - If the asset identifier auxiliary input is set :math:`\mathsf{AssetId}` = :math:`\mathcal{V}^\mathsf{Orchard}` + - NoteCommitment has a “compatibility” path that computes the note commitment as in plain Orchard (i.e.: without including the identifier) - This path also uses the original domain separator for ZEC note commitment - Else, - - The NoteCommitment adds the type, :math:`\mathsf{type}_\mathbb{P}`, as a final “chunk” of the Sinsemilla commitment + - The NoteCommitment adds the identfier, :math:`\mathsf{AssetId}`, as a final “chunk” of the Sinsemilla commitment - The NoteCommitment uses a different domain separator for ZSA note commitment @@ -213,7 +212,7 @@ Backward Compatibility ---------------------- In order to have a "clean" backwards compatibility with the ZEC notes, we have designed the circuit to support both ZEC and ZSA notes. As we specify above, there are three main reasons we can do this: -- The input notes with a type denote the ZSA custom assets, generating a note commitment that includes the type; whereas the notes without a type, denote the ZEC notes, and generate a note commitment that does not include the type, in order to maintain the referencability to the Merkle tree +- The input notes with an asset identifer denote the ZSA custom assets, generating a note commitment that includes the asset identifer; whereas the notes without an identifier, denote the ZEC notes, and generate a note commitment that does not include the asset identifier, in order to maintain the referencability to the Merkle tree - The value commitment is abstracted to allow for the value base-point as a variable private input to the proof - The ZEC-based actions will still include dummy input notes, whereas the ZSA-based actions will include split input notes @@ -223,22 +222,22 @@ Burn Mechanism ============== The burn mechanism may be needed for off-boarding the wrapped assets from the chain, or enabling advanced tokenomics on native tokens. It is part of the Issuance/Burn protocol, but given that it can be seen as an extension of the Transfer protocol, we add it here for readability. -In essence, the burn mechanism is a transparent / revealing extension to the transfer protocol that enables a specific amount of any asset type to be sent into “oblivion”. Our burn mechanism does NOT send assets to a non-spendable address, it simply reduces the total number of assets in circulation at the consensus level. It is enforced at the consensus level, by using an extension of the value balance mechanism used for ZEC assets. +In essence, the burn mechanism is a transparent / revealing extension to the transfer protocol that enables a specific amount of any asset identifier to be sent into “oblivion”. Our burn mechanism does NOT send assets to a non-spendable address, it simply reduces the total number of assets in circulation at the consensus level. It is enforced at the consensus level, by using an extension of the value balance mechanism used for ZEC assets. -First, contrary to the strict transfer transaction, we allow the sender to include a :math:`\mathsf{valueBalvalueBalance_{type}}` variable for every asset type that is being burnt. As we will show in the transaction structure, this is separate from the regular :math:`\mathsf{valueBalance^Orchard}` that is the default transparent value for the ZEC asset. +First, contrary to the strict transfer transaction, we allow the sender to include a :math:`\mathsf{valueBalvalueBalance_{AssetId}}` variable for every asset identifier that is being burnt. As we will show in the transaction structure, this is separate from the regular :math:`\mathsf{valueBalance^Orchard}` that is the default transparent value for the ZEC asset. -For every custom asset that is burnt, we add to the `assetBurn` vector the tuple :math:`(\mathsf{valueBalance_{type}, type}_\mathbb{P})` such that the validator of the transaction can compute the value commitment with the corresponding value base point of that asset. This ensures that the values are all balanced out with respect to the asset types in the transfer. +For every custom asset that is burnt, we add to the `assetBurn` vector the tuple :math:`(\mathsf{valueBalance_{AssetId}, AssetId})` such that the validator of the transaction can compute the value commitment with the corresponding value base point of that asset. This ensures that the values are all balanced out with respect to the asset identifiers in the transfer. -:math:`\mathsf{assetBurn = [(v^{type}, type_\mathbb{P})}| \forall \mathsf{type}_\mathbb{P} \textit{ s.t.}\mathsf{v^{type}\neq 0}]` +:math:`\mathsf{assetBurn = [(v^{AssetId}, AssetId)}| \forall \mathsf{AssetId} \textit{ s.t.}\mathsf{v^{AssetId}\neq 0}]` -The value balances for each asset type in `assetBurn` represents the amount of that asset type that is being burnt. In the case of ZEC, the value balance represents either the transaction fee, or the amount of ZEC changing anonymity pools (to Sapling or Transparent). +The value balances for each asset identifier in `assetBurn` represents the amount of that asset identifier that is being burnt. In the case of ZEC, the value balance represents either the transaction fee, or the amount of ZEC changing anonymity pools (to Sapling or Transparent). -Finally, the validator needs to verify the Balance and Binding Signature by adding the value balances for all assets, as committed using their respective types as the value base point of the Pedersen Commitment. This is done as follows +Finally, the validator needs to verify the Balance and Binding Signature by adding the value balances for all assets, as committed using their respective `AssetId` as the value base point of the Pedersen Commitment. This is done as follows -:math:`\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} - \sum_{\forall \mathsf{type}\textit{ s.t. }\mathsf{v^{type}\neq 0}} \mathsf{Value Commit_0^{ZSA}(v^{type}type_\mathbb{P}) } = \sum \mathsf{rcv_{i,j}^{net}}\mathcal{R}^{\mathsf{Orchard}}` +:math:`\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} - \sum_{\forall \mathsf{AssetId}\textit{ s.t. }\mathsf{v^{AssetId}\neq 0}} \mathsf{ValueCommit_0^{ORchardZSA}(v^{AssetId}, AssetId) } = \sum \mathsf{rcv_{i,j}^{net}}\mathcal{R}^{\mathsf{Orchard}}` -In the case that the balance of all the action values related to a specific asset will be zero, there will be no value added to the vector. This way, the number of assets, nor their types will be revealed, except in the case that an asset is burnt. +In the case that the balance of all the action values related to a specific asset will be zero, there will be no value added to the vector. This way, the number of assets, nor their identifiers will be revealed, except in the case that an asset is burnt. **Note:** Even if this mechanism allows having transparent ↔  shielded asset transfers in theory, the transparent protocol will not be changed with this ZIP to adapt to a multiple asset structure. This means that unless future consensus rules changes do allow it, the unshielding is not not be possible for custom assets. @@ -271,8 +270,8 @@ Security and Privacy -------------------- - Even if the Orchard protocol and ZSA protocol do not share the same anonymity pool (nodes can keep track of the notes that where published with different transaction structures), the migration from one to the other is done automatically and seamlessly. The Orchard bundle will be replaced by the ZSA bundle and all ZEC notes will be fully spendable with the new transaction structure. -- When including new assets we would like to maintain the amount and types of assets private, which is achieved with the design -- We prevent the "roadblock" attack on the asset type by ensuring the output notes receive a type of an asset that exists on the global state +- When including new assets we would like to maintain the amount and identifiers of assets private, which is achieved with the design +- We prevent the "roadblock" attack on the asset identifer by ensuring the output notes receive an asset identifier that exists on the global state Deplopyment ----------- From 38d3168fd73964cade00ed50cae33e6c2dcc791b Mon Sep 17 00:00:00 2001 From: daniben31 Date: Wed, 30 Nov 2022 17:44:41 +0100 Subject: [PATCH 016/101] fixes indentation issues --- zip-0226.html | 186 ++++++++++++++++++++++++-------------------------- zip-0226.rst | 6 +- zip-0227.html | 88 ++++++++++++++++++++++-- zip-0227.rst | 16 ++--- 4 files changed, 182 insertions(+), 114 deletions(-) diff --git a/zip-0226.html b/zip-0226.html index c1e4c008a..f7b8dd8a4 100644 --- a/zip-0226.html +++ b/zip-0226.html @@ -26,7 +26,7 @@

The term "Orchard" in this document is to be interpreted as described in ZIP 224 3.

We define the following additional terms:

    -
  • Asset: A type of note that can be transferred on the Zcash block chain. +
  • Asset: A type of note that can be transferred on the Zcash block chain, identified by the AssetId parameter.
    • ZEC is the default (and currently the only defined) asset for the Zcash mainnet.
    @@ -34,7 +34,7 @@
  • Zcash Shielded Asset: an Asset with issuance defined on the Zcash block chain, and, for now, belonging to the Orchard shielded pool.
  • Wrapped Asset: a Zcash Shielded Asset with native issuance defined outside the Zcash block chain.
  • Native Asset: a Zcash Shielded Asset created uniquely within the Zcash block chain.
  • -
  • Split Note: a Zcash Shielded Asset spend note that is used within an Action to ensure the output note of that Action is of a specific type. The Split Note is not spent in the transaction.
  • +
  • Split Note: a Zcash Shielded Asset spend note that is used within an Action to ensure the output note of that Action is of a specific AssetId. The Split Note is not spent in the transaction.
  • Split Action: a Zcash Shielded Asset Action that contains a Split Note.
@@ -45,73 +45,69 @@

The current Orchard protocol does not support custom assets. Enabling multi-asset support on the Zcash chain will open the door for a host of applications and enhance the ecosystem with application developers and asset custody institutions for issuance and bridging purposes.

Overview

-

In order to be able to represent different Asset types in Orchard, we need to define a new data field that uniquely represents the type of the Asset in question, which we call - \(\mathsf{type}\) +

In order to be able to represent different Asset identifiers in Orchard, we need to define a new data field that uniquely represents the AssetId of the Asset in question, which we call + \(\mathsf{AssetId}\) .

-

The type will be used to enforce the balance of an Action Description 6 is preserved across Assets (see the Orchard Binding Signature 7), and by extension the balance of an Orchard transaction. That is, the sum of all the +

The asset identifier will be used to enforce the balance of an Action Description 6 is preserved across Assets (see the Orchard Binding Signature 7), and by extension the balance of an Orchard transaction. That is, the sum of all the \(\mathsf{value^{net}}\) from each Action Description, computed as \(\mathsf{value^{old}-value^{new}}\) - , must be balanced only with respect to the same Asset type. This is specially important since we will allow different Action Descriptions to transfer notes of different Asset types, where the overall balance is checked without revealing which Assets (or how many different types) are being transferred.

-

As was initially proposed by Jack Grigg and Daira Hopwood 16, we propose to make this happen by changing the value base point, + , must be balanced only with respect to the same Asset identifier. This is specially important since we will allow different Action Descriptions to transfer notes of different Asset identifiers, where the overall balance is checked without revealing which Assets (or how many different identifiers) are being transferred.

+

As was initially proposed by Jack Grigg and Daira Hopwood 15, we propose to make this happen by changing the value base point, \(\mathcal{V}^{\mathsf{Orchard}}\) , in the Homomorphic Pedersen Commitment that generates the value commitment, \(\mathsf{cv^{net}}\) , of the net value in an Orchard Action.

-

Because in a single transaction all value commitments are balanced, there must be as many different value base points as there are asset types in the transaction. We propose to make the - \(\mathsf{type}\) +

Because in a single transaction all value commitments are balanced, there must be as many different value base points as there are asset identifiers in the transaction. We propose to make the + \(\mathsf{AssetId}\) identifier an auxiliary input to the proof, represented already as a point in the Pallas curve. The circuit then should check that the same - \(\mathsf{type}\) - is used in the old note commitment, in the new note commitment and in the value commitment as the base point of the value. This ensures that (1) the input and output notes are of the same type, and (2) that only actions with the same asset type identifier will balance out in the binding and balance signature.

-

In order to ensure the security of the transfers, and as we will explain below, we are replacing input dummy notes for custom assets, as we need to enforce that the type of the output note of that split action is the output of a PRF.

+ \(\mathsf{AssetId}\) + is used in the old note commitment, in the new note commitment and in the value commitment as the base point of the value. This ensures that (1) the input and output notes are of the same AssetId, and (2) that only actions with the same asset identifier will balance out in the binding and balance signature.

+

In order to ensure the security of the transfers, and as we will explain below, we are replacing input dummy notes for custom assets, as we need to enforce that the AssetId of the output note of that split action is the output of a PRF.

Finally, in this ZIP we also describe the burn mechanism, which is a direct extension of the transfer mechanism. The burn process uses a similar mechanism than what is used in Orchard to unshield ZEC, by using the \(\mathsf{valueBalance}\) of the asset in question. Burning assets is useful for many purposes, including bridging of wrapped assets and removing supply of native assets.

Specification

Most of the protocol is kept the same as the Orchard protocol released with NU5, except for the following.

-

Asset Types

-

In the OSA protocol, we include a new variable, the asset type identifier, - \(\mathsf{type}\) - , which is generated as a 32-byte string during issuance (as described in the Issuance ZIP 5). The - \(\mathsf{type}\) - will then be publicly hashed into the corresponding group, in this case the Pallas curve, by using the - \(\mathsf{GroupHash}\) - function. In fact, every ZSA note will contain the group element representation of the asset type identifier. This will enable a much more elegant and simple version of the circuit, as we will see.

-

We denote the string as - \(\mathsf{type}\) - and we denote the equivalent group representation as - \(\mathsf{type}_{\mathbb{G}}\) - when mapped into a specific group, - \(\mathbb{G}\) - . Note that the type of the ZEC asset will be kept as the original value base-point, +

Asset Identifiers

+

For every new asset, there must be a new and unique identifier of the asset. Every asset is defined by the asset description, asset_desc, which is a global byte string (valid across all -future- Zcash protocols). From this asset descritpion, the specific asset identifier, + \(\mathsf{AssetId}\) + , is derived with a GroupHash and used within the output notes, as defined by the specific protocol (e.g.: for now Orchard-style, using Pallas curve).

+

This + \(\mathsf{AssetId}\) + will be the base point of the value commitment for the specific custom asset. Note that the + \(\mathsf{AssetId}\) + of the ZEC asset will be kept as the original value base-point, \(\mathcal{V}^\mathsf{Orchard}\) -

-

In future network and protocol upgrades, the same asset type string can be carried on, with potentially a mapping into a different curve or group. In that case, the turnstile should know how to transform the asset type from one group to another one.

+ .

+

In future network and protocol upgrades, the same asset description string can be carried on, with potentially a mapping into a different curve or group. In that case, the turnstile should know how to transform the asset identifier, + \(\mathsf{AssetId}\) + , from one group to another one.

Note Structure & Commitment

-

First, we need to adapt the components that define the assets, i.e.: notes. A ZSA note differs from an Orchard note by including the type of asset, - \(\mathsf{type}_\mathbb{P}\) +

First, we need to adapt the components that define the assets, i.e.: notes. A ZSA note differs from an Orchard note by including the identifier of asset, + \(\mathsf{AssetId}\) . So an ZSA note looks like:

- \((\mathsf{g_d, pk_d, v, \rho, \psi, type}_{\mathbb{P}})\) + \((\mathsf{g_d, pk_d, v, \rho, \psi, AssetId})\)

Where - \(\mathsf{type}_\mathbb{P}\) - is the unique random group element that identifies each asset in the Pallas curve 8, 9 of the Orchard protocol.

-

In this case, the note commitment, - \(\mathsf{NoteCommit^{ZSA}_{rcm}}\) + \(\mathsf{AssetId}\) + is the unique random group element that identifies each asset in the Pallas curve 8, 9 of the Orchard protocol.

+

In this case, the instance of the note commitment scheme, + \(\mathsf{NoteCommit^{OrchardZSA}_{rcm}}\) , will differ from \(\mathsf{NoteCommit^{Orchard}_{rcm}}\) - in that for non-ZEC assets, the type will be added as an input to the commitment computation. As we will see, the recursive structure of the Sinsemilla-base commitment 10 allows us to add the type as a final recursive step, and hence keep a single instance of the hash function in the circuit for the note commitment verification.

+ in that for non-ZEC assets, the asset identifier will be added as an input to the commitment computation. As we will see, the recursive structure of the Sinsemilla-base commitment 10 allows us to add the asset identifier as a final recursive step, and hence keep a single instance of the Sinsemilla hash function in the circuit for the note commitment verification.

Since the commitment output is still indistinguishable with the original Orchard ZEC note commitments, by definition of the Sinsemilla hash, ZSA note commitments will be added to the same Merkle Commitment Tree. In essence, we have

- \(\mathsf{NoteCommit^{ZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, type_\mathbb{P})} \in \{\mathsf{cm},\bot\}\) + \(\mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, AssetId)} \in \{\mathsf{cm},\bot\}\)

The nullifier is generated in the same manner as in the Orchard protocol.

Value Commitment

-

The Orchard Protocol uses a Sinsemilla-based Homomorphic Pedersen Commitment 11 which is instantiated as

+

The Orchard Protocol uses a Sinsemilla-based Homomorphic Pedersen Commitment 11 which is instantiated as

\(\mathsf{cv^{net}:=ValueCommit^{Orchard}_{rcv}(v^{net})}:= \mathsf{[v^{net}]}\mathcal{V}^{\mathsf{Orchard}}+[\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}}\)

@@ -129,81 +125,81 @@ and \(\mathcal{R}^{\mathsf{Orchard}}\) are fixed for every value commitment, as the values represent the amount of ZEC being transferred.

-

In the case of the ZSA protocol, the value of different asset types in a given transaction will be committed using a different value base point. This enables the final balance of the transaction to be securely computed, such that each asset type is balanced independently, as the assets are not meant to be fungible. The value commitment then becomes

+

In the case of the ZSA protocol, the value of different asset identifiers in a given transaction will be committed using a different value base point. This enables the final balance of the transaction to be securely computed, such that each asset identifier is balanced independently, as the assets are not meant to be fungible. The value commitment then becomes

- \(\mathsf{cv^{net}:=ValueCommit^{ZSA}_{rcv}(v^{net}_{type},\mathcal{V}^{\mathsf{ZSA}}_{\mathsf{type}})}:= \mathsf{[v^{net}_{type}]}\mathcal{V}^{\mathsf{ZSA}}_{\mathsf{type}}+[\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}}\) + \(\mathsf{cv^{net}:=ValueCommit^{OrchardZSA}_{rcv}(v^{net}_{AssetId},\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}})}:= \mathsf{[v^{net}_{AssetId}]}\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}}+[\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}}\)

where - \(\mathsf{v^{net}_{type}} = \mathsf{v^{old}_{type} - v^{new}_{type}}\) + \(\mathsf{v^{net}_{AssetId}} = \mathsf{v^{old}_{AssetId} - v^{new}_{AssetId}}\) such that - \(\mathsf{v^*_{type}}\) - is the value of the note of type - \(\mathsf{type}\) + \(\mathsf{v^*_{AssetId}}\) + is the value of the note of identifier + \(\mathsf{AssetId}\) , and

- \(\mathcal{V}^{\mathsf{ZSA}}_{\mathsf{type}}:=\mathsf{type_\mathbb{P}}= \mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv", "a" || type\_params)}\) + \(\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}}:=\mathsf{AssetId}= \mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv", "a" || ik || \mathsf{asset_desc})}\)

\(\mathcal{R}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv", "r")}\)

Where - \(\mathcal{V}^{\mathsf{ZSA}}_{\mathsf{ZEC}} =\mathcal{V}^{\mathsf{Orchard}}\) + \(\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{ZEC}} =\mathcal{V}^{\mathsf{Orchard}}\) .

Value Balance Verification

-

In order to verify the balance of the different assets, verifier performs exactly the same the process as for the Orchard protocol 7. The main reason is because no custom assets can be unshielded, so all custom assets are contained within the shielded ZSA pool. This means that the net balance of the input and output values is zero, with only one type of value balance published, that of ZEC, +

In order to verify the balance of the different assets, verifier performs exactly the same the process as for the Orchard protocol 7. The main reason is because no custom assets can be unshielded, so all custom assets are contained within the shielded ZSA pool. This means that the net balance of the input and output values is zero, with only one asset identifier of value balance published, that of ZEC, \(\mathsf{v^{balanceOrchard}}\) - , so no net amount of any type will be revealed, and neither the nnumber of types in the transaction. The only exception to this is in the case that an asset is burnt, as we will see below in burnmechanism.

+ , so no net amount of any asset identifier will be revealed, and neither the nnumber of asset identifiers in the transaction. The only exception to this is in the case that an asset is burnt, as we will see below in burnmechanism.

For a total of \(n\) actions in a transfer, the prover can still sign the SIGHASH of the transaction using the binding signature key

\(\mathsf{bsk} = \sum_{\mathsf{ \forall i\in \{1,...,n\}}} \mathsf{rcv_{i}}\)

-

Then we have that the verifier computes

+

Then the verifier MUST compute

\(\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} = \sum \mathsf{rcv_{i}^{net}}\mathcal{R}^{\mathsf{Orchard}}\)

-

And uses it to verify the binding signature, as described in §4.14 of the Zcash Specification 7, by verifying the bindingSignature on the SIGHASH message.

+

And uses it to verify the binding signature, as described in §4.14 of the Zcash Specification 7, by verifying the bindingSignature on the SIGHASH message.

As in the Orchard protocol, the binding signature verification key, \(\mathsf{bvk}\) - , will only be valid (and hence verify the signature correctly, as long as all the value commitments (and corresponding value balances) are equal to zero. In contrast, in this protocol, the value commitments only cancel out per asset type, as the Pedersen commitments add up homomorphically only with respect to the same value base point.

+ , will only be valid (and hence verify the signature correctly), as long as the committed values sum to zero. In contrast, in this protocol, the committed values only sum to zero per Asset identifier, as the Pedersen commitments add up homomorphically only with respect to the same value base point.

Split Notes

-

One of the key functionalities in a UTXO based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This is called a 1-to-many (Orchard) transaction. In order to cope with this today, the input note of the second (third and more) Action (which we call split notes and split Actions respectively) is a dummy spend note 12. Basically, the input note is “faked” inside of the proof in order to hide which action contains the real spend note.

-

This, however, brings some issues when it comes to adding multiple asset types, as the output note of the split Actions cannot be of any asset type, it must be enforced to be an actual output of a GroupHash computation (in fact we want it to be of the same type as the original input note, but the binding signature takes care that the proper balancing is performed). If not, then the prover could essentially input a multiple (or linear combination of) an existing type, with the goal to attack the network by overflowing the ZEC value balance and hence counterfeiting ZEC funds.

-

In order to prevent this, we make some modifications to the circuit. Specifically we remove the dummy note functionality for custom assets and we enforce that every input note to an ZSA Action must be proven to exist in the set of note commitments in the Merkle Tree. We then enforce this real note to be “unspendable” in the sense that its value will be zeroed in split Actions and the nullifier will be randomized, making the note not spendable in the specific Action. Then, the proof itself ensures that the output note is of the same type as the input note. In the circuit, the split note functionality will be activated by a boolean private input to the proof.

-

Note that this is enough to create a chain of induction that ensures that all output notes of a transfer are actual outputs of a GroupHash, preventing any malleability attacks, as they originate in the Issuance protocol, which is publicly verified. Furthermore, we do not care about whether the note is owned by the sender, or whether it was nullified before. Wallets and other clients have a choice to make to ensure the asset type is the preserved for the output note of a split Action, for the value balance verification:

+

One of the key functionalities in a UTXO-based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This requires a 1-to-many (Orchard) transaction. However, because each Action represents and input and an output, the resulting transaction must have multiple inputs. In order to cope with this today, the Actions that have not been assigned input notes are instead given dummy spend notes 12, which we call split Actions and split notes respectively. Basically, the input note is “faked” inside of the proof in order to hide which Action contains the real spend note.

+

This, however, brings some issues when it comes to adding multiple asset identifiers, as the output note of the split Actions cannot be of any asset identifier, it must be enforced to be an actual output of a GroupHash computation (in fact we want it to be of the same identifier as the original input note, but the binding signature takes care that the proper balancing is performed). If not, then the prover could essentially input a multiple (or linear combination of) an existing identifier, with the goal to attack the network by overflowing the ZEC value balance and hence counterfeiting ZEC funds.

+

In order to prevent this, we make some modifications to the circuit. Specifically we remove the dummy note functionality for custom assets and we enforce that every input note to an ZSA Action must be proven to exist in the set of note commitments in the Merkle Tree. We then enforce this real note to be “unspendable” in the sense that its value will be zeroed in split Actions and the nullifier will be randomized, making the note not spendable in the specific Action. Then, the proof itself ensures that the output note is of the same identifier as the input note. In the circuit, the split note functionality will be activated by a boolean private input to the proof.

+

Note that this is enough to create a chain of induction that ensures that all output notes of a transfer are actual outputs of a GroupHash, preventing any malleability attacks, as they originate in the Issuance protocol, which is publicly verified. Furthermore, we do not care about whether the note is owned by the sender, or whether it was nullified before. Wallets and other clients have a choice to make to ensure the asset identifier is the preserved for the output note of a split Action, for the value balance verification:

  1. The split input note could be the same note as the original (non-split) Action,
  2. -
  3. The split input note could be a different unspent note of the same type (note that the note will not actually be spent)
  4. -
  5. The split input note could be an already spent note of the same type (note that by zeroing the value in the circuit, we prevent double spending)
  6. +
  7. The split input note could be a different unspent note of the same AssetId (note that the note will not actually be spent)
  8. +
  9. The split input note could be an already spent note of the same AssetId (note that by zeroing the value in the circuit, we prevent double spending)

The specific circuit changes are presented below.

Circuit Statement

-

The advantage of the design described above, with respect to the circuit statement, is that every ZSA Action statement is kept closely similar to the Orchard Action statement 13, except for a few additions that ensure the security of the asset type system.

-

Asset Type Equality: the following constraints must be added to ensure that the input and output note are of the same type:

+

The advantage of the design described above, with respect to the circuit statement, is that every ZSA Action statement is kept closely similar to the Orchard Action statement 13, except for a few additions that ensure the security of the asset identifier system.

+

Asset Identifier Equality: the following constraints must be added to ensure that the input and output note are of the same AssetId:

    -
  • The asset type, - \(\mathsf{type_\mathbb{P}}\) +
  • The asset identifier, + \(\mathsf{AssetId}\) , for the note is witnessed once, as an auxiliary input.
  • -
  • The witnessed asset type, - \(\mathsf{type_\mathbb{P}}\) +
  • The witnessed asset identifier, + \(\mathsf{AssetId}\) , is added to the old note commitment input.
  • -
  • The witnessed asset type, - \(\mathsf{type_\mathbb{P}}\) +
  • The witnessed asset identifier, + \(\mathsf{AssetId}\) , is added to the new note commitment input.
-

Correct Value Commitment Type: the following constraints must be added to ensure that the value commitment is computed using the witnessed type, as represented in the notes

+

Correct Value Commitment: the following constraints must be added to ensure that the value commitment is computed using the witnessed identifier, as represented in the notes

  • The fixed-base multiplication constraints between the value and the value base point of the value commitment,:math:mathsf{cv}, is replaced with a variable-base multiplication between the two
  • The witness to the value base-point, as defined in valuebase is the auxiliary input - \(\mathsf{type}_\mathbb{P}\) + \(\mathsf{AssetId}\) .
-

Enforce Secure Type for Split Actions: the following constraints must be added to prevent senders from changing the asset type for the output note in the Split Actions:

+

Enforce Secure Identifier for Split Actions: the following constraints must be added to prevent senders from changing the asset identifier for the output note in the Split Actions:

  • @@ -211,7 +207,7 @@
    • Replace the input note value by a generic value, v', as - \(\mathsf{cv^net} = \mathsf{ValueCommit_rcv^OrchardType(v’ - v^new, type}_\mathbb{P})\) + \(\mathsf{cv^net} = \mathsf{ValueCommit_rcv^OrchardZSA(v’ - v^new, AssetId)}\)
    @@ -270,19 +266,19 @@
    • -
      The input note in the old note commitment integrity must either include a type (ZSA note) or not (ZEC-Orchard note)
      +
      The input note in the old note commitment integrity must either include an asset identifier (ZSA note) or not (ZEC-Orchard note)
      • -
        If the type auxiliary input is set - \(\mathsf{type}_\mathbb{P}\) +
        If the asset identifier auxiliary input is set + \(\mathsf{AssetId}\) = \(\mathcal{V}^\mathsf{Orchard}\)
          -
        • NoteCommitment has a “compatibility” path that computes the note commitment as in plain Orchard (i.e.: without including the type)
        • +
        • NoteCommitment has a “compatibility” path that computes the note commitment as in plain Orchard (i.e.: without including the identifier)
        • This path also uses the original domain separator for ZEC note commitment
        @@ -293,8 +289,8 @@
        Else,
          -
        • The NoteCommitment adds the type, - \(\mathsf{type}_\mathbb{P}\) +
        • The NoteCommitment adds the identfier, + \(\mathsf{AssetId}\) , as a final “chunk” of the Sinsemilla commitment
        • The NoteCommitment uses a different domain separator for ZSA note commitment
        @@ -307,34 +303,34 @@

      Backward Compatibility

      -

      In order to have a "clean" backwards compatibility with the ZEC notes, we have designed the circuit to support both ZEC and ZSA notes. As we specify above, there are three main reasons we can do this: - The input notes with a type denote the ZSA custom assets, generating a note commitment that includes the type; whereas the notes without a type, denote the ZEC notes, and generate a note commitment that does not include the type, in order to maintain the referencability to the Merkle tree - The value commitment is abstracted to allow for the value base-point as a variable private input to the proof - The ZEC-based actions will still include dummy input notes, whereas the ZSA-based actions will include split input notes

      +

      In order to have a "clean" backwards compatibility with the ZEC notes, we have designed the circuit to support both ZEC and ZSA notes. As we specify above, there are three main reasons we can do this: - The input notes with an asset identifer denote the ZSA custom assets, generating a note commitment that includes the asset identifer; whereas the notes without an identifier, denote the ZEC notes, and generate a note commitment that does not include the asset identifier, in order to maintain the referencability to the Merkle tree - The value commitment is abstracted to allow for the value base-point as a variable private input to the proof - The ZEC-based actions will still include dummy input notes, whereas the ZSA-based actions will include split input notes

Burn Mechanism

The burn mechanism may be needed for off-boarding the wrapped assets from the chain, or enabling advanced tokenomics on native tokens. It is part of the Issuance/Burn protocol, but given that it can be seen as an extension of the Transfer protocol, we add it here for readability.

-

In essence, the burn mechanism is a transparent / revealing extension to the transfer protocol that enables a specific amount of any asset type to be sent into “oblivion”. Our burn mechanism does NOT send assets to a non-spendable address, it simply reduces the total number of assets in circulation at the consensus level. It is enforced at the consensus level, by using an extension of the value balance mechanism used for ZEC assets.

+

In essence, the burn mechanism is a transparent / revealing extension to the transfer protocol that enables a specific amount of any asset identifier to be sent into “oblivion”. Our burn mechanism does NOT send assets to a non-spendable address, it simply reduces the total number of assets in circulation at the consensus level. It is enforced at the consensus level, by using an extension of the value balance mechanism used for ZEC assets.

First, contrary to the strict transfer transaction, we allow the sender to include a - \(\mathsf{valueBalvalueBalance_{type}}\) - variable for every asset type that is being burnt. As we will show in the transaction structure, this is separate from the regular + \(\mathsf{valueBalvalueBalance_{AssetId}}\) + variable for every asset identifier that is being burnt. As we will show in the transaction structure, this is separate from the regular \(\mathsf{valueBalance^Orchard}\) that is the default transparent value for the ZEC asset.

For every custom asset that is burnt, we add to the assetBurn vector the tuple - \((\mathsf{valueBalance_{type}, type}_\mathbb{P})\) - such that the validator of the transaction can compute the value commitment with the corresponding value base point of that asset. This ensures that the values are all balanced out with respect to the asset types in the transfer.

+ \((\mathsf{valueBalance_{AssetId}, AssetId})\) + such that the validator of the transaction can compute the value commitment with the corresponding value base point of that asset. This ensures that the values are all balanced out with respect to the asset identifiers in the transfer.

- \(\mathsf{assetBurn = [(v^{type}, type_\mathbb{P})}| \forall \mathsf{type}_\mathbb{P} \textit{ s.t.}\mathsf{v^{type}\neq 0}]\) + \(\mathsf{assetBurn = [(v^{AssetId}, AssetId)}| \forall \mathsf{AssetId} \textit{ s.t.}\mathsf{v^{AssetId}\neq 0}]\)

-

The value balances for each asset type in assetBurn represents the amount of that asset type that is being burnt. In the case of ZEC, the value balance represents either the transaction fee, or the amount of ZEC changing anonymity pools (to Sapling or Transparent).

-

Finally, the validator needs to verify the Balance and Binding Signature by adding the value balances for all assets, as committed using their respective types as the value base point of the Pedersen Commitment. This is done as follows

+

The value balances for each asset identifier in assetBurn represents the amount of that asset identifier that is being burnt. In the case of ZEC, the value balance represents either the transaction fee, or the amount of ZEC changing anonymity pools (to Sapling or Transparent).

+

Finally, the validator needs to verify the Balance and Binding Signature by adding the value balances for all assets, as committed using their respective AssetId as the value base point of the Pedersen Commitment. This is done as follows

- \(\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} - \sum_{\forall \mathsf{type}\textit{ s.t. }\mathsf{v^{type}\neq 0}} \mathsf{Value Commit_0^{ZSA}(v^{type}type_\mathbb{P}) } = \sum \mathsf{rcv_{i,j}^{net}}\mathcal{R}^{\mathsf{Orchard}}\) + \(\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} - \sum_{\forall \mathsf{AssetId}\textit{ s.t. }\mathsf{v^{AssetId}\neq 0}} \mathsf{ValueCommit_0^{ORchardZSA}(v^{AssetId}, AssetId) } = \sum \mathsf{rcv_{i,j}^{net}}\mathcal{R}^{\mathsf{Orchard}}\)

-

In the case that the balance of all the action values related to a specific asset will be zero, there will be no value added to the vector. This way, the number of assets, nor their types will be revealed, except in the case that an asset is burnt.

+

In the case that the balance of all the action values related to a specific asset will be zero, there will be no value added to the vector. This way, the number of assets, nor their identifiers will be revealed, except in the case that an asset is burnt.

Note: Even if this mechanism allows having transparent ↔ shielded asset transfers in theory, the transparent protocol will not be changed with this ZIP to adapt to a multiple asset structure. This means that unless future consensus rules changes do allow it, the unshielding is not not be possible for custom assets.

ZSA Transaction Structure

-

Similar to version 5 transaction format, with the following modifications to the Orchard bundle, as defined in 14:

+

Similar to version 5 transaction format, with the following modifications to the Orchard bundle, as defined in 14:

@@ -363,13 +359,13 @@

Other Considerations

Transaction Fees

-

In order to maintain the ZEC economic incentive, the first version of the fees mechanism will be exactly the same as the current Orchard protocol and will always be paid in ZEC denomination. The ECC and GMU team produced a study on fees market on Zcash 15

+

The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317b 16.

Security and Privacy

  • Even if the Orchard protocol and ZSA protocol do not share the same anonymity pool (nodes can keep track of the notes that where published with different transaction structures), the migration from one to the other is done automatically and seamlessly. The Orchard bundle will be replaced by the ZSA bundle and all ZEC notes will be fully spendable with the new transaction structure.
  • -
  • When including new assets we would like to maintain the amount and types of assets private, which is achieved with the design
  • -
  • We prevent the "roadblock" attack on the asset type by ensuring the output notes receive a type of an asset that exists on the global state
  • +
  • When including new assets we would like to maintain the amount and identifiers of assets private, which is achieved with the design
  • +
  • We prevent the "roadblock" attack on the asset identifer by ensuring the output notes receive an asset identifier that exists on the global state

Deplopyment

@@ -500,19 +496,19 @@
- +
- +
15A Study of Decentralized Markets on the Zcash BlockchainUser-Defined Assets and Wrapped Assets
- +
- +
16User-Defined Assets and Wrapped AssetsZIP 317b: ZSA Extension Proportional Fee Mechanism
diff --git a/zip-0226.rst b/zip-0226.rst index 1f40daa5e..26a0a379f 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -262,9 +262,7 @@ Other Considerations Transaction Fees ---------------- -In order to maintain the ZEC economic incentive, the first version of the fees mechanism will be exactly the same as -the current Orchard protocol and will always be paid in ZEC denomination. The ECC and GMU team produced a study on -fees market on Zcash [#fees-study-GMU]_ +The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317b [#zip-0317b]_. Security and Privacy -------------------- @@ -305,5 +303,5 @@ References .. [#protocol-dummynotes] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.8.3: Dummy Notes (Orchard) `_ .. [#protocol-actionstatement] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.17.4: Action Statement (Orchard) `_ .. [#protocol-transactionstructure] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 7.1: Transaction Encoding and Consensus (Transaction Version 5) `_ -.. [#fees-study-GMU] `A Study of Decentralized Markets on the Zcash Blockchain `_ .. [#initial-zsa-issue] `User-Defined Assets and Wrapped Assets `_ +.. [#zip-0317b] `ZIP 317b: ZSA Extension Proportional Fee Mechanism `_ \ No newline at end of file diff --git a/zip-0227.html b/zip-0227.html index 449571265..01f8f6321 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -70,7 +70,7 @@
  • The issuanceAuthorizingKey, denoted as isk, is the key that is used to sign the issuance transaction. This key is used to authorize the issuance of a specific asset type, and is only used by the issuer. Throughout we also call this key the issuer signature key.
  • The issuanceValidatingKey, denoted as ik, is the key that is used to validate the issuance transaction. This key is used to validate the issuance of a specific asset type, and is used by all blockchain users (specifically the asset owners and consensus validators) to associate the asset in question with the issuer. Throughout we also call this key the issuer verification key.
  • -

    The two keys are derived in an analogous manner to the spendAuthorizingKey and spendValidatingKey keys, using the same signature scheme, as described in ZIP 32 7 and in accordance with ZIP 316 8. Specifically,

    +

    The two keys are derived in an analogous manner to the spendAuthorizingKey and spendValidatingKey keys, using the same signature scheme, as described in ZIP 32 7 and in accordance with ZIP 316 8.

    • The issuanceAuthorizingKey is derived directly from the spendingKey, sk, as a private signature key:
    @@ -83,7 +83,7 @@

    \(\mathsf{ik := SpendAuthSig^{Orchard}.DerivePublic(isk)}\)

    -

    This allows the issuer to use the same wallet it usually uses to transfer assets, while keeping a disconnect from the other keys. 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.

    +

    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 7, and can further be in 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.

    Asset Identifier

    For every new asset, there must be a new and unique identifier of the asset. Every asset is defined by the asset description, asset_desc, which is a global byte string (valid across all -future- Zcash protocols). From this asset descritpion, the specific asset identifier, AssetId, is derived with a GroupHash and used within the output notes, as defined by the specific protocol (e.g.: for now Orchard-style, using Pallas curve).

    @@ -214,7 +214,7 @@

    System Message: WARNING/2 (zip-0227.rst line 175)

    Concrete applications

    Bridging Assets Issuers can wrap assets defined in other chains and issue them at once in a single transaction. The specifics of the bridge are not implemented in the protocol, but there are several ways we conceive issuers can build these bridges (at least centralized bridges): - First, the issuance and burn mechanism can be used in conjunction to determine the

    -

    Asset Features - By using the 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,

    +

    Asset Features - By using the 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,

    System Message: ERROR/3 (zip-0227.rst line 194)

    Unexpected indentation.

    @@ -229,7 +229,17 @@

    System Message: WARNING/2 (zip-0227.rst line 195)

    Block quote ends without a blank line; unexpected unindent.

      -
    • 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 AssetId, while at the same time setting finalize = 1, or by - issuing a transaction with a single note in the issuance action pertaining to that AssetId, where the note will contain a 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).
    • +
    • +
      +
      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 AssetId, while at the same time setting finalize = 1, or by
      • +
      • issuing a transaction with a single note in the issuance action pertaining to that AssetId, where the note will contain a 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).
      • +
      +
      +
      +
    • Furthermore, NFT issuance is enabled by issuing in a single bundle several issuance actions, where each AssetId corresponds to value = 1 at the fundamental unit level. Issuers and users should make sure that finalize = 1 for each of the actions in this scenario.
    @@ -247,20 +257,84 @@

    System Message: WARNING/2 (zip-0227.rst line 195)

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

    • The issuance key structure was kept aligned to the original key tree in order to ease issuance integration with wallets and to prevent users from having to manage multiple keys and secrets.
    • -
    • the asset_desc is a general byte string in order to allow for a wide range of information type to be included that may be associated with the assets. Some are: - links for storage such as for NFTs - other metadata for native assets - bridging information for wrapped assets (chain of origin, issuer name, etc) - information to be committed by the issuer, though not enforceable by the protocol
    • +
    • +
      +
      the asset_desc is a general byte string in order to allow for a wide range of information type to be included that may be associated with the assets. Some are:
      +
      +
        +
      • links for storage such as for NFTs
      • +
      • other metadata for native assets
      • +
      • bridging information for wrapped assets (chain of origin, issuer name, etc)
      • +
      • information to be committed by the issuer, though not enforceable by the protocol
      • +
      +
      +
      +
    +

    TxId Digest

    +

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

    +
    issuance_txid_digest
    +├── issueActions
    +└── issuerVerificationKey
    +

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

    +

    issuance_txid_digest

    +

    A BLAKE2b-256 hash of the following values

    +
    T.1: issueActions            (field encoding bytes)
    +T.2: issuerVerificationKey   (field encoding bytes)
    +

    The personalization field of this hash is set to:

    +
    "ZTxIdOrcZSAIssue"
    +

    T.1 issueActions

    +

    A byte encoding of Issue Action information for all Issue Actions belonging to the transaction. For each Action, the following elements are included in the hash:

    +
    T.1a: notes                   (field encoding bytes)
    +T.1b: assetDescription        (field encoding bytes)
    +T.1c: isFinalized             (1 byte)
    +
    T.1a: notes
    +

    A byte encoding of Note information for all Notes belonging to the Action. For each Note, the following elements are included in the hash:

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

    Raw Address encoded as specified in [Zcash Protocol Spec § 5.6.4.2: Orchard Raw Payment Addresses].

    +
    +
    T.1a.2: value
    +

    Note value encoded as little-endian 8-byte representation of u64 raw value.

    +
    +
    T.1a.3: asset
    +

    Asset ID encoded as 32-byte representation of Pallas point.

    +
    +
    T.1a.4: rho
    +

    Nullifier encoded as 32-byte representation of Pallas point.

    +
    +
    T.1a.5: rseed
    +

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

    +
    +
    +
    T.1b: assetDescription
    +

    UTF-8 encoding of the asset description string.

    +
    +
    T.1c: isFinalized
    +

    1-byte representation of a boolean flag that is set to 'true' if the asset type was finalized in this action and 'false' otherwise. 'True' is represented as 1, 'false' as 0.

    +
    +
    +

    T.2 issuerVerificationKey

    +

    A byte encoding of issuer verification key for the bundle as defined in [Zcash Protocol Spec § 4.2.3: Orchard Key Components].

    +
    +
    +

    Security and Privacy Considerations

    Issuer Key or AssetId Compromise

    The design of this protocol does not allow for a rotation of the issuerValidatingKey, that would allow for replacing the key of a specific asset (see Future Work). In case of compromise, the following actions are recommended: - If an asset ID is compromised (and not the issuer verification key), the finalize boolean for that asset should be set to 0 and a new AssetId generated instead. - If an issuer verification key is compromised, the finalize boolean for all the assets issued with that key should be set to 0 and the issuer should change to a new spending key altogether (for the purpose of issuance), and issue new assets, each with a new AssetId.

    -

    Briding Assets 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.

    +

    Briding Assets 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.

    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 issuanceSupplyInfoMap from AssetId to issuanceSupplyInfoMap := (totalSupply, finalize) in order to properly keep track of the total supply for different asset types. 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 317b 6.

    +

    The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317b 6.

    Future Work

    In future versions of this ZIP, the protocol may also include a "key rotation" mechanism. This would allow an issuer to change the underlying ik of a given asset, in case the original one was compromised, without having to chance the asset identifier altogether.

    diff --git a/zip-0227.rst b/zip-0227.rst index e4625cff6..bf12e1401 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -171,7 +171,7 @@ For all actions `IssueAction`: - compute `AssetId` as :math:`GroupHash^{\mathbb{P}}(ik || asset_desc)` - set the `finalize` boolean as desired (if more more issuance actions are to be created for this asset identifier, set `finalize = 0`, otherwise set `finalize = 1`) - For each recipient `i`: - - generate a ZSA output note as :math:`\mathsf{ note_i =(d_i, {pk_d}_i, v_i, \rho_i, \psi_i, \mathsf{AssetId}, rcm_i)}` + - generate a ZSA output note as :math:`\mathsf{ note_i =(d_i, {pk_d}_i, v_i, \rho_i, \psi_i, \mathsf{AssetId}, rcm_i)}` - encode the `IssueAction` into the vector `vIssueActions` of the bundle For the `IssueBundle`: @@ -191,10 +191,10 @@ Issuers can wrap assets defined in other chains and issue them at once in a sing **Asset Features** - By using the `finalize` boolean and the burning mechanism defined in [#zip-0226]_, issuers can control the supply production of any asset associated to their issuer keys. For example, - - by setting `finalize = 1` from the first issuance action for that asset type, 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. + - by setting `finalize = 1` from the first issuance action for that asset type, 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 `AssetId`, while at the same time setting `finalize = 1`, or by - - issuing a transaction with a single note in the issuance action pertaining to that `AssetId`, where the note will contain a `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). + - issuing a last set of tokens of that specific `AssetId`, while at the same time setting `finalize = 1`, or by + - issuing a transaction with a single note in the issuance action pertaining to that `AssetId`, where the note will contain a `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). - Furthermore, NFT issuance is enabled by issuing in a single bundle several issuance actions, where each `AssetId` corresponds to `value = 1` at the fundamental unit level. Issuers and users should make sure that `finalize = 1` for each of the actions in this scenario. Consensus Rule Changes @@ -220,10 +220,10 @@ The following is a list of rationale for different decisions made in the proposa - The issuance key structure was kept aligned to the original key tree in order to ease issuance integration with wallets and to prevent users from having to manage multiple keys and secrets. - the `asset_desc` is a general byte string in order to allow for a wide range of information type to be included that may be associated with the assets. Some are: - - links for storage such as for NFTs - - other metadata for native assets - - bridging information for wrapped assets (chain of origin, issuer name, etc) - - information to be committed by the issuer, though not enforceable by the protocol + - links for storage such as for NFTs + - other metadata for native assets + - bridging information for wrapped assets (chain of origin, issuer name, etc) + - information to be committed by the issuer, though not enforceable by the protocol TxId Digest =========== From a3a58547efbb3d5169052564e9e3310c02cea32f Mon Sep 17 00:00:00 2001 From: "Jonathan S. Rouach" Date: Thu, 8 Dec 2022 12:00:02 +0200 Subject: [PATCH 017/101] Update zip-0227.rst Co-authored-by: Daira Hopwood --- zip-0227.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zip-0227.rst b/zip-0227.rst index bf12e1401..d9b0ec999 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -39,7 +39,7 @@ ZIP 226 [#zip-0226]_ and ZIP 227 [#zip-0227]_ propose in conjunction the Zcash S Motivation ========== -The current Orchard protocol does not support custom assets. Enabling multi-asset support on the Zcash chain will open the door for a host of applications and enhance the ecosystem with application developers and asset custody institutions for issuance and +The Orchard protocol deployed in NU5 does not support custom assets. Enabling multi-asset support on the Zcash chain will open the door for a host of applications and enhance the ecosystem with application developers and asset custody institutions for issuance and bridging purposes. Use Cases From b2dff91f157cb988ccebca7a976f07c4a5b023bb Mon Sep 17 00:00:00 2001 From: "Jonathan S. Rouach" Date: Thu, 8 Dec 2022 12:00:34 +0200 Subject: [PATCH 018/101] Update zip-0227.rst Co-authored-by: Daira Hopwood --- zip-0227.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zip-0227.rst b/zip-0227.rst index d9b0ec999..615da7f23 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -50,7 +50,7 @@ The design presented in this ZIP enables issuance of shielded assets in various - The issuer knows in advance the receivers of the issued asset. - The asset is of non-fungible type, where each asset type can be made part of a single “series” - The supply of the asset is limited or not -- The assets can be wrapped versions of assets in other chains (as long as there is a bridge that supports it) +- The asset can be a wrapped version of an asset issued by another chain (as long as there is a bridge that supports transfer of that asset between chains). See the Concrete Applications section for more details. From 1e60d282cba2d8bd736804adfa7754c88f30c9e3 Mon Sep 17 00:00:00 2001 From: "Jonathan S. Rouach" Date: Thu, 8 Dec 2022 12:01:08 +0200 Subject: [PATCH 019/101] Update zip-0227.rst Co-authored-by: Daira Hopwood --- zip-0227.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zip-0227.rst b/zip-0227.rst index 615da7f23..0f861caa9 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -48,8 +48,8 @@ Use Cases The design presented in this ZIP enables issuance of shielded assets in various modes: - The issuer knows in advance the receivers of the issued asset. -- The asset is of non-fungible type, where each asset type can be made part of a single “series” -- The supply of the asset is limited or not +- The asset can be of non-fungible type, where each asset type can be made part of a single “series”. +- The supply of the asset can be limited in advance or not. - The asset can be a wrapped version of an asset issued by another chain (as long as there is a bridge that supports transfer of that asset between chains). See the Concrete Applications section for more details. From 5a2a7200b702c2940dd30215b7c62366175c917a Mon Sep 17 00:00:00 2001 From: "Jonathan S. Rouach" Date: Thu, 8 Dec 2022 12:16:01 +0200 Subject: [PATCH 020/101] Update zip-0227.rst Co-authored-by: Daira Hopwood --- zip-0227.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zip-0227.rst b/zip-0227.rst index 0f861caa9..47791f4df 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -59,7 +59,7 @@ Requirements - Any user of the Zcash block chain can issue custom assets on chain - The issuance mechanism should enable tracking publicly the supply of the assets on the Zcash block chain -- A user without knowledge of the private key of the issuer of a specific asset should not be able to issue that asset or change the attributes of such asset +- Issuing or changing the attributes of a specific asset should require cryptographic authorization. - The asset identification should be unique and different issuer keys should not be able to generate the same asset identifier From 78f57207a1ea7678fed1c63c88c72f56f179d76f Mon Sep 17 00:00:00 2001 From: "Jonathan S. Rouach" Date: Thu, 8 Dec 2022 12:19:51 +0200 Subject: [PATCH 021/101] Update zip-0227.rst Co-authored-by: Daira Hopwood --- zip-0227.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zip-0227.rst b/zip-0227.rst index 47791f4df..963947756 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -60,7 +60,7 @@ Requirements - Any user of the Zcash block chain can issue custom assets on chain - The issuance mechanism should enable tracking publicly the supply of the assets on the Zcash block chain - Issuing or changing the attributes of a specific asset should require cryptographic authorization. -- The asset identification should be unique and different issuer keys should not be able to generate the same asset identifier +- The asset identification should be unique (among all shielded pools) and different issuer public keys should not be able to generate the same asset identifier. Specification From 75e3ee8279caa9b94374ff8f60550801a90850ee Mon Sep 17 00:00:00 2001 From: "Jonathan S. Rouach" Date: Thu, 8 Dec 2022 12:20:21 +0200 Subject: [PATCH 022/101] Update zip-0227.rst Co-authored-by: Daira Hopwood --- zip-0227.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zip-0227.rst b/zip-0227.rst index 963947756..62c9aecc9 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -66,7 +66,7 @@ Requirements Specification ============= -As explained, the issuance protocol allows for a single issuance action to be sent to many receivers by mean of generating as many output notes as distinct recipients. Furthermore, every bundle can contain many issuance actions. Thus we divide the protocol spec in two sections. +As explained, the issuance protocol allows for a single issuance action to be sent to many receivers, by generating as many output notes as distinct recipients. Furthermore, every bundle can contain many issuance actions. Overview -------- From 9abf395aaaf8376e3ab5f909acbfc88b917e8006 Mon Sep 17 00:00:00 2001 From: "Jonathan S. Rouach" Date: Thu, 8 Dec 2022 12:21:45 +0200 Subject: [PATCH 023/101] Update zip-0227.rst Co-authored-by: Daira Hopwood --- zip-0227.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zip-0227.rst b/zip-0227.rst index 62c9aecc9..cd4618a3a 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -71,7 +71,7 @@ As explained, the issuance protocol allows for a single issuance action to be se Overview -------- -In short, this specification enables only *transparent* issuance, since as a first step, transparency is important to properly test the applications that will be most used in the Zcash ecosystem, while enabling tracking of supply of assets. Any user of the blockchain can issue new asset types, yet only a single issuer (a set of keys) can issue that specific asset type, as the asset identifiers are tied to the issuer keys. +This specification enables only *transparent* issuance, since as a first step, transparency is important to properly test the applications that will be most used in the Zcash ecosystem, while enabling tracking of supply of assets. Any user of the blockchain can issue new asset types, yet only a single issuer (a set of keys) can issue that specific asset type, as the asset identifiers are tied to the issuer keys. The protocol was designed with three main properties in mind: - at the time of issuance, the issuer can already allocate all the tokens to the corresponding owners by creating the corresponding (shielded) output notes to the respective addresses. As is implied, the issuance mechanism is itself transparent, but the allocation is totally private From e9511a0b33f7369fc86f12d37ac758158c2254ba Mon Sep 17 00:00:00 2001 From: "Jonathan S. Rouach" Date: Thu, 8 Dec 2022 12:22:02 +0200 Subject: [PATCH 024/101] Update zip-0227.rst Co-authored-by: Daira Hopwood --- zip-0227.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zip-0227.rst b/zip-0227.rst index cd4618a3a..9e7b4df9f 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -78,7 +78,7 @@ The protocol was designed with three main properties in mind: - in a single issuance bundle, the issuer can publish many issuance actions, or in other words, create multiple custom assets - every issuance action contains the `finiteIssuance` boolean that defines whether that specific custom asset can have further tokens issued or not -The issuance mechanism is broad enough for issuers to either create native 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. In fact, the protocol described below enables, what we hope will be a useful set of, applications. The design decision is not to have a chosen name to describe the custom asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”. +The issuance mechanism is broad enough for issuers to either create native 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. In fact, the protocol described below enables what we hope will be a useful set of applications. The design decision is not to have a chosen name to describe the custom asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”. Issuance Keys ------------- From 8d923484ae155f3773563ced72bb7be880ddf6de Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Thu, 15 Dec 2022 16:25:10 +0530 Subject: [PATCH 025/101] regenerating htmls, updating index.html and README.rst --- README.rst | 172 +++++++++++++++++++++++++------------------------- index.html | 172 +++++++++++++++++++++++++------------------------- zip-0226.html | 30 ++++----- zip-0227.html | 36 +++++------ 4 files changed, 207 insertions(+), 203 deletions(-) diff --git a/README.rst b/README.rst index 4a718bb5b..3d2373fff 100644 --- a/README.rst +++ b/README.rst @@ -75,89 +75,91 @@ Index of ZIPs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ZIP Title Status
    0 ZIP Process Active
    1 Network Upgrade Policy and Scheduling Reserved
    2 Design Considerations for Network Upgrades Reserved
    32 Shielded Hierarchical Deterministic Wallets Final
    76 Transaction Signature Validation before Overwinter Reserved
    143 Transaction Signature Validation for Overwinter Final
    155 addrv2 message Proposed
    173 Bech32 Format Final
    200 Network Upgrade Mechanism Final
    201 Network Peer Management for Overwinter Final
    202 Version 3 Transaction Format for Overwinter Final
    203 Transaction Expiry Final
    204 Zcash P2P Network Protocol Reserved
    205 Deployment of the Sapling Network Upgrade Final
    206 Deployment of the Blossom Network Upgrade Final
    207 Funding Streams Final
    208 Shorter Block Target Spacing Final
    209 Prohibit Negative Shielded Chain Value Pool Balances Final
    210 Sapling Anchor Deduplication within Transactions Withdrawn
    211 Disabling Addition of New Value to the Sprout Chain Value Pool Final
    212 Allow Recipient to Derive Ephemeral Secret from Note Plaintext Final
    213 Shielded Coinbase Final
    214 Consensus rules for a Zcash Development Fund Final
    215 Explicitly Defining and Modifying Ed25519 Validation Rules Final
    216 Require Canonical Jubjub Point Encodings Final
    217 Aggregate Signatures Reserved
    219 Disabling Addition of New Value to the Sapling Chain Value Pool Reserved
    220 Zcash Shielded Assets Withdrawn
    221 FlyClient - Consensus-Layer Changes Final
    222 Transparent Zcash Extensions Draft
    224 Orchard Shielded Protocol Final
    225 Version 5 Transaction Format Final
    226 Zcash Shielded Assets - Transfers and Burns Reserved
    227 Zcash Shielded Assets - Issuance Reserved
    239 Relay of Version 5 Transactions Final
    243 Transaction Signature Validation for Sapling Final
    244 Transaction Identifier Non-Malleability Final
    245 Transaction Identifier Digests & Signature Validation for Transparent Zcash Extensions Draft
    250 Deployment of the Heartwood Network Upgrade Final
    251 Deployment of the Canopy Network Upgrade Final
    252 Deployment of the NU5 Network Upgrade Final
    300 Cross-chain Atomic Transactions Proposed
    301 Zcash Stratum Protocol Final
    302 Standardized Memo Field Format Draft
    303 Sprout Payment Disclosure Reserved
    304 Sapling Address Signatures Draft
    305 Best Practices for Hardware Wallets supporting Sapling Reserved
    306 Security Considerations for Anchor Selection Reserved
    307 Light Client Protocol for Payment Detection Draft
    308 Sprout to Sapling Migration Final
    309 Blind Off-chain Lightweight Transactions (BOLT) Reserved
    310 Security Properties of Sapling Viewing Keys Draft
    311 Sapling Payment Disclosure Reserved
    312 Shielded Multisignatures using FROST Reserved
    313 Reduce Conventional Transaction Fee to 1000 zatoshis Active
    314 Privacy upgrades to the Zcash light client protocol Reserved
    315 Best Practices for Wallet Handling of Multiple Pools Reserved
    316 Unified Addresses and Unified Viewing Keys Final
    317 Proportional Transfer Fee Mechanism Draft
    318 Associated Payload Encryption Reserved
    319 Options for Shielded Pool Retirement Reserved
    321 Payment Request URIs Proposed
    322 Generic Signed Message Format Reserved
    323 Specification of getblocktemplate for Zcash Reserved
    339 Wallet Recovery Words Reserved
    400 Wallet.dat format Draft
    401 Addressing Mempool Denial-of-Service Active
    402 New Wallet Database Format Reserved
    403 Verification Behaviour of zcashd Reserved
    416 Support for Unified Addresses in zcashd Reserved
    1001 Keep the Block Distribution as Initially Defined — 90% to Miners Obsolete
    1002 Opt-in Donation Feature Obsolete
    1003 20% Split Evenly Between the ECC and the Zcash Foundation, and a Voting System Mandate Obsolete
    1004 Miner-Directed Dev Fund Obsolete
    1005 Zcash Community Funding System Obsolete
    1006 Development Fund of 10% to a 2-of-3 Multisig with Community-Involved Third Entity Obsolete
    1007 Enforce Development Fund Commitments with a Legal Charter Obsolete
    1008 Fund ECC for Two More Years Obsolete
    1009 Five-Entity Strategic Council Obsolete
    1010 Compromise Dev Fund Proposal With Diverse Funding Streams Obsolete
    1011 Decentralize the Dev Fee Obsolete
    1012 Dev Fund to ECC + ZF + Major Grants Obsolete
    1013 Keep It Simple, Zcashers: 10% to ECC, 10% to ZF Obsolete
    1014 Establishing a Dev Fund for ECC, ZF, and Major Grants Active
    guide {Something Short and To the Point} Draft
    0 ZIP Process + Active +
    1 Network Upgrade Policy and Scheduling Reserved
    2 Design Considerations for Network Upgrades Reserved
    32 Shielded Hierarchical Deterministic Wallets Final
    76 Transaction Signature Validation before Overwinter Reserved
    143 Transaction Signature Validation for Overwinter Final
    155 addrv2 message Proposed
    173 Bech32 Format Final
    200 Network Upgrade Mechanism Final
    201 Network Peer Management for Overwinter Final
    202 Version 3 Transaction Format for Overwinter Final
    203 Transaction Expiry Final
    204 Zcash P2P Network Protocol Reserved
    205 Deployment of the Sapling Network Upgrade Final
    206 Deployment of the Blossom Network Upgrade Final
    207 Funding Streams Final
    208 Shorter Block Target Spacing Final
    209 Prohibit Negative Shielded Chain Value Pool Balances Final
    210 Sapling Anchor Deduplication within Transactions Withdrawn
    211 Disabling Addition of New Value to the Sprout Chain Value Pool Final
    212 Allow Recipient to Derive Ephemeral Secret from Note Plaintext Final
    213 Shielded Coinbase Final
    214 Consensus rules for a Zcash Development Fund Final
    215 Explicitly Defining and Modifying Ed25519 Validation Rules Final
    216 Require Canonical Jubjub Point Encodings Final
    217 Aggregate Signatures Reserved
    219 Disabling Addition of New Value to the Sapling Chain Value Pool Reserved
    220 Zcash Shielded Assets Withdrawn
    221 FlyClient - Consensus-Layer Changes Final
    222 Transparent Zcash Extensions Draft
    224 Orchard Shielded Protocol Final
    225 Version 5 Transaction Format Final
    226 Transfer and Burn of Zcash Shielded Assets Draft
    227 Issuance of Zcash Shielded Assets Draft
    239 Relay of Version 5 Transactions Final
    243 Transaction Signature Validation for Sapling Final
    244 Transaction Identifier Non-Malleability Final
    245 Transaction Identifier Digests & Signature Validation for Transparent Zcash Extensions Draft
    250 Deployment of the Heartwood Network Upgrade Final
    251 Deployment of the Canopy Network Upgrade Final
    252 Deployment of the NU5 Network Upgrade Final
    300 Cross-chain Atomic Transactions Proposed
    301 Zcash Stratum Protocol Final
    302 Standardized Memo Field Format Draft
    303 Sprout Payment Disclosure Reserved
    304 Sapling Address Signatures Draft
    305 Best Practices for Hardware Wallets supporting Sapling Reserved
    306 Security Considerations for Anchor Selection Reserved
    307 Light Client Protocol for Payment Detection Draft
    308 Sprout to Sapling Migration Final
    309 Blind Off-chain Lightweight Transactions (BOLT) Reserved
    310 Security Properties of Sapling Viewing Keys Draft
    311 Sapling Payment Disclosure Reserved
    312 Shielded Multisignatures using FROST Reserved
    313 Reduce Conventional Transaction Fee to 1000 zatoshis Active
    314 Privacy upgrades to the Zcash light client protocol Reserved
    315 Best Practices for Wallet Handling of Multiple Pools Reserved
    316 Unified Addresses and Unified Viewing Keys Final
    317 Proportional Transfer Fee Mechanism Draft
    318 Associated Payload Encryption Reserved
    319 Options for Shielded Pool Retirement Reserved
    321 Payment Request URIs Proposed
    322 Generic Signed Message Format Reserved
    323 Specification of getblocktemplate for Zcash Reserved
    339 Wallet Recovery Words Reserved
    400 Wallet.dat format Draft
    401 Addressing Mempool Denial-of-Service Active
    402 New Wallet Database Format Reserved
    403 Verification Behaviour of zcashd Reserved
    416 Support for Unified Addresses in zcashd Reserved
    1001 Keep the Block Distribution as Initially Defined — 90% to Miners Obsolete
    1002 Opt-in Donation Feature Obsolete
    1003 20% Split Evenly Between the ECC and the Zcash Foundation, and a Voting System Mandate Obsolete
    1004 Miner-Directed Dev Fund Obsolete
    1005 Zcash Community Funding System Obsolete
    1006 Development Fund of 10% to a 2-of-3 Multisig with Community-Involved Third Entity Obsolete
    1007 Enforce Development Fund Commitments with a Legal Charter Obsolete
    1008 Fund ECC for Two More Years Obsolete
    1009 Five-Entity Strategic Council Obsolete
    1010 Compromise Dev Fund Proposal With Diverse Funding Streams Obsolete
    1011 Decentralize the Dev Fee Obsolete
    1012 Dev Fund to ECC + ZF + Major Grants Obsolete
    1013 Keep It Simple, Zcashers: 10% to ECC, 10% to ZF Obsolete
    1014 Establishing a Dev Fund for ECC, ZF, and Major Grants Active
    guide {Something Short and To the Point} Draft
    diff --git a/index.html b/index.html index a62d3e192..e54761d4f 100644 --- a/index.html +++ b/index.html @@ -49,91 +49,93 @@

    Index of ZIPs

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ZIP Title Status
    0 ZIP Process Active
    1 Network Upgrade Policy and Scheduling Reserved
    2 Design Considerations for Network Upgrades Reserved
    32 Shielded Hierarchical Deterministic Wallets Final
    76 Transaction Signature Validation before Overwinter Reserved
    143 Transaction Signature Validation for Overwinter Final
    155 addrv2 message Proposed
    173 Bech32 Format Final
    200 Network Upgrade Mechanism Final
    201 Network Peer Management for Overwinter Final
    202 Version 3 Transaction Format for Overwinter Final
    203 Transaction Expiry Final
    204 Zcash P2P Network Protocol Reserved
    205 Deployment of the Sapling Network Upgrade Final
    206 Deployment of the Blossom Network Upgrade Final
    207 Funding Streams Final
    208 Shorter Block Target Spacing Final
    209 Prohibit Negative Shielded Chain Value Pool Balances Final
    210 Sapling Anchor Deduplication within Transactions Withdrawn
    211 Disabling Addition of New Value to the Sprout Chain Value Pool Final
    212 Allow Recipient to Derive Ephemeral Secret from Note Plaintext Final
    213 Shielded Coinbase Final
    214 Consensus rules for a Zcash Development Fund Final
    215 Explicitly Defining and Modifying Ed25519 Validation Rules Final
    216 Require Canonical Jubjub Point Encodings Final
    217 Aggregate Signatures Reserved
    219 Disabling Addition of New Value to the Sapling Chain Value Pool Reserved
    220 Zcash Shielded Assets Withdrawn
    221 FlyClient - Consensus-Layer Changes Final
    222 Transparent Zcash Extensions Draft
    224 Orchard Shielded Protocol Final
    225 Version 5 Transaction Format Final
    226 Zcash Shielded Assets - Transfers and Burns Reserved
    227 Zcash Shielded Assets - Issuance Reserved
    239 Relay of Version 5 Transactions Final
    243 Transaction Signature Validation for Sapling Final
    244 Transaction Identifier Non-Malleability Final
    245 Transaction Identifier Digests & Signature Validation for Transparent Zcash Extensions Draft
    250 Deployment of the Heartwood Network Upgrade Final
    251 Deployment of the Canopy Network Upgrade Final
    252 Deployment of the NU5 Network Upgrade Final
    300 Cross-chain Atomic Transactions Proposed
    301 Zcash Stratum Protocol Final
    302 Standardized Memo Field Format Draft
    303 Sprout Payment Disclosure Reserved
    304 Sapling Address Signatures Draft
    305 Best Practices for Hardware Wallets supporting Sapling Reserved
    306 Security Considerations for Anchor Selection Reserved
    307 Light Client Protocol for Payment Detection Draft
    308 Sprout to Sapling Migration Final
    309 Blind Off-chain Lightweight Transactions (BOLT) Reserved
    310 Security Properties of Sapling Viewing Keys Draft
    311 Sapling Payment Disclosure Reserved
    312 Shielded Multisignatures using FROST Reserved
    313 Reduce Conventional Transaction Fee to 1000 zatoshis Active
    314 Privacy upgrades to the Zcash light client protocol Reserved
    315 Best Practices for Wallet Handling of Multiple Pools Reserved
    316 Unified Addresses and Unified Viewing Keys Final
    317 Proportional Transfer Fee Mechanism Draft
    318 Associated Payload Encryption Reserved
    319 Options for Shielded Pool Retirement Reserved
    321 Payment Request URIs Proposed
    322 Generic Signed Message Format Reserved
    323 Specification of getblocktemplate for Zcash Reserved
    339 Wallet Recovery Words Reserved
    400 Wallet.dat format Draft
    401 Addressing Mempool Denial-of-Service Active
    402 New Wallet Database Format Reserved
    403 Verification Behaviour of zcashd Reserved
    416 Support for Unified Addresses in zcashd Reserved
    1001 Keep the Block Distribution as Initially Defined — 90% to Miners Obsolete
    1002 Opt-in Donation Feature Obsolete
    1003 20% Split Evenly Between the ECC and the Zcash Foundation, and a Voting System Mandate Obsolete
    1004 Miner-Directed Dev Fund Obsolete
    1005 Zcash Community Funding System Obsolete
    1006 Development Fund of 10% to a 2-of-3 Multisig with Community-Involved Third Entity Obsolete
    1007 Enforce Development Fund Commitments with a Legal Charter Obsolete
    1008 Fund ECC for Two More Years Obsolete
    1009 Five-Entity Strategic Council Obsolete
    1010 Compromise Dev Fund Proposal With Diverse Funding Streams Obsolete
    1011 Decentralize the Dev Fee Obsolete
    1012 Dev Fund to ECC + ZF + Major Grants Obsolete
    1013 Keep It Simple, Zcashers: 10% to ECC, 10% to ZF Obsolete
    1014 Establishing a Dev Fund for ECC, ZF, and Major Grants Active
    guide {Something Short and To the Point} Draft
    0 ZIP Process + Active +
    1 Network Upgrade Policy and Scheduling Reserved
    2 Design Considerations for Network Upgrades Reserved
    32 Shielded Hierarchical Deterministic Wallets Final
    76 Transaction Signature Validation before Overwinter Reserved
    143 Transaction Signature Validation for Overwinter Final
    155 addrv2 message Proposed
    173 Bech32 Format Final
    200 Network Upgrade Mechanism Final
    201 Network Peer Management for Overwinter Final
    202 Version 3 Transaction Format for Overwinter Final
    203 Transaction Expiry Final
    204 Zcash P2P Network Protocol Reserved
    205 Deployment of the Sapling Network Upgrade Final
    206 Deployment of the Blossom Network Upgrade Final
    207 Funding Streams Final
    208 Shorter Block Target Spacing Final
    209 Prohibit Negative Shielded Chain Value Pool Balances Final
    210 Sapling Anchor Deduplication within Transactions Withdrawn
    211 Disabling Addition of New Value to the Sprout Chain Value Pool Final
    212 Allow Recipient to Derive Ephemeral Secret from Note Plaintext Final
    213 Shielded Coinbase Final
    214 Consensus rules for a Zcash Development Fund Final
    215 Explicitly Defining and Modifying Ed25519 Validation Rules Final
    216 Require Canonical Jubjub Point Encodings Final
    217 Aggregate Signatures Reserved
    219 Disabling Addition of New Value to the Sapling Chain Value Pool Reserved
    220 Zcash Shielded Assets Withdrawn
    221 FlyClient - Consensus-Layer Changes Final
    222 Transparent Zcash Extensions Draft
    224 Orchard Shielded Protocol Final
    225 Version 5 Transaction Format Final
    226 Transfer and Burn of Zcash Shielded Assets Draft
    227 Issuance of Zcash Shielded Assets Draft
    239 Relay of Version 5 Transactions Final
    243 Transaction Signature Validation for Sapling Final
    244 Transaction Identifier Non-Malleability Final
    245 Transaction Identifier Digests & Signature Validation for Transparent Zcash Extensions Draft
    250 Deployment of the Heartwood Network Upgrade Final
    251 Deployment of the Canopy Network Upgrade Final
    252 Deployment of the NU5 Network Upgrade Final
    300 Cross-chain Atomic Transactions Proposed
    301 Zcash Stratum Protocol Final
    302 Standardized Memo Field Format Draft
    303 Sprout Payment Disclosure Reserved
    304 Sapling Address Signatures Draft
    305 Best Practices for Hardware Wallets supporting Sapling Reserved
    306 Security Considerations for Anchor Selection Reserved
    307 Light Client Protocol for Payment Detection Draft
    308 Sprout to Sapling Migration Final
    309 Blind Off-chain Lightweight Transactions (BOLT) Reserved
    310 Security Properties of Sapling Viewing Keys Draft
    311 Sapling Payment Disclosure Reserved
    312 Shielded Multisignatures using FROST Reserved
    313 Reduce Conventional Transaction Fee to 1000 zatoshis Active
    314 Privacy upgrades to the Zcash light client protocol Reserved
    315 Best Practices for Wallet Handling of Multiple Pools Reserved
    316 Unified Addresses and Unified Viewing Keys Final
    317 Proportional Transfer Fee Mechanism Draft
    318 Associated Payload Encryption Reserved
    319 Options for Shielded Pool Retirement Reserved
    321 Payment Request URIs Proposed
    322 Generic Signed Message Format Reserved
    323 Specification of getblocktemplate for Zcash Reserved
    339 Wallet Recovery Words Reserved
    400 Wallet.dat format Draft
    401 Addressing Mempool Denial-of-Service Active
    402 New Wallet Database Format Reserved
    403 Verification Behaviour of zcashd Reserved
    416 Support for Unified Addresses in zcashd Reserved
    1001 Keep the Block Distribution as Initially Defined — 90% to Miners Obsolete
    1002 Opt-in Donation Feature Obsolete
    1003 20% Split Evenly Between the ECC and the Zcash Foundation, and a Voting System Mandate Obsolete
    1004 Miner-Directed Dev Fund Obsolete
    1005 Zcash Community Funding System Obsolete
    1006 Development Fund of 10% to a 2-of-3 Multisig with Community-Involved Third Entity Obsolete
    1007 Enforce Development Fund Commitments with a Legal Charter Obsolete
    1008 Fund ECC for Two More Years Obsolete
    1009 Five-Entity Strategic Council Obsolete
    1010 Compromise Dev Fund Proposal With Diverse Funding Streams Obsolete
    1011 Decentralize the Dev Fee Obsolete
    1012 Dev Fund to ECC + ZF + Major Grants Obsolete
    1013 Keep It Simple, Zcashers: 10% to ECC, 10% to ZF Obsolete
    1014 Establishing a Dev Fund for ECC, ZF, and Major Grants Active
    guide {Something Short and To the Point} Draft
    diff --git a/zip-0226.html b/zip-0226.html index f7b8dd8a4..d6fd06a57 100644 --- a/zip-0226.html +++ b/zip-0226.html @@ -21,9 +21,9 @@ License: MIT Discussions-To: <https://github.com/zcash/zips/issues/618>

    Terminology

    -

    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 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.

    We define the following additional terms:

    • Asset: A type of note that can be transferred on the Zcash block chain, identified by the AssetId parameter. @@ -39,7 +39,7 @@

    Abstract

    -

    ZIP 226 and ZIP 227 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 5. The transfer and burn of such assets is defined in ZIP 226 4.

    +

    ZIP 226 and ZIP 227 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 5. The transfer and burn of such assets is defined in ZIP 226 4.

    Motivation

    The current Orchard protocol does not support custom assets. Enabling multi-asset support on the Zcash chain will open the door for a host of applications and enhance the ecosystem with application developers and asset custody institutions for issuance and bridging purposes.

    @@ -48,12 +48,12 @@

    In order to be able to represent different Asset identifiers in Orchard, we need to define a new data field that uniquely represents the AssetId of the Asset in question, which we call \(\mathsf{AssetId}\) .

    -

    The asset identifier will be used to enforce the balance of an Action Description 6 is preserved across Assets (see the Orchard Binding Signature 7), and by extension the balance of an Orchard transaction. That is, the sum of all the +

    The asset identifier will be used to enforce the balance of an Action Description 6 is preserved across Assets (see the Orchard Binding Signature 7), and by extension the balance of an Orchard transaction. That is, the sum of all the \(\mathsf{value^{net}}\) from each Action Description, computed as \(\mathsf{value^{old}-value^{new}}\) , must be balanced only with respect to the same Asset identifier. This is specially important since we will allow different Action Descriptions to transfer notes of different Asset identifiers, where the overall balance is checked without revealing which Assets (or how many different identifiers) are being transferred.

    -

    As was initially proposed by Jack Grigg and Daira Hopwood 15, we propose to make this happen by changing the value base point, +

    As was initially proposed by Jack Grigg and Daira Hopwood 15, we propose to make this happen by changing the value base point, \(\mathcal{V}^{\mathsf{Orchard}}\) , in the Homomorphic Pedersen Commitment that generates the value commitment, \(\mathsf{cv^{net}}\) @@ -94,12 +94,12 @@

    Where \(\mathsf{AssetId}\) - is the unique random group element that identifies each asset in the Pallas curve 8, 9 of the Orchard protocol.

    + is the unique random group element that identifies each asset in the Pallas curve 8, 9 of the Orchard protocol.

    In this case, the instance of the note commitment scheme, \(\mathsf{NoteCommit^{OrchardZSA}_{rcm}}\) , will differ from \(\mathsf{NoteCommit^{Orchard}_{rcm}}\) - in that for non-ZEC assets, the asset identifier will be added as an input to the commitment computation. As we will see, the recursive structure of the Sinsemilla-base commitment 10 allows us to add the asset identifier as a final recursive step, and hence keep a single instance of the Sinsemilla hash function in the circuit for the note commitment verification.

    + in that for non-ZEC assets, the asset identifier will be added as an input to the commitment computation. As we will see, the recursive structure of the Sinsemilla-base commitment 10 allows us to add the asset identifier as a final recursive step, and hence keep a single instance of the Sinsemilla hash function in the circuit for the note commitment verification.

    Since the commitment output is still indistinguishable with the original Orchard ZEC note commitments, by definition of the Sinsemilla hash, ZSA note commitments will be added to the same Merkle Commitment Tree. In essence, we have

    \(\mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, AssetId)} \in \{\mathsf{cm},\bot\}\) @@ -107,7 +107,7 @@

    The nullifier is generated in the same manner as in the Orchard protocol.

    Value Commitment

    -

    The Orchard Protocol uses a Sinsemilla-based Homomorphic Pedersen Commitment 11 which is instantiated as

    +

    The Orchard Protocol uses a Sinsemilla-based Homomorphic Pedersen Commitment 11 which is instantiated as

    \(\mathsf{cv^{net}:=ValueCommit^{Orchard}_{rcv}(v^{net})}:= \mathsf{[v^{net}]}\mathcal{V}^{\mathsf{Orchard}}+[\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}}\)

    @@ -147,7 +147,7 @@ .

    Value Balance Verification

    -

    In order to verify the balance of the different assets, verifier performs exactly the same the process as for the Orchard protocol 7. The main reason is because no custom assets can be unshielded, so all custom assets are contained within the shielded ZSA pool. This means that the net balance of the input and output values is zero, with only one asset identifier of value balance published, that of ZEC, +

    In order to verify the balance of the different assets, verifier performs exactly the same the process as for the Orchard protocol 7. The main reason is because no custom assets can be unshielded, so all custom assets are contained within the shielded ZSA pool. This means that the net balance of the input and output values is zero, with only one asset identifier of value balance published, that of ZEC, \(\mathsf{v^{balanceOrchard}}\) , so no net amount of any asset identifier will be revealed, and neither the nnumber of asset identifiers in the transaction. The only exception to this is in the case that an asset is burnt, as we will see below in burnmechanism.

    For a total of @@ -160,13 +160,13 @@

    \(\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} = \sum \mathsf{rcv_{i}^{net}}\mathcal{R}^{\mathsf{Orchard}}\)

    -

    And uses it to verify the binding signature, as described in §4.14 of the Zcash Specification 7, by verifying the bindingSignature on the SIGHASH message.

    +

    And uses it to verify the binding signature, as described in §4.14 of the Zcash Specification 7, by verifying the bindingSignature on the SIGHASH message.

    As in the Orchard protocol, the binding signature verification key, \(\mathsf{bvk}\) , will only be valid (and hence verify the signature correctly), as long as the committed values sum to zero. In contrast, in this protocol, the committed values only sum to zero per Asset identifier, as the Pedersen commitments add up homomorphically only with respect to the same value base point.

    Split Notes

    -

    One of the key functionalities in a UTXO-based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This requires a 1-to-many (Orchard) transaction. However, because each Action represents and input and an output, the resulting transaction must have multiple inputs. In order to cope with this today, the Actions that have not been assigned input notes are instead given dummy spend notes 12, which we call split Actions and split notes respectively. Basically, the input note is “faked” inside of the proof in order to hide which Action contains the real spend note.

    +

    One of the key functionalities in a UTXO-based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This requires a 1-to-many (Orchard) transaction. However, because each Action represents and input and an output, the resulting transaction must have multiple inputs. In order to cope with this today, the Actions that have not been assigned input notes are instead given dummy spend notes 12, which we call split Actions and split notes respectively. Basically, the input note is “faked” inside of the proof in order to hide which Action contains the real spend note.

    This, however, brings some issues when it comes to adding multiple asset identifiers, as the output note of the split Actions cannot be of any asset identifier, it must be enforced to be an actual output of a GroupHash computation (in fact we want it to be of the same identifier as the original input note, but the binding signature takes care that the proper balancing is performed). If not, then the prover could essentially input a multiple (or linear combination of) an existing identifier, with the goal to attack the network by overflowing the ZEC value balance and hence counterfeiting ZEC funds.

    In order to prevent this, we make some modifications to the circuit. Specifically we remove the dummy note functionality for custom assets and we enforce that every input note to an ZSA Action must be proven to exist in the set of note commitments in the Merkle Tree. We then enforce this real note to be “unspendable” in the sense that its value will be zeroed in split Actions and the nullifier will be randomized, making the note not spendable in the specific Action. Then, the proof itself ensures that the output note is of the same identifier as the input note. In the circuit, the split note functionality will be activated by a boolean private input to the proof.

    Note that this is enough to create a chain of induction that ensures that all output notes of a transfer are actual outputs of a GroupHash, preventing any malleability attacks, as they originate in the Issuance protocol, which is publicly verified. Furthermore, we do not care about whether the note is owned by the sender, or whether it was nullified before. Wallets and other clients have a choice to make to ensure the asset identifier is the preserved for the output note of a split Action, for the value balance verification:

    @@ -179,7 +179,7 @@

    Circuit Statement

    -

    The advantage of the design described above, with respect to the circuit statement, is that every ZSA Action statement is kept closely similar to the Orchard Action statement 13, except for a few additions that ensure the security of the asset identifier system.

    +

    The advantage of the design described above, with respect to the circuit statement, is that every ZSA Action statement is kept closely similar to the Orchard Action statement 13, except for a few additions that ensure the security of the asset identifier system.

    Asset Identifier Equality: the following constraints must be added to ensure that the input and output note are of the same AssetId:

    • The asset identifier, @@ -330,7 +330,7 @@

      Note: Even if this mechanism allows having transparent ↔ shielded asset transfers in theory, the transparent protocol will not be changed with this ZIP to adapt to a multiple asset structure. This means that unless future consensus rules changes do allow it, the unshielding is not not be possible for custom assets.

    ZSA Transaction Structure

    -

    Similar to version 5 transaction format, with the following modifications to the Orchard bundle, as defined in 14:

    +

    Similar to version 5 transaction format, with the following modifications to the Orchard bundle, as defined in 14:

    @@ -359,7 +359,7 @@

    Other Considerations

    Transaction Fees

    -

    The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317b 16.

    +

    The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317b 16.

    Security and Privacy

      diff --git a/zip-0227.html b/zip-0227.html index 01f8f6321..b0973c802 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -21,9 +21,9 @@ License: MIT Discussions-To: <https://github.com/zcash/zips/issues/618>

      Terminology

      -

      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 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.

      We define the following additional terms:

      • Custom Asset: A type of note that can be transferred on the Zcash block chain. ZEC is the default (and currently the only defined) asset for the Zcash mainnet. Different custom assets are defined and differentiated by their identifier (AssetId).
      • @@ -34,18 +34,18 @@

      Abstract

      -

      ZIP 226 4 and ZIP 227 5 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 5. 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, as it produces notes that can only be transferred under ZSA.

      +

      ZIP 226 4 and ZIP 227 5 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 5. 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, as it produces notes that can only be transferred under ZSA.

      Motivation

      -

      The current Orchard protocol does not support custom assets. Enabling multi-asset support on the Zcash chain will open the door for a host of applications and enhance the ecosystem with application developers and asset custody institutions for issuance and bridging purposes.

      +

      The Orchard protocol deployed in NU5 does not support custom assets. Enabling multi-asset support on the Zcash chain will open the door for a host of applications and enhance the ecosystem with application developers and asset custody institutions for issuance and bridging purposes.

      Use Cases

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

      • The issuer knows in advance the receivers of the issued asset.
      • -
      • The asset is of non-fungible type, where each asset type can be made part of a single “series”
      • -
      • The supply of the asset is limited or not
      • -
      • The assets can be wrapped versions of assets in other chains (as long as there is a bridge that supports it)
      • +
      • The asset can be of non-fungible type, where each asset type can be made part of a single “series”.
      • +
      • The supply of the asset can be limited in advance or not.
      • +
      • The asset can be a wrapped version of an asset issued by another chain (as long as there is a bridge that supports transfer of that asset between chains).

      See the Concrete Applications section for more details.

      @@ -53,16 +53,16 @@
      • Any user of the Zcash block chain can issue custom assets on chain
      • The issuance mechanism should enable tracking publicly the supply of the assets on the Zcash block chain
      • -
      • A user without knowledge of the private key of the issuer of a specific asset should not be able to issue that asset or change the attributes of such asset
      • -
      • The asset identification should be unique and different issuer keys should not be able to generate the same asset identifier
      • +
      • Issuing or changing the attributes of a specific asset should require cryptographic authorization.
      • +
      • The asset identification should be unique (among all shielded pools) and different issuer public keys should not be able to generate the same asset identifier.

    Specification

    -

    As explained, the issuance protocol allows for a single issuance action to be sent to many receivers by mean of generating as many output notes as distinct recipients. Furthermore, every bundle can contain many issuance actions. Thus we divide the protocol spec in two sections.

    +

    As explained, the issuance protocol allows for a single issuance action to be sent to many receivers, by generating as many output notes as distinct recipients. Furthermore, every bundle can contain many issuance actions.

    Overview

    -

    In short, this specification enables only transparent issuance, since as a first step, transparency is important to properly test the applications that will be most used in the Zcash ecosystem, while enabling tracking of supply of assets. Any user of the blockchain can issue new asset types, yet only a single issuer (a set of keys) can issue that specific asset type, as the asset identifiers are tied to the issuer keys.

    +

    This specification enables only transparent issuance, since as a first step, transparency is important to properly test the applications that will be most used in the Zcash ecosystem, while enabling tracking of supply of assets. Any user of the blockchain can issue new asset types, yet only a single issuer (a set of keys) can issue that specific asset type, as the asset identifiers are tied to the issuer keys.

    The protocol was designed with three main properties in mind: - at the time of issuance, the issuer can already allocate all the tokens to the corresponding owners by creating the corresponding (shielded) output notes to the respective addresses. As is implied, the issuance mechanism is itself transparent, but the allocation is totally private - in a single issuance bundle, the issuer can publish many issuance actions, or in other words, create multiple custom assets - every issuance action contains the finiteIssuance boolean that defines whether that specific custom asset can have further tokens issued or not

    -

    The issuance mechanism is broad enough for issuers to either create native 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. In fact, the protocol described below enables, what we hope will be a useful set of, applications. The design decision is not to have a chosen name to describe the custom asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”.

    +

    The issuance mechanism is broad enough for issuers to either create native 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. In fact, the protocol described below enables what we hope will be a useful set of applications. The design decision is not to have a chosen name to describe the custom asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”.

    Issuance Keys

    There are two keys relevant to the Issuer:

    @@ -70,7 +70,7 @@
  • The issuanceAuthorizingKey, denoted as isk, is the key that is used to sign the issuance transaction. This key is used to authorize the issuance of a specific asset type, and is only used by the issuer. Throughout we also call this key the issuer signature key.
  • The issuanceValidatingKey, denoted as ik, is the key that is used to validate the issuance transaction. This key is used to validate the issuance of a specific asset type, and is used by all blockchain users (specifically the asset owners and consensus validators) to associate the asset in question with the issuer. Throughout we also call this key the issuer verification key.
  • -

    The two keys are derived in an analogous manner to the spendAuthorizingKey and spendValidatingKey keys, using the same signature scheme, as described in ZIP 32 7 and in accordance with ZIP 316 8.

    +

    The two keys are derived in an analogous manner to the spendAuthorizingKey and spendValidatingKey keys, using the same signature scheme, as described in ZIP 32 7 and in accordance with ZIP 316 8.

    • The issuanceAuthorizingKey is derived directly from the spendingKey, sk, as a private signature key:
    @@ -83,7 +83,7 @@

    \(\mathsf{ik := SpendAuthSig^{Orchard}.DerivePublic(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 7, and can further be in 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.

    +

    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 7, and can further be in 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.

    Asset Identifier

    For every new asset, there must be a new and unique identifier of the asset. Every asset is defined by the asset description, asset_desc, which is a global byte string (valid across all -future- Zcash protocols). From this asset descritpion, the specific asset identifier, AssetId, is derived with a GroupHash and used within the output notes, as defined by the specific protocol (e.g.: for now Orchard-style, using Pallas curve).

    @@ -214,7 +214,7 @@

    System Message: WARNING/2 (zip-0227.rst line 175)

    Concrete applications

    Bridging Assets Issuers can wrap assets defined in other chains and issue them at once in a single transaction. The specifics of the bridge are not implemented in the protocol, but there are several ways we conceive issuers can build these bridges (at least centralized bridges): - First, the issuance and burn mechanism can be used in conjunction to determine the

    -

    Asset Features - By using the 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,

    +

    Asset Features - By using the 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,

    System Message: ERROR/3 (zip-0227.rst line 194)

    Unexpected indentation.

    @@ -327,14 +327,14 @@

    System Message: WARNING/2 (zip-0227.rst line 195)

    Security and Privacy Considerations

    Issuer Key or AssetId Compromise

    The design of this protocol does not allow for a rotation of the issuerValidatingKey, that would allow for replacing the key of a specific asset (see Future Work). In case of compromise, the following actions are recommended: - If an asset ID is compromised (and not the issuer verification key), the finalize boolean for that asset should be set to 0 and a new AssetId generated instead. - If an issuer verification key is compromised, the finalize boolean for all the assets issued with that key should be set to 0 and the issuer should change to a new spending key altogether (for the purpose of issuance), and issue new assets, each with a new AssetId.

    -

    Briding Assets 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.

    +

    Briding Assets 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.

    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 issuanceSupplyInfoMap from AssetId to issuanceSupplyInfoMap := (totalSupply, finalize) in order to properly keep track of the total supply for different asset types. 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 317b 6.

    +

    The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317b 6.

    Future Work

    In future versions of this ZIP, the protocol may also include a "key rotation" mechanism. This would allow an issuer to change the underlying ik of a given asset, in case the original one was compromised, without having to chance the asset identifier altogether.

    From 214c865c654bea9f5743592d35a1598b943de973 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Mon, 19 Dec 2022 12:03:51 +0530 Subject: [PATCH 026/101] minor typographical improvements in ZIP 226 --- zip-0226.html | 17 +++++++++-------- zip-0226.rst | 15 +++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/zip-0226.html b/zip-0226.html index d6fd06a57..52511a770 100644 --- a/zip-0226.html +++ b/zip-0226.html @@ -71,7 +71,7 @@

    Specification

    Most of the protocol is kept the same as the Orchard protocol released with NU5, except for the following.

    Asset Identifiers

    -

    For every new asset, there must be a new and unique identifier of the asset. Every asset is defined by the asset description, asset_desc, which is a global byte string (valid across all -future- Zcash protocols). From this asset descritpion, the specific asset identifier, +

    For every new asset, there must be a new and unique identifier of the asset. Every asset is defined by the asset description, asset_desc, which is a global byte string (valid across all -future- Zcash protocols). From this asset description, the specific asset identifier, \(\mathsf{AssetId}\) , is derived with a GroupHash and used within the output notes, as defined by the specific protocol (e.g.: for now Orchard-style, using Pallas curve).

    This @@ -136,7 +136,7 @@ is the value of the note of identifier \(\mathsf{AssetId}\) , and

    -

    +

    \(\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}}:=\mathsf{AssetId}= \mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv", "a" || ik || \mathsf{asset_desc})}\)

    @@ -149,7 +149,7 @@

    Value Balance Verification

    In order to verify the balance of the different assets, verifier performs exactly the same the process as for the Orchard protocol 7. The main reason is because no custom assets can be unshielded, so all custom assets are contained within the shielded ZSA pool. This means that the net balance of the input and output values is zero, with only one asset identifier of value balance published, that of ZEC, \(\mathsf{v^{balanceOrchard}}\) - , so no net amount of any asset identifier will be revealed, and neither the nnumber of asset identifiers in the transaction. The only exception to this is in the case that an asset is burnt, as we will see below in burnmechanism.

    + , so no net amount of any asset identifier will be revealed, and neither the nnumber of asset identifiers in the transaction. The only exception to this is in the case that an asset is burnt, as we will see below in the burn mechanism.

    For a total of \(n\) actions in a transfer, the prover can still sign the SIGHASH of the transaction using the binding signature key

    @@ -166,7 +166,7 @@ , will only be valid (and hence verify the signature correctly), as long as the committed values sum to zero. In contrast, in this protocol, the committed values only sum to zero per Asset identifier, as the Pedersen commitments add up homomorphically only with respect to the same value base point.

    Split Notes

    -

    One of the key functionalities in a UTXO-based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This requires a 1-to-many (Orchard) transaction. However, because each Action represents and input and an output, the resulting transaction must have multiple inputs. In order to cope with this today, the Actions that have not been assigned input notes are instead given dummy spend notes 12, which we call split Actions and split notes respectively. Basically, the input note is “faked” inside of the proof in order to hide which Action contains the real spend note.

    +

    One of the key functionalities in a UTXO-based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This requires a 1-to-many (Orchard) transaction. However, because each Action represents an input and an output, the resulting transaction must have multiple inputs. In order to cope with this today, the Actions that have not been assigned input notes are instead given dummy spend notes 12, which we call split Actions and split notes respectively. Basically, the input note is “faked” inside of the proof in order to hide which Action contains the real spend note.

    This, however, brings some issues when it comes to adding multiple asset identifiers, as the output note of the split Actions cannot be of any asset identifier, it must be enforced to be an actual output of a GroupHash computation (in fact we want it to be of the same identifier as the original input note, but the binding signature takes care that the proper balancing is performed). If not, then the prover could essentially input a multiple (or linear combination of) an existing identifier, with the goal to attack the network by overflowing the ZEC value balance and hence counterfeiting ZEC funds.

    In order to prevent this, we make some modifications to the circuit. Specifically we remove the dummy note functionality for custom assets and we enforce that every input note to an ZSA Action must be proven to exist in the set of note commitments in the Merkle Tree. We then enforce this real note to be “unspendable” in the sense that its value will be zeroed in split Actions and the nullifier will be randomized, making the note not spendable in the specific Action. Then, the proof itself ensures that the output note is of the same identifier as the input note. In the circuit, the split note functionality will be activated by a boolean private input to the proof.

    Note that this is enough to create a chain of induction that ensures that all output notes of a transfer are actual outputs of a GroupHash, preventing any malleability attacks, as they originate in the Issuance protocol, which is publicly verified. Furthermore, we do not care about whether the note is owned by the sender, or whether it was nullified before. Wallets and other clients have a choice to make to ensure the asset identifier is the preserved for the output note of a split Action, for the value balance verification:

    @@ -194,8 +194,10 @@

    Correct Value Commitment: the following constraints must be added to ensure that the value commitment is computed using the witnessed identifier, as represented in the notes

      -
    • The fixed-base multiplication constraints between the value and the value base point of the value commitment,:math:mathsf{cv}, is replaced with a variable-base multiplication between the two
    • -
    • The witness to the value base-point, as defined in valuebase is the auxiliary input +
    • The fixed-base multiplication constraints between the value and the value base point of the value commitment, + \(\mathsf{cv}\) + , is replaced with a variable-base multiplication between the two.
    • +
    • The witness to the value base-point, as defined in the value base equation is the auxiliary input \(\mathsf{AssetId}\) .
    @@ -306,12 +308,11 @@

    In order to have a "clean" backwards compatibility with the ZEC notes, we have designed the circuit to support both ZEC and ZSA notes. As we specify above, there are three main reasons we can do this: - The input notes with an asset identifer denote the ZSA custom assets, generating a note commitment that includes the asset identifer; whereas the notes without an identifier, denote the ZEC notes, and generate a note commitment that does not include the asset identifier, in order to maintain the referencability to the Merkle tree - The value commitment is abstracted to allow for the value base-point as a variable private input to the proof - The ZEC-based actions will still include dummy input notes, whereas the ZSA-based actions will include split input notes

    -

    Burn Mechanism

    The burn mechanism may be needed for off-boarding the wrapped assets from the chain, or enabling advanced tokenomics on native tokens. It is part of the Issuance/Burn protocol, but given that it can be seen as an extension of the Transfer protocol, we add it here for readability.

    In essence, the burn mechanism is a transparent / revealing extension to the transfer protocol that enables a specific amount of any asset identifier to be sent into “oblivion”. Our burn mechanism does NOT send assets to a non-spendable address, it simply reduces the total number of assets in circulation at the consensus level. It is enforced at the consensus level, by using an extension of the value balance mechanism used for ZEC assets.

    First, contrary to the strict transfer transaction, we allow the sender to include a - \(\mathsf{valueBalvalueBalance_{AssetId}}\) + \(\mathsf{valueBalance_{AssetId}}\) variable for every asset identifier that is being burnt. As we will show in the transaction structure, this is separate from the regular \(\mathsf{valueBalance^Orchard}\) that is the default transparent value for the ZEC asset.

    diff --git a/zip-0226.rst b/zip-0226.rst index 26a0a379f..9f310016e 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -70,7 +70,7 @@ Most of the protocol is kept the same as the Orchard protocol released with NU5, Asset Identifiers ----------------- -For every new asset, there must be a new and unique identifier of the asset. Every asset is defined by the asset description, `asset_desc`, which is a global byte string (valid across all -future- Zcash protocols). From this asset descritpion, the specific asset identifier, :math:`\mathsf{AssetId}`, is derived with a `GroupHash` and used within the output notes, as defined by the specific protocol (e.g.: for now Orchard-style, using Pallas curve). +For every new asset, there must be a new and unique identifier of the asset. Every asset is defined by the asset description, `asset_desc`, which is a global byte string (valid across all -future- Zcash protocols). From this asset description, the specific asset identifier, :math:`\mathsf{AssetId}`, is derived with a `GroupHash` and used within the output notes, as defined by the specific protocol (e.g.: for now Orchard-style, using Pallas curve). This :math:`\mathsf{AssetId}` will be the base point of the value commitment for the specific custom asset. Note that the :math:`\mathsf{AssetId}` of the ZEC asset will be kept as the original value base-point, :math:`\mathcal{V}^\mathsf{Orchard}`. @@ -122,7 +122,7 @@ In the case of the ZSA protocol, the value of different asset identifiers in a g where :math:`\mathsf{v^{net}_{AssetId}} = \mathsf{v^{old}_{AssetId} - v^{new}_{AssetId}}` such that :math:`\mathsf{v^*_{AssetId}}` is the value of the note of identifier :math:`\mathsf{AssetId}`, and -.. _valuebase: +.. _`value base`: :math:`\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}}:=\mathsf{AssetId}= \mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv", "a" || ik || \mathsf{asset_desc})}` @@ -133,7 +133,7 @@ Where :math:`\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{ZEC}} =\mathcal{V}^{\mat Value Balance Verification -------------------------- -In order to verify the balance of the different assets, verifier performs exactly the same the process as for the Orchard protocol [#protocol-binding]_. The main reason is because no custom assets can be unshielded, so all custom assets are contained within the shielded ZSA pool. This means that the net balance of the input and output values is zero, with only one asset identifier of value balance published, that of ZEC, :math:`\mathsf{v^{balanceOrchard}}`, so no net amount of any asset identifier will be revealed, and neither the nnumber of asset identifiers in the transaction. The only exception to this is in the case that an asset is *burnt*, as we will see below in burnmechanism_. +In order to verify the balance of the different assets, verifier performs exactly the same the process as for the Orchard protocol [#protocol-binding]_. The main reason is because no custom assets can be unshielded, so all custom assets are contained within the shielded ZSA pool. This means that the net balance of the input and output values is zero, with only one asset identifier of value balance published, that of ZEC, :math:`\mathsf{v^{balanceOrchard}}`, so no net amount of any asset identifier will be revealed, and neither the nnumber of asset identifiers in the transaction. The only exception to this is in the case that an asset is *burnt*, as we will see below in the `burn mechanism`_. For a total of :math:`n` actions in a transfer, the prover can still sign the `SIGHASH` of the transaction using the binding signature key @@ -151,7 +151,7 @@ As in the Orchard protocol, the binding signature verification key, :math:`\math Split Notes ----------- -One of the key functionalities in a UTXO-based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This requires a 1-to-many (Orchard) transaction. However, because each Action represents and input and an output, the resulting transaction must have multiple inputs. In order to cope with this today, the Actions that have not been assigned input notes are instead given *dummy spend notes* [#protocol-dummynotes]_, which we call split Actions and split notes respectively. Basically, the input note is “faked” inside of the proof in order to hide which Action contains the *real* spend note. +One of the key functionalities in a UTXO-based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This requires a 1-to-many (Orchard) transaction. However, because each Action represents an input and an output, the resulting transaction must have multiple inputs. In order to cope with this today, the Actions that have not been assigned input notes are instead given *dummy spend notes* [#protocol-dummynotes]_, which we call split Actions and split notes respectively. Basically, the input note is “faked” inside of the proof in order to hide which Action contains the *real* spend note. This, however, brings some issues when it comes to adding multiple asset identifiers, as the output note of the split Actions *cannot* be of *any* asset identifier, it must be enforced to be an actual output of a GroupHash computation (in fact we want it to be of the same identifier as the original input note, but the binding signature takes care that the proper balancing is performed). If not, then the prover could essentially input a multiple (or linear combination of) an existing identifier, with the goal to attack the network by overflowing the ZEC value balance and hence counterfeiting ZEC funds. @@ -180,8 +180,8 @@ same `AssetId`: **Correct Value Commitment:** the following constraints must be added to ensure that the value commitment is computed using the witnessed identifier, as represented in the notes -- The fixed-base multiplication constraints between the value and the value base point of the value commitment,:math:`\mathsf{cv}`, is replaced with a variable-base multiplication between the two -- The witness to the value base-point, as defined in valuebase_ is the auxiliary input :math:`\mathsf{AssetId}`. +- The fixed-base multiplication constraints between the value and the value base point of the value commitment, :math:`\mathsf{cv}`, is replaced with a variable-base multiplication between the two. +- The witness to the value base-point, as defined in the `value base`_ equation is the auxiliary input :math:`\mathsf{AssetId}`. **Enforce Secure Identifier for Split Actions:** the following constraints must be added to prevent senders from changing the asset identifier for the output note in the Split Actions: @@ -216,7 +216,6 @@ In order to have a "clean" backwards compatibility with the ZEC notes, we have d - The value commitment is abstracted to allow for the value base-point as a variable private input to the proof - The ZEC-based actions will still include dummy input notes, whereas the ZSA-based actions will include split input notes -.. _burnmechanism: Burn Mechanism ============== @@ -224,7 +223,7 @@ The burn mechanism may be needed for off-boarding the wrapped assets from the ch In essence, the burn mechanism is a transparent / revealing extension to the transfer protocol that enables a specific amount of any asset identifier to be sent into “oblivion”. Our burn mechanism does NOT send assets to a non-spendable address, it simply reduces the total number of assets in circulation at the consensus level. It is enforced at the consensus level, by using an extension of the value balance mechanism used for ZEC assets. -First, contrary to the strict transfer transaction, we allow the sender to include a :math:`\mathsf{valueBalvalueBalance_{AssetId}}` variable for every asset identifier that is being burnt. As we will show in the transaction structure, this is separate from the regular :math:`\mathsf{valueBalance^Orchard}` that is the default transparent value for the ZEC asset. +First, contrary to the strict transfer transaction, we allow the sender to include a :math:`\mathsf{valueBalance_{AssetId}}` variable for every asset identifier that is being burnt. As we will show in the transaction structure, this is separate from the regular :math:`\mathsf{valueBalance^Orchard}` that is the default transparent value for the ZEC asset. For every custom asset that is burnt, we add to the `assetBurn` vector the tuple :math:`(\mathsf{valueBalance_{AssetId}, AssetId})` such that the validator of the transaction can compute the value commitment with the corresponding value base point of that asset. This ensures that the values are all balanced out with respect to the asset identifiers in the transfer. From 06b9e7d27cbc9cc3f0fa0a905c8ce263be86bf9e Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Mon, 19 Dec 2022 23:00:32 +0530 Subject: [PATCH 027/101] typographical improvements in ZIP 227 --- zip-0227.html | 290 ++++++++++++++++++++++++++++++++------------------ zip-0227.rst | 154 +++++++++++++++------------ 2 files changed, 274 insertions(+), 170 deletions(-) diff --git a/zip-0227.html b/zip-0227.html index b0973c802..2c4965635 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -26,7 +26,9 @@

    The term "Orchard" in this document is to be interpreted as described in ZIP 224 3.

    We define the following additional terms:

      -
    • Custom Asset: A type of note that can be transferred on the Zcash block chain. ZEC is the default (and currently the only defined) asset for the Zcash mainnet. Different custom assets are defined and differentiated by their identifier (AssetId).
    • +
    • Custom Asset: A type of note that can be transferred on the Zcash block chain. ZEC is the default (and currently the only defined) asset for the Zcash mainnet. Different custom assets are defined and differentiated by their identifier ( + \(\mathsf{AssetId}\) + ).
    • Zcash Shielded Asset: an asset with issuance defined on the Zcash block chain, and, with this ZIP, belonging to the Orchard anonymity pool.
    • Wrapped Asset: a ZSA asset with native issuance defined outside the Zcash block chain.
    • Issuance Action: an instance of a single issuance of a Zcash Shielded Asset. It defines the issuance of a single asset identifier.
    • @@ -47,12 +49,12 @@
    • The supply of the asset can be limited in advance or not.
    • The asset can be a wrapped version of an asset issued by another chain (as long as there is a bridge that supports transfer of that asset between chains).
    -

    See the Concrete Applications section for more details.

    +

    See the Concrete Applications section for more details.

    Requirements

      -
    • Any user of the Zcash block chain can issue custom assets on chain
    • -
    • The issuance mechanism should enable tracking publicly the supply of the assets on the Zcash block chain
    • +
    • Any user of the Zcash block chain can issue custom assets on chain.
    • +
    • The issuance mechanism should enable tracking publicly the supply of the assets on the Zcash block chain.
    • Issuing or changing the attributes of a specific asset should require cryptographic authorization.
    • The asset identification should be unique (among all shielded pools) and different issuer public keys should not be able to generate the same asset identifier.
    @@ -61,48 +63,81 @@

    As explained, the issuance protocol allows for a single issuance action to be sent to many receivers, by generating as many output notes as distinct recipients. Furthermore, every bundle can contain many issuance actions.

    Overview

    This specification enables only transparent issuance, since as a first step, transparency is important to properly test the applications that will be most used in the Zcash ecosystem, while enabling tracking of supply of assets. Any user of the blockchain can issue new asset types, yet only a single issuer (a set of keys) can issue that specific asset type, as the asset identifiers are tied to the issuer keys.

    -

    The protocol was designed with three main properties in mind: - at the time of issuance, the issuer can already allocate all the tokens to the corresponding owners by creating the corresponding (shielded) output notes to the respective addresses. As is implied, the issuance mechanism is itself transparent, but the allocation is totally private - in a single issuance bundle, the issuer can publish many issuance actions, or in other words, create multiple custom assets - every issuance action contains the finiteIssuance boolean that defines whether that specific custom asset can have further tokens issued or not

    -

    The issuance mechanism is broad enough for issuers to either create native 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. In fact, the protocol described below enables what we hope will be a useful set of applications. The design decision is not to have a chosen name to describe the custom asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”.

    +

    The protocol was designed with three main properties in mind:

    +
      +
    • At the time of issuance, the issuer can already allocate all the tokens to the corresponding owners by creating the corresponding (shielded) output notes to the respective addresses. As is implied, the issuance mechanism is itself transparent, but the allocation is totally private.
    • +
    • In a single issuance bundle, the issuer can publish many issuance actions, or in other words, create multiple custom assets.
    • +
    • Every issuance action contains the finalize boolean that defines whether that specific custom asset can have further tokens issued or not.
    • +
    +

    The issuance mechanism is broad enough for issuers to either create native 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. In fact, the protocol described below enables what we hope will be a useful set of applications. The design decision is not to have a chosen name to describe the custom asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”.

    Issuance Keys

    There are two keys relevant to the Issuer:

      -
    1. The issuanceAuthorizingKey, denoted as isk, is the key that is used to sign the issuance transaction. This key is used to authorize the issuance of a specific asset type, and is only used by the issuer. Throughout we also call this key the issuer signature key.
    2. -
    3. The issuanceValidatingKey, denoted as ik, is the key that is used to validate the issuance transaction. This key is used to validate the issuance of a specific asset type, and is used by all blockchain users (specifically the asset owners and consensus validators) to associate the asset in question with the issuer. Throughout we also call this key the issuer verification key.
    4. +
    5. The issuance authorizing key, denoted as + \(\mathsf{isk}\) + , is the key that is used to sign the issuance transaction. This key is used to authorize the issuance of a specific asset type, and is only used by the issuer. Throughout we also call this key the issuer signature key.
    6. +
    7. The issuance validating key, denoted as + \(\mathsf{ik}\) + , is the key that is used to validate the issuance transaction. This key is used to validate the issuance of a specific asset type, and is used by all blockchain users (specifically the asset owners and consensus validators) to associate the asset in question with the issuer. Throughout we also call this key the issuer verification key.
    -

    The two keys are derived in an analogous manner to the spendAuthorizingKey and spendValidatingKey keys, using the same signature scheme, as described in ZIP 32 7 and in accordance with ZIP 316 8.

    +

    The two keys are derived in an analogous manner to the spend authorizing key and spend validating key, using the same signature scheme, as described in ZIP 32 7 and in accordance with ZIP 316 8.

      -
    • The issuanceAuthorizingKey is derived directly from the spendingKey, sk, as a private signature key:
    • +
    • The issuance authorizing key is derived directly from the spending key, + \(\mathsf{sk}\) + , as a private signature key:
    -

    - \(\mathsf{isk := ToScalar^{Orchard}(︀ PRF^{expand}_{sk} ([0x0a])}\) -

    +
    \(\mathsf{isk := ToScalar^{Orchard}(︀ PRF^{expand}_{sk} ([0x0a])}\)
      -
    • The issuanceValidatingKey is derived from the issuanceAuthorizingKey, isk, as a public verification key:
    • +
    • The issuance validating key is derived from the issuance authorizing key, + \(\mathsf{isk}\) + , as a public verification key:
    -

    - \(\mathsf{ik := SpendAuthSig^{Orchard}.DerivePublic(isk)}\) -

    +
    \(\mathsf{ik := SpendAuthSig^{Orchard}.DerivePublic(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 7, and can further be in 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.

    Asset Identifier

    -

    For every new asset, there must be a new and unique identifier of the asset. Every asset is defined by the asset description, asset_desc, which is a global byte string (valid across all -future- Zcash protocols). From this asset descritpion, the specific asset identifier, AssetId, is derived with a GroupHash and used within the output notes, as defined by the specific protocol (e.g.: for now Orchard-style, using Pallas curve).

    -

    The main requirement for the asset identifier is for it to be collision-free, as two different issuers MUST not be able to issue the same asset type. One way to achieve this is to make the identifier dependent on the issuer keys, as the issuer keys are unique to each issuer. We achieve this by deriving the asset identifier, AssetId as follows:

    +

    For every new asset, there must be a new and unique identifier of the asset. Every asset is defined by the asset description, + \(\mathsf{asset\_desc}\) + , which is a global byte string (valid across all -future- Zcash protocols). From this asset description, the specific asset identifier, + \(\mathsf{AssetId}\) + , is derived with a GroupHash and used within the output notes, as defined by the specific protocol (e.g.: for now Orchard-style, using Pallas curve).

    +

    The main requirement for the asset identifier is for it to be collision-free, as two different issuers MUST not be able to issue the same asset type. One way to achieve this is to make the identifier dependent on the issuer keys, as the issuer keys are unique to each issuer. We achieve this by deriving the asset identifier, + \(\mathsf{AssetId}\) + as follows:

    - \(\mathsf{AssetId := GroupHash^{\mathbb{P}}}\mathsf{(ik || asset_desc)}\) + \(\mathsf{AssetId := GroupHash^{\mathbb{P}}}\mathsf{(ik || asset\_desc)}\)

    where

      -
    • asset_desc is the asset description, a UTF-8 encoded string of up to 512 bytes, which includes any information pertaining to the issuance
    • -
    • issuanceValidatingKey is the public key of the issuer, used to verify the signature on the transaction SIGHASH and is defined as ik
    • +
    • + \(\mathsf{asset\_desc}\) + is the asset description, a UTF-8 encoded string of up to 512 bytes, which includes any information pertaining to the issuance
    • +
    • + \(\mathsf{ik}\) + is the issuance validating key of the issuer, used to verify the signature on the transaction SIGHASH and is defined above

    Global Issuance State

    -

    Issuance requires the following additions to the global state: - previously_finalized, a set of AssetId that have been finalized (i.e.: the finalize flag has been set to 1).

    +

    Issuance requires the following additions to the global state:

    +
      +
    • previously_finalized, a set of + \(\mathsf{AssetId}\) + that have been finalized (i.e.: the finalize flag has been set to 1).
    • +

    Issuance Action Description

    -

    An issuance action, IssueAction, is the instance of issuing a specific custom asset, and contains the following fields: - asset_desc: the asset description, a UTF-8 encoded string of up to 512 bytes - notes: an array containing the unencrypted output notes of the recipients of the asset, of type Note - finalize: a boolean that defines whether the issuance of that specific custom asset is finalized or not

    -

    Once finiteSupply is set to 1, it cannot be unset. For assets whose finalize = 1, no further tokens can be issued, so as seen below, the validators will reject the transaction. For assets whose finalize = 0, new issuance actions can be issued in future transactions. These must use the same asset description, asset_desc, and can either maintain finalize = 0 or change it to 1, denoting the last transaction containing issuance of such custom asset.

    +

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

    +
      +
    • + \(\mathsf{asset\_desc}\) + : the asset description, a UTF-8 encoded string of up to 512 bytes
    • +
    • notes: an array containing the unencrypted output notes of the recipients of the asset, of type Note
    • +
    • finalize: a boolean that defines whether the issuance of that specific custom asset is finalized or not
    • +
    +

    Once finalize is set to 1, it cannot be unset. For assets whose finalize = 1, no further tokens can be issued, so as seen below, the validators will reject the transaction. For assets whose finalize = 0, new issuance actions can be issued in future transactions. These must use the same asset description, + \(\mathsf{asset\_desc}\) + , and can either maintain finalize = 0 or change it to finalize = 1, denoting the last transaction containing issuance of such custom asset.

    @@ -115,7 +150,9 @@ - + @@ -133,7 +170,7 @@ - + @@ -144,9 +181,15 @@

    Issuance Bundle

    An issuance bundle, IssueBundle, 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:

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

    The issuance bundle is then added within the transaction format as a new bundle. This structure will be added to the v6 transaction format.

    Variesasset_desc + \(\mathsf{asset\_desc}\) + byte Uni-code encoded string of varied size, up to 512 bytes
    1 bitfinalizefinalize boolean The boolean that determines the finality of the issuance of that asset
    @@ -173,9 +216,11 @@ - + - + @@ -188,87 +233,114 @@

    Issuance Protocol

    The issuer program performs the following operations

    -

    For all actions IssueAction: - encode asset_desc as 512 byte-string - compute AssetId as - \(GroupHash^{\mathbb{P}}(ik || asset_desc)\) - - set the finalize boolean as desired (if more more issuance actions are to be created for this asset identifier, set finalize = 0, otherwise set finalize = 1) - For each recipient i:

    -
    -

    System Message: ERROR/3 (zip-0227.rst line 174)

    -

    Unexpected indentation.

    -
    -
    -
      -
    • generate a ZSA output note as - \(\mathsf{ note_i =(d_i, {pk_d}_i, v_i, \rho_i, \psi_i, \mathsf{AssetId}, rcm_i)}\) -
    • -
    -
    -
    -

    System Message: WARNING/2 (zip-0227.rst line 175)

    -

    Block quote ends without a blank line; unexpected unindent.

    -
    +

    For all actions IssueAction:

      +
    • encode + \(\mathsf{asset\_desc}\) + as 512 byte-string
    • +
    • compute + \(\mathsf{AssetId}\) + as + \(GroupHash^{\mathbb{P}}(ik || asset_desc)\) +
    • +
    • set the finalize boolean as desired (if more more issuance actions are to be created for this asset identifier, set finalize = 0, otherwise set finalize = 1)
    • +
    • For each recipient i: +
        +
      • generate a ZSA output note as + \(\mathsf{ note_i =(d_i, {pk_d}_i, v_i, \rho_i, \psi_i, \mathsf{AssetId}, rcm_i)}\) +
      • +
      +
    • encode the IssueAction into the vector vIssueActions of the bundle
    -

    For the IssueBundle: - encode the vIssueActions vector - encode the ik as 32 byte-string - sign the SIGHASH of the transaction with the issuanceAuthorizingKey, isk, using the RedPallas signature scheme. The signature is then added to the issuance bundle.

    -

    NOTE that the commitment is not included in the IssuanceAction itsefl. As explained below, it is later computed by the validators and added to the NoteCommitmentTree.

    +

    For the IssueBundle:

    +
      +
    • encode the vIssueActions vector
    • +
    • encode the + \(\mathsf{ik}\) + as 32 byte-string
    • +
    • sign the SIGHASH of the transaction with the issuance authorizing key, + \(\mathsf{isk}\) + , using the RedPallas 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 later computed by the validators and added to the NoteCommitmentTree.

    -

    Concrete applications

    -

    Bridging Assets Issuers can wrap assets defined in other chains and issue them at once in a single transaction. The specifics of the bridge are not implemented in the protocol, but there are several ways we conceive issuers can build these bridges (at least centralized bridges): - First, the issuance and burn mechanism can be used in conjunction to determine the

    -

    Asset Features - By using the 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,

    -
    -

    System Message: ERROR/3 (zip-0227.rst line 194)

    -

    Unexpected indentation.

    -
    -
    -
      -
    • by setting finalize = 1 from the first issuance action for that asset type, 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.
    • -
    -
    -
    -

    System Message: WARNING/2 (zip-0227.rst line 195)

    -

    Block quote ends without a blank line; unexpected unindent.

    -
    +

    Concrete Applications

    +

    Bridging Assets Issuers can wrap assets defined in other chains and issue them at once in a single transaction. The specifics of the bridge are not implemented in the protocol, but there are several ways we conceive issuers can build these bridges (at least centralized bridges):

      -
    • -
      -
      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 AssetId, while at the same time setting finalize = 1, or by
      • -
      • issuing a transaction with a single note in the issuance action pertaining to that AssetId, where the note will contain a 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).
      • -
      -
      -
      +
    • First, the issuance and burn mechanism can be used in conjunction to determine the
    • +
    +

    Asset Features

    +
      +
    • By using the 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, +
        +
      • by setting finalize = 1 from the first issuance action for that asset type, 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}\) + , while at the same time setting 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 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).
      • +
    • -
    • Furthermore, NFT issuance is enabled by issuing in a single bundle several issuance actions, where each AssetId corresponds to value = 1 at the fundamental unit level. Issuers and users should make sure that finalize = 1 for each of the actions in this scenario.
    • +
    • Furthermore, NFT issuance is enabled by issuing in a single bundle several issuance actions, where each + \(\mathsf{AssetId}\) + corresponds to value = 1 at the fundamental unit level. Issuers and users should make sure that finalize = 1 for each of the actions in this scenario.

    Consensus Rule Changes

    -

    For the IssueBundle, - Verify the RedPallas-based issuance authorization signature on SIGHASH, authorization is valid, based on authorization.VerifySig(ik, SIGHASH)

    -

    For each IssueAction in IssueBundle: - check that asset_desc is a string with 0 < byte size <= 512 - retrieve AssetId from the first note in the sequence and check that AssetId = GroupHash^{mathbb{P}}(ik || asset_desc) is properly derived - check that the AssetId does not exist in the previously_finalized set in the global state - check that every note in the IssueAction contains the same AssetId and also that every note is of type Note and is properly constructed as - \(note = (\mathsf{g_d, pk_d, v, \rho, \psi, AssetId})\) -

    -

    If all of the above checks pass, do the following: - For each note, compute the note commitment as - \(cm = \mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, AssetId)}\) - and - add cm to the Merkle tree of note commitments, NoteCommitmentTree - If finalize = 1, add AssetId to the previously_finalized set in the global state

    +

    For the IssueBundle:

    +
      +
    • Verify the RedPallas-based issuance authorization signature on SIGHASH, authorization is valid, based on authorization.VerifySig(ik, SIGHASH)
    • +
    +

    For each IssueAction in IssueBundle:

    +
      +
    • check that + \(\mathsf{asset\_desc}\) + is a string with 0 < byte size <= 512
    • +
    • retrieve + \(\mathsf{AssetId}\) + from the first note in the sequence and check that + \(\mathsf{AssetId = GroupHash^{\mathbb{P}}(ik || asset\_desc)}\) + is properly derived
    • +
    • check that the + \(\mathsf{AssetId}\) + does not exist in the previously_finalized set in the global state
    • +
    • check that every note in the IssueAction contains the same + \(\mathsf{AssetId}\) + and also that every note is of type Note and is properly constructed as + \(note = (\mathsf{g_d, pk_d, v, \rho, \psi, AssetId})\) +
    • +
    +

    If all of the above checks pass, do the following:

    +
      +
    • For each note, compute the note commitment as + \(cm = \mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, AssetId)}\) + and
    • +
    • add cm to the Merkle tree of note commitments, NoteCommitmentTree
    • +
    • If finalize = 1, add + \(\mathsf{AssetId}\) + to the previously_finalized set in the global state
    • +

    Rationale

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

    • The issuance key structure was kept aligned to the original key tree in order to ease issuance integration with wallets and to prevent users from having to manage multiple keys and secrets.
    • -
    • -
      -
      the asset_desc is a general byte string in order to allow for a wide range of information type to be included that may be associated with the assets. Some are:
      -
      -
        -
      • links for storage such as for NFTs
      • -
      • other metadata for native assets
      • -
      • bridging information for wrapped assets (chain of origin, issuer name, etc)
      • -
      • information to be committed by the issuer, though not enforceable by the protocol
      • -
      -
      -
      +
    • The + \(\mathsf{asset\_desc}\) + is a general byte string in order to allow for a wide range of information type to be included that may be associated with the assets. Some are: +
        +
      • links for storage such as for NFTs
      • +
      • other metadata for native assets
      • +
      • bridging information for wrapped assets (chain of origin, issuer name, etc)
      • +
      • information to be committed by the issuer, though not enforceable by the protocol
      • +
    @@ -326,18 +398,32 @@

    System Message: WARNING/2 (zip-0227.rst line 195)

    Security and Privacy Considerations

    Issuer Key or AssetId Compromise

    -

    The design of this protocol does not allow for a rotation of the issuerValidatingKey, that would allow for replacing the key of a specific asset (see Future Work). In case of compromise, the following actions are recommended: - If an asset ID is compromised (and not the issuer verification key), the finalize boolean for that asset should be set to 0 and a new AssetId generated instead. - If an issuer verification key is compromised, the finalize boolean for all the assets issued with that key should be set to 0 and the issuer should change to a new spending key altogether (for the purpose of issuance), and issue new assets, each with a new AssetId.

    -

    Briding Assets 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 design of this protocol does not allow for a rotation of the issuer validating key, that would allow for replacing the key of a specific asset (see Future Work). In case of compromise, the following actions are recommended:

    +
      +
    • If an asset ID is compromised (and not the issuer verification key), the finalize boolean for that asset should be set to 0 and a new + \(\mathsf{AssetId}\) + generated instead.
    • +
    • If an issuer verification key is compromised, the finalize boolean for all the assets issued with that key should be set to 0 and the issuer should change to a new spending key altogether (for the purpose of issuance), 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 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.

    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 issuanceSupplyInfoMap from AssetId to issuanceSupplyInfoMap := (totalSupply, finalize) in order to properly keep track of the total supply for different asset types. This is useful for wallets and other applications that need to keep track of the total supply of assets.

    +

    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 issuanceSupplyInfoMap from + \(\mathsf{AssetId}\) + to + \(\mathsf{issuanceSupplyInfoMap := (totalSupply, finalize)}\) + in order to properly keep track of the total supply for different asset types. 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 317b 6.

    Future Work

    -

    In future versions of this ZIP, the protocol may also include a "key rotation" mechanism. This would allow an issuer to change the underlying ik of a given asset, in case the original one was compromised, without having to chance the asset identifier altogether.

    +

    In future versions of this ZIP, the protocol may also include a "key rotation" mechanism. This would allow an issuer to change the underlying + \(\mathsf{ik}\) + of a given asset, in case the original one was compromised, without having to chance the asset identifier altogether.

    Test Vectors

    diff --git a/zip-0227.rst b/zip-0227.rst index 9e7b4df9f..71021e636 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -25,7 +25,7 @@ The term "Orchard" in this document is to be interpreted as described in ZIP 224 We define the following additional terms: -- Custom Asset: A type of note that can be transferred on the Zcash block chain. ZEC is the default (and currently the only defined) asset for the Zcash mainnet. Different custom assets are defined and differentiated by their identifier (`AssetId`). +- Custom Asset: A type of note that can be transferred on the Zcash block chain. ZEC is the default (and currently the only defined) asset for the Zcash mainnet. Different custom assets are defined and differentiated by their identifier (:math:`\mathsf{AssetId}`). - Zcash Shielded Asset: an asset with issuance defined on the Zcash block chain, and, with this ZIP, belonging to the Orchard anonymity pool. - Wrapped Asset: a ZSA asset with native issuance defined outside the Zcash block chain. - Issuance Action: an instance of a single issuance of a Zcash Shielded Asset. It defines the issuance of a single asset identifier. @@ -52,13 +52,13 @@ The design presented in this ZIP enables issuance of shielded assets in various - The supply of the asset can be limited in advance or not. - The asset can be a wrapped version of an asset issued by another chain (as long as there is a bridge that supports transfer of that asset between chains). -See the Concrete Applications section for more details. +See the `Concrete Applications`_ section for more details. Requirements ============ -- Any user of the Zcash block chain can issue custom assets on chain -- The issuance mechanism should enable tracking publicly the supply of the assets on the Zcash block chain +- Any user of the Zcash block chain can issue custom assets on chain. +- The issuance mechanism should enable tracking publicly the supply of the assets on the Zcash block chain. - Issuing or changing the attributes of a specific asset should require cryptographic authorization. - The asset identification should be unique (among all shielded pools) and different issuer public keys should not be able to generate the same asset identifier. @@ -74,71 +74,74 @@ Overview This specification enables only *transparent* issuance, since as a first step, transparency is important to properly test the applications that will be most used in the Zcash ecosystem, while enabling tracking of supply of assets. Any user of the blockchain can issue new asset types, yet only a single issuer (a set of keys) can issue that specific asset type, as the asset identifiers are tied to the issuer keys. The protocol was designed with three main properties in mind: -- at the time of issuance, the issuer can already allocate all the tokens to the corresponding owners by creating the corresponding (shielded) output notes to the respective addresses. As is implied, the issuance mechanism is itself transparent, but the allocation is totally private -- in a single issuance bundle, the issuer can publish many issuance actions, or in other words, create multiple custom assets -- every issuance action contains the `finiteIssuance` boolean that defines whether that specific custom asset can have further tokens issued or not -The issuance mechanism is broad enough for issuers to either create native 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. In fact, the protocol described below enables what we hope will be a useful set of applications. The design decision is not to have a chosen name to describe the custom asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”. +- At the time of issuance, the issuer can already allocate all the tokens to the corresponding owners by creating the corresponding (shielded) output notes to the respective addresses. As is implied, the issuance mechanism is itself transparent, but the allocation is totally private. +- In a single issuance bundle, the issuer can publish many issuance actions, or in other words, create multiple custom assets. +- Every issuance action contains the ``finalize`` boolean that defines whether that specific custom asset can have further tokens issued or not. + +The issuance mechanism is broad enough for issuers to either create native 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. In fact, the protocol described below enables what we hope will be a useful set of applications. The design decision is not to have a chosen name to describe the custom asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”. Issuance Keys ------------- There are two keys relevant to the Issuer: -1. The `issuanceAuthorizingKey`, denoted as `isk`, is the key that is used to sign the issuance transaction. This key is used to authorize the issuance of a specific asset type, and is only used by the issuer. Throughout we also call this key the issuer signature key. +1. The issuance authorizing key, denoted as :math:`\mathsf{isk}`, is the key that is used to sign the issuance transaction. This key is used to authorize the issuance of a specific asset type, and is only used by the issuer. Throughout we also call this key the issuer signature key. -2. The `issuanceValidatingKey`, denoted as `ik`, is the key that is used to validate the issuance transaction. This key is used to validate the issuance of a specific asset type, and is used by all blockchain users (specifically the asset owners and consensus validators) to associate the asset in question with the issuer. Throughout we also call this key the issuer verification key. +2. The issuance validating key, denoted as :math:`\mathsf{ik}`, is the key that is used to validate the issuance transaction. This key is used to validate the issuance of a specific asset type, and is used by all blockchain users (specifically the asset owners and consensus validators) to associate the asset in question with the issuer. Throughout we also call this key the issuer verification key. -The two keys are derived in an analogous manner to the `spendAuthorizingKey` and `spendValidatingKey` keys, using the same signature scheme, as described in ZIP 32 [#zip-0032]_ and in accordance with ZIP 316 [#zip-0316]_. +The two keys are derived in an analogous manner to the spend authorizing key and spend validating key, using the same signature scheme, as described in ZIP 32 [#zip-0032]_ and in accordance with ZIP 316 [#zip-0316]_. -- The `issuanceAuthorizingKey` is derived directly from the `spendingKey`, `sk`, as a private signature key: +- The issuance authorizing key is derived directly from the spending key, :math:`\mathsf{sk}`, as a private signature key: -:math:`\mathsf{isk := ToScalar^{Orchard}(︀ PRF^{expand}_{sk} ([0x0a])}` +.. math:: \mathsf{isk := ToScalar^{Orchard}(︀ PRF^{expand}_{sk} ([0x0a])} -- The `issuanceValidatingKey` is derived from the `issuanceAuthorizingKey`, `isk`, as a public verification key: +- The issuance validating key is derived from the issuance authorizing key, :math:`\mathsf{isk}`, as a public verification key: -:math:`\mathsf{ik := SpendAuthSig^{Orchard}.DerivePublic(isk)}` +.. math:: \mathsf{ik := SpendAuthSig^{Orchard}.DerivePublic(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 [#zip-0032]_, and can further be in 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. Asset Identifier ---------------- -For every new asset, there must be a new and unique identifier of the asset. Every asset is defined by the asset description, `asset_desc`, which is a global byte string (valid across all -future- Zcash protocols). From this asset descritpion, the specific asset identifier, `AssetId`, is derived with a `GroupHash` and used within the output notes, as defined by the specific protocol (e.g.: for now Orchard-style, using Pallas curve). +For every new asset, there must be a new and unique identifier of the asset. Every asset is defined by the asset description, :math:`\mathsf{asset\_desc}`, which is a global byte string (valid across all -future- Zcash protocols). From this asset description, the specific asset identifier, :math:`\mathsf{AssetId}`, is derived with a `GroupHash` and used within the output notes, as defined by the specific protocol (e.g.: for now Orchard-style, using Pallas curve). -The main requirement for the asset identifier is for it to be collision-free, as two different issuers MUST not be able to issue the same asset type. One way to achieve this is to make the identifier dependent on the issuer keys, as the issuer keys are unique to each issuer. We achieve this by deriving the asset identifier, `AssetId` as follows: +The main requirement for the asset identifier is for it to be collision-free, as two different issuers MUST not be able to issue the same asset type. One way to achieve this is to make the identifier dependent on the issuer keys, as the issuer keys are unique to each issuer. We achieve this by deriving the asset identifier, :math:`\mathsf{AssetId}` as follows: -:math:`\mathsf{AssetId := GroupHash^{\mathbb{P}}}\mathsf{(ik || asset_desc)}` +:math:`\mathsf{AssetId := GroupHash^{\mathbb{P}}}\mathsf{(ik || asset\_desc)}` where -- `asset_desc` is the asset description, a UTF-8 encoded string of up to 512 bytes, which includes any information pertaining to the issuance -- `issuanceValidatingKey` is the public key of the issuer, used to verify the signature on the transaction SIGHASH and is defined as `ik` +- :math:`\mathsf{asset\_desc}` is the asset description, a UTF-8 encoded string of up to 512 bytes, which includes any information pertaining to the issuance +- :math:`\mathsf{ik}` is the issuance validating key of the issuer, used to verify the signature on the transaction SIGHASH and is defined above Global Issuance State --------------------- Issuance requires the following additions to the global state: -- `previously_finalized`, a set of `AssetId` that have been finalized (i.e.: the `finalize` flag has been set to `1`). + +- ``previously_finalized``, a set of :math:`\mathsf{AssetId}` that have been finalized (i.e.: the ``finalize`` flag has been set to ``1``). Issuance Action Description --------------------------- An issuance action, `IssueAction`, is the instance of issuing a specific custom asset, and contains the following fields: -- `asset_desc`: the asset description, a UTF-8 encoded string of up to 512 bytes + +- :math:`\mathsf{asset\_desc}`: the asset description, a UTF-8 encoded string of up to 512 bytes - `notes`: an array containing the unencrypted output notes of the recipients of the asset, of type `Note` -- `finalize`: a boolean that defines whether the issuance of that specific custom asset is finalized or not +- ``finalize``: a boolean that defines whether the issuance of that specific custom asset is finalized or not -Once `finiteSupply` is set to 1, it cannot be unset. For assets whose `finalize = 1`, no further tokens can be issued, so as seen below, the validators will reject the transaction. For assets whose `finalize = 0`, new issuance actions can be issued in future transactions. These must use the same asset description, `asset_desc`, and can either maintain `finalize = 0` or change it to `1`, denoting the last transaction containing issuance of such custom asset. +Once ``finalize`` is set to 1, it cannot be unset. For assets whose ``finalize = 1``, no further tokens can be issued, so as seen below, the validators will reject the transaction. For assets whose ``finalize = 0``, new issuance actions can be issued in future transactions. These must use the same asset description, :math:`\mathsf{asset\_desc}`, and can either maintain ``finalize = 0`` or change it to ``finalize = 1``, denoting the last transaction containing issuance of such custom asset. -================= ================== ========================== ======================================================================== -Size Name Data Type Description -================= ================== ========================== ======================================================================== -Varies asset_desc byte Uni-code encoded string of varied size, up to 512 bytes -Varies nNotes compactSize The number of notes in the issuance action -noteSize * nNotes vNotes Note[nNotes] A sequence of note descriptions within the issuance action -1 bit finalize boolean The boolean that determines the finality of the issuance of that asset -================= ================== ========================== ======================================================================== +================= =============================== ========================== ======================================================================== +Size Name Data Type Description +================= =============================== ========================== ======================================================================== +Varies :math:`\mathsf{asset\_desc}` byte Uni-code encoded string of varied size, up to 512 bytes +Varies nNotes compactSize The number of notes in the issuance action +noteSize * nNotes vNotes Note[nNotes] A sequence of note descriptions within the issuance action +1 bit ``finalize`` boolean The boolean that determines the finality of the issuance of that asset +================= =============================== ========================== ======================================================================== 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. @@ -147,79 +150,93 @@ Issuance Bundle An issuance bundle, `IssueBundle`, 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: -- `ik`: the `issuanceValidatingKey`, that allows the validators to verify that the `AssetId` is properly associated with the issuer -- `actions`: an array of issuance actions, of type `IssueAction` -- `authorization`: the signature of the transaction SIGHASH, signed by the `issuanceAuthorizingKey`, `isk`, that validates the issuance +- :math:`\mathsf{ik}`: the issuance validating key, that allows the validators to verify that the :math:`\mathsf{AssetId}` is properly associated with the issuer. +- `actions`: an array of issuance actions, of type `IssueAction`. +- `authorization`: the signature of the transaction SIGHASH, signed by the issuance authorizing key, :math:`\mathsf{isk}`, that validates the issuance . The issuance bundle is then added within the transaction format as a new bundle. This structure will be added to the v6 transaction format. -======= ================== ========================== ========================================================================= +======= ==================== ========================== ========================================================================= Bytes Name Data Type Description -======= ================== ========================== ========================================================================= -Varies nIssueActions compactSize The number of issuance actions in the bundle -Varies vIssueActions IssueAction[nIssueActions] A sequence of issuance actions descriptions -32 ik byte[32] The public verification key of the issuer, used to validate the signature -64 authorization byte[64] The signature of the transaction SIGHASH, signed by the issuer -======= ================== ========================== ========================================================================= +======= ==================== ========================== ========================================================================= +Varies nIssueActions compactSize The number of issuance actions in the bundle +Varies vIssueActions IssueAction[nIssueActions] A sequence of issuance actions descriptions +32 :math:`\mathsf{ik}` byte[32] The issuance validating key of the issuer, used to validate the signature +64 authorization byte[64] The signature of the transaction SIGHASH, signed by the issuer +======= ==================== ========================== ========================================================================= Issuance Protocol ----------------- The issuer program performs the following operations For all actions `IssueAction`: -- encode `asset_desc` as 512 byte-string -- compute `AssetId` as :math:`GroupHash^{\mathbb{P}}(ik || asset_desc)` -- set the `finalize` boolean as desired (if more more issuance actions are to be created for this asset identifier, set `finalize = 0`, otherwise set `finalize = 1`) -- For each recipient `i`: + +- encode :math:`\mathsf{asset\_desc}` as 512 byte-string +- compute :math:`\mathsf{AssetId}` as :math:`GroupHash^{\mathbb{P}}(ik || asset_desc)` +- set the ``finalize`` boolean as desired (if more more issuance actions are to be created for this asset identifier, set ``finalize = 0``, otherwise set ``finalize = 1``) +- For each recipient ``i``: + - generate a ZSA output note as :math:`\mathsf{ note_i =(d_i, {pk_d}_i, v_i, \rho_i, \psi_i, \mathsf{AssetId}, rcm_i)}` + - encode the `IssueAction` into the vector `vIssueActions` of the bundle For the `IssueBundle`: + - encode the `vIssueActions` vector -- encode the `ik` as 32 byte-string -- sign the `SIGHASH` of the transaction with the `issuanceAuthorizingKey`, `isk`, using the RedPallas signature scheme. The signature is then added to the issuance bundle. +- encode the :math:`\mathsf{ik}` as 32 byte-string +- sign the `SIGHASH` of the transaction with the issuance authorizing key, :math:`\mathsf{isk}`, using the RedPallas signature scheme. The signature is then added to the issuance bundle. -NOTE that the commitment is not included in the `IssuanceAction` itsefl. 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 later computed by the validators and added to the `NoteCommitmentTree`. -Concrete applications +Concrete Applications --------------------- **Bridging Assets** Issuers can wrap assets defined in other chains and issue them at once in a single transaction. The specifics of the bridge are not implemented in the protocol, but there are several ways we conceive issuers can build these bridges (at least centralized bridges): + - First, the issuance and burn mechanism can be used in conjunction to determine the **Asset Features** -- By using the `finalize` boolean and the burning mechanism defined in [#zip-0226]_, issuers can control the supply production of any asset associated to their issuer keys. For example, - - by setting `finalize = 1` from the first issuance action for that asset type, 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. + +- By using the ``finalize`` boolean and the burning mechanism defined in [#zip-0226]_, issuers can control the supply production of any asset associated to their issuer keys. For example, + + - by setting ``finalize = 1`` from the first issuance action for that asset type, 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 `AssetId`, while at the same time setting `finalize = 1`, or by - - issuing a transaction with a single note in the issuance action pertaining to that `AssetId`, where the note will contain a `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). -- Furthermore, NFT issuance is enabled by issuing in a single bundle several issuance actions, where each `AssetId` corresponds to `value = 1` at the fundamental unit level. Issuers and users should make sure that `finalize = 1` for each of the actions in this scenario. + + - issuing a last set of tokens of that specific :math:`\mathsf{AssetId}`, while at the same time setting ``finalize = 1``, or by + - issuing a transaction with a single note in the issuance action pertaining to that :math:`\mathsf{AssetId}`, where the note will contain a ``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). + +- Furthermore, NFT issuance is enabled by issuing in a single bundle several issuance actions, where each :math:`\mathsf{AssetId}` corresponds to ``value = 1`` at the fundamental unit level. Issuers and users should make sure that ``finalize = 1`` for each of the actions in this scenario. Consensus Rule Changes ---------------------- -For the IssueBundle, +For the IssueBundle: + - Verify the RedPallas-based issuance authorization signature on `SIGHASH`, `authorization` is valid, based on `authorization.VerifySig(ik, SIGHASH)` For each `IssueAction` in `IssueBundle`: -- check that `asset_desc` is a string with `0 < byte size <= 512` -- retrieve `AssetId` from the first note in the sequence and check that `AssetId = GroupHash^{\mathbb{P}}(ik || asset_desc)` is properly derived -- check that the `AssetId` does not exist in the `previously_finalized` set in the global state -- check that every note in the `IssueAction` contains the same `AssetId` and also that every note is of type `Note` and is properly constructed as :math:`note = (\mathsf{g_d, pk_d, v, \rho, \psi, AssetId})` + +- check that :math:`\mathsf{asset\_desc}` is a string with `0 < byte size <= 512` +- retrieve :math:`\mathsf{AssetId}` from the first note in the sequence and check that :math:`\mathsf{AssetId = GroupHash^{\mathbb{P}}(ik || asset\_desc)}` is properly derived +- check that the :math:`\mathsf{AssetId}` does not exist in the ``previously_finalized`` set in the global state +- check that every note in the `IssueAction` contains the same :math:`\mathsf{AssetId}` and also that every note is of type `Note` and is properly constructed as :math:`note = (\mathsf{g_d, pk_d, v, \rho, \psi, AssetId})` If all of the above checks pass, do the following: + - For each note, compute the note commitment as :math:`cm = \mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, AssetId)}` and - add `cm` to the Merkle tree of note commitments, `NoteCommitmentTree` -- If `finalize = 1`, add `AssetId` to the `previously_finalized` set in the global state +- If ``finalize = 1``, add :math:`\mathsf{AssetId}` to the ``previously_finalized`` set in the global state Rationale ========= The following is a list of rationale for different decisions made in the proposal: - The issuance key structure was kept aligned to the original key tree in order to ease issuance integration with wallets and to prevent users from having to manage multiple keys and secrets. -- the `asset_desc` is a general byte string in order to allow for a wide range of information type to be included that may be associated with the assets. Some are: +- The :math:`\mathsf{asset\_desc}` is a general byte string in order to allow for a wide range of information type to be included that may be associated with the assets. Some are: + - links for storage such as for NFTs - other metadata for native assets - bridging information for wrapped assets (chain of origin, issuer name, etc) @@ -305,11 +322,12 @@ Security and Privacy Considerations **Issuer Key or AssetId Compromise** -The design of this protocol does not allow for a rotation of the `issuerValidatingKey`, that would allow for replacing the key of a specific asset (see Future Work). In case of compromise, the following actions are recommended: -- If an asset ID is compromised (and not the issuer verification key), the `finalize` boolean for that asset should be set to `0` and a new `AssetId` generated instead. -- If an issuer verification key is compromised, the `finalize` boolean for all the assets issued with that key should be set to `0` and the issuer should change to a new spending key altogether (for the purpose of issuance), and issue new assets, each with a new `AssetId`. +The design of this protocol does not allow for a rotation of the issuer validating key, that would allow for replacing the key of a specific asset (see Future Work). In case of compromise, the following actions are recommended: -**Briding Assets** +- If an asset ID is compromised (and not the issuer verification key), the ``finalize`` boolean for that asset should be set to `0` and a new :math:`\mathsf{AssetId}` generated instead. +- If an issuer verification key is compromised, the ``finalize`` boolean for all the assets issued with that key should be set to `0` and the issuer should change to a new spending key altogether (for the purpose of issuance), and issue new assets, each with a new :math:`\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 [#zip-0226]_. 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 @@ -318,7 +336,7 @@ 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 `issuanceSupplyInfoMap` from `AssetId` to `issuanceSupplyInfoMap := (totalSupply, finalize)` in order to properly keep track of the total supply for different asset types. This is useful for wallets and other applications that need to keep track of the total supply of assets. +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 `issuanceSupplyInfoMap` from :math:`\mathsf{AssetId}` to :math:`\mathsf{issuanceSupplyInfoMap := (totalSupply, finalize)}` in order to properly keep track of the total supply for different asset types. This is useful for wallets and other applications that need to keep track of the total supply of assets. Fee Structures -------------- @@ -328,7 +346,7 @@ The fee mechanism described in this ZIP will follow the mechanism described in Z Future Work ----------- -In future versions of this ZIP, the protocol may also include a "key rotation" mechanism. This would allow an issuer to change the underlying `ik` of a given asset, in case the original one was compromised, without having to chance the asset identifier altogether. +In future versions of this ZIP, the protocol may also include a "key rotation" mechanism. This would allow an issuer to change the underlying :math:`\mathsf{ik}` of a given asset, in case the original one was compromised, without having to chance the asset identifier altogether. Test Vectors ============ From b009b51b63dbc18f1b9e959760c1a08b37d1c026 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Mon, 19 Dec 2022 23:43:25 +0530 Subject: [PATCH 028/101] typographical improvements in ZIP 226 --- zip-0226.html | 48 ++++++++++++++++++++++++++++++++++-------------- zip-0226.rst | 33 ++++++++++++++------------------- 2 files changed, 48 insertions(+), 33 deletions(-) diff --git a/zip-0226.html b/zip-0226.html index 52511a770..7be5a5656 100644 --- a/zip-0226.html +++ b/zip-0226.html @@ -26,7 +26,9 @@

    The term "Orchard" in this document is to be interpreted as described in ZIP 224 3.

    We define the following additional terms:

      -
    • Asset: A type of note that can be transferred on the Zcash block chain, identified by the AssetId parameter. +
    • Asset: A type of note that can be transferred on the Zcash block chain, identified by the + \(\mathsf{AssetId}\) + parameter.
      • ZEC is the default (and currently the only defined) asset for the Zcash mainnet.
      @@ -34,7 +36,9 @@
    • Zcash Shielded Asset: an Asset with issuance defined on the Zcash block chain, and, for now, belonging to the Orchard shielded pool.
    • Wrapped Asset: a Zcash Shielded Asset with native issuance defined outside the Zcash block chain.
    • Native Asset: a Zcash Shielded Asset created uniquely within the Zcash block chain.
    • -
    • Split Note: a Zcash Shielded Asset spend note that is used within an Action to ensure the output note of that Action is of a specific AssetId. The Split Note is not spent in the transaction.
    • +
    • Split Note: a Zcash Shielded Asset spend note that is used within an Action to ensure the output note of that Action is of a specific + \(\mathsf{AssetId}\) + . The Split Note is not spent in the transaction.
    • Split Action: a Zcash Shielded Asset Action that contains a Split Note.
    @@ -45,7 +49,7 @@

    The current Orchard protocol does not support custom assets. Enabling multi-asset support on the Zcash chain will open the door for a host of applications and enhance the ecosystem with application developers and asset custody institutions for issuance and bridging purposes.

    Overview

    -

    In order to be able to represent different Asset identifiers in Orchard, we need to define a new data field that uniquely represents the AssetId of the Asset in question, which we call +

    In order to be able to represent different Asset identifiers in Orchard, we need to define a new data field that uniquely represents the identifier of the Asset in question, which we call \(\mathsf{AssetId}\) .

    The asset identifier will be used to enforce the balance of an Action Description 6 is preserved across Assets (see the Orchard Binding Signature 7), and by extension the balance of an Orchard transaction. That is, the sum of all the @@ -62,8 +66,12 @@ \(\mathsf{AssetId}\) identifier an auxiliary input to the proof, represented already as a point in the Pallas curve. The circuit then should check that the same \(\mathsf{AssetId}\) - is used in the old note commitment, in the new note commitment and in the value commitment as the base point of the value. This ensures that (1) the input and output notes are of the same AssetId, and (2) that only actions with the same asset identifier will balance out in the binding and balance signature.

    -

    In order to ensure the security of the transfers, and as we will explain below, we are replacing input dummy notes for custom assets, as we need to enforce that the AssetId of the output note of that split action is the output of a PRF.

    + is used in the old note commitment, in the new note commitment and in the value commitment as the base point of the value. This ensures that (1) the input and output notes are of the same + \(\mathsf{AssetId}\) + , and (2) that only actions with the same asset identifier will balance out in the binding and balance signature.

    +

    In order to ensure the security of the transfers, and as we will explain below, we are replacing input dummy notes for custom assets, as we need to enforce that the + \(\mathsf{AssetId}\) + of the output note of that split action is the output of a PRF.

    Finally, in this ZIP we also describe the burn mechanism, which is a direct extension of the transfer mechanism. The burn process uses a similar mechanism than what is used in Orchard to unshield ZEC, by using the \(\mathsf{valueBalance}\) of the asset in question. Burning assets is useful for many purposes, including bridging of wrapped assets and removing supply of native assets.

    @@ -71,7 +79,9 @@

    Specification

    Most of the protocol is kept the same as the Orchard protocol released with NU5, except for the following.

    Asset Identifiers

    -

    For every new asset, there must be a new and unique identifier of the asset. Every asset is defined by the asset description, asset_desc, which is a global byte string (valid across all -future- Zcash protocols). From this asset description, the specific asset identifier, +

    For every new asset, there must be a new and unique identifier of the asset. Every asset is defined by the asset description, + \(\mathsf{asset\_desc}\) + , which is a global byte string (valid across all -future- Zcash protocols). From this asset description, the specific asset identifier, \(\mathsf{AssetId}\) , is derived with a GroupHash and used within the output notes, as defined by the specific protocol (e.g.: for now Orchard-style, using Pallas curve).

    This @@ -172,15 +182,21 @@

    Note that this is enough to create a chain of induction that ensures that all output notes of a transfer are actual outputs of a GroupHash, preventing any malleability attacks, as they originate in the Issuance protocol, which is publicly verified. Furthermore, we do not care about whether the note is owned by the sender, or whether it was nullified before. Wallets and other clients have a choice to make to ensure the asset identifier is the preserved for the output note of a split Action, for the value balance verification:

    1. The split input note could be the same note as the original (non-split) Action,
    2. -
    3. The split input note could be a different unspent note of the same AssetId (note that the note will not actually be spent)
    4. -
    5. The split input note could be an already spent note of the same AssetId (note that by zeroing the value in the circuit, we prevent double spending)
    6. +
    7. The split input note could be a different unspent note of the same + \(\mathsf{AssetId}\) + (note that the note will not actually be spent)
    8. +
    9. The split input note could be an already spent note of the same + \(\mathsf{AssetId}\) + (note that by zeroing the value in the circuit, we prevent double spending)

    The specific circuit changes are presented below.

    Circuit Statement

    The advantage of the design described above, with respect to the circuit statement, is that every ZSA Action statement is kept closely similar to the Orchard Action statement 13, except for a few additions that ensure the security of the asset identifier system.

    -

    Asset Identifier Equality: the following constraints must be added to ensure that the input and output note are of the same AssetId:

    +

    Asset Identifier Equality: the following constraints must be added to ensure that the input and output note are of the same + \(\mathsf{AssetId}\) + :

    • The asset identifier, \(\mathsf{AssetId}\) @@ -217,10 +233,10 @@
    • -
      Add a boolean “split” variable as an auxiliary witness. This variable is to be activated split = 1 if the Action in question is a split and split = 0 if the Action is actually spending an input note:
      +
      Add a boolean split variable as an auxiliary witness. This variable is to be activated split = 1 if the Action in question is a split and split = 0 if the Action is actually spending an input note:
        -
      • If split = 1 then set v' = 0 otherwise v'=v^old from the auxiliary input
      • +
      • If split = 1 then set v' = 0 otherwise v'=v^old from the auxiliary input
      @@ -253,7 +269,7 @@ as \(\mathsf{nf_old = DeriveNullifier_nk}(\rho^\mathsf{old}, \psi', \mathsf{cm^old})\)
    • -
    • if split = 1 set +
    • if split = 1 set \(\psi' = \mathsf{randomSample}\) , otherwise set \(\psi' = \psi^{old}\) @@ -323,7 +339,9 @@ \(\mathsf{assetBurn = [(v^{AssetId}, AssetId)}| \forall \mathsf{AssetId} \textit{ s.t.}\mathsf{v^{AssetId}\neq 0}]\)

      The value balances for each asset identifier in assetBurn represents the amount of that asset identifier that is being burnt. In the case of ZEC, the value balance represents either the transaction fee, or the amount of ZEC changing anonymity pools (to Sapling or Transparent).

      -

      Finally, the validator needs to verify the Balance and Binding Signature by adding the value balances for all assets, as committed using their respective AssetId as the value base point of the Pedersen Commitment. This is done as follows

      +

      Finally, the validator needs to verify the Balance and Binding Signature by adding the value balances for all assets, as committed using their respective + \(\mathsf{AssetId}\) + as the value base point of the Pedersen Commitment. This is done as follows

      \(\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} - \sum_{\forall \mathsf{AssetId}\textit{ s.t. }\mathsf{v^{AssetId}\neq 0}} \mathsf{ValueCommit_0^{ORchardZSA}(v^{AssetId}, AssetId) } = \sum \mathsf{rcv_{i,j}^{net}}\mathcal{R}^{\mathsf{Orchard}}\)

      @@ -356,7 +374,9 @@
    32ik + \(\mathsf{ik}\) + byte[32]The public verification key of the issuer, used to validate the signatureThe issuance validating key of the issuer, used to validate the signature
    64
    -

    And in terms of the action size, the ZSA action size differs from the Orchard action size by 32 bytes (given by the addition of the AssetId). This implies that the size goes from 820 bytes in the Orchard action to 852 bytes in the ZSA action.

    +

    And in terms of the action size, the ZSA action size differs from the Orchard action size by 32 bytes (given by the addition of the + \(\mathsf{AssetId}\) + ). This implies that the size goes from 820 bytes in the Orchard action to 852 bytes in the ZSA action.

    Other Considerations

    Transaction Fees

    diff --git a/zip-0226.rst b/zip-0226.rst index 9f310016e..280204e60 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -26,14 +26,14 @@ The term "Orchard" in this document is to be interpreted as described in ZIP 224 We define the following additional terms: -- Asset: A type of note that can be transferred on the Zcash block chain, identified by the `AssetId` parameter. +- Asset: A type of note that can be transferred on the Zcash block chain, identified by the :math:`\mathsf{AssetId}` parameter. - ZEC is the default (and currently the only defined) asset for the Zcash mainnet. - Zcash Shielded Asset: an Asset with issuance defined on the Zcash block chain, and, for now, belonging to the Orchard shielded pool. - Wrapped Asset: a Zcash Shielded Asset with native issuance defined outside the Zcash block chain. - Native Asset: a Zcash Shielded Asset created uniquely within the Zcash block chain. -- Split Note: a Zcash Shielded Asset spend note that is used within an Action to ensure the output note of that Action is of a specific `AssetId`. The Split Note is not spent in the transaction. +- Split Note: a Zcash Shielded Asset spend note that is used within an Action to ensure the output note of that Action is of a specific :math:`\mathsf{AssetId}`. The Split Note is not spent in the transaction. - Split Action: a Zcash Shielded Asset Action that contains a Split Note. Abstract @@ -50,15 +50,15 @@ The current Orchard protocol does not support custom assets. Enabling multi-asse Overview ======== -In order to be able to represent different Asset identifiers in Orchard, we need to define a new data field that uniquely represents the `AssetId` of the Asset in question, which we call :math:`\mathsf{AssetId}`. +In order to be able to represent different Asset identifiers in Orchard, we need to define a new data field that uniquely represents the identifier of the Asset in question, which we call :math:`\mathsf{AssetId}`. The asset identifier will be used to enforce the balance of an Action Description [#protocol-actions]_ is preserved across Assets (see the Orchard Binding Signature [#protocol-binding]_), and by extension the balance of an Orchard transaction. That is, the sum of all the :math:`\mathsf{value^{net}}` from each Action Description, computed as :math:`\mathsf{value^{old}-value^{new}}`, must be balanced **only with respect to the same Asset identifier**. This is specially important since we will allow different Action Descriptions to transfer notes of different Asset identifiers, where the overall balance is checked without revealing which Assets (or how many different identifiers) are being transferred. As was initially proposed by Jack Grigg and Daira Hopwood [#initial-zsa-issue]_, we propose to make this happen by changing the value base point, :math:`\mathcal{V}^{\mathsf{Orchard}}`, in the Homomorphic Pedersen Commitment that generates the value commitment, :math:`\mathsf{cv^{net}}`, of the *net value* in an Orchard Action. -Because in a single transaction all value commitments are balanced, there must be as many different value base points as there are asset identifiers in the transaction. We propose to make the :math:`\mathsf{AssetId}` identifier an auxiliary input to the proof, represented already as a point in the Pallas curve. The circuit then should check that the same :math:`\mathsf{AssetId}` is used in the old note commitment, in the new note commitment **and** in the value commitment as the base point of the value. This ensures that (1) the input and output notes are of the same `AssetId`, and (2) that only actions with the same asset identifier will balance out in the binding and balance signature. +Because in a single transaction all value commitments are balanced, there must be as many different value base points as there are asset identifiers in the transaction. We propose to make the :math:`\mathsf{AssetId}` identifier an auxiliary input to the proof, represented already as a point in the Pallas curve. The circuit then should check that the same :math:`\mathsf{AssetId}` is used in the old note commitment, in the new note commitment **and** in the value commitment as the base point of the value. This ensures that (1) the input and output notes are of the same :math:`\mathsf{AssetId}`, and (2) that only actions with the same asset identifier will balance out in the binding and balance signature. -In order to ensure the security of the transfers, and as we will explain below, we are replacing input dummy notes for custom assets, as we need to enforce that the `AssetId` of the output note of that split action is the output of a PRF. +In order to ensure the security of the transfers, and as we will explain below, we are replacing input dummy notes for custom assets, as we need to enforce that the :math:`\mathsf{AssetId}` of the output note of that split action is the output of a PRF. Finally, in this ZIP we also describe the *burn* mechanism, which is a direct extension of the transfer mechanism. The burn process uses a similar mechanism than what is used in Orchard to unshield ZEC, by using the :math:`\mathsf{valueBalance}` of the asset in question. Burning assets is useful for many purposes, including bridging of wrapped assets and removing supply of native assets. @@ -70,7 +70,7 @@ Most of the protocol is kept the same as the Orchard protocol released with NU5, Asset Identifiers ----------------- -For every new asset, there must be a new and unique identifier of the asset. Every asset is defined by the asset description, `asset_desc`, which is a global byte string (valid across all -future- Zcash protocols). From this asset description, the specific asset identifier, :math:`\mathsf{AssetId}`, is derived with a `GroupHash` and used within the output notes, as defined by the specific protocol (e.g.: for now Orchard-style, using Pallas curve). +For every new asset, there must be a new and unique identifier of the asset. Every asset is defined by the asset description, :math:`\mathsf{asset\_desc}`, which is a global byte string (valid across all -future- Zcash protocols). From this asset description, the specific asset identifier, :math:`\mathsf{AssetId}`, is derived with a `GroupHash` and used within the output notes, as defined by the specific protocol (e.g.: for now Orchard-style, using Pallas curve). This :math:`\mathsf{AssetId}` will be the base point of the value commitment for the specific custom asset. Note that the :math:`\mathsf{AssetId}` of the ZEC asset will be kept as the original value base-point, :math:`\mathcal{V}^\mathsf{Orchard}`. @@ -91,10 +91,8 @@ In this case, the instance of the note commitment scheme, :math:`\mathsf{NoteCom Since the commitment output is still indistinguishable with the original Orchard ZEC note commitments, by definition of the Sinsemilla hash, ZSA note commitments will be added to the same Merkle Commitment Tree. In essence, we have - :math:`\mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, AssetId)} \in \{\mathsf{cm},\bot\}` - The nullifier is generated in the same manner as in the Orchard protocol. Value Commitment @@ -116,10 +114,8 @@ being transferred. In the case of the ZSA protocol, the value of different asset identifiers in a given transaction will be committed using a **different value base point**. This enables the final balance of the transaction to be securely computed, such that each asset identifier is balanced independently, as the assets are not meant to be fungible. The value commitment then becomes - :math:`\mathsf{cv^{net}:=ValueCommit^{OrchardZSA}_{rcv}(v^{net}_{AssetId},\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}})}:= \mathsf{[v^{net}_{AssetId}]}\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}}+[\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}}` - where :math:`\mathsf{v^{net}_{AssetId}} = \mathsf{v^{old}_{AssetId} - v^{new}_{AssetId}}` such that :math:`\mathsf{v^*_{AssetId}}` is the value of the note of identifier :math:`\mathsf{AssetId}`, and .. _`value base`: @@ -143,7 +139,6 @@ Then the verifier MUST compute :math:`\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} = \sum \mathsf{rcv_{i}^{net}}\mathcal{R}^{\mathsf{Orchard}}` - And uses it to verify the binding signature, as described in §4.14 of the Zcash Specification [#protocol-binding]_, by verifying the `bindingSignature` on the `SIGHASH` message. As in the Orchard protocol, the binding signature verification key, :math:`\mathsf{bvk}`, will only be valid (and hence verify the signature correctly), as long as the committed values sum to zero. In contrast, in this protocol, the committed values only sum to zero **per Asset identifier**, as the Pedersen commitments add up homomorphically only with respect to the same value base point. @@ -161,8 +156,8 @@ will be zeroed in split Actions and the nullifier will be randomized, making the Note that this is enough to create a chain of induction that ensures that all output notes of a transfer are actual outputs of a GroupHash, preventing any malleability attacks, as they originate in the Issuance protocol, which is publicly verified. Furthermore, we do not care about whether the note is owned by the sender, or whether it was nullified before. Wallets and other clients have a choice to make to ensure the asset identifier is the preserved for the output note of a split Action, for the value balance verification: 1. The split input note could be the same note as the original (non-split) Action, -2. The split input note could be a different unspent note of the same `AssetId` (note that the note will not actually be spent) -3. The split input note could be an already spent note of the same `AssetId` (note that by zeroing the value in the circuit, we prevent double spending) +2. The split input note could be a different unspent note of the same :math:`\mathsf{AssetId}` (note that the note will not actually be spent) +3. The split input note could be an already spent note of the same :math:`\mathsf{AssetId}` (note that by zeroing the value in the circuit, we prevent double spending) The specific circuit changes are presented below. @@ -172,7 +167,7 @@ Circuit Statement The advantage of the design described above, with respect to the circuit statement, is that every *ZSA Action statement* is kept closely similar to the Orchard Action statement [#protocol-actionstatement]_, except for a few additions that ensure the security of the asset identifier system. **Asset Identifier Equality:** the following constraints must be added to ensure that the input and output note are of the -same `AssetId`: +same :math:`\mathsf{AssetId}`: - The asset identifier, :math:`\mathsf{AssetId}`, for the note is witnessed once, as an auxiliary input. - The witnessed asset identifier, :math:`\mathsf{AssetId}`, is added to the old note commitment input. @@ -187,13 +182,13 @@ same `AssetId`: - The Value Commitment Integrity should be changed - Replace the input note value by a generic value, `v'`, as :math:`\mathsf{cv^net} = \mathsf{ValueCommit_rcv^OrchardZSA(v’ - v^new, AssetId)}` -- Add a boolean “split” variable as an auxiliary witness. This variable is to be activated `split = 1` if the Action in question is a split and `split = 0` if the Action is actually spending an input note: - - If `split = 1` then set `v' = 0` otherwise `v'=v^old` from the auxiliary input +- Add a boolean ``split`` variable as an auxiliary witness. This variable is to be activated ``split = 1`` if the Action in question is a split and ``split = 0`` if the Action is actually spending an input note: + - If ``split = 1`` then set `v' = 0` otherwise `v'=v^old` from the auxiliary input - The Merkle Path Validity should check the existance of the note commitment as usual (and not like with dummy notes): - Check that (path, pos) is a valid Merkle path of depth :math:`\mathsf{MerkleDepth^Orchard}`, from :math:`\mathsf{cm^old}` to the anchor :math:`\mathsf{rt^Orchard}`. - The Nullifier Integrity will be changed to prevent the identification of notes - Replace the :math:`\psi_{old}` value with a generic :math:`\psi'` as :math:`\mathsf{nf_old = DeriveNullifier_nk}(\rho^\mathsf{old}, \psi', \mathsf{cm^old})` - - if `split = 1` set :math:`\psi' = \mathsf{randomSample}`, otherwise set :math:`\psi' = \psi^{old}` + - if ``split = 1`` set :math:`\psi' = \mathsf{randomSample}`, otherwise set :math:`\psi' = \psi^{old}` **Enabling Backwards Compatibility with ZEC Notes:** the following constraints must be added to enable backwards compatibility with the Orchard ZEC notes. @@ -232,7 +227,7 @@ For every custom asset that is burnt, we add to the `assetBurn` vector the tuple The value balances for each asset identifier in `assetBurn` represents the amount of that asset identifier that is being burnt. In the case of ZEC, the value balance represents either the transaction fee, or the amount of ZEC changing anonymity pools (to Sapling or Transparent). -Finally, the validator needs to verify the Balance and Binding Signature by adding the value balances for all assets, as committed using their respective `AssetId` as the value base point of the Pedersen Commitment. This is done as follows +Finally, the validator needs to verify the Balance and Binding Signature by adding the value balances for all assets, as committed using their respective :math:`\mathsf{AssetId}` as the value base point of the Pedersen Commitment. This is done as follows :math:`\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} - \sum_{\forall \mathsf{AssetId}\textit{ s.t. }\mathsf{v^{AssetId}\neq 0}} \mathsf{ValueCommit_0^{ORchardZSA}(v^{AssetId}, AssetId) } = \sum \mathsf{rcv_{i,j}^{net}}\mathcal{R}^{\mathsf{Orchard}}` @@ -253,7 +248,7 @@ Similar to version 5 transaction format, with the following modifications to the | | | | 8 bytes of valueBalance | +-----------------+-------------+-----------------------------------+-------------------------+ -And in terms of the action size, the ZSA action size differs from the Orchard action size by 32 bytes (given by the addition of the `AssetId`). This implies that the size goes from 820 bytes in the Orchard action to 852 bytes in the ZSA action. +And in terms of the action size, the ZSA action size differs from the Orchard action size by 32 bytes (given by the addition of the :math:`\mathsf{AssetId}`). This implies that the size goes from 820 bytes in the Orchard action to 852 bytes in the ZSA action. Other Considerations ==================== From 820cfaecdb87b9c199c392fdeb2346a7ed66dad4 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Tue, 20 Dec 2022 01:27:57 +0530 Subject: [PATCH 029/101] resolving open comments from PR#628 --- zip-0226.html | 34 ++++++++++++++++++---------------- zip-0226.rst | 28 ++++++++++++++++------------ 2 files changed, 34 insertions(+), 28 deletions(-) diff --git a/zip-0226.html b/zip-0226.html index 7be5a5656..f13d867f0 100644 --- a/zip-0226.html +++ b/zip-0226.html @@ -36,17 +36,17 @@
  • Zcash Shielded Asset: an Asset with issuance defined on the Zcash block chain, and, for now, belonging to the Orchard shielded pool.
  • Wrapped Asset: a Zcash Shielded Asset with native issuance defined outside the Zcash block chain.
  • Native Asset: a Zcash Shielded Asset created uniquely within the Zcash block chain.
  • -
  • Split Note: a Zcash Shielded Asset spend note that is used within an Action to ensure the output note of that Action is of a specific +
  • Split Input: an Action input identifying a Zcash Shielded Asset note, used to ensure that the output note of that Action is of a validly issued \(\mathsf{AssetId}\) - . The Split Note is not spent in the transaction.
  • -
  • Split Action: a Zcash Shielded Asset Action that contains a Split Note.
  • + when there is no corresponding real input note to spend. The Action does not spend the note identified by the Split Input. +
  • Split Action: a Zcash Shielded Asset Action that contains a Split Input.
  • Abstract

    ZIP 226 and ZIP 227 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 5. The transfer and burn of such assets is defined in ZIP 226 4.

    Motivation

    -

    The current Orchard protocol does not support custom assets. Enabling multi-asset support on the Zcash chain will open the door for a host of applications and enhance the ecosystem with application developers and asset custody institutions for issuance and bridging purposes.

    +

    The current Orchard protocol does not support custom assets. Enabling multi-asset support on the Zcash chain will open the door for a host of applications, and enhance the ecosystem with application developers and asset custody institutions for issuance and bridging purposes.

    Overview

    In order to be able to represent different Asset identifiers in Orchard, we need to define a new data field that uniquely represents the identifier of the Asset in question, which we call @@ -157,9 +157,9 @@ .

    Value Balance Verification

    -

    In order to verify the balance of the different assets, verifier performs exactly the same the process as for the Orchard protocol 7. The main reason is because no custom assets can be unshielded, so all custom assets are contained within the shielded ZSA pool. This means that the net balance of the input and output values is zero, with only one asset identifier of value balance published, that of ZEC, +

    In order to verify the balance of the different assets, verifier performs exactly the same the process as for the Orchard protocol 7. The main reason why no changes to this process are needed is that no custom assets can be unshielded, so all custom assets are contained within the shielded ZSA pool. This means that the net balance of the input and output values is zero, with only one asset identifier of value balance published, that of ZEC, \(\mathsf{v^{balanceOrchard}}\) - , so no net amount of any asset identifier will be revealed, and neither the nnumber of asset identifiers in the transaction. The only exception to this is in the case that an asset is burnt, as we will see below in the burn mechanism.

    + . No net amount of any other asset identifier will be revealed, and the number of asset identifiers in the transaction is also hidden. The only exception to this is in the case that an asset is burnt, as we will see below in the burn mechanism.

    For a total of \(n\) actions in a transfer, the prover can still sign the SIGHASH of the transaction using the binding signature key

    @@ -170,24 +170,26 @@

    \(\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} = \sum \mathsf{rcv_{i}^{net}}\mathcal{R}^{\mathsf{Orchard}}\)

    -

    And uses it to verify the binding signature, as described in §4.14 of the Zcash Specification 7, by verifying the bindingSignature on the SIGHASH message.

    +

    and use it to verify the bindingSignature on the SIGHASH message, as described in §4.14 of the Zcash Specification 7.

    As in the Orchard protocol, the binding signature verification key, \(\mathsf{bvk}\) , will only be valid (and hence verify the signature correctly), as long as the committed values sum to zero. In contrast, in this protocol, the committed values only sum to zero per Asset identifier, as the Pedersen commitments add up homomorphically only with respect to the same value base point.

    Split Notes

    One of the key functionalities in a UTXO-based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This requires a 1-to-many (Orchard) transaction. However, because each Action represents an input and an output, the resulting transaction must have multiple inputs. In order to cope with this today, the Actions that have not been assigned input notes are instead given dummy spend notes 12, which we call split Actions and split notes respectively. Basically, the input note is “faked” inside of the proof in order to hide which Action contains the real spend note.

    -

    This, however, brings some issues when it comes to adding multiple asset identifiers, as the output note of the split Actions cannot be of any asset identifier, it must be enforced to be an actual output of a GroupHash computation (in fact we want it to be of the same identifier as the original input note, but the binding signature takes care that the proper balancing is performed). If not, then the prover could essentially input a multiple (or linear combination of) an existing identifier, with the goal to attack the network by overflowing the ZEC value balance and hence counterfeiting ZEC funds.

    +

    This, however, brings some issues when it comes to adding multiple Asset identifiers, as the output note of the split Actions cannot be of any Asset identifier, it must be enforced to be an actual output of a GroupHash computation (in fact we want it to be of the same identifier as the original input note, but the binding signature takes care that the proper balancing is performed). If not, then the prover could essentially input a multiple (or linear combination) of an existing identifier, with the goal to attack the network by overflowing the ZEC value balance and hence counterfeiting ZEC funds.

    In order to prevent this, we make some modifications to the circuit. Specifically we remove the dummy note functionality for custom assets and we enforce that every input note to an ZSA Action must be proven to exist in the set of note commitments in the Merkle Tree. We then enforce this real note to be “unspendable” in the sense that its value will be zeroed in split Actions and the nullifier will be randomized, making the note not spendable in the specific Action. Then, the proof itself ensures that the output note is of the same identifier as the input note. In the circuit, the split note functionality will be activated by a boolean private input to the proof.

    -

    Note that this is enough to create a chain of induction that ensures that all output notes of a transfer are actual outputs of a GroupHash, preventing any malleability attacks, as they originate in the Issuance protocol, which is publicly verified. Furthermore, we do not care about whether the note is owned by the sender, or whether it was nullified before. Wallets and other clients have a choice to make to ensure the asset identifier is the preserved for the output note of a split Action, for the value balance verification:

    +

    This creates a chain of induction that ensures that the value base points of all output notes of a transfer are actual outputs of a GroupHash, as they originate in the Issuance protocol which is publicly verified. If this were not done then it would be possible to violate balance, for example by using a value base point derived from those of other Assets.

    +

    Note that we do not care about whether the note identified by a Split Input is owned by the sender, or whether it was nullified before.

    +

    Wallets and other clients have a choice to make to ensure the Asset type is preserved for the output note of a Split Action:

      -
    1. The split input note could be the same note as the original (non-split) Action,
    2. -
    3. The split input note could be a different unspent note of the same +
    4. The Split Input note could be another note of the same asset identifier that is being spent by this transaction (but not by this Split Input).
    5. +
    6. The Split Input note could be a different unspent note of the same \(\mathsf{AssetId}\) - (note that the note will not actually be spent)
    7. -
    8. The split input note could be an already spent note of the same + (note that the note will not actually be spent).
    9. +
    10. The Split Input note could be an already spent note of the same \(\mathsf{AssetId}\) - (note that by zeroing the value in the circuit, we prevent double spending)
    11. + (note that by zeroing the value in the circuit, we prevent double spending).

    The specific circuit changes are presented below.

    @@ -213,11 +215,11 @@
  • The fixed-base multiplication constraints between the value and the value base point of the value commitment, \(\mathsf{cv}\) , is replaced with a variable-base multiplication between the two.
  • -
  • The witness to the value base-point, as defined in the value base equation is the auxiliary input +
  • The witness to the value base point, as defined in the value base equation is the auxiliary input \(\mathsf{AssetId}\) .
  • -

    Enforce Secure Identifier for Split Actions: the following constraints must be added to prevent senders from changing the asset identifier for the output note in the Split Actions:

    +

    Enforce Secure Identifier for Split Actions: the following constraints must be added to prevent senders from changing the asset identifier for the output note in a Split Action:

    • diff --git a/zip-0226.rst b/zip-0226.rst index 280204e60..06e916dd3 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -33,8 +33,8 @@ We define the following additional terms: - Zcash Shielded Asset: an Asset with issuance defined on the Zcash block chain, and, for now, belonging to the Orchard shielded pool. - Wrapped Asset: a Zcash Shielded Asset with native issuance defined outside the Zcash block chain. - Native Asset: a Zcash Shielded Asset created uniquely within the Zcash block chain. -- Split Note: a Zcash Shielded Asset spend note that is used within an Action to ensure the output note of that Action is of a specific :math:`\mathsf{AssetId}`. The Split Note is not spent in the transaction. -- Split Action: a Zcash Shielded Asset Action that contains a Split Note. +- Split Input: an Action input identifying a Zcash Shielded Asset note, used to ensure that the output note of that Action is of a validly issued :math:`\mathsf{AssetId}` when there is no corresponding real input note to spend. The Action does not spend the note identified by the Split Input. +- Split Action: a Zcash Shielded Asset Action that contains a Split Input. Abstract ======== @@ -46,7 +46,7 @@ in ZIP 227 [#zip-0227]_. The transfer and burn of such assets is defined in ZIP Motivation ========== -The current Orchard protocol does not support custom assets. Enabling multi-asset support on the Zcash chain will open the door for a host of applications and enhance the ecosystem with application developers and asset custody institutions for issuance and bridging purposes. +The current Orchard protocol does not support custom assets. Enabling multi-asset support on the Zcash chain will open the door for a host of applications, and enhance the ecosystem with application developers and asset custody institutions for issuance and bridging purposes. Overview ======== @@ -129,7 +129,7 @@ Where :math:`\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{ZEC}} =\mathcal{V}^{\mat Value Balance Verification -------------------------- -In order to verify the balance of the different assets, verifier performs exactly the same the process as for the Orchard protocol [#protocol-binding]_. The main reason is because no custom assets can be unshielded, so all custom assets are contained within the shielded ZSA pool. This means that the net balance of the input and output values is zero, with only one asset identifier of value balance published, that of ZEC, :math:`\mathsf{v^{balanceOrchard}}`, so no net amount of any asset identifier will be revealed, and neither the nnumber of asset identifiers in the transaction. The only exception to this is in the case that an asset is *burnt*, as we will see below in the `burn mechanism`_. +In order to verify the balance of the different assets, verifier performs exactly the same the process as for the Orchard protocol [#protocol-binding]_. The main reason why no changes to this process are needed is that no custom assets can be unshielded, so all custom assets are contained within the shielded ZSA pool. This means that the net balance of the input and output values is zero, with only one asset identifier of value balance published, that of ZEC, :math:`\mathsf{v^{balanceOrchard}}`. No net amount of any other asset identifier will be revealed, and the number of asset identifiers in the transaction is also hidden. The only exception to this is in the case that an asset is *burnt*, as we will see below in the `burn mechanism`_. For a total of :math:`n` actions in a transfer, the prover can still sign the `SIGHASH` of the transaction using the binding signature key @@ -139,7 +139,7 @@ Then the verifier MUST compute :math:`\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} = \sum \mathsf{rcv_{i}^{net}}\mathcal{R}^{\mathsf{Orchard}}` -And uses it to verify the binding signature, as described in §4.14 of the Zcash Specification [#protocol-binding]_, by verifying the `bindingSignature` on the `SIGHASH` message. +and use it to verify the `bindingSignature` on the `SIGHASH` message, as described in §4.14 of the Zcash Specification [#protocol-binding]_. As in the Orchard protocol, the binding signature verification key, :math:`\mathsf{bvk}`, will only be valid (and hence verify the signature correctly), as long as the committed values sum to zero. In contrast, in this protocol, the committed values only sum to zero **per Asset identifier**, as the Pedersen commitments add up homomorphically only with respect to the same value base point. @@ -148,16 +148,20 @@ Split Notes One of the key functionalities in a UTXO-based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This requires a 1-to-many (Orchard) transaction. However, because each Action represents an input and an output, the resulting transaction must have multiple inputs. In order to cope with this today, the Actions that have not been assigned input notes are instead given *dummy spend notes* [#protocol-dummynotes]_, which we call split Actions and split notes respectively. Basically, the input note is “faked” inside of the proof in order to hide which Action contains the *real* spend note. -This, however, brings some issues when it comes to adding multiple asset identifiers, as the output note of the split Actions *cannot* be of *any* asset identifier, it must be enforced to be an actual output of a GroupHash computation (in fact we want it to be of the same identifier as the original input note, but the binding signature takes care that the proper balancing is performed). If not, then the prover could essentially input a multiple (or linear combination of) an existing identifier, with the goal to attack the network by overflowing the ZEC value balance and hence counterfeiting ZEC funds. +This, however, brings some issues when it comes to adding multiple Asset identifiers, as the output note of the split Actions *cannot* be of *any* Asset identifier, it must be enforced to be an actual output of a GroupHash computation (in fact we want it to be of the same identifier as the original input note, but the binding signature takes care that the proper balancing is performed). If not, then the prover could essentially input a multiple (or linear combination) of an existing identifier, with the goal to attack the network by overflowing the ZEC value balance and hence counterfeiting ZEC funds. In order to prevent this, we make some modifications to the circuit. Specifically we remove the dummy note functionality for custom assets and we enforce that *every* input note to an ZSA Action must be proven to exist in the set of note commitments in the Merkle Tree. We then enforce this real note to be “unspendable” in the sense that its value will be zeroed in split Actions and the nullifier will be randomized, making the note not spendable in the specific Action. Then, the proof itself ensures that the output note is of the same identifier as the input note. In the circuit, the split note functionality will be activated by a boolean private input to the proof. -Note that this is enough to create a chain of induction that ensures that all output notes of a transfer are actual outputs of a GroupHash, preventing any malleability attacks, as they originate in the Issuance protocol, which is publicly verified. Furthermore, we do not care about whether the note is owned by the sender, or whether it was nullified before. Wallets and other clients have a choice to make to ensure the asset identifier is the preserved for the output note of a split Action, for the value balance verification: +This creates a chain of induction that ensures that the value base points of all output notes of a transfer are actual outputs of a GroupHash, as they originate in the Issuance protocol which is publicly verified. If this were not done then it would be possible to violate balance, for example by using a value base point derived from those of other Assets. -1. The split input note could be the same note as the original (non-split) Action, -2. The split input note could be a different unspent note of the same :math:`\mathsf{AssetId}` (note that the note will not actually be spent) -3. The split input note could be an already spent note of the same :math:`\mathsf{AssetId}` (note that by zeroing the value in the circuit, we prevent double spending) +Note that we do not care about whether the note identified by a Split Input is owned by the sender, or whether it was nullified before. + +Wallets and other clients have a choice to make to ensure the Asset type is preserved for the output note of a Split Action: + +1. The Split Input note could be another note of the same asset identifier that is being spent by this transaction (but not by this Split Input). +2. The Split Input note could be a different unspent note of the same :math:`\mathsf{AssetId}` (note that the note will not actually be spent). +3. The Split Input note could be an already spent note of the same :math:`\mathsf{AssetId}` (note that by zeroing the value in the circuit, we prevent double spending). The specific circuit changes are presented below. @@ -176,9 +180,9 @@ same :math:`\mathsf{AssetId}`: **Correct Value Commitment:** the following constraints must be added to ensure that the value commitment is computed using the witnessed identifier, as represented in the notes - The fixed-base multiplication constraints between the value and the value base point of the value commitment, :math:`\mathsf{cv}`, is replaced with a variable-base multiplication between the two. -- The witness to the value base-point, as defined in the `value base`_ equation is the auxiliary input :math:`\mathsf{AssetId}`. +- The witness to the value base point, as defined in the `value base`_ equation is the auxiliary input :math:`\mathsf{AssetId}`. -**Enforce Secure Identifier for Split Actions:** the following constraints must be added to prevent senders from changing the asset identifier for the output note in the Split Actions: +**Enforce Secure Identifier for Split Actions:** the following constraints must be added to prevent senders from changing the asset identifier for the output note in a Split Action: - The Value Commitment Integrity should be changed - Replace the input note value by a generic value, `v'`, as :math:`\mathsf{cv^net} = \mathsf{ValueCommit_rcv^OrchardZSA(v’ - v^new, AssetId)}` From fa9809aa10ebf789ac87f15104344a93832a77ad Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Tue, 20 Dec 2022 12:53:24 +0530 Subject: [PATCH 030/101] resolving open comments from PR#628 --- zip-0227.html | 25 ++++++++++++------------- zip-0227.rst | 14 +++++++------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/zip-0227.html b/zip-0227.html index 2c4965635..0ef84b541 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -24,19 +24,18 @@

      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 "Zcash Shielded Asset" and "Wrapped Asset" in this document are to be interpreted as described in ZIP 226 4.

      We define the following additional terms:

      • Custom Asset: A type of note that can be transferred on the Zcash block chain. ZEC is the default (and currently the only defined) asset for the Zcash mainnet. Different custom assets are defined and differentiated by their identifier ( \(\mathsf{AssetId}\) ).
      • -
      • Zcash Shielded Asset: an asset with issuance defined on the Zcash block chain, and, with this ZIP, belonging to the Orchard anonymity pool.
      • -
      • Wrapped Asset: a ZSA asset with native issuance defined outside the Zcash block chain.
      • Issuance Action: an instance of a single issuance of a Zcash Shielded Asset. It defines the issuance of a single asset identifier.
      • Issuance Bundle: the bundle in the transaction that contains all the issuance actions of that transaction.

    Abstract

    -

    ZIP 226 4 and ZIP 227 5 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 5. 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, as it produces notes that can only be transferred under ZSA.

    +

    ZIP 226 4 and ZIP 227 5 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 5. 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.

    Motivation

    The Orchard protocol deployed in NU5 does not support custom assets. Enabling multi-asset support on the Zcash chain will open the door for a host of applications and enhance the ecosystem with application developers and asset custody institutions for issuance and bridging purposes.

    @@ -62,14 +61,14 @@

    Specification

    As explained, the issuance protocol allows for a single issuance action to be sent to many receivers, by generating as many output notes as distinct recipients. Furthermore, every bundle can contain many issuance actions.

    Overview

    -

    This specification enables only transparent issuance, since as a first step, transparency is important to properly test the applications that will be most used in the Zcash ecosystem, while enabling tracking of supply of assets. Any user of the blockchain can issue new asset types, yet only a single issuer (a set of keys) can issue that specific asset type, as the asset identifiers are tied to the issuer keys.

    +

    This specification enables only transparent issuance, since as a first step, transparency is important to properly test the applications that will be most used in the Zcash ecosystem, while enabling tracking of supply of assets. Any user of the block chain can issue new asset types, yet only a single issuer (a set of keys) can issue that specific asset type, as the asset identifiers are tied to the issuer keys.

    The protocol was designed with three main properties in mind:

    • At the time of issuance, the issuer can already allocate all the tokens to the corresponding owners by creating the corresponding (shielded) output notes to the respective addresses. As is implied, the issuance mechanism is itself transparent, but the allocation is totally private.
    • In a single issuance bundle, the issuer can publish many issuance actions, or in other words, create multiple custom assets.
    • Every issuance action contains the finalize boolean that defines whether that specific custom asset can have further tokens issued or not.
    -

    The issuance mechanism is broad enough for issuers to either create native 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. In fact, the protocol described below enables what we hope will be a useful set of applications. The design decision is not to have a chosen name to describe the custom asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”.

    +

    The issuance mechanism is broad enough for issuers to either create native 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. In fact, the protocol described below enables what we hope will be a useful set of applications. The design decision is not to have a chosen name to describe the custom asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”.

    Issuance Keys

    There are two keys relevant to the Issuer:

    @@ -79,9 +78,9 @@ , is the key that is used to sign the issuance transaction. This key is used to authorize the issuance of a specific asset type, and is only used by the issuer. Throughout we also call this key the issuer signature key.
  • The issuance validating key, denoted as \(\mathsf{ik}\) - , is the key that is used to validate the issuance transaction. This key is used to validate the issuance of a specific asset type, and is used by all blockchain users (specifically the asset owners and consensus validators) to associate the asset in question with the issuer. Throughout we also call this key the issuer verification key.
  • + , is the key that is used to validate the issuance transaction. This key is used to validate the issuance of a specific asset type, and is used by all block chain users (specifically the asset owners and consensus validators) to associate the asset in question with the issuer. Throughout we also call this key the issuer verification key. -

    The two keys are derived in an analogous manner to the spend authorizing key and spend validating key, using the same signature scheme, as described in ZIP 32 7 and in accordance with ZIP 316 8.

    +

    The two keys are derived in an analogous manner to the spend authorizing key and spend validating key, using the same signature scheme, as described in ZIP 32 7 and in accordance with ZIP 316 8.

    • The issuance authorizing key is derived directly from the spending key, \(\mathsf{sk}\) @@ -94,14 +93,14 @@ , as a public verification key:
    \(\mathsf{ik := SpendAuthSig^{Orchard}.DerivePublic(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 7, and can further be in 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.

    +

    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 7, and can further be in 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.

    Asset Identifier

    For every new asset, there must be a new and unique identifier of the asset. Every asset is defined by the asset description, \(\mathsf{asset\_desc}\) - , which is a global byte string (valid across all -future- Zcash protocols). From this asset description, the specific asset identifier, + , which is a global byte string (valid across all -future- Zcash shielded protocols). From this asset description, the specific asset identifier, \(\mathsf{AssetId}\) - , is derived with a GroupHash and used within the output notes, as defined by the specific protocol (e.g.: for now Orchard-style, using Pallas curve).

    + , is derived with a GroupHash and used within the output notes, as defined by the specific protocol (e.g. for now Orchard-style, using Pallas curve).

    The main requirement for the asset identifier is for it to be collision-free, as two different issuers MUST not be able to issue the same asset type. One way to achieve this is to make the identifier dependent on the issuer keys, as the issuer keys are unique to each issuer. We achieve this by deriving the asset identifier, \(\mathsf{AssetId}\) as follows:

    @@ -272,7 +271,7 @@

    Asset Features

      -
    • By using the 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, +
    • By using the 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,
      • by setting finalize = 1 from the first issuance action for that asset type, 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.
      @@ -407,7 +406,7 @@ \(\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 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.

    +

    Bridging Assets 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.

    Other Considerations

    Implementing Zcash Nodes

    @@ -418,7 +417,7 @@ in order to properly keep track of the total supply for different asset types. 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 317b 6.

    +

    The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317b 6.

    Future Work

    In future versions of this ZIP, the protocol may also include a "key rotation" mechanism. This would allow an issuer to change the underlying diff --git a/zip-0227.rst b/zip-0227.rst index 71021e636..ba78e7419 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -23,18 +23,18 @@ The term "network upgrade" in this document is to be interpreted as described in The term "Orchard" in this document is to be interpreted as described in ZIP 224 [#zip-0224]_. +The terms "Zcash Shielded Asset" and "Wrapped Asset" in this document are to be interpreted as described in ZIP 226 [#zip-0226]_. + We define the following additional terms: - Custom Asset: A type of note that can be transferred on the Zcash block chain. ZEC is the default (and currently the only defined) asset for the Zcash mainnet. Different custom assets are defined and differentiated by their identifier (:math:`\mathsf{AssetId}`). -- Zcash Shielded Asset: an asset with issuance defined on the Zcash block chain, and, with this ZIP, belonging to the Orchard anonymity pool. -- Wrapped Asset: a ZSA asset with native issuance defined outside the Zcash block chain. - Issuance Action: an instance of a single issuance of a Zcash Shielded Asset. It defines the issuance of a single asset identifier. - Issuance Bundle: the bundle in the transaction that contains all the issuance actions of that transaction. Abstract ======== -ZIP 226 [#zip-0226]_ and ZIP 227 [#zip-0227]_ 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 [#zip-0227]_. The transfer and burn of such assets is defined in ZIP 226 [#zip-0226]_. This ZIP must only be implemented in conjuction with ZIP 226 [#zip-0226]_, as the issuance mechanism is only valid for the ZSA transfer protocol, as it produces notes that can only be transferred under ZSA. +ZIP 226 [#zip-0226]_ and ZIP 227 [#zip-0227]_ 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 [#zip-0227]_. The transfer and burn of such assets is defined in ZIP 226 [#zip-0226]_. This ZIP must only be implemented in conjuction with ZIP 226 [#zip-0226]_, as the issuance mechanism is only valid for the ZSA transfer protocol, because it produces notes that can only be transferred under ZSA. Motivation ========== @@ -71,7 +71,7 @@ As explained, the issuance protocol allows for a single issuance action to be se Overview -------- -This specification enables only *transparent* issuance, since as a first step, transparency is important to properly test the applications that will be most used in the Zcash ecosystem, while enabling tracking of supply of assets. Any user of the blockchain can issue new asset types, yet only a single issuer (a set of keys) can issue that specific asset type, as the asset identifiers are tied to the issuer keys. +This specification enables only *transparent* issuance, since as a first step, transparency is important to properly test the applications that will be most used in the Zcash ecosystem, while enabling tracking of supply of assets. Any user of the block chain can issue new asset types, yet only a single issuer (a set of keys) can issue that specific asset type, as the asset identifiers are tied to the issuer keys. The protocol was designed with three main properties in mind: @@ -79,7 +79,7 @@ The protocol was designed with three main properties in mind: - In a single issuance bundle, the issuer can publish many issuance actions, or in other words, create multiple custom assets. - Every issuance action contains the ``finalize`` boolean that defines whether that specific custom asset can have further tokens issued or not. -The issuance mechanism is broad enough for issuers to either create native 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. In fact, the protocol described below enables what we hope will be a useful set of applications. The design decision is not to have a chosen name to describe the custom asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”. +The issuance mechanism is broad enough for issuers to either create native 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. In fact, the protocol described below enables what we hope will be a useful set of applications. The design decision is not to have a chosen name to describe the custom asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”. Issuance Keys ------------- @@ -88,7 +88,7 @@ There are two keys relevant to the Issuer: 1. The issuance authorizing key, denoted as :math:`\mathsf{isk}`, is the key that is used to sign the issuance transaction. This key is used to authorize the issuance of a specific asset type, and is only used by the issuer. Throughout we also call this key the issuer signature key. -2. The issuance validating key, denoted as :math:`\mathsf{ik}`, is the key that is used to validate the issuance transaction. This key is used to validate the issuance of a specific asset type, and is used by all blockchain users (specifically the asset owners and consensus validators) to associate the asset in question with the issuer. Throughout we also call this key the issuer verification key. +2. The issuance validating key, denoted as :math:`\mathsf{ik}`, is the key that is used to validate the issuance transaction. This key is used to validate the issuance of a specific asset type, and is used by all block chain users (specifically the asset owners and consensus validators) to associate the asset in question with the issuer. Throughout we also call this key the issuer verification key. The two keys are derived in an analogous manner to the spend authorizing key and spend validating key, using the same signature scheme, as described in ZIP 32 [#zip-0032]_ and in accordance with ZIP 316 [#zip-0316]_. @@ -105,7 +105,7 @@ This allows the issuer to use the same wallet it usually uses to transfer assets Asset Identifier ---------------- -For every new asset, there must be a new and unique identifier of the asset. Every asset is defined by the asset description, :math:`\mathsf{asset\_desc}`, which is a global byte string (valid across all -future- Zcash protocols). From this asset description, the specific asset identifier, :math:`\mathsf{AssetId}`, is derived with a `GroupHash` and used within the output notes, as defined by the specific protocol (e.g.: for now Orchard-style, using Pallas curve). +For every new asset, there must be a new and unique identifier of the asset. Every asset is defined by the asset description, :math:`\mathsf{asset\_desc}`, which is a global byte string (valid across all -future- Zcash shielded protocols). From this asset description, the specific asset identifier, :math:`\mathsf{AssetId}`, is derived with a `GroupHash` and used within the output notes, as defined by the specific protocol (e.g. for now Orchard-style, using Pallas curve). The main requirement for the asset identifier is for it to be collision-free, as two different issuers MUST not be able to issue the same asset type. One way to achieve this is to make the identifier dependent on the issuer keys, as the issuer keys are unique to each issuer. We achieve this by deriving the asset identifier, :math:`\mathsf{AssetId}` as follows: From 0d9528ede6090c96870fe2187f7995d0dfcdab3e Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Sat, 24 Dec 2022 11:09:38 +0530 Subject: [PATCH 031/101] resolving comments from PR#628 --- zip-0226.html | 136 ++++++++++++++++++++++++++------------------------ zip-0226.rst | 98 ++++++++++++++++++------------------ 2 files changed, 119 insertions(+), 115 deletions(-) diff --git a/zip-0226.html b/zip-0226.html index f13d867f0..49b626eef 100644 --- a/zip-0226.html +++ b/zip-0226.html @@ -30,7 +30,7 @@ \(\mathsf{AssetId}\) parameter.

      -
    • ZEC is the default (and currently the only defined) asset for the Zcash mainnet.
    • +
    • ZEC is the default (and currently the only defined) Asset for the Zcash mainnet.
  • Zcash Shielded Asset: an Asset with issuance defined on the Zcash block chain, and, for now, belonging to the Orchard shielded pool.
  • @@ -43,16 +43,16 @@

    Abstract

    -

    ZIP 226 and ZIP 227 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 5. The transfer and burn of such assets is defined in ZIP 226 4.

    +

    ZIP 226 and ZIP 227 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 5. The transfer and burn of such Assets is defined in ZIP 226 4.

    Motivation

    -

    The current Orchard protocol does not support custom assets. Enabling multi-asset support on the Zcash chain will open the door for a host of applications, and enhance the ecosystem with application developers and asset custody institutions for issuance and bridging purposes.

    +

    The current Orchard protocol does not support custom Assets. Enabling multi-asset support on the Zcash chain will open the door for a host of applications, and enhance the ecosystem with application developers and Asset custody institutions for issuance and bridging purposes.

    Overview

    In order to be able to represent different Asset identifiers in Orchard, we need to define a new data field that uniquely represents the identifier of the Asset in question, which we call \(\mathsf{AssetId}\) .

    -

    The asset identifier will be used to enforce the balance of an Action Description 6 is preserved across Assets (see the Orchard Binding Signature 7), and by extension the balance of an Orchard transaction. That is, the sum of all the +

    The Asset identifier will be used to enforce the balance of an Action Description 6 is preserved across Assets (see the Orchard Binding Signature 7), and by extension the balance of an Orchard transaction. That is, the sum of all the \(\mathsf{value^{net}}\) from each Action Description, computed as \(\mathsf{value^{old}-value^{new}}\) @@ -62,62 +62,64 @@ , in the Homomorphic Pedersen Commitment that generates the value commitment, \(\mathsf{cv^{net}}\) , of the net value in an Orchard Action.

    -

    Because in a single transaction all value commitments are balanced, there must be as many different value base points as there are asset identifiers in the transaction. We propose to make the +

    Because in a single transaction all value commitments are balanced, there must be as many different value base points as there are Asset identifiers in the transaction. We propose to make the \(\mathsf{AssetId}\) - identifier an auxiliary input to the proof, represented already as a point in the Pallas curve. The circuit then should check that the same + identifier an auxiliary input to the proof for each Action, represented already as a point on the Pallas curve. The circuit then should check that the same \(\mathsf{AssetId}\) - is used in the old note commitment, in the new note commitment and in the value commitment as the base point of the value. This ensures that (1) the input and output notes are of the same + is used in the old note commitment, in the new note commitment and as the base point + \(\mathcal{V}^\mathsf{Orchard}\) + in the value commitment. This ensures (1) that the input and output notes are of the same \(\mathsf{AssetId}\) - , and (2) that only actions with the same asset identifier will balance out in the binding and balance signature.

    -

    In order to ensure the security of the transfers, and as we will explain below, we are replacing input dummy notes for custom assets, as we need to enforce that the + , and (2) that only actions with the same Asset identifier will balance out in the binding and balance signatures.

    +

    In order to ensure the security of the transfers, and as we will explain below, we are redefining input dummy notes for custom Assets, as we need to enforce that the \(\mathsf{AssetId}\) - of the output note of that split action is the output of a PRF.

    -

    Finally, in this ZIP we also describe the burn mechanism, which is a direct extension of the transfer mechanism. The burn process uses a similar mechanism than what is used in Orchard to unshield ZEC, by using the + of the output note of that split Action is the output of a PRF.

    +

    Finally, in this ZIP we also describe the burn mechanism, which is a direct extension of the transfer mechanism. The burn process uses a similar mechanism to what is used in Orchard to unshield ZEC, by using the \(\mathsf{valueBalance}\) - of the asset in question. Burning assets is useful for many purposes, including bridging of wrapped assets and removing supply of native assets.

    + of the Asset in question. Burning Assets is useful for many purposes, including bridging of Wrapped Assets and removing supply of Native Assets.

    Specification

    Most of the protocol is kept the same as the Orchard protocol released with NU5, except for the following.

    Asset Identifiers

    -

    For every new asset, there must be a new and unique identifier of the asset. Every asset is defined by the asset description, +

    For every new Asset, there must be a new and unique identifier of the Asset. Every Asset is defined by the Asset description, \(\mathsf{asset\_desc}\) - , which is a global byte string (valid across all -future- Zcash protocols). From this asset description, the specific asset identifier, + , which is a global byte string (valid across all -future- Zcash protocols). From this Asset description the specific Asset identifier, \(\mathsf{AssetId}\) , is derived with a GroupHash and used within the output notes, as defined by the specific protocol (e.g.: for now Orchard-style, using Pallas curve).

    This \(\mathsf{AssetId}\) - will be the base point of the value commitment for the specific custom asset. Note that the + will be the base point of the value commitment for the specific custom Asset. Note that the \(\mathsf{AssetId}\) - of the ZEC asset will be kept as the original value base-point, + of the ZEC Asset will be kept as the original value base point, \(\mathcal{V}^\mathsf{Orchard}\) .

    -

    In future network and protocol upgrades, the same asset description string can be carried on, with potentially a mapping into a different curve or group. In that case, the turnstile should know how to transform the asset identifier, +

    In future network and protocol upgrades, the same Asset description string can be carried on, with potentially a mapping into a different shielded protocol. In that case, the turnstile should know how to transform the Asset identifier, \(\mathsf{AssetId}\) - , from one group to another one.

    + , from one shielded protocol to another.

    Note Structure & Commitment

    -

    First, we need to adapt the components that define the assets, i.e.: notes. A ZSA note differs from an Orchard note by including the identifier of asset, +

    First, we need to adapt the components that define the Assets, i.e.: notes. A ZSA note differs from an Orchard note by including the identifier of the Asset, \(\mathsf{AssetId}\) - . So an ZSA note looks like:

    + . So a ZSA note looks like:

    \((\mathsf{g_d, pk_d, v, \rho, \psi, AssetId})\)

    Where \(\mathsf{AssetId}\) - is the unique random group element that identifies each asset in the Pallas curve 8, 9 of the Orchard protocol.

    + is the unique random element of the Pallas group 8 that identifies each Asset in the Orchard protocol.

    In this case, the instance of the note commitment scheme, \(\mathsf{NoteCommit^{OrchardZSA}_{rcm}}\) , will differ from \(\mathsf{NoteCommit^{Orchard}_{rcm}}\) - in that for non-ZEC assets, the asset identifier will be added as an input to the commitment computation. As we will see, the recursive structure of the Sinsemilla-base commitment 10 allows us to add the asset identifier as a final recursive step, and hence keep a single instance of the Sinsemilla hash function in the circuit for the note commitment verification.

    -

    Since the commitment output is still indistinguishable with the original Orchard ZEC note commitments, by definition of the Sinsemilla hash, ZSA note commitments will be added to the same Merkle Commitment Tree. In essence, we have

    + in that for non-ZEC Assets, the Asset identifier will be added as an input to the commitment computation. As we will see, the nested structure of the Sinsemilla-based commitment 10 allows us to add the Asset identifier as a final recursive step, and hence keep a single instance of the Sinsemilla hash function in the circuit for the note commitment verification.

    +

    The commitment output is still indistinguishable from the original Orchard ZEC note commitments, by definition of the Sinsemilla hash. ZSA note commitments will therefore be added to the same Orchard Note Commitment Tree. In essence, we have

    - \(\mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, AssetId)} \in \{\mathsf{cm},\bot\}\) + \(\mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, AssetId)} \in \mathsf{NoteCommit^{Orchard}.Output} \cup \{\bot\}\)

    The nullifier is generated in the same manner as in the Orchard protocol.

    Value Commitment

    -

    The Orchard Protocol uses a Sinsemilla-based Homomorphic Pedersen Commitment 11 which is instantiated as

    +

    The Orchard Protocol uses a Sinsemilla-based Homomorphic Pedersen Commitment 11 which is instantiated as

    \(\mathsf{cv^{net}:=ValueCommit^{Orchard}_{rcv}(v^{net})}:= \mathsf{[v^{net}]}\mathcal{V}^{\mathsf{Orchard}}+[\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}}\)

    @@ -135,7 +137,7 @@ and \(\mathcal{R}^{\mathsf{Orchard}}\) are fixed for every value commitment, as the values represent the amount of ZEC being transferred.

    -

    In the case of the ZSA protocol, the value of different asset identifiers in a given transaction will be committed using a different value base point. This enables the final balance of the transaction to be securely computed, such that each asset identifier is balanced independently, as the assets are not meant to be fungible. The value commitment then becomes

    +

    In the case of the ZSA protocol, the value of different Asset identifiers in a given transaction will be committed using a different value base point. This enables the final balance of the transaction to be securely computed, such that each Asset identifier is balanced independently, as Assets with different identifiers are not meant to be mutually fungible. The value commitment then becomes

    \(\mathsf{cv^{net}:=ValueCommit^{OrchardZSA}_{rcv}(v^{net}_{AssetId},\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}})}:= \mathsf{[v^{net}_{AssetId}]}\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}}+[\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}}\)

    @@ -147,7 +149,7 @@ \(\mathsf{AssetId}\) , and

    - \(\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}}:=\mathsf{AssetId}= \mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv", "a" || ik || \mathsf{asset_desc})}\) + \(\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}}:=\mathsf{AssetId}= \mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv", "a" || } \mathsf{ik} \texttt{ || } \mathsf{asset\_desc} \texttt{)}\)

    \(\mathcal{R}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv", "r")}\) @@ -157,12 +159,12 @@ .

    Value Balance Verification

    -

    In order to verify the balance of the different assets, verifier performs exactly the same the process as for the Orchard protocol 7. The main reason why no changes to this process are needed is that no custom assets can be unshielded, so all custom assets are contained within the shielded ZSA pool. This means that the net balance of the input and output values is zero, with only one asset identifier of value balance published, that of ZEC, +

    In order to verify the balance of the different Assets, the verifier MUST perform exactly the same process as for the Orchard protocol 7. The main reason why no changes to this process are needed is that no custom Assets can be unshielded, so all custom Assets are contained within the shielded pool. This means that the net balance of the input and output values is zero, with only one Asset identifier of value balance published, that of ZEC, \(\mathsf{v^{balanceOrchard}}\) - . No net amount of any other asset identifier will be revealed, and the number of asset identifiers in the transaction is also hidden. The only exception to this is in the case that an asset is burnt, as we will see below in the burn mechanism.

    + . No net amount of any other Asset identifier will be revealed, and the number of Asset identifiers in the transaction is also hidden. The only exception to this is in the case that an Asset is burnt, as we will see below in the burn mechanism.

    For a total of \(n\) - actions in a transfer, the prover can still sign the SIGHASH of the transaction using the binding signature key

    + Actions in a transfer, the prover MUST still sign the SIGHASH of the transaction using the binding signature key

    \(\mathsf{bsk} = \sum_{\mathsf{ \forall i\in \{1,...,n\}}} \mathsf{rcv_{i}}\)

    @@ -170,20 +172,20 @@

    \(\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} = \sum \mathsf{rcv_{i}^{net}}\mathcal{R}^{\mathsf{Orchard}}\)

    -

    and use it to verify the bindingSignature on the SIGHASH message, as described in §4.14 of the Zcash Specification 7.

    +

    and use it to verify the bindingSignature on the SIGHASH message, as described in §4.14 of the Zcash Specification 7.

    As in the Orchard protocol, the binding signature verification key, \(\mathsf{bvk}\) , will only be valid (and hence verify the signature correctly), as long as the committed values sum to zero. In contrast, in this protocol, the committed values only sum to zero per Asset identifier, as the Pedersen commitments add up homomorphically only with respect to the same value base point.

    Split Notes

    -

    One of the key functionalities in a UTXO-based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This requires a 1-to-many (Orchard) transaction. However, because each Action represents an input and an output, the resulting transaction must have multiple inputs. In order to cope with this today, the Actions that have not been assigned input notes are instead given dummy spend notes 12, which we call split Actions and split notes respectively. Basically, the input note is “faked” inside of the proof in order to hide which Action contains the real spend note.

    +

    One of the key functionalities in a UTXO-based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This requires a 1-to-many (Orchard) transaction. However, because each Action represents an input and an output, the resulting transaction must have multiple inputs. In order to cope with this today, the Actions that have not been assigned input notes are instead given dummy spend notes 12, which we call split Actions and split notes respectively. Basically, the input note is “faked” inside of the proof in order to hide which Action contains the real spend note.

    This, however, brings some issues when it comes to adding multiple Asset identifiers, as the output note of the split Actions cannot be of any Asset identifier, it must be enforced to be an actual output of a GroupHash computation (in fact we want it to be of the same identifier as the original input note, but the binding signature takes care that the proper balancing is performed). If not, then the prover could essentially input a multiple (or linear combination) of an existing identifier, with the goal to attack the network by overflowing the ZEC value balance and hence counterfeiting ZEC funds.

    -

    In order to prevent this, we make some modifications to the circuit. Specifically we remove the dummy note functionality for custom assets and we enforce that every input note to an ZSA Action must be proven to exist in the set of note commitments in the Merkle Tree. We then enforce this real note to be “unspendable” in the sense that its value will be zeroed in split Actions and the nullifier will be randomized, making the note not spendable in the specific Action. Then, the proof itself ensures that the output note is of the same identifier as the input note. In the circuit, the split note functionality will be activated by a boolean private input to the proof.

    +

    In order to prevent this, we make some modifications to the circuit. Specifically we remove the dummy note functionality for custom Assets and we enforce that every input note to an ZSA Action must be proven to exist in the set of note commitments in the note commitment tree. We then enforce this real note to be “unspendable” in the sense that its value will be zeroed in split Actions and the nullifier will be randomized, making the note not spendable in the specific Action. Then, the proof itself ensures that the output note is of the same identifier as the input note. In the circuit, the split note functionality will be activated by a boolean private input to the proof.

    This creates a chain of induction that ensures that the value base points of all output notes of a transfer are actual outputs of a GroupHash, as they originate in the Issuance protocol which is publicly verified. If this were not done then it would be possible to violate balance, for example by using a value base point derived from those of other Assets.

    Note that we do not care about whether the note identified by a Split Input is owned by the sender, or whether it was nullified before.

    Wallets and other clients have a choice to make to ensure the Asset type is preserved for the output note of a Split Action:

      -
    1. The Split Input note could be another note of the same asset identifier that is being spent by this transaction (but not by this Split Input).
    2. +
    3. The Split Input note could be another note of the same Asset identifier that is being spent by this transaction (but not by this Split Input).
    4. The Split Input note could be a different unspent note of the same \(\mathsf{AssetId}\) (note that the note will not actually be spent).
    5. @@ -195,22 +197,22 @@

    Circuit Statement

    -

    The advantage of the design described above, with respect to the circuit statement, is that every ZSA Action statement is kept closely similar to the Orchard Action statement 13, except for a few additions that ensure the security of the asset identifier system.

    +

    The advantage of the design described above, with respect to the circuit statement, is that every ZSA Action statement is kept closely similar to the Orchard Action statement 13, except for a few additions that ensure the security of the Asset identifier system.

    Asset Identifier Equality: the following constraints must be added to ensure that the input and output note are of the same \(\mathsf{AssetId}\) :

      -
    • The asset identifier, +
    • The Asset identifier, \(\mathsf{AssetId}\) , for the note is witnessed once, as an auxiliary input.
    • -
    • The witnessed asset identifier, +
    • The witnessed Asset identifier, \(\mathsf{AssetId}\) , is added to the old note commitment input.
    • -
    • The witnessed asset identifier, +
    • The witnessed Asset identifier, \(\mathsf{AssetId}\) , is added to the new note commitment input.
    -

    Correct Value Commitment: the following constraints must be added to ensure that the value commitment is computed using the witnessed identifier, as represented in the notes

    +

    Correct Value Commitment: the following constraints must be added to ensure that the value commitment is computed using the witnessed Asset identifier, as represented in the notes:

    • The fixed-base multiplication constraints between the value and the value base point of the value commitment, \(\mathsf{cv}\) @@ -219,7 +221,7 @@ \(\mathsf{AssetId}\) .
    -

    Enforce Secure Identifier for Split Actions: the following constraints must be added to prevent senders from changing the asset identifier for the output note in a Split Action:

    +

    Enforce Secure Identifier for Split Actions: the following constraints must be added to prevent senders from changing the Asset identifier for the output note in a Split Action:

    • @@ -238,14 +240,14 @@
      Add a boolean split variable as an auxiliary witness. This variable is to be activated split = 1 if the Action in question is a split and split = 0 if the Action is actually spending an input note:
        -
      • If split = 1 then set v' = 0 otherwise v'=v^old from the auxiliary input
      • +
      • If split = 1 then set v' = 0 otherwise v'=v^old from the auxiliary input.
    • -
      The Merkle Path Validity should check the existance of the note commitment as usual (and not like with dummy notes):
      +
      The Merkle Path Validity should check the existence of the note commitment as usual (and not like with dummy notes):
      • Check that (path, pos) is a valid Merkle path of depth @@ -271,27 +273,29 @@ as \(\mathsf{nf_old = DeriveNullifier_nk}(\rho^\mathsf{old}, \psi', \mathsf{cm^old})\)
      • -
      • if split = 1 set - \(\psi' = \mathsf{randomSample}\) - , otherwise set +
      • if + \(split = 0\) + then constrain \(\psi' = \psi^{old}\) -
      • + . (Otherwise + \(\psi'\) + should be sampled randomly.)

    Enabling Backwards Compatibility with ZEC Notes: the following constraints must be added to enable backwards compatibility with the Orchard ZEC notes.

    -

    The old note commitment is computed using a “rolling-aggregate” sinsemilla commitment. This means that the commitment is computed by adding new chunks or windows to the accumulated value. This method will be used in order to maintain a single commitment instance for the old note commitment, that will be used both for Orchard ZEC notes and for ZSA notes. The original Orchard ZEC notes will be conserved and not actually be converted into ZSA notes, as we will always need to compute them.

    +

    The old note commitment is computed using a “rolling-aggregate” Sinsemilla commitment. This means that the commitment is computed by adding new chunks or windows to the accumulated value. This method will be used in order to maintain a single commitment instance for the old note commitment, that will be used both for Orchard ZEC notes and for ZSA notes. The original Orchard ZEC notes will be conserved and not actually be converted into ZSA notes, as we will always need to compute them.

    • -
      The input note in the old note commitment integrity must either include an asset identifier (ZSA note) or not (ZEC-Orchard note)
      +
      The input note in the old note commitment integrity must either include an Asset identifier (ZSA note) or not (ZEC-Orchard note)
      • -
        If the asset identifier auxiliary input is set +
        If the Asset identifier auxiliary input is set \(\mathsf{AssetId}\) = \(\mathcal{V}^\mathsf{Orchard}\) @@ -323,35 +327,35 @@

      Backward Compatibility

      -

      In order to have a "clean" backwards compatibility with the ZEC notes, we have designed the circuit to support both ZEC and ZSA notes. As we specify above, there are three main reasons we can do this: - The input notes with an asset identifer denote the ZSA custom assets, generating a note commitment that includes the asset identifer; whereas the notes without an identifier, denote the ZEC notes, and generate a note commitment that does not include the asset identifier, in order to maintain the referencability to the Merkle tree - The value commitment is abstracted to allow for the value base-point as a variable private input to the proof - The ZEC-based actions will still include dummy input notes, whereas the ZSA-based actions will include split input notes

      +

      In order to have a "clean" backwards compatibility with the ZEC notes, we have designed the circuit to support both ZEC and ZSA notes. As we specify above, there are three main reasons we can do this: - The input notes with an Asset identifer denote the ZSA custom Assets, generating a note commitment that includes the Asset identifer; whereas the notes without an identifier, denote the ZEC notes, and generate a note commitment that does not include the Asset identifier, in order to maintain the referencability to the Merkle tree - The value commitment is abstracted to allow for the value base-point as a variable private input to the proof - The ZEC-based actions will still include dummy input notes, whereas the ZSA-based actions will include split input notes

    Burn Mechanism

    -

    The burn mechanism may be needed for off-boarding the wrapped assets from the chain, or enabling advanced tokenomics on native tokens. It is part of the Issuance/Burn protocol, but given that it can be seen as an extension of the Transfer protocol, we add it here for readability.

    -

    In essence, the burn mechanism is a transparent / revealing extension to the transfer protocol that enables a specific amount of any asset identifier to be sent into “oblivion”. Our burn mechanism does NOT send assets to a non-spendable address, it simply reduces the total number of assets in circulation at the consensus level. It is enforced at the consensus level, by using an extension of the value balance mechanism used for ZEC assets.

    +

    The burn mechanism may be needed for off-boarding the Wrapped Assets from the chain, or enabling advanced tokenomics on native tokens. It is part of the Issuance/Burn protocol, but given that it can be seen as an extension of the Transfer protocol, we add it here for readability.

    +

    In essence, the burn mechanism is a transparent / revealing extension to the transfer protocol that enables a specific amount of any Asset identifier to be sent into “oblivion”. Our burn mechanism does NOT send Assets to a non-spendable address, it simply reduces the total number of units of a given Asset in circulation at the consensus level. It is enforced at the consensus level, by using an extension of the value balance mechanism used for ZEC Assets.

    First, contrary to the strict transfer transaction, we allow the sender to include a \(\mathsf{valueBalance_{AssetId}}\) - variable for every asset identifier that is being burnt. As we will show in the transaction structure, this is separate from the regular + variable for every Asset identifier that is being burnt. As we will show in the transaction structure, this is separate from the regular \(\mathsf{valueBalance^Orchard}\) - that is the default transparent value for the ZEC asset.

    -

    For every custom asset that is burnt, we add to the assetBurn vector the tuple + that is the default transparent value for the ZEC Asset.

    +

    For every custom Asset that is burnt, we add to the assetBurn vector the tuple \((\mathsf{valueBalance_{AssetId}, AssetId})\) - such that the validator of the transaction can compute the value commitment with the corresponding value base point of that asset. This ensures that the values are all balanced out with respect to the asset identifiers in the transfer.

    + such that the validator of the transaction can compute the value commitment with the corresponding value base point of that Asset. This ensures that the values are all balanced out with respect to the Asset identifiers in the transfer.

    \(\mathsf{assetBurn = [(v^{AssetId}, AssetId)}| \forall \mathsf{AssetId} \textit{ s.t.}\mathsf{v^{AssetId}\neq 0}]\)

    -

    The value balances for each asset identifier in assetBurn represents the amount of that asset identifier that is being burnt. In the case of ZEC, the value balance represents either the transaction fee, or the amount of ZEC changing anonymity pools (to Sapling or Transparent).

    -

    Finally, the validator needs to verify the Balance and Binding Signature by adding the value balances for all assets, as committed using their respective +

    The value balances for each Asset identifier in assetBurn represents the amount of that Asset identifier that is being burnt. In the case of ZEC, the value balance represents either the transaction fee, or the amount of ZEC changing anonymity pools (to Sapling or Transparent).

    +

    Finally, the validator needs to verify the Balance and Binding Signature by adding the value balances for all Assets, as committed using their respective \(\mathsf{AssetId}\) as the value base point of the Pedersen Commitment. This is done as follows

    \(\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} - \sum_{\forall \mathsf{AssetId}\textit{ s.t. }\mathsf{v^{AssetId}\neq 0}} \mathsf{ValueCommit_0^{ORchardZSA}(v^{AssetId}, AssetId) } = \sum \mathsf{rcv_{i,j}^{net}}\mathcal{R}^{\mathsf{Orchard}}\)

    -

    In the case that the balance of all the action values related to a specific asset will be zero, there will be no value added to the vector. This way, the number of assets, nor their identifiers will be revealed, except in the case that an asset is burnt.

    -

    Note: Even if this mechanism allows having transparent ↔ shielded asset transfers in theory, the transparent protocol will not be changed with this ZIP to adapt to a multiple asset structure. This means that unless future consensus rules changes do allow it, the unshielding is not not be possible for custom assets.

    +

    In the case that the balance of all the action values related to a specific Asset will be zero, there will be no value added to the vector. This way, the number of Assets, nor their identifiers will be revealed, except in the case that an Asset is burnt.

    +

    Note: Even if this mechanism allows having transparent ↔ shielded Asset transfers in theory, the transparent protocol will not be changed with this ZIP to adapt to a multiple Asset structure. This means that unless future consensus rules changes do allow it, unshielding will not be possible for custom Assets.

    ZSA Transaction Structure

    -

    Similar to version 5 transaction format, with the following modifications to the Orchard bundle, as defined in 14:

    +

    Similar to version 5 transaction format, with the following modifications to the Orchard bundle, as defined in 14:

    @@ -366,13 +370,13 @@ - + - +
    varies nAssetBurn compactSizenumber of assets burntnumber of Assets burnt
    40*nAssetBurn vAssetBurn bytes[40][nAssetBurn]32 bytes asset type_t, 8 bytes of valueBalance32 bytes Asset type_t, 8 bytes of valueBalance
    @@ -382,13 +386,13 @@

    Other Considerations

    Transaction Fees

    -

    The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317b 16.

    +

    The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317b 16.

    Security and Privacy

    • Even if the Orchard protocol and ZSA protocol do not share the same anonymity pool (nodes can keep track of the notes that where published with different transaction structures), the migration from one to the other is done automatically and seamlessly. The Orchard bundle will be replaced by the ZSA bundle and all ZEC notes will be fully spendable with the new transaction structure.
    • -
    • When including new assets we would like to maintain the amount and identifiers of assets private, which is achieved with the design
    • -
    • We prevent the "roadblock" attack on the asset identifer by ensuring the output notes receive an asset identifier that exists on the global state
    • +
    • When including new Assets we would like to maintain the amount and identifiers of Assets private, which is achieved with the design
    • +
    • We prevent the "roadblock" attack on the Asset identifer by ensuring the output notes receive an Asset identifier that exists on the global state

    Deplopyment

    diff --git a/zip-0226.rst b/zip-0226.rst index 06e916dd3..006870fc6 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -28,7 +28,7 @@ We define the following additional terms: - Asset: A type of note that can be transferred on the Zcash block chain, identified by the :math:`\mathsf{AssetId}` parameter. - - ZEC is the default (and currently the only defined) asset for the Zcash mainnet. + - ZEC is the default (and currently the only defined) Asset for the Zcash mainnet. - Zcash Shielded Asset: an Asset with issuance defined on the Zcash block chain, and, for now, belonging to the Orchard shielded pool. - Wrapped Asset: a Zcash Shielded Asset with native issuance defined outside the Zcash block chain. @@ -40,27 +40,27 @@ Abstract ======== ZIP 226 and ZIP 227 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 [#zip-0227]_. The transfer and burn of such assets is defined in ZIP 226 [#zip-0226]_. +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 [#zip-0227]_. The transfer and burn of such Assets is defined in ZIP 226 [#zip-0226]_. Motivation ========== -The current Orchard protocol does not support custom assets. Enabling multi-asset support on the Zcash chain will open the door for a host of applications, and enhance the ecosystem with application developers and asset custody institutions for issuance and bridging purposes. +The current Orchard protocol does not support custom Assets. Enabling multi-asset support on the Zcash chain will open the door for a host of applications, and enhance the ecosystem with application developers and Asset custody institutions for issuance and bridging purposes. Overview ======== In order to be able to represent different Asset identifiers in Orchard, we need to define a new data field that uniquely represents the identifier of the Asset in question, which we call :math:`\mathsf{AssetId}`. -The asset identifier will be used to enforce the balance of an Action Description [#protocol-actions]_ is preserved across Assets (see the Orchard Binding Signature [#protocol-binding]_), and by extension the balance of an Orchard transaction. That is, the sum of all the :math:`\mathsf{value^{net}}` from each Action Description, computed as :math:`\mathsf{value^{old}-value^{new}}`, must be balanced **only with respect to the same Asset identifier**. This is specially important since we will allow different Action Descriptions to transfer notes of different Asset identifiers, where the overall balance is checked without revealing which Assets (or how many different identifiers) are being transferred. +The Asset identifier will be used to enforce the balance of an Action Description [#protocol-actions]_ is preserved across Assets (see the Orchard Binding Signature [#protocol-binding]_), and by extension the balance of an Orchard transaction. That is, the sum of all the :math:`\mathsf{value^{net}}` from each Action Description, computed as :math:`\mathsf{value^{old}-value^{new}}`, must be balanced **only with respect to the same Asset identifier**. This is specially important since we will allow different Action Descriptions to transfer notes of different Asset identifiers, where the overall balance is checked without revealing which Assets (or how many different identifiers) are being transferred. As was initially proposed by Jack Grigg and Daira Hopwood [#initial-zsa-issue]_, we propose to make this happen by changing the value base point, :math:`\mathcal{V}^{\mathsf{Orchard}}`, in the Homomorphic Pedersen Commitment that generates the value commitment, :math:`\mathsf{cv^{net}}`, of the *net value* in an Orchard Action. -Because in a single transaction all value commitments are balanced, there must be as many different value base points as there are asset identifiers in the transaction. We propose to make the :math:`\mathsf{AssetId}` identifier an auxiliary input to the proof, represented already as a point in the Pallas curve. The circuit then should check that the same :math:`\mathsf{AssetId}` is used in the old note commitment, in the new note commitment **and** in the value commitment as the base point of the value. This ensures that (1) the input and output notes are of the same :math:`\mathsf{AssetId}`, and (2) that only actions with the same asset identifier will balance out in the binding and balance signature. +Because in a single transaction all value commitments are balanced, there must be as many different value base points as there are Asset identifiers in the transaction. We propose to make the :math:`\mathsf{AssetId}` identifier an auxiliary input to the proof for each Action, represented already as a point on the Pallas curve. The circuit then should check that the same :math:`\mathsf{AssetId}` is used in the old note commitment, in the new note commitment **and** as the base point :math:`\mathcal{V}^\mathsf{Orchard}` in the value commitment. This ensures (1) that the input and output notes are of the same :math:`\mathsf{AssetId}`, and (2) that only actions with the same Asset identifier will balance out in the binding and balance signatures. -In order to ensure the security of the transfers, and as we will explain below, we are replacing input dummy notes for custom assets, as we need to enforce that the :math:`\mathsf{AssetId}` of the output note of that split action is the output of a PRF. +In order to ensure the security of the transfers, and as we will explain below, we are redefining input dummy notes for custom Assets, as we need to enforce that the :math:`\mathsf{AssetId}` of the output note of that split Action is the output of a PRF. -Finally, in this ZIP we also describe the *burn* mechanism, which is a direct extension of the transfer mechanism. The burn process uses a similar mechanism than what is used in Orchard to unshield ZEC, by using the :math:`\mathsf{valueBalance}` of the asset in question. Burning assets is useful for many purposes, including bridging of wrapped assets and removing supply of native assets. +Finally, in this ZIP we also describe the *burn* mechanism, which is a direct extension of the transfer mechanism. The burn process uses a similar mechanism to what is used in Orchard to unshield ZEC, by using the :math:`\mathsf{valueBalance}` of the Asset in question. Burning Assets is useful for many purposes, including bridging of Wrapped Assets and removing supply of Native Assets. Specification ============= @@ -70,28 +70,28 @@ Most of the protocol is kept the same as the Orchard protocol released with NU5, Asset Identifiers ----------------- -For every new asset, there must be a new and unique identifier of the asset. Every asset is defined by the asset description, :math:`\mathsf{asset\_desc}`, which is a global byte string (valid across all -future- Zcash protocols). From this asset description, the specific asset identifier, :math:`\mathsf{AssetId}`, is derived with a `GroupHash` and used within the output notes, as defined by the specific protocol (e.g.: for now Orchard-style, using Pallas curve). +For every new Asset, there must be a new and unique identifier of the Asset. Every Asset is defined by the *Asset description*, :math:`\mathsf{asset\_desc}`, which is a global byte string (valid across all -future- Zcash protocols). From this Asset description the specific Asset identifier, :math:`\mathsf{AssetId}`, is derived with a `GroupHash` and used within the output notes, as defined by the specific protocol (e.g.: for now Orchard-style, using Pallas curve). -This :math:`\mathsf{AssetId}` will be the base point of the value commitment for the specific custom asset. Note that the :math:`\mathsf{AssetId}` of the ZEC asset will be kept as the original value base-point, :math:`\mathcal{V}^\mathsf{Orchard}`. +This :math:`\mathsf{AssetId}` will be the base point of the value commitment for the specific custom Asset. Note that the :math:`\mathsf{AssetId}` of the ZEC Asset will be kept as the original value base point, :math:`\mathcal{V}^\mathsf{Orchard}`. -In future network and protocol upgrades, the same asset description string can be carried on, with potentially a mapping into a different curve or group. In that case, the turnstile should know how to transform the asset identifier, :math:`\mathsf{AssetId}`, from one group to another one. +In future network and protocol upgrades, the same Asset description string can be carried on, with potentially a mapping into a different shielded protocol. In that case, the turnstile should know how to transform the Asset identifier, :math:`\mathsf{AssetId}`, from one shielded protocol to another. Note Structure & Commitment --------------------------- -First, we need to adapt the components that define the assets, i.e.: *notes*. A ZSA note differs from an Orchard note by including the identifier of asset, :math:`\mathsf{AssetId}`. So an ZSA note looks like: +First, we need to adapt the components that define the Assets, i.e.: *notes*. A ZSA note differs from an Orchard note by including the identifier of the Asset, :math:`\mathsf{AssetId}`. So a ZSA note looks like: :math:`(\mathsf{g_d, pk_d, v, \rho, \psi, AssetId})` -Where :math:`\mathsf{AssetId}` is the unique random group element that identifies each asset in the Pallas curve [#protocol-pallasandvesta]_, [#pasta-evidence]_ of the Orchard protocol. +Where :math:`\mathsf{AssetId}` is the unique random element of the Pallas group [#protocol-pallasandvesta]_ that identifies each Asset in the Orchard protocol. -In this case, the instance of the note commitment scheme, :math:`\mathsf{NoteCommit^{OrchardZSA}_{rcm}}`, will differ from :math:`\mathsf{NoteCommit^{Orchard}_{rcm}}` in that for non-ZEC assets, the asset identifier will be added as an input to the commitment computation. As we will see, the recursive structure of the Sinsemilla-base commitment [#protocol-concretesinsemillacommit]_ allows us to add the asset identifier as a final recursive step, and hence keep a single instance of the Sinsemilla hash function in the circuit for the note commitment verification. +In this case, the instance of the note commitment scheme, :math:`\mathsf{NoteCommit^{OrchardZSA}_{rcm}}`, will differ from :math:`\mathsf{NoteCommit^{Orchard}_{rcm}}` in that for non-ZEC Assets, the Asset identifier will be added as an input to the commitment computation. As we will see, the nested structure of the Sinsemilla-based commitment [#protocol-concretesinsemillacommit]_ allows us to add the Asset identifier as a final recursive step, and hence keep a single instance of the Sinsemilla hash function in the circuit for the note commitment verification. -Since the commitment output is still indistinguishable with the original Orchard ZEC note commitments, by definition of the Sinsemilla hash, ZSA note commitments will be added to the same Merkle Commitment Tree. In essence, we have +The commitment output is still indistinguishable from the original Orchard ZEC note commitments, by definition of the Sinsemilla hash. ZSA note commitments will therefore be added to the same Orchard Note Commitment Tree. In essence, we have -:math:`\mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, AssetId)} \in \{\mathsf{cm},\bot\}` +:math:`\mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, AssetId)} \in \mathsf{NoteCommit^{Orchard}.Output} \cup \{\bot\}` The nullifier is generated in the same manner as in the Orchard protocol. @@ -112,7 +112,7 @@ In the case of the Orchard protocol, we see that the base points :math:`\mathcal :math:`\mathcal{R}^{\mathsf{Orchard}}` are fixed for every value commitment, as the values represent the amount of ZEC being transferred. -In the case of the ZSA protocol, the value of different asset identifiers in a given transaction will be committed using a **different value base point**. This enables the final balance of the transaction to be securely computed, such that each asset identifier is balanced independently, as the assets are not meant to be fungible. The value commitment then becomes +In the case of the ZSA protocol, the value of different Asset identifiers in a given transaction will be committed using a **different value base point**. This enables the final balance of the transaction to be securely computed, such that each Asset identifier is balanced independently, as Assets with different identifiers are not meant to be mutually fungible. The value commitment then becomes :math:`\mathsf{cv^{net}:=ValueCommit^{OrchardZSA}_{rcv}(v^{net}_{AssetId},\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}})}:= \mathsf{[v^{net}_{AssetId}]}\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}}+[\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}}` @@ -120,7 +120,7 @@ where :math:`\mathsf{v^{net}_{AssetId}} = \mathsf{v^{old}_{AssetId} - v^{new}_{A .. _`value base`: -:math:`\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}}:=\mathsf{AssetId}= \mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv", "a" || ik || \mathsf{asset_desc})}` +:math:`\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}}:=\mathsf{AssetId}= \mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv", "a" || } \mathsf{ik} \texttt{ || } \mathsf{asset\_desc} \texttt{)}` :math:`\mathcal{R}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv", "r")}` @@ -129,9 +129,9 @@ Where :math:`\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{ZEC}} =\mathcal{V}^{\mat Value Balance Verification -------------------------- -In order to verify the balance of the different assets, verifier performs exactly the same the process as for the Orchard protocol [#protocol-binding]_. The main reason why no changes to this process are needed is that no custom assets can be unshielded, so all custom assets are contained within the shielded ZSA pool. This means that the net balance of the input and output values is zero, with only one asset identifier of value balance published, that of ZEC, :math:`\mathsf{v^{balanceOrchard}}`. No net amount of any other asset identifier will be revealed, and the number of asset identifiers in the transaction is also hidden. The only exception to this is in the case that an asset is *burnt*, as we will see below in the `burn mechanism`_. +In order to verify the balance of the different Assets, the verifier MUST perform exactly the same process as for the Orchard protocol [#protocol-binding]_. The main reason why no changes to this process are needed is that no custom Assets can be unshielded, so all custom Assets are contained within the shielded pool. This means that the net balance of the input and output values is zero, with only one Asset identifier of value balance published, that of ZEC, :math:`\mathsf{v^{balanceOrchard}}`. No net amount of any other Asset identifier will be revealed, and the number of Asset identifiers in the transaction is also hidden. The only exception to this is in the case that an Asset is *burnt*, as we will see below in the `burn mechanism`_. -For a total of :math:`n` actions in a transfer, the prover can still sign the `SIGHASH` of the transaction using the binding signature key +For a total of :math:`n` Actions in a transfer, the prover MUST still sign the `SIGHASH` of the transaction using the binding signature key :math:`\mathsf{bsk} = \sum_{\mathsf{ \forall i\in \{1,...,n\}}} \mathsf{rcv_{i}}` @@ -150,7 +150,7 @@ One of the key functionalities in a UTXO-based protocol is the fact that input n This, however, brings some issues when it comes to adding multiple Asset identifiers, as the output note of the split Actions *cannot* be of *any* Asset identifier, it must be enforced to be an actual output of a GroupHash computation (in fact we want it to be of the same identifier as the original input note, but the binding signature takes care that the proper balancing is performed). If not, then the prover could essentially input a multiple (or linear combination) of an existing identifier, with the goal to attack the network by overflowing the ZEC value balance and hence counterfeiting ZEC funds. -In order to prevent this, we make some modifications to the circuit. Specifically we remove the dummy note functionality for custom assets and we enforce that *every* input note to an ZSA Action must be proven to exist in the set of note commitments in the Merkle Tree. We then enforce this real note to be “unspendable” in the sense that its value +In order to prevent this, we make some modifications to the circuit. Specifically we remove the dummy note functionality for custom Assets and we enforce that *every* input note to an ZSA Action must be proven to exist in the set of note commitments in the note commitment tree. We then enforce this real note to be “unspendable” in the sense that its value will be zeroed in split Actions and the nullifier will be randomized, making the note not spendable in the specific Action. Then, the proof itself ensures that the output note is of the same identifier as the input note. In the circuit, the split note functionality will be activated by a boolean private input to the proof. This creates a chain of induction that ensures that the value base points of all output notes of a transfer are actual outputs of a GroupHash, as they originate in the Issuance protocol which is publicly verified. If this were not done then it would be possible to violate balance, for example by using a value base point derived from those of other Assets. @@ -159,7 +159,7 @@ Note that we do not care about whether the note identified by a Split Input is o Wallets and other clients have a choice to make to ensure the Asset type is preserved for the output note of a Split Action: -1. The Split Input note could be another note of the same asset identifier that is being spent by this transaction (but not by this Split Input). +1. The Split Input note could be another note of the same Asset identifier that is being spent by this transaction (but not by this Split Input). 2. The Split Input note could be a different unspent note of the same :math:`\mathsf{AssetId}` (note that the note will not actually be spent). 3. The Split Input note could be an already spent note of the same :math:`\mathsf{AssetId}` (note that by zeroing the value in the circuit, we prevent double spending). @@ -168,38 +168,38 @@ The specific circuit changes are presented below. Circuit Statement ================= -The advantage of the design described above, with respect to the circuit statement, is that every *ZSA Action statement* is kept closely similar to the Orchard Action statement [#protocol-actionstatement]_, except for a few additions that ensure the security of the asset identifier system. +The advantage of the design described above, with respect to the circuit statement, is that every *ZSA Action statement* is kept closely similar to the Orchard Action statement [#protocol-actionstatement]_, except for a few additions that ensure the security of the Asset identifier system. -**Asset Identifier Equality:** the following constraints must be added to ensure that the input and output note are of the -same :math:`\mathsf{AssetId}`: +**Asset Identifier Equality:** the following constraints must be added to ensure that +the input and output note are of the same :math:`\mathsf{AssetId}`: -- The asset identifier, :math:`\mathsf{AssetId}`, for the note is witnessed once, as an auxiliary input. -- The witnessed asset identifier, :math:`\mathsf{AssetId}`, is added to the old note commitment input. -- The witnessed asset identifier, :math:`\mathsf{AssetId}`, is added to the new note commitment input. +- The Asset identifier, :math:`\mathsf{AssetId}`, for the note is witnessed once, as an auxiliary input. +- The witnessed Asset identifier, :math:`\mathsf{AssetId}`, is added to the old note commitment input. +- The witnessed Asset identifier, :math:`\mathsf{AssetId}`, is added to the new note commitment input. -**Correct Value Commitment:** the following constraints must be added to ensure that the value commitment is computed using the witnessed identifier, as represented in the notes +**Correct Value Commitment:** the following constraints must be added to ensure that the value commitment is computed using the witnessed Asset identifier, as represented in the notes: - The fixed-base multiplication constraints between the value and the value base point of the value commitment, :math:`\mathsf{cv}`, is replaced with a variable-base multiplication between the two. - The witness to the value base point, as defined in the `value base`_ equation is the auxiliary input :math:`\mathsf{AssetId}`. -**Enforce Secure Identifier for Split Actions:** the following constraints must be added to prevent senders from changing the asset identifier for the output note in a Split Action: +**Enforce Secure Identifier for Split Actions:** the following constraints must be added to prevent senders from changing the Asset identifier for the output note in a Split Action: - The Value Commitment Integrity should be changed - Replace the input note value by a generic value, `v'`, as :math:`\mathsf{cv^net} = \mathsf{ValueCommit_rcv^OrchardZSA(v’ - v^new, AssetId)}` - Add a boolean ``split`` variable as an auxiliary witness. This variable is to be activated ``split = 1`` if the Action in question is a split and ``split = 0`` if the Action is actually spending an input note: - - If ``split = 1`` then set `v' = 0` otherwise `v'=v^old` from the auxiliary input -- The Merkle Path Validity should check the existance of the note commitment as usual (and not like with dummy notes): + - If ``split = 1`` then set `v' = 0` otherwise `v'=v^old` from the auxiliary input. +- The Merkle Path Validity should check the existence of the note commitment as usual (and not like with dummy notes): - Check that (path, pos) is a valid Merkle path of depth :math:`\mathsf{MerkleDepth^Orchard}`, from :math:`\mathsf{cm^old}` to the anchor :math:`\mathsf{rt^Orchard}`. - The Nullifier Integrity will be changed to prevent the identification of notes - Replace the :math:`\psi_{old}` value with a generic :math:`\psi'` as :math:`\mathsf{nf_old = DeriveNullifier_nk}(\rho^\mathsf{old}, \psi', \mathsf{cm^old})` - - if ``split = 1`` set :math:`\psi' = \mathsf{randomSample}`, otherwise set :math:`\psi' = \psi^{old}` + - if :math:`split = 0` then constrain :math:`\psi' = \psi^{old}`. (Otherwise :math:`\psi'` should be sampled randomly.) **Enabling Backwards Compatibility with ZEC Notes:** the following constraints must be added to enable backwards compatibility with the Orchard ZEC notes. -The old note commitment is computed using a “rolling-aggregate” sinsemilla commitment. This means that the commitment is computed by adding new chunks or windows to the accumulated value. This method will be used in order to maintain a single commitment instance for the old note commitment, that will be used both for Orchard ZEC notes and for ZSA notes. The original Orchard ZEC notes will be conserved and not actually be converted into ZSA notes, as we will always need to compute them. +The old note commitment is computed using a “rolling-aggregate” Sinsemilla commitment. This means that the commitment is computed by adding new chunks or windows to the accumulated value. This method will be used in order to maintain a single commitment instance for the old note commitment, that will be used both for Orchard ZEC notes and for ZSA notes. The original Orchard ZEC notes will be conserved and not actually be converted into ZSA notes, as we will always need to compute them. -- The input note in the old note commitment integrity must either include an asset identifier (ZSA note) or not (ZEC-Orchard note) - - If the asset identifier auxiliary input is set :math:`\mathsf{AssetId}` = :math:`\mathcal{V}^\mathsf{Orchard}` +- The input note in the old note commitment integrity must either include an Asset identifier (ZSA note) or not (ZEC-Orchard note) + - If the Asset identifier auxiliary input is set :math:`\mathsf{AssetId}` = :math:`\mathcal{V}^\mathsf{Orchard}` - NoteCommitment has a “compatibility” path that computes the note commitment as in plain Orchard (i.e.: without including the identifier) - This path also uses the original domain separator for ZEC note commitment - Else, @@ -211,33 +211,33 @@ Backward Compatibility ---------------------- In order to have a "clean" backwards compatibility with the ZEC notes, we have designed the circuit to support both ZEC and ZSA notes. As we specify above, there are three main reasons we can do this: -- The input notes with an asset identifer denote the ZSA custom assets, generating a note commitment that includes the asset identifer; whereas the notes without an identifier, denote the ZEC notes, and generate a note commitment that does not include the asset identifier, in order to maintain the referencability to the Merkle tree +- The input notes with an Asset identifer denote the ZSA custom Assets, generating a note commitment that includes the Asset identifer; whereas the notes without an identifier, denote the ZEC notes, and generate a note commitment that does not include the Asset identifier, in order to maintain the referencability to the Merkle tree - The value commitment is abstracted to allow for the value base-point as a variable private input to the proof - The ZEC-based actions will still include dummy input notes, whereas the ZSA-based actions will include split input notes Burn Mechanism ============== -The burn mechanism may be needed for off-boarding the wrapped assets from the chain, or enabling advanced tokenomics on native tokens. It is part of the Issuance/Burn protocol, but given that it can be seen as an extension of the Transfer protocol, we add it here for readability. +The burn mechanism may be needed for off-boarding the Wrapped Assets from the chain, or enabling advanced tokenomics on native tokens. It is part of the Issuance/Burn protocol, but given that it can be seen as an extension of the Transfer protocol, we add it here for readability. -In essence, the burn mechanism is a transparent / revealing extension to the transfer protocol that enables a specific amount of any asset identifier to be sent into “oblivion”. Our burn mechanism does NOT send assets to a non-spendable address, it simply reduces the total number of assets in circulation at the consensus level. It is enforced at the consensus level, by using an extension of the value balance mechanism used for ZEC assets. +In essence, the burn mechanism is a transparent / revealing extension to the transfer protocol that enables a specific amount of any Asset identifier to be sent into “oblivion”. Our burn mechanism does NOT send Assets to a non-spendable address, it simply reduces the total number of units of a given Asset in circulation at the consensus level. It is enforced at the consensus level, by using an extension of the value balance mechanism used for ZEC Assets. -First, contrary to the strict transfer transaction, we allow the sender to include a :math:`\mathsf{valueBalance_{AssetId}}` variable for every asset identifier that is being burnt. As we will show in the transaction structure, this is separate from the regular :math:`\mathsf{valueBalance^Orchard}` that is the default transparent value for the ZEC asset. +First, contrary to the strict transfer transaction, we allow the sender to include a :math:`\mathsf{valueBalance_{AssetId}}` variable for every Asset identifier that is being burnt. As we will show in the transaction structure, this is separate from the regular :math:`\mathsf{valueBalance^Orchard}` that is the default transparent value for the ZEC Asset. -For every custom asset that is burnt, we add to the `assetBurn` vector the tuple :math:`(\mathsf{valueBalance_{AssetId}, AssetId})` such that the validator of the transaction can compute the value commitment with the corresponding value base point of that asset. This ensures that the values are all balanced out with respect to the asset identifiers in the transfer. +For every custom Asset that is burnt, we add to the `assetBurn` vector the tuple :math:`(\mathsf{valueBalance_{AssetId}, AssetId})` such that the validator of the transaction can compute the value commitment with the corresponding value base point of that Asset. This ensures that the values are all balanced out with respect to the Asset identifiers in the transfer. :math:`\mathsf{assetBurn = [(v^{AssetId}, AssetId)}| \forall \mathsf{AssetId} \textit{ s.t.}\mathsf{v^{AssetId}\neq 0}]` -The value balances for each asset identifier in `assetBurn` represents the amount of that asset identifier that is being burnt. In the case of ZEC, the value balance represents either the transaction fee, or the amount of ZEC changing anonymity pools (to Sapling or Transparent). +The value balances for each Asset identifier in `assetBurn` represents the amount of that Asset identifier that is being burnt. In the case of ZEC, the value balance represents either the transaction fee, or the amount of ZEC changing anonymity pools (to Sapling or Transparent). -Finally, the validator needs to verify the Balance and Binding Signature by adding the value balances for all assets, as committed using their respective :math:`\mathsf{AssetId}` as the value base point of the Pedersen Commitment. This is done as follows +Finally, the validator needs to verify the Balance and Binding Signature by adding the value balances for all Assets, as committed using their respective :math:`\mathsf{AssetId}` as the value base point of the Pedersen Commitment. This is done as follows :math:`\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} - \sum_{\forall \mathsf{AssetId}\textit{ s.t. }\mathsf{v^{AssetId}\neq 0}} \mathsf{ValueCommit_0^{ORchardZSA}(v^{AssetId}, AssetId) } = \sum \mathsf{rcv_{i,j}^{net}}\mathcal{R}^{\mathsf{Orchard}}` -In the case that the balance of all the action values related to a specific asset will be zero, there will be no value added to the vector. This way, the number of assets, nor their identifiers will be revealed, except in the case that an asset is burnt. +In the case that the balance of all the action values related to a specific Asset will be zero, there will be no value added to the vector. This way, the number of Assets, nor their identifiers will be revealed, except in the case that an Asset is burnt. -**Note:** Even if this mechanism allows having transparent ↔  shielded asset transfers in theory, the transparent protocol will not be changed with this ZIP to adapt to a multiple asset structure. This means that unless future consensus rules changes do allow it, the unshielding is not not be possible for custom assets. +**Note:** Even if this mechanism allows having transparent ↔ shielded Asset transfers in theory, the transparent protocol will not be changed with this ZIP to adapt to a multiple Asset structure. This means that unless future consensus rules changes do allow it, unshielding will not be possible for custom Assets. ZSA Transaction Structure ========================= @@ -246,9 +246,9 @@ Similar to version 5 transaction format, with the following modifications to the +-----------------+-------------+-----------------------------------+-------------------------+ | Bytes | Name | Data Type | Description | +=================+=============+===================================+=========================+ -| varies | nAssetBurn | compactSize | number of assets burnt | +| varies | nAssetBurn | compactSize | number of Assets burnt | +-----------------+-------------+-----------------------------------+-------------------------+ -| 40*nAssetBurn | vAssetBurn | bytes[40][nAssetBurn] | 32 bytes asset type_t, | +| 40*nAssetBurn | vAssetBurn | bytes[40][nAssetBurn] | 32 bytes Asset type_t, | | | | | 8 bytes of valueBalance | +-----------------+-------------+-----------------------------------+-------------------------+ @@ -266,8 +266,8 @@ Security and Privacy -------------------- - Even if the Orchard protocol and ZSA protocol do not share the same anonymity pool (nodes can keep track of the notes that where published with different transaction structures), the migration from one to the other is done automatically and seamlessly. The Orchard bundle will be replaced by the ZSA bundle and all ZEC notes will be fully spendable with the new transaction structure. -- When including new assets we would like to maintain the amount and identifiers of assets private, which is achieved with the design -- We prevent the "roadblock" attack on the asset identifer by ensuring the output notes receive an asset identifier that exists on the global state +- When including new Assets we would like to maintain the amount and identifiers of Assets private, which is achieved with the design +- We prevent the "roadblock" attack on the Asset identifer by ensuring the output notes receive an Asset identifier that exists on the global state Deplopyment ----------- From f40ce2a4079963d7e7e4ef634be2861d2de03fec Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Sun, 25 Dec 2022 11:36:47 +0530 Subject: [PATCH 032/101] resolving comments from PR#628 --- zip-0227.html | 102 +++++++++++++++++++++++++------------------------- zip-0227.rst | 96 +++++++++++++++++++++++------------------------ 2 files changed, 99 insertions(+), 99 deletions(-) diff --git a/zip-0227.html b/zip-0227.html index 0ef84b541..23bdaaf02 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -27,58 +27,58 @@

    The terms "Zcash Shielded Asset" and "Wrapped Asset" in this document are to be interpreted as described in ZIP 226 4.

    We define the following additional terms:

      -
    • Custom Asset: A type of note that can be transferred on the Zcash block chain. ZEC is the default (and currently the only defined) asset for the Zcash mainnet. Different custom assets are defined and differentiated by their identifier ( +
    • Custom Asset: A type of note that can be transferred on the Zcash block chain. ZEC is the default (and currently the only defined) Asset for the Zcash mainnet. Different custom Assets are defined and differentiated by their identifier ( \(\mathsf{AssetId}\) ).
    • -
    • Issuance Action: an instance of a single issuance of a Zcash Shielded Asset. It defines the issuance of a single asset identifier.
    • +
    • Issuance Action: an instance of a single issuance of a Zcash Shielded Asset. It defines the issuance of a single Asset identifier.
    • Issuance Bundle: the bundle in the transaction that contains all the issuance actions of that transaction.

    Abstract

    -

    ZIP 226 4 and ZIP 227 5 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 5. 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.

    +

    ZIP 226 4 and ZIP 227 5 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 5. 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.

    Motivation

    -

    The Orchard protocol deployed in NU5 does not support custom assets. Enabling multi-asset support on the Zcash chain will open the door for a host of applications and enhance the ecosystem with application developers and asset custody institutions for issuance and bridging purposes.

    +

    The Orchard protocol deployed in NU5 does not support custom Assets. Enabling multi-Asset support on the Zcash chain will open the door for a host of applications and enhance the ecosystem with application developers and Asset custody institutions for issuance and bridging purposes.

    Use Cases

    -

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

    +

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

      -
    • The issuer knows in advance the receivers of the issued asset.
    • -
    • The asset can be of non-fungible type, where each asset type can be made part of a single “series”.
    • -
    • The supply of the asset can be limited in advance or not.
    • -
    • The asset can be a wrapped version of an asset issued by another chain (as long as there is a bridge that supports transfer of that asset between chains).
    • +
    • The issuer knows in advance the receivers of the issued Asset.
    • +
    • The Asset can be of non-fungible type, where each Asset type can be made part of a single “series”.
    • +
    • The supply of the Asset can be limited in advance or not.
    • +
    • The Asset can be a wrapped version of an Asset issued by another chain (as long as there is a bridge that supports transfer of that Asset between chains).

    See the Concrete Applications section for more details.

    Requirements

      -
    • Any user of the Zcash block chain can issue custom assets on chain.
    • -
    • The issuance mechanism should enable tracking publicly the supply of the assets on the Zcash block chain.
    • -
    • Issuing or changing the attributes of a specific asset should require cryptographic authorization.
    • -
    • The asset identification should be unique (among all shielded pools) and different issuer public keys should not be able to generate the same asset identifier.
    • +
    • Any user of the Zcash block chain can issue custom Assets on chain.
    • +
    • The issuance mechanism should enable public tracking of the supply of the Assets on the Zcash block chain.
    • +
    • Issuing or changing the attributes of a specific Asset should require cryptographic authorization.
    • +
    • The Asset identification should be unique (among all shielded pools) and different issuer public keys should not be able to generate the same Asset identifier.

    Specification

    As explained, the issuance protocol allows for a single issuance action to be sent to many receivers, by generating as many output notes as distinct recipients. Furthermore, every bundle can contain many issuance actions.

    Overview

    -

    This specification enables only transparent issuance, since as a first step, transparency is important to properly test the applications that will be most used in the Zcash ecosystem, while enabling tracking of supply of assets. Any user of the block chain can issue new asset types, yet only a single issuer (a set of keys) can issue that specific asset type, as the asset identifiers are tied to the issuer keys.

    +

    This specification enables only transparent issuance, since as a first step, transparency is important to properly test the applications that will be most used in the Zcash ecosystem, while enabling tracking of supply of Assets. Any user of the block chain can issue new Asset types, yet only a single issuer (a set of keys) can issue that specific Asset type, as the Asset identifiers are tied to the issuer keys.

    The protocol was designed with three main properties in mind:

    • At the time of issuance, the issuer can already allocate all the tokens to the corresponding owners by creating the corresponding (shielded) output notes to the respective addresses. As is implied, the issuance mechanism is itself transparent, but the allocation is totally private.
    • -
    • In a single issuance bundle, the issuer can publish many issuance actions, or in other words, create multiple custom assets.
    • -
    • Every issuance action contains the finalize boolean that defines whether that specific custom asset can have further tokens issued or not.
    • +
    • In a single issuance bundle, the issuer can publish many issuance actions, or in other words, create multiple custom Assets.
    • +
    • Every issuance action contains the finalize boolean that defines whether that specific custom Asset can have further tokens issued or not.
    -

    The issuance mechanism is broad enough for issuers to either create native 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. In fact, the protocol described below enables what we hope will be a useful set of applications. The design decision is not to have a chosen name to describe the custom asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”.

    +

    The issuance mechanism is broad enough for issuers to either create native 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. In fact, the protocol described below enables what we hope will be a useful set of applications. The design decision is not to have a chosen name to describe the custom Asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”.

    Issuance Keys

    There are two keys relevant to the Issuer:

    1. The issuance authorizing key, denoted as \(\mathsf{isk}\) - , is the key that is used to sign the issuance transaction. This key is used to authorize the issuance of a specific asset type, and is only used by the issuer. Throughout we also call this key the issuer signature key.
    2. + , is the key that is used to sign the issuance transaction. This key is used to authorize the issuance of a specific Asset type, and is only used by the issuer. Throughout we also call this key the issuer signature key.
    3. The issuance validating key, denoted as \(\mathsf{ik}\) - , is the key that is used to validate the issuance transaction. This key is used to validate the issuance of a specific asset type, and is used by all block chain users (specifically the asset owners and consensus validators) to associate the asset in question with the issuer. Throughout we also call this key the issuer verification key.
    4. + , is the key that is used to validate the issuance transaction. This key is used to validate the issuance of a specific Asset type, and is used by all block chain users (specifically the Asset owners and consensus validators) to associate the Asset in question with the issuer. Throughout we also call this key the issuer verification key.

    The two keys are derived in an analogous manner to the spend authorizing key and spend validating key, using the same signature scheme, as described in ZIP 32 7 and in accordance with ZIP 316 8.

      @@ -93,15 +93,15 @@ , as a public verification key:
    \(\mathsf{ik := SpendAuthSig^{Orchard}.DerivePublic(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 7, and can further be in 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.

    +

    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 7, and can further be in 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.

    Asset Identifier

    -

    For every new asset, there must be a new and unique identifier of the asset. Every asset is defined by the asset description, +

    For every new Asset, there must be a new and unique identifier of the Asset. Every Asset is defined by the Asset description, \(\mathsf{asset\_desc}\) - , which is a global byte string (valid across all -future- Zcash shielded protocols). From this asset description, the specific asset identifier, + , which is a global byte string (valid across all -future- Zcash shielded protocols). From this Asset description, the specific Asset identifier, \(\mathsf{AssetId}\) , is derived with a GroupHash and used within the output notes, as defined by the specific protocol (e.g. for now Orchard-style, using Pallas curve).

    -

    The main requirement for the asset identifier is for it to be collision-free, as two different issuers MUST not be able to issue the same asset type. One way to achieve this is to make the identifier dependent on the issuer keys, as the issuer keys are unique to each issuer. We achieve this by deriving the asset identifier, +

    The main requirement for the Asset identifier is for it to be collision-free, as two different issuers MUST not be able to issue the same Asset type. One way to achieve this is to make the identifier dependent on the issuer keys, as the issuer keys are unique to each issuer. We achieve this by deriving the Asset identifier, \(\mathsf{AssetId}\) as follows:

    @@ -111,10 +111,10 @@

    • \(\mathsf{asset\_desc}\) - is the asset description, a UTF-8 encoded string of up to 512 bytes, which includes any information pertaining to the issuance
    • + is the Asset description, a UTF-8 encoded string of up to 512 bytes, which includes any information pertaining to the issuance.
    • \(\mathsf{ik}\) - is the issuance validating key of the issuer, used to verify the signature on the transaction SIGHASH and is defined above
    • + is the issuance validating key of the issuer, used to verify the signature on the transaction SIGHASH and is defined above.

    Global Issuance State

    @@ -126,17 +126,17 @@

    Issuance Action Description

    -

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

    +

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

    • \(\mathsf{asset\_desc}\) - : the asset description, a UTF-8 encoded string of up to 512 bytes
    • -
    • notes: an array containing the unencrypted output notes of the recipients of the asset, of type Note
    • -
    • finalize: a boolean that defines whether the issuance of that specific custom asset is finalized or not
    • + : the Asset description, a UTF-8 encoded string of up to 512 bytes +
    • notes: an array containing the unencrypted output notes of the recipients of the Asset, of type Note
    • +
    • finalize: a boolean that defines whether the issuance of that specific custom Asset is finalized or not
    -

    Once finalize is set to 1, it cannot be unset. For assets whose finalize = 1, no further tokens can be issued, so as seen below, the validators will reject the transaction. For assets whose finalize = 0, new issuance actions can be issued in future transactions. These must use the same asset description, +

    Once finalize is set to 1, it cannot be unset. For Assets whose finalize = 1, no further tokens can be issued, so as seen below, the validators will reject the transaction. For Assets whose finalize = 0, new issuance actions can be issued in future transactions. These must use the same Asset description, \(\mathsf{asset\_desc}\) - , and can either maintain finalize = 0 or change it to finalize = 1, denoting the last transaction containing issuance of such custom asset.

    + , and can either maintain finalize = 0 or change it to finalize = 1, denoting the last transaction containing issuance of such custom Asset.

    @@ -171,7 +171,7 @@ - +
    1 bit finalize booleanThe boolean that determines the finality of the issuance of that assetThe boolean that determines the finality of the issuance of that Asset
    @@ -240,9 +240,9 @@
  • compute \(\mathsf{AssetId}\) as - \(GroupHash^{\mathbb{P}}(ik || asset_desc)\) + \(GroupHash^{\mathbb{P}}(ik || asset\_desc)\)
  • -
  • set the finalize boolean as desired (if more more issuance actions are to be created for this asset identifier, set finalize = 0, otherwise set finalize = 1)
  • +
  • set the finalize boolean as desired (if more more issuance actions are to be created for this Asset identifier, set finalize = 0, otherwise set finalize = 1)
  • For each recipient i:
    • generate a ZSA output note as @@ -265,25 +265,25 @@

      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.

  • Concrete Applications

    -

    Bridging Assets Issuers can wrap assets defined in other chains and issue them at once in a single transaction. The specifics of the bridge are not implemented in the protocol, but there are several ways we conceive issuers can build these bridges (at least centralized bridges):

    +

    Bridging Assets Issuers can wrap Assets defined in other chains and issue them at once in a single transaction. The specifics of the bridge are not implemented in the protocol, but there are several ways we conceive issuers can build these bridges (at least centralized bridges):

    • First, the issuance and burn mechanism can be used in conjunction to determine the

    Asset Features

      -
    • By using the 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, +
    • By using the 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,
        -
      • by setting finalize = 1 from the first issuance action for that asset type, 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.
      • +
      • by setting finalize = 1 from the first issuance action for that Asset type, 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 +
    • 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}\) , while at the same time setting 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 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).
      • + , where the note will contain a 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).
    • Furthermore, NFT issuance is enabled by issuing in a single bundle several issuance actions, where each @@ -333,11 +333,11 @@
    • The issuance key structure was kept aligned to the original key tree in order to ease issuance integration with wallets and to prevent users from having to manage multiple keys and secrets.
    • The \(\mathsf{asset\_desc}\) - is a general byte string in order to allow for a wide range of information type to be included that may be associated with the assets. Some are: + is a general byte string in order to allow for a wide range of information type to be included that may be associated with the Assets. Some are:
      • links for storage such as for NFTs
      • -
      • other metadata for native assets
      • -
      • bridging information for wrapped assets (chain of origin, issuer name, etc)
      • +
      • other metadata for native Assets
      • +
      • bridging information for wrapped Assets (chain of origin, issuer name, etc)
      • information to be committed by the issuer, though not enforceable by the protocol
    • @@ -384,10 +384,10 @@
    T.1b: assetDescription
    -

    UTF-8 encoding of the asset description string.

    +

    UTF-8 encoding of the Asset description string.

    T.1c: isFinalized
    -

    1-byte representation of a boolean flag that is set to 'true' if the asset type was finalized in this action and 'false' otherwise. 'True' is represented as 1, 'false' as 0.

    +

    1-byte representation of a boolean flag that is set to 'true' if the Asset type was finalized in this action and 'false' otherwise. 'True' is represented as 1, 'false' as 0.

    T.2 issuerVerificationKey

    @@ -397,24 +397,24 @@

    Security and Privacy Considerations

    Issuer Key or AssetId Compromise

    -

    The design of this protocol does not allow for a rotation of the issuer validating key, that would allow for replacing the key of a specific asset (see Future Work). In case of compromise, the following actions are recommended:

    +

    The design of this protocol does not allow for a rotation of the issuer validating key, that would allow for replacing the key of a specific Asset (see Future Work). In case of compromise, the following actions are recommended:

      -
    • If an asset ID is compromised (and not the issuer verification key), the finalize boolean for that asset should be set to 0 and a new +
    • If an Asset identifier is compromised (and not the issuer verification key), the finalize boolean for that Asset should be set to 0 and a new \(\mathsf{AssetId}\) generated instead.
    • -
    • If an issuer verification key is compromised, the finalize boolean for all the assets issued with that key should be set to 0 and the issuer should change to a new spending key altogether (for the purpose of issuance), and issue new assets, each with a new +
    • If an issuer verification key is compromised, the finalize boolean for all the Assets issued with that key should be set to 0 and the issuer should change to a new spending key altogether (for the purpose of issuance), 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 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.

    +

    Bridging Assets 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.

    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 issuanceSupplyInfoMap from +

    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 issuanceSupplyInfoMap from \(\mathsf{AssetId}\) to \(\mathsf{issuanceSupplyInfoMap := (totalSupply, finalize)}\) - in order to properly keep track of the total supply for different asset types. This is useful for wallets and other applications that need to keep track of the total supply of assets.

    + in order to properly keep track of the total supply for different Asset types. 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 317b 6.

    @@ -422,7 +422,7 @@

    Future Work

    In future versions of this ZIP, the protocol may also include a "key rotation" mechanism. This would allow an issuer to change the underlying \(\mathsf{ik}\) - of a given asset, in case the original one was compromised, without having to chance the asset identifier altogether.

    + of a given Asset, in case the original one was compromised, without having to change the Asset identifier altogether.

    Test Vectors

    diff --git a/zip-0227.rst b/zip-0227.rst index ba78e7419..81e885e6f 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -27,40 +27,40 @@ The terms "Zcash Shielded Asset" and "Wrapped Asset" in this document are to be We define the following additional terms: -- Custom Asset: A type of note that can be transferred on the Zcash block chain. ZEC is the default (and currently the only defined) asset for the Zcash mainnet. Different custom assets are defined and differentiated by their identifier (:math:`\mathsf{AssetId}`). -- Issuance Action: an instance of a single issuance of a Zcash Shielded Asset. It defines the issuance of a single asset identifier. +- Custom Asset: A type of note that can be transferred on the Zcash block chain. ZEC is the default (and currently the only defined) Asset for the Zcash mainnet. Different custom Assets are defined and differentiated by their identifier (:math:`\mathsf{AssetId}`). +- Issuance Action: an instance of a single issuance of a Zcash Shielded Asset. It defines the issuance of a single Asset identifier. - Issuance Bundle: the bundle in the transaction that contains all the issuance actions of that transaction. Abstract ======== -ZIP 226 [#zip-0226]_ and ZIP 227 [#zip-0227]_ 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 [#zip-0227]_. The transfer and burn of such assets is defined in ZIP 226 [#zip-0226]_. This ZIP must only be implemented in conjuction with ZIP 226 [#zip-0226]_, as the issuance mechanism is only valid for the ZSA transfer protocol, because it produces notes that can only be transferred under ZSA. +ZIP 226 [#zip-0226]_ and ZIP 227 [#zip-0227]_ 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 [#zip-0227]_. The transfer and burn of such Assets is defined in ZIP 226 [#zip-0226]_. This ZIP must only be implemented in conjuction with ZIP 226 [#zip-0226]_, as the issuance mechanism is only valid for the ZSA transfer protocol, because it produces notes that can only be transferred under ZSA. Motivation ========== -The Orchard protocol deployed in NU5 does not support custom assets. Enabling multi-asset support on the Zcash chain will open the door for a host of applications and enhance the ecosystem with application developers and asset custody institutions for issuance and +The Orchard protocol deployed in NU5 does not support custom Assets. Enabling multi-Asset support on the Zcash chain will open the door for a host of applications and enhance the ecosystem with application developers and Asset custody institutions for issuance and bridging purposes. Use Cases ========= -The design presented in this ZIP enables issuance of shielded assets in various modes: +The design presented in this ZIP enables issuance of shielded Assets in various modes: -- The issuer knows in advance the receivers of the issued asset. -- The asset can be of non-fungible type, where each asset type can be made part of a single “series”. -- The supply of the asset can be limited in advance or not. -- The asset can be a wrapped version of an asset issued by another chain (as long as there is a bridge that supports transfer of that asset between chains). +- The issuer knows in advance the receivers of the issued Asset. +- The Asset can be of non-fungible type, where each Asset type can be made part of a single “series”. +- The supply of the Asset can be limited in advance or not. +- The Asset can be a wrapped version of an Asset issued by another chain (as long as there is a bridge that supports transfer of that Asset between chains). See the `Concrete Applications`_ section for more details. Requirements ============ -- Any user of the Zcash block chain can issue custom assets on chain. -- The issuance mechanism should enable tracking publicly the supply of the assets on the Zcash block chain. -- Issuing or changing the attributes of a specific asset should require cryptographic authorization. -- The asset identification should be unique (among all shielded pools) and different issuer public keys should not be able to generate the same asset identifier. +- Any user of the Zcash block chain can issue custom Assets on chain. +- The issuance mechanism should enable public tracking of the supply of the Assets on the Zcash block chain. +- Issuing or changing the attributes of a specific Asset should require cryptographic authorization. +- The Asset identification should be unique (among all shielded pools) and different issuer public keys should not be able to generate the same Asset identifier. Specification @@ -71,24 +71,24 @@ As explained, the issuance protocol allows for a single issuance action to be se Overview -------- -This specification enables only *transparent* issuance, since as a first step, transparency is important to properly test the applications that will be most used in the Zcash ecosystem, while enabling tracking of supply of assets. Any user of the block chain can issue new asset types, yet only a single issuer (a set of keys) can issue that specific asset type, as the asset identifiers are tied to the issuer keys. +This specification enables only *transparent* issuance, since as a first step, transparency is important to properly test the applications that will be most used in the Zcash ecosystem, while enabling tracking of supply of Assets. Any user of the block chain can issue new Asset types, yet only a single issuer (a set of keys) can issue that specific Asset type, as the Asset identifiers are tied to the issuer keys. The protocol was designed with three main properties in mind: - At the time of issuance, the issuer can already allocate all the tokens to the corresponding owners by creating the corresponding (shielded) output notes to the respective addresses. As is implied, the issuance mechanism is itself transparent, but the allocation is totally private. -- In a single issuance bundle, the issuer can publish many issuance actions, or in other words, create multiple custom assets. -- Every issuance action contains the ``finalize`` boolean that defines whether that specific custom asset can have further tokens issued or not. +- In a single issuance bundle, the issuer can publish many issuance actions, or in other words, create multiple custom Assets. +- Every issuance action contains the ``finalize`` boolean that defines whether that specific custom Asset can have further tokens issued or not. -The issuance mechanism is broad enough for issuers to either create native 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. In fact, the protocol described below enables what we hope will be a useful set of applications. The design decision is not to have a chosen name to describe the custom asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”. +The issuance mechanism is broad enough for issuers to either create native 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. In fact, the protocol described below enables what we hope will be a useful set of applications. The design decision is not to have a chosen name to describe the custom Asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”. Issuance Keys ------------- There are two keys relevant to the Issuer: -1. The issuance authorizing key, denoted as :math:`\mathsf{isk}`, is the key that is used to sign the issuance transaction. This key is used to authorize the issuance of a specific asset type, and is only used by the issuer. Throughout we also call this key the issuer signature key. +1. The issuance authorizing key, denoted as :math:`\mathsf{isk}`, is the key that is used to sign the issuance transaction. This key is used to authorize the issuance of a specific Asset type, and is only used by the issuer. Throughout we also call this key the issuer signature key. -2. The issuance validating key, denoted as :math:`\mathsf{ik}`, is the key that is used to validate the issuance transaction. This key is used to validate the issuance of a specific asset type, and is used by all block chain users (specifically the asset owners and consensus validators) to associate the asset in question with the issuer. Throughout we also call this key the issuer verification key. +2. The issuance validating key, denoted as :math:`\mathsf{ik}`, is the key that is used to validate the issuance transaction. This key is used to validate the issuance of a specific Asset type, and is used by all block chain users (specifically the Asset owners and consensus validators) to associate the Asset in question with the issuer. Throughout we also call this key the issuer verification key. The two keys are derived in an analogous manner to the spend authorizing key and spend validating key, using the same signature scheme, as described in ZIP 32 [#zip-0032]_ and in accordance with ZIP 316 [#zip-0316]_. @@ -100,21 +100,21 @@ The two keys are derived in an analogous manner to the spend authorizing key and .. math:: \mathsf{ik := SpendAuthSig^{Orchard}.DerivePublic(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 [#zip-0032]_, and can further be in 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. +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 [#zip-0032]_, and can further be in 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. Asset Identifier ---------------- -For every new asset, there must be a new and unique identifier of the asset. Every asset is defined by the asset description, :math:`\mathsf{asset\_desc}`, which is a global byte string (valid across all -future- Zcash shielded protocols). From this asset description, the specific asset identifier, :math:`\mathsf{AssetId}`, is derived with a `GroupHash` and used within the output notes, as defined by the specific protocol (e.g. for now Orchard-style, using Pallas curve). +For every new Asset, there must be a new and unique identifier of the Asset. Every Asset is defined by the Asset description, :math:`\mathsf{asset\_desc}`, which is a global byte string (valid across all -future- Zcash shielded protocols). From this Asset description, the specific Asset identifier, :math:`\mathsf{AssetId}`, is derived with a `GroupHash` and used within the output notes, as defined by the specific protocol (e.g. for now Orchard-style, using Pallas curve). -The main requirement for the asset identifier is for it to be collision-free, as two different issuers MUST not be able to issue the same asset type. One way to achieve this is to make the identifier dependent on the issuer keys, as the issuer keys are unique to each issuer. We achieve this by deriving the asset identifier, :math:`\mathsf{AssetId}` as follows: +The main requirement for the Asset identifier is for it to be collision-free, as two different issuers MUST not be able to issue the same Asset type. One way to achieve this is to make the identifier dependent on the issuer keys, as the issuer keys are unique to each issuer. We achieve this by deriving the Asset identifier, :math:`\mathsf{AssetId}` as follows: :math:`\mathsf{AssetId := GroupHash^{\mathbb{P}}}\mathsf{(ik || asset\_desc)}` where -- :math:`\mathsf{asset\_desc}` is the asset description, a UTF-8 encoded string of up to 512 bytes, which includes any information pertaining to the issuance -- :math:`\mathsf{ik}` is the issuance validating key of the issuer, used to verify the signature on the transaction SIGHASH and is defined above +- :math:`\mathsf{asset\_desc}` is the Asset description, a UTF-8 encoded string of up to 512 bytes, which includes any information pertaining to the issuance. +- :math:`\mathsf{ik}` is the issuance validating key of the issuer, used to verify the signature on the transaction SIGHASH and is defined above. Global Issuance State --------------------- @@ -126,13 +126,13 @@ Issuance requires the following additions to the global state: Issuance Action Description --------------------------- -An issuance action, `IssueAction`, is the instance of issuing a specific custom asset, and contains the following fields: +An issuance action, `IssueAction`, is the instance of issuing a specific custom Asset, and contains the following fields: -- :math:`\mathsf{asset\_desc}`: the asset description, a UTF-8 encoded string of up to 512 bytes -- `notes`: an array containing the unencrypted output notes of the recipients of the asset, of type `Note` -- ``finalize``: a boolean that defines whether the issuance of that specific custom asset is finalized or not +- :math:`\mathsf{asset\_desc}`: the Asset description, a UTF-8 encoded string of up to 512 bytes +- `notes`: an array containing the unencrypted output notes of the recipients of the Asset, of type `Note` +- ``finalize``: a boolean that defines whether the issuance of that specific custom Asset is finalized or not -Once ``finalize`` is set to 1, it cannot be unset. For assets whose ``finalize = 1``, no further tokens can be issued, so as seen below, the validators will reject the transaction. For assets whose ``finalize = 0``, new issuance actions can be issued in future transactions. These must use the same asset description, :math:`\mathsf{asset\_desc}`, and can either maintain ``finalize = 0`` or change it to ``finalize = 1``, denoting the last transaction containing issuance of such custom asset. +Once ``finalize`` is set to 1, it cannot be unset. For Assets whose ``finalize = 1``, no further tokens can be issued, so as seen below, the validators will reject the transaction. For Assets whose ``finalize = 0``, new issuance actions can be issued in future transactions. These must use the same Asset description, :math:`\mathsf{asset\_desc}`, and can either maintain ``finalize = 0`` or change it to ``finalize = 1``, denoting the last transaction containing issuance of such custom Asset. ================= =============================== ========================== ======================================================================== Size Name Data Type Description @@ -140,7 +140,7 @@ Size Name Data Type Des Varies :math:`\mathsf{asset\_desc}` byte Uni-code encoded string of varied size, up to 512 bytes Varies nNotes compactSize The number of notes in the issuance action noteSize * nNotes vNotes Note[nNotes] A sequence of note descriptions within the issuance action -1 bit ``finalize`` boolean The boolean that determines the finality of the issuance of that asset +1 bit ``finalize`` boolean The boolean that determines the finality of the issuance of that Asset ================= =============================== ========================== ======================================================================== 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. @@ -172,8 +172,8 @@ The issuer program performs the following operations For all actions `IssueAction`: - encode :math:`\mathsf{asset\_desc}` as 512 byte-string -- compute :math:`\mathsf{AssetId}` as :math:`GroupHash^{\mathbb{P}}(ik || asset_desc)` -- set the ``finalize`` boolean as desired (if more more issuance actions are to be created for this asset identifier, set ``finalize = 0``, otherwise set ``finalize = 1``) +- compute :math:`\mathsf{AssetId}` as :math:`GroupHash^{\mathbb{P}}(ik || asset\_desc)` +- set the ``finalize`` boolean as desired (if more more issuance actions are to be created for this Asset identifier, set ``finalize = 0``, otherwise set ``finalize = 1``) - For each recipient ``i``: - generate a ZSA output note as :math:`\mathsf{ note_i =(d_i, {pk_d}_i, v_i, \rho_i, \psi_i, \mathsf{AssetId}, rcm_i)}` @@ -193,20 +193,20 @@ Concrete Applications --------------------- **Bridging Assets** -Issuers can wrap assets defined in other chains and issue them at once in a single transaction. The specifics of the bridge are not implemented in the protocol, but there are several ways we conceive issuers can build these bridges (at least centralized bridges): +Issuers can wrap Assets defined in other chains and issue them at once in a single transaction. The specifics of the bridge are not implemented in the protocol, but there are several ways we conceive issuers can build these bridges (at least centralized bridges): - First, the issuance and burn mechanism can be used in conjunction to determine the **Asset Features** -- By using the ``finalize`` boolean and the burning mechanism defined in [#zip-0226]_, issuers can control the supply production of any asset associated to their issuer keys. For example, +- By using the ``finalize`` boolean and the burning mechanism defined in [#zip-0226]_, issuers can control the supply production of any Asset associated to their issuer keys. For example, - - by setting ``finalize = 1`` from the first issuance action for that asset type, 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. + - by setting ``finalize = 1`` from the first issuance action for that Asset type, 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 +- 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 :math:`\mathsf{AssetId}`, while at the same time setting ``finalize = 1``, or by - - issuing a transaction with a single note in the issuance action pertaining to that :math:`\mathsf{AssetId}`, where the note will contain a ``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). + - issuing a transaction with a single note in the issuance action pertaining to that :math:`\mathsf{AssetId}`, where the note will contain a ``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). - Furthermore, NFT issuance is enabled by issuing in a single bundle several issuance actions, where each :math:`\mathsf{AssetId}` corresponds to ``value = 1`` at the fundamental unit level. Issuers and users should make sure that ``finalize = 1`` for each of the actions in this scenario. @@ -235,11 +235,11 @@ Rationale The following is a list of rationale for different decisions made in the proposal: - The issuance key structure was kept aligned to the original key tree in order to ease issuance integration with wallets and to prevent users from having to manage multiple keys and secrets. -- The :math:`\mathsf{asset\_desc}` is a general byte string in order to allow for a wide range of information type to be included that may be associated with the assets. Some are: +- The :math:`\mathsf{asset\_desc}` is a general byte string in order to allow for a wide range of information type to be included that may be associated with the Assets. Some are: - links for storage such as for NFTs - - other metadata for native assets - - bridging information for wrapped assets (chain of origin, issuer name, etc) + - other metadata for native Assets + - bridging information for wrapped Assets (chain of origin, issuer name, etc) - information to be committed by the issuer, though not enforceable by the protocol TxId Digest @@ -305,11 +305,11 @@ The ZIP 212 32-byte seed randomness for a note. T.1b: assetDescription '''''''''''''''''''''' -UTF-8 encoding of the asset description string. +UTF-8 encoding of the Asset description string. T.1c: isFinalized ''''''''''''''''' -1-byte representation of a boolean flag that is set to 'true' if the asset type was finalized in this action and 'false' otherwise. 'True' is represented as 1, 'false' as 0. +1-byte representation of a boolean flag that is set to 'true' if the Asset type was finalized in this action and 'false' otherwise. 'True' is represented as 1, 'false' as 0. T.2 issuerVerificationKey @@ -322,13 +322,13 @@ Security and Privacy Considerations **Issuer Key or AssetId Compromise** -The design of this protocol does not allow for a rotation of the issuer validating key, that would allow for replacing the key of a specific asset (see Future Work). In case of compromise, the following actions are recommended: +The design of this protocol does not allow for a rotation of the issuer validating key, that would allow for replacing the key of a specific Asset (see Future Work). In case of compromise, the following actions are recommended: -- If an asset ID is compromised (and not the issuer verification key), the ``finalize`` boolean for that asset should be set to `0` and a new :math:`\mathsf{AssetId}` generated instead. -- If an issuer verification key is compromised, the ``finalize`` boolean for all the assets issued with that key should be set to `0` and the issuer should change to a new spending key altogether (for the purpose of issuance), and issue new assets, each with a new :math:`\mathsf{AssetId}`. +- If an Asset identifier is compromised (and not the issuer verification key), the ``finalize`` boolean for that Asset should be set to `0` and a new :math:`\mathsf{AssetId}` generated instead. +- If an issuer verification key is compromised, the ``finalize`` boolean for all the Assets issued with that key should be set to `0` and the issuer should change to a new spending key altogether (for the purpose of issuance), and issue new Assets, each with a new :math:`\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 [#zip-0226]_. 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 [#zip-0226]_. 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 ==================== @@ -336,7 +336,7 @@ 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 `issuanceSupplyInfoMap` from :math:`\mathsf{AssetId}` to :math:`\mathsf{issuanceSupplyInfoMap := (totalSupply, finalize)}` in order to properly keep track of the total supply for different asset types. This is useful for wallets and other applications that need to keep track of the total supply of assets. +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 `issuanceSupplyInfoMap` from :math:`\mathsf{AssetId}` to :math:`\mathsf{issuanceSupplyInfoMap := (totalSupply, finalize)}` in order to properly keep track of the total supply for different Asset types. This is useful for wallets and other applications that need to keep track of the total supply of Assets. Fee Structures -------------- @@ -346,7 +346,7 @@ The fee mechanism described in this ZIP will follow the mechanism described in Z Future Work ----------- -In future versions of this ZIP, the protocol may also include a "key rotation" mechanism. This would allow an issuer to change the underlying :math:`\mathsf{ik}` of a given asset, in case the original one was compromised, without having to chance the asset identifier altogether. +In future versions of this ZIP, the protocol may also include a "key rotation" mechanism. This would allow an issuer to change the underlying :math:`\mathsf{ik}` of a given Asset, in case the original one was compromised, without having to change the Asset identifier altogether. Test Vectors ============ From 8ed51c2444418e5eb675d94e7290bd9476fef138 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Tue, 27 Dec 2022 00:37:31 +0530 Subject: [PATCH 033/101] streamlining zip definitions, updating motivation for ZIP 227 --- zip-0226.html | 22 ++++++++++++---------- zip-0226.rst | 6 +++--- zip-0227.html | 21 ++++++++------------- zip-0227.rst | 8 +++----- 4 files changed, 26 insertions(+), 31 deletions(-) diff --git a/zip-0226.html b/zip-0226.html index 49b626eef..830922e77 100644 --- a/zip-0226.html +++ b/zip-0226.html @@ -31,11 +31,11 @@ parameter.
    • ZEC is the default (and currently the only defined) Asset for the Zcash mainnet.
    • +
    • We use the term "custom Asset" to refer to any Asset other than ZEC.
  • Zcash Shielded Asset: an Asset with issuance defined on the Zcash block chain, and, for now, belonging to the Orchard shielded pool.
  • Wrapped Asset: a Zcash Shielded Asset with native issuance defined outside the Zcash block chain.
  • -
  • Native Asset: a Zcash Shielded Asset created uniquely within the Zcash block chain.
  • Split Input: an Action input identifying a Zcash Shielded Asset note, used to ensure that the output note of that Action is of a validly issued \(\mathsf{AssetId}\) when there is no corresponding real input note to spend. The Action does not spend the note identified by the Split Input.
  • @@ -149,8 +149,10 @@ \(\mathsf{AssetId}\) , and

    - \(\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}}:=\mathsf{AssetId}= \mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv", "a" || } \mathsf{ik} \texttt{ || } \mathsf{asset\_desc} \texttt{)}\) -

    + \(\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}}:=\mathsf{AssetId}\) + , where the Asset identifier + \(\mathsf{AssetId}\) + is computed as defined in ZIP 227 5.

    \(\mathcal{R}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv", "r")}\)

    @@ -159,7 +161,7 @@ .

    Value Balance Verification

    -

    In order to verify the balance of the different Assets, the verifier MUST perform exactly the same process as for the Orchard protocol 7. The main reason why no changes to this process are needed is that no custom Assets can be unshielded, so all custom Assets are contained within the shielded pool. This means that the net balance of the input and output values is zero, with only one Asset identifier of value balance published, that of ZEC, +

    In order to verify the balance of the different Assets, the verifier MUST perform exactly the same process as for the Orchard protocol 7. The main reason why no changes to this process are needed is that no custom Assets can be unshielded, so all custom Assets are contained within the shielded pool. This means that the net balance of the input and output values is zero, with only one Asset identifier of value balance published, that of ZEC, \(\mathsf{v^{balanceOrchard}}\) . No net amount of any other Asset identifier will be revealed, and the number of Asset identifiers in the transaction is also hidden. The only exception to this is in the case that an Asset is burnt, as we will see below in the burn mechanism.

    For a total of @@ -172,13 +174,13 @@

    \(\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} = \sum \mathsf{rcv_{i}^{net}}\mathcal{R}^{\mathsf{Orchard}}\)

    -

    and use it to verify the bindingSignature on the SIGHASH message, as described in §4.14 of the Zcash Specification 7.

    +

    and use it to verify the bindingSignature on the SIGHASH message, as described in §4.14 of the Zcash Specification 7.

    As in the Orchard protocol, the binding signature verification key, \(\mathsf{bvk}\) , will only be valid (and hence verify the signature correctly), as long as the committed values sum to zero. In contrast, in this protocol, the committed values only sum to zero per Asset identifier, as the Pedersen commitments add up homomorphically only with respect to the same value base point.

    Split Notes

    -

    One of the key functionalities in a UTXO-based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This requires a 1-to-many (Orchard) transaction. However, because each Action represents an input and an output, the resulting transaction must have multiple inputs. In order to cope with this today, the Actions that have not been assigned input notes are instead given dummy spend notes 12, which we call split Actions and split notes respectively. Basically, the input note is “faked” inside of the proof in order to hide which Action contains the real spend note.

    +

    One of the key functionalities in a UTXO-based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This requires a 1-to-many (Orchard) transaction. However, because each Action represents an input and an output, the resulting transaction must have multiple inputs. In order to cope with this today, the Actions that have not been assigned input notes are instead given dummy spend notes 12, which we call split Actions and split notes respectively. Basically, the input note is “faked” inside of the proof in order to hide which Action contains the real spend note.

    This, however, brings some issues when it comes to adding multiple Asset identifiers, as the output note of the split Actions cannot be of any Asset identifier, it must be enforced to be an actual output of a GroupHash computation (in fact we want it to be of the same identifier as the original input note, but the binding signature takes care that the proper balancing is performed). If not, then the prover could essentially input a multiple (or linear combination) of an existing identifier, with the goal to attack the network by overflowing the ZEC value balance and hence counterfeiting ZEC funds.

    In order to prevent this, we make some modifications to the circuit. Specifically we remove the dummy note functionality for custom Assets and we enforce that every input note to an ZSA Action must be proven to exist in the set of note commitments in the note commitment tree. We then enforce this real note to be “unspendable” in the sense that its value will be zeroed in split Actions and the nullifier will be randomized, making the note not spendable in the specific Action. Then, the proof itself ensures that the output note is of the same identifier as the input note. In the circuit, the split note functionality will be activated by a boolean private input to the proof.

    This creates a chain of induction that ensures that the value base points of all output notes of a transfer are actual outputs of a GroupHash, as they originate in the Issuance protocol which is publicly verified. If this were not done then it would be possible to violate balance, for example by using a value base point derived from those of other Assets.

    @@ -197,7 +199,7 @@

    Circuit Statement

    -

    The advantage of the design described above, with respect to the circuit statement, is that every ZSA Action statement is kept closely similar to the Orchard Action statement 13, except for a few additions that ensure the security of the Asset identifier system.

    +

    The advantage of the design described above, with respect to the circuit statement, is that every ZSA Action statement is kept closely similar to the Orchard Action statement 13, except for a few additions that ensure the security of the Asset identifier system.

    Asset Identifier Equality: the following constraints must be added to ensure that the input and output note are of the same \(\mathsf{AssetId}\) :

    @@ -327,7 +329,7 @@

    Backward Compatibility

    -

    In order to have a "clean" backwards compatibility with the ZEC notes, we have designed the circuit to support both ZEC and ZSA notes. As we specify above, there are three main reasons we can do this: - The input notes with an Asset identifer denote the ZSA custom Assets, generating a note commitment that includes the Asset identifer; whereas the notes without an identifier, denote the ZEC notes, and generate a note commitment that does not include the Asset identifier, in order to maintain the referencability to the Merkle tree - The value commitment is abstracted to allow for the value base-point as a variable private input to the proof - The ZEC-based actions will still include dummy input notes, whereas the ZSA-based actions will include split input notes

    +

    In order to have a "clean" backwards compatibility with the ZEC notes, we have designed the circuit to support both ZEC and ZSA notes. As we specify above, there are three main reasons we can do this: - The input notes with an Asset identifer denote the custom Assets, generating a note commitment that includes the Asset identifer; whereas the notes without an identifier, denote the ZEC notes, and generate a note commitment that does not include the Asset identifier, in order to maintain the referencability to the Merkle tree - The value commitment is abstracted to allow for the value base-point as a variable private input to the proof - The ZEC-based actions will still include dummy input notes, whereas the ZSA-based actions will include split input notes

    Burn Mechanism

    @@ -355,7 +357,7 @@

    Note: Even if this mechanism allows having transparent ↔ shielded Asset transfers in theory, the transparent protocol will not be changed with this ZIP to adapt to a multiple Asset structure. This means that unless future consensus rules changes do allow it, unshielding will not be possible for custom Assets.

    ZSA Transaction Structure

    -

    Similar to version 5 transaction format, with the following modifications to the Orchard bundle, as defined in 14:

    +

    Similar to version 5 transaction format, with the following modifications to the Orchard bundle, as defined in 14:

    @@ -386,7 +388,7 @@

    Other Considerations

    Transaction Fees

    -

    The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317b 16.

    +

    The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317b 16.

    Security and Privacy

      diff --git a/zip-0226.rst b/zip-0226.rst index 006870fc6..8ac23d89f 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -29,10 +29,10 @@ We define the following additional terms: - Asset: A type of note that can be transferred on the Zcash block chain, identified by the :math:`\mathsf{AssetId}` parameter. - ZEC is the default (and currently the only defined) Asset for the Zcash mainnet. + - We use the term "custom Asset" to refer to any Asset other than ZEC. - Zcash Shielded Asset: an Asset with issuance defined on the Zcash block chain, and, for now, belonging to the Orchard shielded pool. - Wrapped Asset: a Zcash Shielded Asset with native issuance defined outside the Zcash block chain. -- Native Asset: a Zcash Shielded Asset created uniquely within the Zcash block chain. - Split Input: an Action input identifying a Zcash Shielded Asset note, used to ensure that the output note of that Action is of a validly issued :math:`\mathsf{AssetId}` when there is no corresponding real input note to spend. The Action does not spend the note identified by the Split Input. - Split Action: a Zcash Shielded Asset Action that contains a Split Input. @@ -120,7 +120,7 @@ where :math:`\mathsf{v^{net}_{AssetId}} = \mathsf{v^{old}_{AssetId} - v^{new}_{A .. _`value base`: -:math:`\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}}:=\mathsf{AssetId}= \mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv", "a" || } \mathsf{ik} \texttt{ || } \mathsf{asset\_desc} \texttt{)}` +:math:`\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}}:=\mathsf{AssetId}`, where the Asset identifier :math:`\mathsf{AssetId}` is computed as defined in ZIP 227 [#zip-0227]_. :math:`\mathcal{R}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv", "r")}` @@ -211,7 +211,7 @@ Backward Compatibility ---------------------- In order to have a "clean" backwards compatibility with the ZEC notes, we have designed the circuit to support both ZEC and ZSA notes. As we specify above, there are three main reasons we can do this: -- The input notes with an Asset identifer denote the ZSA custom Assets, generating a note commitment that includes the Asset identifer; whereas the notes without an identifier, denote the ZEC notes, and generate a note commitment that does not include the Asset identifier, in order to maintain the referencability to the Merkle tree +- The input notes with an Asset identifer denote the custom Assets, generating a note commitment that includes the Asset identifer; whereas the notes without an identifier, denote the ZEC notes, and generate a note commitment that does not include the Asset identifier, in order to maintain the referencability to the Merkle tree - The value commitment is abstracted to allow for the value base-point as a variable private input to the proof - The ZEC-based actions will still include dummy input notes, whereas the ZSA-based actions will include split input notes diff --git a/zip-0227.html b/zip-0227.html index 23bdaaf02..18712cc6d 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -24,12 +24,9 @@

      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 "Zcash Shielded Asset" and "Wrapped Asset" in this document are to be interpreted as described in ZIP 226 4.

      +

      The terms "Asset", "custom Asset", and "Wrapped Asset" in this document are to be interpreted as described in ZIP 226 4.

      We define the following additional terms:

        -
      • Custom Asset: A type of note that can be transferred on the Zcash block chain. ZEC is the default (and currently the only defined) Asset for the Zcash mainnet. Different custom Assets are defined and differentiated by their identifier ( - \(\mathsf{AssetId}\) - ).
      • Issuance Action: an instance of a single issuance of a Zcash Shielded Asset. It defines the issuance of a single Asset identifier.
      • Issuance Bundle: the bundle in the transaction that contains all the issuance actions of that transaction.
      @@ -38,7 +35,7 @@

      ZIP 226 4 and ZIP 227 5 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 5. 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.

    Motivation

    -

    The Orchard protocol deployed in NU5 does not support custom Assets. Enabling multi-Asset support on the Zcash chain will open the door for a host of applications and enhance the ecosystem with application developers and Asset custody institutions for issuance and bridging purposes.

    +

    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.

    Use Cases

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

    @@ -80,7 +77,7 @@ \(\mathsf{ik}\) , is the key that is used to validate the issuance transaction. This key is used to validate the issuance of a specific Asset type, and is used by all block chain users (specifically the Asset owners and consensus validators) to associate the Asset in question with the issuer. Throughout we also call this key the issuer verification key. -

    The two keys are derived in an analogous manner to the spend authorizing key and spend validating key, using the same signature scheme, as described in ZIP 32 7 and in accordance with ZIP 316 8.

    +

    The two keys are derived in an analogous manner to the spend authorizing key and spend validating key, using the same signature scheme, as described in ZIP 32 7 and in accordance with ZIP 316 8.

    • The issuance authorizing key is derived directly from the spending key, \(\mathsf{sk}\) @@ -93,7 +90,7 @@ , as a public verification key:
    \(\mathsf{ik := SpendAuthSig^{Orchard}.DerivePublic(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 7, and can further be in 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.

    +

    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 7, and can further be in 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.

    Asset Identifier

    For every new Asset, there must be a new and unique identifier of the Asset. Every Asset is defined by the Asset description, @@ -104,9 +101,7 @@

    The main requirement for the Asset identifier is for it to be collision-free, as two different issuers MUST not be able to issue the same Asset type. One way to achieve this is to make the identifier dependent on the issuer keys, as the issuer keys are unique to each issuer. We achieve this by deriving the Asset identifier, \(\mathsf{AssetId}\) as follows:

    -

    - \(\mathsf{AssetId := GroupHash^{\mathbb{P}}}\mathsf{(ik || asset\_desc)}\) -

    +
    \(\mathsf{AssetId}= \mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv",} \mathsf{ik}\texttt{||}\mathsf{asset\_desc} \texttt{)}\)

    where

    • @@ -271,7 +266,7 @@

    Asset Features

      -
    • By using the 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, +
    • By using the 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,
      • by setting finalize = 1 from the first issuance action for that Asset type, 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.
      @@ -406,7 +401,7 @@ \(\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 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.

    +

    Bridging Assets 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.

    Other Considerations

    Implementing Zcash Nodes

    @@ -417,7 +412,7 @@ in order to properly keep track of the total supply for different Asset types. 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 317b 6.

    +

    The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317b 6.

    Future Work

    In future versions of this ZIP, the protocol may also include a "key rotation" mechanism. This would allow an issuer to change the underlying diff --git a/zip-0227.rst b/zip-0227.rst index 81e885e6f..c21bb1af6 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -23,11 +23,10 @@ The term "network upgrade" in this document is to be interpreted as described in The term "Orchard" in this document is to be interpreted as described in ZIP 224 [#zip-0224]_. -The terms "Zcash Shielded Asset" and "Wrapped Asset" in this document are to be interpreted as described in ZIP 226 [#zip-0226]_. +The terms "Asset", "custom Asset", and "Wrapped Asset" in this document are to be interpreted as described in ZIP 226 [#zip-0226]_. We define the following additional terms: -- Custom Asset: A type of note that can be transferred on the Zcash block chain. ZEC is the default (and currently the only defined) Asset for the Zcash mainnet. Different custom Assets are defined and differentiated by their identifier (:math:`\mathsf{AssetId}`). - Issuance Action: an instance of a single issuance of a Zcash Shielded Asset. It defines the issuance of a single Asset identifier. - Issuance Bundle: the bundle in the transaction that contains all the issuance actions of that transaction. @@ -39,8 +38,7 @@ ZIP 226 [#zip-0226]_ and ZIP 227 [#zip-0227]_ propose in conjunction the Zcash S Motivation ========== -The Orchard protocol deployed in NU5 does not support custom Assets. Enabling multi-Asset support on the Zcash chain will open the door for a host of applications and enhance the ecosystem with application developers and Asset custody institutions for issuance and -bridging purposes. +This ZIP is a supporting ZIP for ZIP 226 [#zip-0226]_, 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. Use Cases ========= @@ -109,7 +107,7 @@ For every new Asset, there must be a new and unique identifier of the Asset. Eve The main requirement for the Asset identifier is for it to be collision-free, as two different issuers MUST not be able to issue the same Asset type. One way to achieve this is to make the identifier dependent on the issuer keys, as the issuer keys are unique to each issuer. We achieve this by deriving the Asset identifier, :math:`\mathsf{AssetId}` as follows: -:math:`\mathsf{AssetId := GroupHash^{\mathbb{P}}}\mathsf{(ik || asset\_desc)}` +.. math:: \mathsf{AssetId}= \mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv",} \mathsf{ik}\texttt{||}\mathsf{asset\_desc} \texttt{)} where From 5c6aad43c9b8d0867e1430b2847f415becb299bf Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Tue, 27 Dec 2022 14:21:16 +0530 Subject: [PATCH 034/101] edits to reword native assets, and make Wrapped Asset usage consistent throughout the ZIPs --- zip-0226.html | 4 ++-- zip-0226.rst | 4 ++-- zip-0227.html | 10 +++++----- zip-0227.rst | 10 +++++----- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/zip-0226.html b/zip-0226.html index 830922e77..3abc88546 100644 --- a/zip-0226.html +++ b/zip-0226.html @@ -76,7 +76,7 @@ of the output note of that split Action is the output of a PRF.

    Finally, in this ZIP we also describe the burn mechanism, which is a direct extension of the transfer mechanism. The burn process uses a similar mechanism to what is used in Orchard to unshield ZEC, by using the \(\mathsf{valueBalance}\) - of the Asset in question. Burning Assets is useful for many purposes, including bridging of Wrapped Assets and removing supply of Native Assets.

    + of the Asset in question. Burning Assets is useful for many purposes, including bridging of Wrapped Assets and removing supply of Assets.

    Specification

    Most of the protocol is kept the same as the Orchard protocol released with NU5, except for the following.

    @@ -333,7 +333,7 @@

    Burn Mechanism

    -

    The burn mechanism may be needed for off-boarding the Wrapped Assets from the chain, or enabling advanced tokenomics on native tokens. It is part of the Issuance/Burn protocol, but given that it can be seen as an extension of the Transfer protocol, we add it here for readability.

    +

    The burn mechanism may be needed for off-boarding the Wrapped Assets from the chain, or enabling advanced tokenomics on Assets. It is part of the Issuance/Burn protocol, but given that it can be seen as an extension of the Transfer protocol, we add it here for readability.

    In essence, the burn mechanism is a transparent / revealing extension to the transfer protocol that enables a specific amount of any Asset identifier to be sent into “oblivion”. Our burn mechanism does NOT send Assets to a non-spendable address, it simply reduces the total number of units of a given Asset in circulation at the consensus level. It is enforced at the consensus level, by using an extension of the value balance mechanism used for ZEC Assets.

    First, contrary to the strict transfer transaction, we allow the sender to include a \(\mathsf{valueBalance_{AssetId}}\) diff --git a/zip-0226.rst b/zip-0226.rst index 8ac23d89f..34900eb79 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -60,7 +60,7 @@ Because in a single transaction all value commitments are balanced, there must b In order to ensure the security of the transfers, and as we will explain below, we are redefining input dummy notes for custom Assets, as we need to enforce that the :math:`\mathsf{AssetId}` of the output note of that split Action is the output of a PRF. -Finally, in this ZIP we also describe the *burn* mechanism, which is a direct extension of the transfer mechanism. The burn process uses a similar mechanism to what is used in Orchard to unshield ZEC, by using the :math:`\mathsf{valueBalance}` of the Asset in question. Burning Assets is useful for many purposes, including bridging of Wrapped Assets and removing supply of Native Assets. +Finally, in this ZIP we also describe the *burn* mechanism, which is a direct extension of the transfer mechanism. The burn process uses a similar mechanism to what is used in Orchard to unshield ZEC, by using the :math:`\mathsf{valueBalance}` of the Asset in question. Burning Assets is useful for many purposes, including bridging of Wrapped Assets and removing supply of Assets. Specification ============= @@ -218,7 +218,7 @@ In order to have a "clean" backwards compatibility with the ZEC notes, we have d Burn Mechanism ============== -The burn mechanism may be needed for off-boarding the Wrapped Assets from the chain, or enabling advanced tokenomics on native tokens. It is part of the Issuance/Burn protocol, but given that it can be seen as an extension of the Transfer protocol, we add it here for readability. +The burn mechanism may be needed for off-boarding the Wrapped Assets from the chain, or enabling advanced tokenomics on Assets. It is part of the Issuance/Burn protocol, but given that it can be seen as an extension of the Transfer protocol, we add it here for readability. In essence, the burn mechanism is a transparent / revealing extension to the transfer protocol that enables a specific amount of any Asset identifier to be sent into “oblivion”. Our burn mechanism does NOT send Assets to a non-spendable address, it simply reduces the total number of units of a given Asset in circulation at the consensus level. It is enforced at the consensus level, by using an extension of the value balance mechanism used for ZEC Assets. diff --git a/zip-0227.html b/zip-0227.html index 18712cc6d..8899bb4d8 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -65,7 +65,7 @@

  • In a single issuance bundle, the issuer can publish many issuance actions, or in other words, create multiple custom Assets.
  • Every issuance action contains the finalize boolean that defines whether that specific custom Asset can have further tokens issued or not.
  • -

    The issuance mechanism is broad enough for issuers to either create native 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. In fact, the protocol described below enables what we hope will be a useful set of applications. The design decision is not to have a chosen name to describe the custom Asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”.

    +

    The issuance mechanism 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. In fact, the protocol described below enables what we hope will be a useful set of applications. The design decision is not to have a chosen name to describe the custom Asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”.

    Issuance Keys

    There are two keys relevant to the Issuer:

    @@ -330,10 +330,10 @@ \(\mathsf{asset\_desc}\) is a general byte string in order to allow for a wide range of information type to be included that may be associated with the Assets. Some are:
      -
    • links for storage such as for NFTs
    • -
    • other metadata for native Assets
    • -
    • bridging information for wrapped Assets (chain of origin, issuer name, etc)
    • -
    • information to be committed by the issuer, though not enforceable by the protocol
    • +
    • links for storage such as for NFTs.
    • +
    • metadata for Assets, encoded in any format.
    • +
    • bridging information for Wrapped Assets (chain of origin, issuer name, etc)
    • +
    • information to be committed by the issuer, though not enforceable by the protocol.
    diff --git a/zip-0227.rst b/zip-0227.rst index c21bb1af6..b693db654 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -77,7 +77,7 @@ The protocol was designed with three main properties in mind: - In a single issuance bundle, the issuer can publish many issuance actions, or in other words, create multiple custom Assets. - Every issuance action contains the ``finalize`` boolean that defines whether that specific custom Asset can have further tokens issued or not. -The issuance mechanism is broad enough for issuers to either create native 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. In fact, the protocol described below enables what we hope will be a useful set of applications. The design decision is not to have a chosen name to describe the custom Asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”. +The issuance mechanism 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. In fact, the protocol described below enables what we hope will be a useful set of applications. The design decision is not to have a chosen name to describe the custom Asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”. Issuance Keys ------------- @@ -235,10 +235,10 @@ The following is a list of rationale for different decisions made in the proposa - The issuance key structure was kept aligned to the original key tree in order to ease issuance integration with wallets and to prevent users from having to manage multiple keys and secrets. - The :math:`\mathsf{asset\_desc}` is a general byte string in order to allow for a wide range of information type to be included that may be associated with the Assets. Some are: - - links for storage such as for NFTs - - other metadata for native Assets - - bridging information for wrapped Assets (chain of origin, issuer name, etc) - - information to be committed by the issuer, though not enforceable by the protocol + - links for storage such as for NFTs. + - metadata for Assets, encoded in any format. + - bridging information for Wrapped Assets (chain of origin, issuer name, etc) + - information to be committed by the issuer, though not enforceable by the protocol. TxId Digest =========== From 1e3c89fc1cf7f579e36b6378281b984e783a4b9c Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Tue, 27 Dec 2022 15:03:46 +0530 Subject: [PATCH 035/101] adding burn consensus rule (disallowing burning 0 value of assets) --- zip-0226.html | 6 +++++- zip-0226.rst | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/zip-0226.html b/zip-0226.html index 3abc88546..b8c73754f 100644 --- a/zip-0226.html +++ b/zip-0226.html @@ -339,7 +339,11 @@ \(\mathsf{valueBalance_{AssetId}}\) variable for every Asset identifier that is being burnt. As we will show in the transaction structure, this is separate from the regular \(\mathsf{valueBalance^Orchard}\) - that is the default transparent value for the ZEC Asset.

    + that is the default transparent value for the ZEC Asset. We require that for every + \(\mathsf{valueBalance_{AssetId}}\) + provided as above by the sender, + \(\mathsf{valueBalance_{AssetId}} \neq 0\) + . This is enforced via a consensus rule.

    For every custom Asset that is burnt, we add to the assetBurn vector the tuple \((\mathsf{valueBalance_{AssetId}, AssetId})\) such that the validator of the transaction can compute the value commitment with the corresponding value base point of that Asset. This ensures that the values are all balanced out with respect to the Asset identifiers in the transfer.

    diff --git a/zip-0226.rst b/zip-0226.rst index 34900eb79..aa1173a14 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -223,6 +223,7 @@ The burn mechanism may be needed for off-boarding the Wrapped Assets from the ch In essence, the burn mechanism is a transparent / revealing extension to the transfer protocol that enables a specific amount of any Asset identifier to be sent into “oblivion”. Our burn mechanism does NOT send Assets to a non-spendable address, it simply reduces the total number of units of a given Asset in circulation at the consensus level. It is enforced at the consensus level, by using an extension of the value balance mechanism used for ZEC Assets. First, contrary to the strict transfer transaction, we allow the sender to include a :math:`\mathsf{valueBalance_{AssetId}}` variable for every Asset identifier that is being burnt. As we will show in the transaction structure, this is separate from the regular :math:`\mathsf{valueBalance^Orchard}` that is the default transparent value for the ZEC Asset. +We require that for every :math:`\mathsf{valueBalance_{AssetId}}` provided as above by the sender, :math:`\mathsf{valueBalance_{AssetId}} \neq 0`. This is enforced via a consensus rule. For every custom Asset that is burnt, we add to the `assetBurn` vector the tuple :math:`(\mathsf{valueBalance_{AssetId}, AssetId})` such that the validator of the transaction can compute the value commitment with the corresponding value base point of that Asset. This ensures that the values are all balanced out with respect to the Asset identifiers in the transfer. From 943415170f656d7ddd0d829d08175c78c4c0907e Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Tue, 27 Dec 2022 17:56:26 +0530 Subject: [PATCH 036/101] adding the AssetIdHash abstraction to the issuance ZIP --- zip-0227.html | 25 ++++++++++++++++++++----- zip-0227.rst | 13 ++++++++++--- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/zip-0227.html b/zip-0227.html index 8899bb4d8..644d889f8 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -97,11 +97,13 @@ \(\mathsf{asset\_desc}\) , which is a global byte string (valid across all -future- Zcash shielded protocols). From this Asset description, the specific Asset identifier, \(\mathsf{AssetId}\) - , is derived with a GroupHash and used within the output notes, as defined by the specific protocol (e.g. for now Orchard-style, using Pallas curve).

    + , is derived using an Asset identifier hash, + \(\mathsf{AssetIdHash}\) + that is defined by the specific protocol (e.g. for now Orchard-style, using Pallas curve), and used within the output notes.

    The main requirement for the Asset identifier is for it to be collision-free, as two different issuers MUST not be able to issue the same Asset type. One way to achieve this is to make the identifier dependent on the issuer keys, as the issuer keys are unique to each issuer. We achieve this by deriving the Asset identifier, \(\mathsf{AssetId}\) as follows:

    -
    \(\mathsf{AssetId}= \mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv",} \mathsf{ik}\texttt{||}\mathsf{asset\_desc} \texttt{)}\)
    +
    \(\mathsf{AssetId} = \mathsf{AssetIdHash(ik, asset\_desc)}\)

    where

    • @@ -111,6 +113,11 @@ \(\mathsf{ik}\) is the issuance validating key of the issuer, used to verify the signature on the transaction SIGHASH and is defined above.
    +

    In the case of the Orchard protocol, we define

    +
    \(\mathsf{AssetIdHash^{Orchard}(ik, asset\_desc)} := \mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv",} \mathsf{ik}\texttt{||}\mathsf{asset\_desc} \texttt{)}\)
    +

    where + \(\mathsf{GroupHash^{\mathbb{P}}}\) + is the Group Hash into the group of points on the Pallas curve defined in the protocol spec 9

    Global Issuance State

    Issuance requires the following additions to the global state:

    @@ -266,7 +273,7 @@

    Asset Features

      -
    • By using the 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, +
    • By using the 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,
      • by setting finalize = 1 from the first issuance action for that Asset type, 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.
      @@ -401,7 +408,7 @@ \(\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 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.

    +

    Bridging Assets 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.

    Other Considerations

    Implementing Zcash Nodes

    @@ -412,7 +419,7 @@ in order to properly keep track of the total supply for different Asset types. 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 317b 6.

    +

    The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317b 6.

    Future Work

    In future versions of this ZIP, the protocol may also include a "key rotation" mechanism. This would allow an issuer to change the underlying @@ -499,6 +506,14 @@

    + + + + + + + +
    9Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.9.8: Group Hash into Pallas and Vesta
    diff --git a/zip-0227.rst b/zip-0227.rst index b693db654..1dbdc50b3 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -103,17 +103,23 @@ This allows the issuer to use the same wallet it usually uses to transfer Assets Asset Identifier ---------------- -For every new Asset, there must be a new and unique identifier of the Asset. Every Asset is defined by the Asset description, :math:`\mathsf{asset\_desc}`, which is a global byte string (valid across all -future- Zcash shielded protocols). From this Asset description, the specific Asset identifier, :math:`\mathsf{AssetId}`, is derived with a `GroupHash` and used within the output notes, as defined by the specific protocol (e.g. for now Orchard-style, using Pallas curve). +For every new Asset, there must be a new and unique identifier of the Asset. Every Asset is defined by the Asset description, :math:`\mathsf{asset\_desc}`, which is a global byte string (valid across all -future- Zcash shielded protocols). From this Asset description, the specific Asset identifier, :math:`\mathsf{AssetId}`, is derived using an Asset identifier hash, :math:`\mathsf{AssetIdHash}` that is defined by the specific protocol (e.g. for now Orchard-style, using Pallas curve), and used within the output notes. The main requirement for the Asset identifier is for it to be collision-free, as two different issuers MUST not be able to issue the same Asset type. One way to achieve this is to make the identifier dependent on the issuer keys, as the issuer keys are unique to each issuer. We achieve this by deriving the Asset identifier, :math:`\mathsf{AssetId}` as follows: -.. math:: \mathsf{AssetId}= \mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv",} \mathsf{ik}\texttt{||}\mathsf{asset\_desc} \texttt{)} +.. math:: \mathsf{AssetId} = \mathsf{AssetIdHash(ik, asset\_desc)} where - :math:`\mathsf{asset\_desc}` is the Asset description, a UTF-8 encoded string of up to 512 bytes, which includes any information pertaining to the issuance. - :math:`\mathsf{ik}` is the issuance validating key of the issuer, used to verify the signature on the transaction SIGHASH and is defined above. +In the case of the Orchard protocol, we define + +.. math:: \mathsf{AssetIdHash^{Orchard}(ik, asset\_desc)} := \mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv",} \mathsf{ik}\texttt{||}\mathsf{asset\_desc} \texttt{)} + +where :math:`\mathsf{GroupHash^{\mathbb{P}}}` is the Group Hash into the group of points on the Pallas curve defined in the protocol spec [#protocol-concretegrouphashpallasandvesta]_ + Global Issuance State --------------------- @@ -372,4 +378,5 @@ References .. [#zip-0227] `ZIP 227: Issuance of Zcash Shielded Assets `_ .. [#zip-0317b] `ZIP 317b: ZSA Extension Proportional Fee Mechanism `_ .. [#zip-0032] `ZIP 32: Shielded Hierarchical Deterministic Wallets `_ -.. [#zip-0316] `ZIP 316: Unified Addresses and Unified Viewing Keys `_ \ No newline at end of file +.. [#zip-0316] `ZIP 316: Unified Addresses and Unified Viewing Keys `_ +.. [#protocol-concretegrouphashpallasandvesta] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.9.8: Group Hash into Pallas and Vesta `_ \ No newline at end of file From 44a1ef309eb2caa91018dc8965a7572e91836b05 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Tue, 3 Jan 2023 08:17:30 +0530 Subject: [PATCH 037/101] adding suggestions based on comments --- zip-0226.html | 2 +- zip-0226.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/zip-0226.html b/zip-0226.html index b8c73754f..f22643e48 100644 --- a/zip-0226.html +++ b/zip-0226.html @@ -46,7 +46,7 @@

    ZIP 226 and ZIP 227 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 5. The transfer and burn of such Assets is defined in ZIP 226 4.

    Motivation

    -

    The current Orchard protocol does not support custom Assets. Enabling multi-asset support on the Zcash chain will open the door for a host of applications, and enhance the ecosystem with application developers and Asset custody institutions for issuance and bridging purposes.

    +

    The Orchard protocol deployed in NU5 does not support custom Assets. Enabling multi-asset support on the Zcash chain will open the door for a host of applications, and enhance the ecosystem with application developers and Asset custody institutions for issuance and bridging purposes.

    Overview

    In order to be able to represent different Asset identifiers in Orchard, we need to define a new data field that uniquely represents the identifier of the Asset in question, which we call diff --git a/zip-0226.rst b/zip-0226.rst index aa1173a14..2be23034d 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -46,7 +46,7 @@ in ZIP 227 [#zip-0227]_. The transfer and burn of such Assets is defined in ZIP Motivation ========== -The current Orchard protocol does not support custom Assets. Enabling multi-asset support on the Zcash chain will open the door for a host of applications, and enhance the ecosystem with application developers and Asset custody institutions for issuance and bridging purposes. +The Orchard protocol deployed in NU5 does not support custom Assets. Enabling multi-asset support on the Zcash chain will open the door for a host of applications, and enhance the ecosystem with application developers and Asset custody institutions for issuance and bridging purposes. Overview ======== From 3bfd9b479bae697e4e70f8f7e7069f147fbc94b1 Mon Sep 17 00:00:00 2001 From: Vivek Arte <46618816+vivek-arte@users.noreply.github.com> Date: Tue, 3 Jan 2023 10:16:55 +0530 Subject: [PATCH 038/101] Applying suggestions from ZIP review Co-authored-by: Deirdre Connolly --- zip-0227.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/zip-0227.rst b/zip-0227.rst index 1dbdc50b3..8c99f3a4b 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -219,7 +219,7 @@ Consensus Rule Changes For the IssueBundle: -- Verify the RedPallas-based issuance authorization signature on `SIGHASH`, `authorization` is valid, based on `authorization.VerifySig(ik, SIGHASH)` +- Verify the RedPallas-based issuance authorization signature on `SIGHASH`, `authorization`, is verified by invoking `authorization.VerifySig(ik, SIGHASH)` For each `IssueAction` in `IssueBundle`: @@ -234,6 +234,7 @@ If all of the above checks pass, do the following: - add `cm` to the Merkle tree of note commitments, `NoteCommitmentTree` - If ``finalize = 1``, add :math:`\mathsf{AssetId}` to the ``previously_finalized`` set in the global state + Rationale ========= The following is a list of rationale for different decisions made in the proposal: @@ -248,7 +249,7 @@ The following is a list of rationale for different decisions made in the proposa TxId Digest =========== -A new issuance transaction digest algorithm is defined that constructs the identifier for an issuance transaction. Each branch of the tree of hashes will correspond to a specific subset of transaction data. The overall structure of the hash is as follows; each name referenced here will be described in detail below:: +A new issuance transaction digest algorithm is defined that constructs the identifier for an issuance transaction. Each branch of the tree of hashes will correspond to a specific subset of transaction data. The overall structure of the hash is as follows; each name referenced here will be described in detail below: issuance_txid_digest ├── issueActions From 44f4c3233be1ef197847358a4803cd60566a9661 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Tue, 3 Jan 2023 10:18:27 +0530 Subject: [PATCH 039/101] making html based on suggested changes in the previous commit --- zip-0227.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zip-0227.html b/zip-0227.html index 644d889f8..fe7675bb7 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -296,7 +296,7 @@

    Consensus Rule Changes

    For the IssueBundle:

      -
    • Verify the RedPallas-based issuance authorization signature on SIGHASH, authorization is valid, based on authorization.VerifySig(ik, SIGHASH)
    • +
    • Verify the RedPallas-based issuance authorization signature on SIGHASH, authorization, is verified by invoking authorization.VerifySig(ik, SIGHASH)

    For each IssueAction in IssueBundle:

      @@ -347,9 +347,9 @@

    TxId Digest

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

    -
    issuance_txid_digest
    -├── issueActions
    -└── issuerVerificationKey
    +
    +

    issuance_txid_digest ├── issueActions └── issuerVerificationKey

    +

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

    issuance_txid_digest

    A BLAKE2b-256 hash of the following values

    From 9270a78b95bbc8802142a123b9b2b928f6357e3a Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Tue, 3 Jan 2023 23:53:57 +0530 Subject: [PATCH 040/101] edits based on review comments --- zip-0227.html | 18 +++++++++--------- zip-0227.rst | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/zip-0227.html b/zip-0227.html index fe7675bb7..9fccd6854 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -40,7 +40,7 @@

    Use Cases

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

      -
    • The issuer knows in advance the receivers of the issued Asset.
    • +
    • The issuer may or may not know the receivers of the issued Asset in advance.
    • The Asset can be of non-fungible type, where each Asset type can be made part of a single “series”.
    • The supply of the Asset can be limited in advance or not.
    • The Asset can be a wrapped version of an Asset issued by another chain (as long as there is a bridge that supports transfer of that Asset between chains).
    • @@ -155,7 +155,7 @@ \(\mathsf{asset\_desc}\) byte - Uni-code encoded string of varied size, up to 512 bytes + UTF-8 encoded string of varied size, up to 512 bytes Varies @@ -282,7 +282,7 @@
      • issuing a last set of tokens of that specific \(\mathsf{AssetId}\) - , while at the same time setting finalize = 1, or by
      • + , during which 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 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).
      • @@ -361,7 +361,7 @@

        A byte encoding of Issue Action information for all Issue Actions belonging to the transaction. For each Action, the following elements are included in the hash:

        T.1a: notes                   (field encoding bytes)
         T.1b: assetDescription        (field encoding bytes)
        -T.1c: isFinalized             (1 byte)
        +T.1c: isFinalized (1 bit)
        T.1a: notes

        A byte encoding of Note information for all Notes belonging to the Action. For each Note, the following elements are included in the hash:

        T.1a.1: recipient                    (field encoding bytes)
        @@ -389,11 +389,11 @@
                                 

        UTF-8 encoding of the Asset description string.

        T.1c: isFinalized
        -

        1-byte representation of a boolean flag that is set to 'true' if the Asset type was finalized in this action and 'false' otherwise. 'True' is represented as 1, 'false' as 0.

        +

        1-bit representation of a boolean flag that is set to 'true' if the Asset type was finalized in this action and 'false' otherwise. 'True' is represented as 1, 'false' as 0.

    T.2 issuerVerificationKey

    -

    A byte encoding of issuer verification key for the bundle as defined in [Zcash Protocol Spec § 4.2.3: Orchard Key Components].

    +

    A byte encoding of issuer validating key for the bundle as defined in [Zcash Protocol Spec § 4.2.3: Orchard Key Components].

    @@ -401,10 +401,10 @@

    Issuer Key or AssetId Compromise

    The design of this protocol does not allow for a rotation of the issuer validating key, that would allow for replacing the key of a specific Asset (see Future Work). In case of compromise, the following actions are recommended:

      -
    • If an Asset identifier is compromised (and not the issuer verification key), the finalize boolean for that Asset should be set to 0 and a new +
    • If an Asset identifier is compromised (and not the issuer validating key), the finalize boolean for that Asset should be set to 0 and a new \(\mathsf{AssetId}\) generated instead.
    • -
    • If an issuer verification key is compromised, the finalize boolean for all the Assets issued with that key should be set to 0 and the issuer should change to a new spending key altogether (for the purpose of issuance), and issue new Assets, each with a new +
    • If an issuer validating key is compromised, the finalize boolean for all the Assets issued with that key should be set to 0 and the issuer should change to a new issuance authorizing key, and issue new Assets, each with a new \(\mathsf{AssetId}\) .
    @@ -412,7 +412,7 @@

    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 issuanceSupplyInfoMap from +

    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 issuanceSupplyInfoMap from \(\mathsf{AssetId}\) to \(\mathsf{issuanceSupplyInfoMap := (totalSupply, finalize)}\) diff --git a/zip-0227.rst b/zip-0227.rst index 8c99f3a4b..2ee61f6a0 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -45,7 +45,7 @@ Use Cases The design presented in this ZIP enables issuance of shielded Assets in various modes: -- The issuer knows in advance the receivers of the issued Asset. +- The issuer may or may not know the receivers of the issued Asset in advance. - The Asset can be of non-fungible type, where each Asset type can be made part of a single “series”. - The supply of the Asset can be limited in advance or not. - The Asset can be a wrapped version of an Asset issued by another chain (as long as there is a bridge that supports transfer of that Asset between chains). @@ -141,7 +141,7 @@ Once ``finalize`` is set to 1, it cannot be unset. For Assets whose ``finalize = ================= =============================== ========================== ======================================================================== Size Name Data Type Description ================= =============================== ========================== ======================================================================== -Varies :math:`\mathsf{asset\_desc}` byte Uni-code encoded string of varied size, up to 512 bytes +Varies :math:`\mathsf{asset\_desc}` byte UTF-8 encoded string of varied size, up to 512 bytes Varies nNotes compactSize The number of notes in the issuance action noteSize * nNotes vNotes Note[nNotes] A sequence of note descriptions within the issuance action 1 bit ``finalize`` boolean The boolean that determines the finality of the issuance of that Asset @@ -209,7 +209,7 @@ Issuers can wrap Assets defined in other chains and issue them at once in a sing - 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 :math:`\mathsf{AssetId}`, while at the same time setting ``finalize = 1``, or by + - issuing a last set of tokens of that specific :math:`\mathsf{AssetId}`, during which ``finalize = 1``, or by - issuing a transaction with a single note in the issuance action pertaining to that :math:`\mathsf{AssetId}`, where the note will contain a ``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). - Furthermore, NFT issuance is enabled by issuing in a single bundle several issuance actions, where each :math:`\mathsf{AssetId}` corresponds to ``value = 1`` at the fundamental unit level. Issuers and users should make sure that ``finalize = 1`` for each of the actions in this scenario. @@ -274,7 +274,7 @@ A byte encoding of Issue Action information for all Issue Actions belonging to t T.1a: notes (field encoding bytes) T.1b: assetDescription (field encoding bytes) - T.1c: isFinalized (1 byte) + T.1c: isFinalized (1 bit) T.1a: notes @@ -314,12 +314,12 @@ UTF-8 encoding of the Asset description string. T.1c: isFinalized ''''''''''''''''' -1-byte representation of a boolean flag that is set to 'true' if the Asset type was finalized in this action and 'false' otherwise. 'True' is represented as 1, 'false' as 0. +1-bit representation of a boolean flag that is set to 'true' if the Asset type was finalized in this action and 'false' otherwise. 'True' is represented as 1, 'false' as 0. T.2 issuerVerificationKey ````````````````````````` -A byte encoding of issuer verification key for the bundle as defined in [Zcash Protocol Spec § 4.2.3: Orchard Key Components]. +A byte encoding of issuer validating key for the bundle as defined in [Zcash Protocol Spec § 4.2.3: Orchard Key Components]. Security and Privacy Considerations @@ -329,8 +329,8 @@ Security and Privacy Considerations The design of this protocol does not allow for a rotation of the issuer validating key, that would allow for replacing the key of a specific Asset (see Future Work). In case of compromise, the following actions are recommended: -- If an Asset identifier is compromised (and not the issuer verification key), the ``finalize`` boolean for that Asset should be set to `0` and a new :math:`\mathsf{AssetId}` generated instead. -- If an issuer verification key is compromised, the ``finalize`` boolean for all the Assets issued with that key should be set to `0` and the issuer should change to a new spending key altogether (for the purpose of issuance), and issue new Assets, each with a new :math:`\mathsf{AssetId}`. +- If an Asset identifier is compromised (and not the issuer validating key), the ``finalize`` boolean for that Asset should be set to `0` and a new :math:`\mathsf{AssetId}` generated instead. +- If an issuer validating key is compromised, the ``finalize`` boolean for all the Assets issued with that key should be set to `0` and the issuer should change to a new issuance authorizing key, and issue new Assets, each with a new :math:`\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 [#zip-0226]_. 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. @@ -341,7 +341,7 @@ 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 `issuanceSupplyInfoMap` from :math:`\mathsf{AssetId}` to :math:`\mathsf{issuanceSupplyInfoMap := (totalSupply, finalize)}` in order to properly keep track of the total supply for different Asset types. This is useful for wallets and other applications that need to keep track of the total supply of Assets. +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 `issuanceSupplyInfoMap` from :math:`\mathsf{AssetId}` to :math:`\mathsf{issuanceSupplyInfoMap := (totalSupply, finalize)}` in order to properly keep track of the total supply for different Asset types. This is useful for wallets and other applications that need to keep track of the total supply of Assets. Fee Structures -------------- From b6d2efc41ec19a3329173842c707d3c0e83d0610 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Mon, 9 Jan 2023 12:21:32 +0530 Subject: [PATCH 041/101] adding reference links to ZIP 226 --- zip-0226.html | 150 +++++++++++++++++++++++++++----------------------- zip-0226.rst | 65 +++++++++++----------- 2 files changed, 113 insertions(+), 102 deletions(-) diff --git a/zip-0226.html b/zip-0226.html index f22643e48..8a3de2998 100644 --- a/zip-0226.html +++ b/zip-0226.html @@ -52,26 +52,26 @@

    In order to be able to represent different Asset identifiers in Orchard, we need to define a new data field that uniquely represents the identifier of the Asset in question, which we call \(\mathsf{AssetId}\) .

    -

    The Asset identifier will be used to enforce the balance of an Action Description 6 is preserved across Assets (see the Orchard Binding Signature 7), and by extension the balance of an Orchard transaction. That is, the sum of all the +

    The Asset identifier will be used to enforce the balance of an Action Description 7 is preserved across Assets (see the Orchard Binding Signature 8), and by extension the balance of an Orchard transaction. That is, the sum of all the \(\mathsf{value^{net}}\) from each Action Description, computed as \(\mathsf{value^{old}-value^{new}}\) , must be balanced only with respect to the same Asset identifier. This is specially important since we will allow different Action Descriptions to transfer notes of different Asset identifiers, where the overall balance is checked without revealing which Assets (or how many different identifiers) are being transferred.

    -

    As was initially proposed by Jack Grigg and Daira Hopwood 15, we propose to make this happen by changing the value base point, +

    As was initially proposed by Jack Grigg and Daira Hopwood 17, we propose to make this happen by changing the value base point, \(\mathcal{V}^{\mathsf{Orchard}}\) , in the Homomorphic Pedersen Commitment that generates the value commitment, \(\mathsf{cv^{net}}\) , of the net value in an Orchard Action.

    Because in a single transaction all value commitments are balanced, there must be as many different value base points as there are Asset identifiers in the transaction. We propose to make the \(\mathsf{AssetId}\) - identifier an auxiliary input to the proof for each Action, represented already as a point on the Pallas curve. The circuit then should check that the same + identifier an auxiliary input to the proof for each Action statement 15, represented already as a point on the Pallas curve. The circuit then should check that the same \(\mathsf{AssetId}\) - is used in the old note commitment, in the new note commitment and as the base point + is used in the old note commitment and the new note commitment 12, and as the base point \(\mathcal{V}^\mathsf{Orchard}\) - in the value commitment. This ensures (1) that the input and output notes are of the same + in the value commitment 13. This ensures (1) that the input and output notes are of the same \(\mathsf{AssetId}\) , and (2) that only actions with the same Asset identifier will balance out in the binding and balance signatures.

    -

    In order to ensure the security of the transfers, and as we will explain below, we are redefining input dummy notes for custom Assets, as we need to enforce that the +

    In order to ensure the security of the transfers, and as we will explain below, we are redefining input dummy notes 14 for custom Assets, as we need to enforce that the \(\mathsf{AssetId}\) of the output note of that split Action is the output of a PRF.

    Finally, in this ZIP we also describe the burn mechanism, which is a direct extension of the transfer mechanism. The burn process uses a similar mechanism to what is used in Orchard to unshield ZEC, by using the @@ -98,89 +98,83 @@ , from one shielded protocol to another.

    Note Structure & Commitment

    -

    First, we need to adapt the components that define the Assets, i.e.: notes. A ZSA note differs from an Orchard note by including the identifier of the Asset, +

    First, we need to adapt the components that define the Assets, i.e.: notes. A ZSA note differs from an Orchard note 6 by additionally including the identifier of the Asset, \(\mathsf{AssetId}\) - . So a ZSA note looks like:

    -

    + . So a ZSA note is a tuple \((\mathsf{g_d, pk_d, v, \rho, \psi, AssetId})\) -

    -

    Where + , where \(\mathsf{AssetId}\) - is the unique random element of the Pallas group 8 that identifies each Asset in the Orchard protocol.

    + is the unique random element of the Pallas group 9 that identifies each Asset in the Orchard protocol.

    +

    Let + \(\mathsf{Note^{OrchardZSA}}\) + be the type of a ZSA note, i.e. + \(\mathsf{Note^{OrchardZSA}} := \mathsf{Note^{Orchard}} \times \mathbb{P}^{*}\) + .

    In this case, the instance of the note commitment scheme, \(\mathsf{NoteCommit^{OrchardZSA}_{rcm}}\) , will differ from \(\mathsf{NoteCommit^{Orchard}_{rcm}}\) - in that for non-ZEC Assets, the Asset identifier will be added as an input to the commitment computation. As we will see, the nested structure of the Sinsemilla-based commitment 10 allows us to add the Asset identifier as a final recursive step, and hence keep a single instance of the Sinsemilla hash function in the circuit for the note commitment verification.

    -

    The commitment output is still indistinguishable from the original Orchard ZEC note commitments, by definition of the Sinsemilla hash. ZSA note commitments will therefore be added to the same Orchard Note Commitment Tree. In essence, we have

    -

    - \(\mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, AssetId)} \in \mathsf{NoteCommit^{Orchard}.Output} \cup \{\bot\}\) -

    + in that for non-ZEC Assets, the Asset identifier will be added as an input to the commitment computation. As we will see, the nested structure of the Sinsemilla-based commitment 12 allows us to add the Asset identifier as a final recursive step, and hence keep a single instance of the Sinsemilla hash function in the circuit for the note commitment verification.

    +

    The commitment output is still indistinguishable from the original Orchard ZEC note commitments, by definition of the Sinsemilla hash function 11. ZSA note commitments will therefore be added to the same Orchard Note Commitment Tree. In essence, we have:

    +
    \(\mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, AssetId)} \in \mathsf{NoteCommit^{Orchard}.Output}\)

    The nullifier is generated in the same manner as in the Orchard protocol.

    Value Commitment

    -

    The Orchard Protocol uses a Sinsemilla-based Homomorphic Pedersen Commitment 11 which is instantiated as

    -

    - \(\mathsf{cv^{net}:=ValueCommit^{Orchard}_{rcv}(v^{net})}:= \mathsf{[v^{net}]}\mathcal{V}^{\mathsf{Orchard}}+[\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}}\) -

    -

    Where +

    The Orchard Protocol uses a Sinsemilla-based Homomorphic Pedersen Commitment 13 to perform the value commitment, which is instantiated as

    +
    \(\mathsf{cv^{net}:=ValueCommit^{Orchard}_{rcv}(v^{net})}:= \mathsf{[v^{net}]}\mathcal{V}^{\mathsf{Orchard}}+[\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}}\)
    +

    where \(\mathsf{v^{net} = v^{old} - v^{new}}\) - and

    -

    + ; \(\mathcal{V}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}(\texttt{"z.cash:Orchard-cv", "v")}\) -

    -

    + ; and \(\mathcal{R}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}(\texttt{"z.cash:Orchard-cv", "r")}\) -

    + .

    In the case of the Orchard protocol, we see that the base points \(\mathcal{V}^{\mathsf{Orchard}}\) and \(\mathcal{R}^{\mathsf{Orchard}}\) are fixed for every value commitment, as the values represent the amount of ZEC being transferred.

    In the case of the ZSA protocol, the value of different Asset identifiers in a given transaction will be committed using a different value base point. This enables the final balance of the transaction to be securely computed, such that each Asset identifier is balanced independently, as Assets with different identifiers are not meant to be mutually fungible. The value commitment then becomes

    -

    - \(\mathsf{cv^{net}:=ValueCommit^{OrchardZSA}_{rcv}(v^{net}_{AssetId},\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}})}:= \mathsf{[v^{net}_{AssetId}]}\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}}+[\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}}\) -

    +
    \(\mathsf{cv^{net}:=ValueCommit^{OrchardZSA}_{rcv}(v^{net}_{AssetId},\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}})}:= \mathsf{[v^{net}_{AssetId}]}\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}}+[\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}}\)

    where \(\mathsf{v^{net}_{AssetId}} = \mathsf{v^{old}_{AssetId} - v^{new}_{AssetId}}\) such that - \(\mathsf{v^*_{AssetId}}\) - is the value of the note of identifier + \(\mathsf{v^{old}_{AssetId}}\) + and + \(\mathsf{v^{new}_{AssetId}}\) + are the values of the old and new notes of identifier \(\mathsf{AssetId}\) - , and

    + respectively,

    \(\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}}:=\mathsf{AssetId}\) , where the Asset identifier \(\mathsf{AssetId}\) - is computed as defined in ZIP 227 5.

    + is computed as defined in ZIP 227 5, and

    \(\mathcal{R}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv", "r")}\) -

    -

    Where - \(\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{ZEC}} =\mathcal{V}^{\mathsf{Orchard}}\) .

    +

    We define + \(\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{ZEC}} :=\mathcal{V}^{\mathsf{Orchard}}\) + so that the value commitment for ZEC notes is computed identically to the Orchard protocol deployed in NU5 3.

    Value Balance Verification

    -

    In order to verify the balance of the different Assets, the verifier MUST perform exactly the same process as for the Orchard protocol 7. The main reason why no changes to this process are needed is that no custom Assets can be unshielded, so all custom Assets are contained within the shielded pool. This means that the net balance of the input and output values is zero, with only one Asset identifier of value balance published, that of ZEC, +

    In order to verify the balance of the different Assets, the verifier MUST perform exactly the same process as for the Orchard protocol 8. The main reason why no changes to this process are needed is that no custom Assets can be unshielded, so all custom Assets are contained within the shielded pool. This means that the net balance of the input and output values is zero, with only one Asset identifier of value balance published, that of ZEC, \(\mathsf{v^{balanceOrchard}}\) . No net amount of any other Asset identifier will be revealed, and the number of Asset identifiers in the transaction is also hidden. The only exception to this is in the case that an Asset is burnt, as we will see below in the burn mechanism.

    For a total of \(n\) - Actions in a transfer, the prover MUST still sign the SIGHASH of the transaction using the binding signature key

    -

    + Actions in a transfer, the prover MUST still sign the SIGHASH of the transaction using the binding signature key \(\mathsf{bsk} = \sum_{\mathsf{ \forall i\in \{1,...,n\}}} \mathsf{rcv_{i}}\) -

    + .

    Then the verifier MUST compute

    -

    - \(\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} = \sum \mathsf{rcv_{i}^{net}}\mathcal{R}^{\mathsf{Orchard}}\) -

    -

    and use it to verify the bindingSignature on the SIGHASH message, as described in §4.14 of the Zcash Specification 7.

    +
    \(\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} = \sum \mathsf{rcv_{i}^{net}}\mathcal{R}^{\mathsf{Orchard}}\)
    +

    and use it to verify the bindingSignature on the SIGHASH message, as described in §4.14 of the Zcash Specification 8.

    As in the Orchard protocol, the binding signature verification key, \(\mathsf{bvk}\) , will only be valid (and hence verify the signature correctly), as long as the committed values sum to zero. In contrast, in this protocol, the committed values only sum to zero per Asset identifier, as the Pedersen commitments add up homomorphically only with respect to the same value base point.

    Split Notes

    -

    One of the key functionalities in a UTXO-based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This requires a 1-to-many (Orchard) transaction. However, because each Action represents an input and an output, the resulting transaction must have multiple inputs. In order to cope with this today, the Actions that have not been assigned input notes are instead given dummy spend notes 12, which we call split Actions and split notes respectively. Basically, the input note is “faked” inside of the proof in order to hide which Action contains the real spend note.

    +

    One of the key functionalities in a UTXO-based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This requires a 1-to-many (Orchard) transaction. However, because each Action represents an input and an output, the resulting transaction must have multiple inputs. In order to cope with this today, the Actions that have not been assigned input notes are instead given dummy spend notes 14, which we call split Actions and split notes respectively. Basically, the input note is “faked” inside of the proof in order to hide which Action contains the real spend note.

    This, however, brings some issues when it comes to adding multiple Asset identifiers, as the output note of the split Actions cannot be of any Asset identifier, it must be enforced to be an actual output of a GroupHash computation (in fact we want it to be of the same identifier as the original input note, but the binding signature takes care that the proper balancing is performed). If not, then the prover could essentially input a multiple (or linear combination) of an existing identifier, with the goal to attack the network by overflowing the ZEC value balance and hence counterfeiting ZEC funds.

    In order to prevent this, we make some modifications to the circuit. Specifically we remove the dummy note functionality for custom Assets and we enforce that every input note to an ZSA Action must be proven to exist in the set of note commitments in the note commitment tree. We then enforce this real note to be “unspendable” in the sense that its value will be zeroed in split Actions and the nullifier will be randomized, making the note not spendable in the specific Action. Then, the proof itself ensures that the output note is of the same identifier as the input note. In the circuit, the split note functionality will be activated by a boolean private input to the proof.

    This creates a chain of induction that ensures that the value base points of all output notes of a transfer are actual outputs of a GroupHash, as they originate in the Issuance protocol which is publicly verified. If this were not done then it would be possible to violate balance, for example by using a value base point derived from those of other Assets.

    @@ -199,7 +193,7 @@

    Circuit Statement

    -

    The advantage of the design described above, with respect to the circuit statement, is that every ZSA Action statement is kept closely similar to the Orchard Action statement 13, except for a few additions that ensure the security of the Asset identifier system.

    +

    The advantage of the design described above, with respect to the circuit statement, is that every ZSA Action statement is kept closely similar to the Orchard Action statement 15, except for a few additions that ensure the security of the Asset identifier system.

    Asset Identifier Equality: the following constraints must be added to ensure that the input and output note are of the same \(\mathsf{AssetId}\) :

    @@ -242,7 +236,11 @@
    Add a boolean split variable as an auxiliary witness. This variable is to be activated split = 1 if the Action in question is a split and split = 0 if the Action is actually spending an input note:
      -
    • If split = 1 then set v' = 0 otherwise v'=v^old from the auxiliary input.
    • +
    • If split = 1 then set + \(\mathsf{v}' = 0\) + otherwise + \(\mathsf{v}'=\mathsf{v^{old}}\) + from the auxiliary input.
    @@ -329,7 +327,7 @@

    Backward Compatibility

    -

    In order to have a "clean" backwards compatibility with the ZEC notes, we have designed the circuit to support both ZEC and ZSA notes. As we specify above, there are three main reasons we can do this: - The input notes with an Asset identifer denote the custom Assets, generating a note commitment that includes the Asset identifer; whereas the notes without an identifier, denote the ZEC notes, and generate a note commitment that does not include the Asset identifier, in order to maintain the referencability to the Merkle tree - The value commitment is abstracted to allow for the value base-point as a variable private input to the proof - The ZEC-based actions will still include dummy input notes, whereas the ZSA-based actions will include split input notes

    +

    In order to have a "clean" backwards compatibility with the ZEC notes, we have designed the circuit to support both ZEC and ZSA notes. As we specify above, there are three main reasons we can do this: - The input notes with an Asset identifer denote the custom Assets, generating a note commitment that includes the Asset identifer; whereas the notes without an identifier, denote the ZEC notes, and generate a note commitment that does not include the Asset identifier, in order to maintain the referencability to the Merkle tree - The value commitment is abstracted to allow for the value base-point as a variable private input to the proof - The ZEC-based actions will still include dummy input notes, whereas the ZSA-based actions will include split input notes.

    Burn Mechanism

    @@ -348,20 +346,20 @@ \((\mathsf{valueBalance_{AssetId}, AssetId})\) such that the validator of the transaction can compute the value commitment with the corresponding value base point of that Asset. This ensures that the values are all balanced out with respect to the Asset identifiers in the transfer.

    - \(\mathsf{assetBurn = [(v^{AssetId}, AssetId)}| \forall \mathsf{AssetId} \textit{ s.t.}\mathsf{v^{AssetId}\neq 0}]\) + \(\mathsf{assetBurn = \{ (v^{AssetId}, AssetId)}\ |\ \forall\ \mathsf{AssetId}\ \textit{s.t.}\ \mathsf{v^{AssetId}} \neq 0 \}\)

    The value balances for each Asset identifier in assetBurn represents the amount of that Asset identifier that is being burnt. In the case of ZEC, the value balance represents either the transaction fee, or the amount of ZEC changing anonymity pools (to Sapling or Transparent).

    Finally, the validator needs to verify the Balance and Binding Signature by adding the value balances for all Assets, as committed using their respective \(\mathsf{AssetId}\) as the value base point of the Pedersen Commitment. This is done as follows

    - \(\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} - \sum_{\forall \mathsf{AssetId}\textit{ s.t. }\mathsf{v^{AssetId}\neq 0}} \mathsf{ValueCommit_0^{ORchardZSA}(v^{AssetId}, AssetId) } = \sum \mathsf{rcv_{i,j}^{net}}\mathcal{R}^{\mathsf{Orchard}}\) + \(\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} - \sum_{\forall \mathsf{AssetId}\textit{ s.t. }\mathsf{v^{AssetId}\neq 0}} \mathsf{ValueCommit_0^{OrchardZSA}(v^{AssetId}, AssetId) } = \sum \mathsf{rcv_{i,j}^{net}}\mathcal{R}^{\mathsf{Orchard}}\)

    In the case that the balance of all the action values related to a specific Asset will be zero, there will be no value added to the vector. This way, the number of Assets, nor their identifiers will be revealed, except in the case that an Asset is burnt.

    Note: Even if this mechanism allows having transparent ↔ shielded Asset transfers in theory, the transparent protocol will not be changed with this ZIP to adapt to a multiple Asset structure. This means that unless future consensus rules changes do allow it, unshielding will not be possible for custom Assets.

    ZSA Transaction Structure

    -

    Similar to version 5 transaction format, with the following modifications to the Orchard bundle, as defined in 14:

    +

    The transaction format is similar to the version 5 transaction format described in the Zcash specification 16, with the following additions to the Orchard bundle:

    @@ -386,19 +384,19 @@
    -

    And in terms of the action size, the ZSA action size differs from the Orchard action size by 32 bytes (given by the addition of the +

    In terms of the action size, the ZSA action size differs from the Orchard action size by 32 bytes (due to the addition of the \(\mathsf{AssetId}\) ). This implies that the size goes from 820 bytes in the Orchard action to 852 bytes in the ZSA action.

    Other Considerations

    Transaction Fees

    -

    The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317b 16.

    +

    The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317b 18.

    Security and Privacy

    • Even if the Orchard protocol and ZSA protocol do not share the same anonymity pool (nodes can keep track of the notes that where published with different transaction structures), the migration from one to the other is done automatically and seamlessly. The Orchard bundle will be replaced by the ZSA bundle and all ZEC notes will be fully spendable with the new transaction structure.
    • -
    • When including new Assets we would like to maintain the amount and identifiers of Assets private, which is achieved with the design
    • -
    • We prevent the "roadblock" attack on the Asset identifer by ensuring the output notes receive an Asset identifier that exists on the global state
    • +
    • When including new Assets we would like to maintain the amount and identifiers of Assets private, which is achieved with the design.
    • +
    • We prevent the "roadblock" attack on the Asset identifer by ensuring the output notes receive an Asset identifier that exists on the global state.

    Deplopyment

    @@ -457,10 +455,18 @@ - +
    + + + +
    6Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 3.2: Notes
    + + + + @@ -468,15 +474,15 @@
    7 Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 3.7: Action Transfers and their Descriptions
    - - + +
    7Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.14: Balance and Binding Signature (Orchard)8Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.14: Balance and Binding Signature (Orchard)
    - + @@ -484,15 +490,23 @@
    89 Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.9.6: Pallas and Vesta
    - +
    910 Pallas/Vesta supporting evidence
    + + + + + + + +
    11Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.1.9: Sinsemilla hash function
    - + @@ -500,7 +514,7 @@
    1012 Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.8.4: Sinsemilla commitments
    - + @@ -508,7 +522,7 @@
    1113 Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.8.3: Homomorphic Pedersen commitments (Sapling and Orchard)
    - + @@ -516,7 +530,7 @@
    1214 Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.8.3: Dummy Notes (Orchard)
    - + @@ -524,7 +538,7 @@
    1315 Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.17.4: Action Statement (Orchard)
    - + @@ -532,7 +546,7 @@
    1416 Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 7.1: Transaction Encoding and Consensus (Transaction Version 5)
    - + @@ -540,7 +554,7 @@
    1517 User-Defined Assets and Wrapped Assets
    - + diff --git a/zip-0226.rst b/zip-0226.rst index 2be23034d..840f9538f 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -56,9 +56,9 @@ The Asset identifier will be used to enforce the balance of an Action Descriptio As was initially proposed by Jack Grigg and Daira Hopwood [#initial-zsa-issue]_, we propose to make this happen by changing the value base point, :math:`\mathcal{V}^{\mathsf{Orchard}}`, in the Homomorphic Pedersen Commitment that generates the value commitment, :math:`\mathsf{cv^{net}}`, of the *net value* in an Orchard Action. -Because in a single transaction all value commitments are balanced, there must be as many different value base points as there are Asset identifiers in the transaction. We propose to make the :math:`\mathsf{AssetId}` identifier an auxiliary input to the proof for each Action, represented already as a point on the Pallas curve. The circuit then should check that the same :math:`\mathsf{AssetId}` is used in the old note commitment, in the new note commitment **and** as the base point :math:`\mathcal{V}^\mathsf{Orchard}` in the value commitment. This ensures (1) that the input and output notes are of the same :math:`\mathsf{AssetId}`, and (2) that only actions with the same Asset identifier will balance out in the binding and balance signatures. +Because in a single transaction all value commitments are balanced, there must be as many different value base points as there are Asset identifiers in the transaction. We propose to make the :math:`\mathsf{AssetId}` identifier an auxiliary input to the proof for each Action statement [#protocol-actionstatement]_, represented already as a point on the Pallas curve. The circuit then should check that the same :math:`\mathsf{AssetId}` is used in the old note commitment and the new note commitment [#protocol-concretesinsemillacommit]_, **and** as the base point :math:`\mathcal{V}^\mathsf{Orchard}` in the value commitment [#protocol-concretevaluecommit]_. This ensures (1) that the input and output notes are of the same :math:`\mathsf{AssetId}`, and (2) that only actions with the same Asset identifier will balance out in the binding and balance signatures. -In order to ensure the security of the transfers, and as we will explain below, we are redefining input dummy notes for custom Assets, as we need to enforce that the :math:`\mathsf{AssetId}` of the output note of that split Action is the output of a PRF. +In order to ensure the security of the transfers, and as we will explain below, we are redefining input dummy notes [#protocol-dummynotes]_ for custom Assets, as we need to enforce that the :math:`\mathsf{AssetId}` of the output note of that split Action is the output of a PRF. Finally, in this ZIP we also describe the *burn* mechanism, which is a direct extension of the transfer mechanism. The burn process uses a similar mechanism to what is used in Orchard to unshield ZEC, by using the :math:`\mathsf{valueBalance}` of the Asset in question. Burning Assets is useful for many purposes, including bridging of Wrapped Assets and removing supply of Assets. @@ -79,34 +79,30 @@ In future network and protocol upgrades, the same Asset description string can b Note Structure & Commitment --------------------------- -First, we need to adapt the components that define the Assets, i.e.: *notes*. A ZSA note differs from an Orchard note by including the identifier of the Asset, :math:`\mathsf{AssetId}`. So a ZSA note looks like: +First, we need to adapt the components that define the Assets, i.e.: *notes*. A ZSA note differs from an Orchard note [#protocol-notes]_ by additionally including the identifier of the Asset, :math:`\mathsf{AssetId}`. So a ZSA note is a tuple :math:`(\mathsf{g_d, pk_d, v, \rho, \psi, AssetId})`, +where :math:`\mathsf{AssetId}` is the unique random element of the Pallas group [#protocol-pallasandvesta]_ that identifies each Asset in the Orchard protocol. - -:math:`(\mathsf{g_d, pk_d, v, \rho, \psi, AssetId})` - - -Where :math:`\mathsf{AssetId}` is the unique random element of the Pallas group [#protocol-pallasandvesta]_ that identifies each Asset in the Orchard protocol. +Let :math:`\mathsf{Note^{OrchardZSA}}` be the type of a ZSA note, i.e. +:math:`\mathsf{Note^{OrchardZSA}} := \mathsf{Note^{Orchard}} \times \mathbb{P}^{*}`. In this case, the instance of the note commitment scheme, :math:`\mathsf{NoteCommit^{OrchardZSA}_{rcm}}`, will differ from :math:`\mathsf{NoteCommit^{Orchard}_{rcm}}` in that for non-ZEC Assets, the Asset identifier will be added as an input to the commitment computation. As we will see, the nested structure of the Sinsemilla-based commitment [#protocol-concretesinsemillacommit]_ allows us to add the Asset identifier as a final recursive step, and hence keep a single instance of the Sinsemilla hash function in the circuit for the note commitment verification. -The commitment output is still indistinguishable from the original Orchard ZEC note commitments, by definition of the Sinsemilla hash. ZSA note commitments will therefore be added to the same Orchard Note Commitment Tree. In essence, we have +The commitment output is still indistinguishable from the original Orchard ZEC note commitments, by definition of the Sinsemilla hash function [#protocol-concretesinsemillahash]_. ZSA note commitments will therefore be added to the same Orchard Note Commitment Tree. In essence, we have: -:math:`\mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, AssetId)} \in \mathsf{NoteCommit^{Orchard}.Output} \cup \{\bot\}` +.. math:: \mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, AssetId)} \in \mathsf{NoteCommit^{Orchard}.Output} The nullifier is generated in the same manner as in the Orchard protocol. Value Commitment ---------------- -The Orchard Protocol uses a Sinsemilla-based Homomorphic Pedersen Commitment [#protocol-concretevaluecommit]_ which is instantiated as +The Orchard Protocol uses a Sinsemilla-based Homomorphic Pedersen Commitment [#protocol-concretevaluecommit]_ to perform the value commitment, which is instantiated as -:math:`\mathsf{cv^{net}:=ValueCommit^{Orchard}_{rcv}(v^{net})}:= \mathsf{[v^{net}]}\mathcal{V}^{\mathsf{Orchard}}+[\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}}` +.. math:: \mathsf{cv^{net}:=ValueCommit^{Orchard}_{rcv}(v^{net})}:= \mathsf{[v^{net}]}\mathcal{V}^{\mathsf{Orchard}}+[\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}} -Where :math:`\mathsf{v^{net} = v^{old} - v^{new}}` and - -:math:`\mathcal{V}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}(\texttt{"z.cash:Orchard-cv", "v")}` - -:math:`\mathcal{R}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}(\texttt{"z.cash:Orchard-cv", "r")}` +where :math:`\mathsf{v^{net} = v^{old} - v^{new}}`; +:math:`\mathcal{V}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}(\texttt{"z.cash:Orchard-cv", "v")}`; and +:math:`\mathcal{R}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}(\texttt{"z.cash:Orchard-cv", "r")}`. In the case of the Orchard protocol, we see that the base points :math:`\mathcal{V}^{\mathsf{Orchard}}` and :math:`\mathcal{R}^{\mathsf{Orchard}}` are fixed for every value commitment, as the values represent the amount of ZEC @@ -114,17 +110,17 @@ being transferred. In the case of the ZSA protocol, the value of different Asset identifiers in a given transaction will be committed using a **different value base point**. This enables the final balance of the transaction to be securely computed, such that each Asset identifier is balanced independently, as Assets with different identifiers are not meant to be mutually fungible. The value commitment then becomes -:math:`\mathsf{cv^{net}:=ValueCommit^{OrchardZSA}_{rcv}(v^{net}_{AssetId},\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}})}:= \mathsf{[v^{net}_{AssetId}]}\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}}+[\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}}` +.. math:: \mathsf{cv^{net}:=ValueCommit^{OrchardZSA}_{rcv}(v^{net}_{AssetId},\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}})}:= \mathsf{[v^{net}_{AssetId}]}\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}}+[\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}} -where :math:`\mathsf{v^{net}_{AssetId}} = \mathsf{v^{old}_{AssetId} - v^{new}_{AssetId}}` such that :math:`\mathsf{v^*_{AssetId}}` is the value of the note of identifier :math:`\mathsf{AssetId}`, and +where :math:`\mathsf{v^{net}_{AssetId}} = \mathsf{v^{old}_{AssetId} - v^{new}_{AssetId}}` such that :math:`\mathsf{v^{old}_{AssetId}}` and :math:`\mathsf{v^{new}_{AssetId}}` are the values of the old and new notes of identifier :math:`\mathsf{AssetId}` respectively, .. _`value base`: -:math:`\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}}:=\mathsf{AssetId}`, where the Asset identifier :math:`\mathsf{AssetId}` is computed as defined in ZIP 227 [#zip-0227]_. +:math:`\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}}:=\mathsf{AssetId}`, where the Asset identifier :math:`\mathsf{AssetId}` is computed as defined in ZIP 227 [#zip-0227]_, and -:math:`\mathcal{R}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv", "r")}` +:math:`\mathcal{R}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv", "r")}`. -Where :math:`\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{ZEC}} =\mathcal{V}^{\mathsf{Orchard}}`. +We define :math:`\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{ZEC}} :=\mathcal{V}^{\mathsf{Orchard}}` so that the value commitment for ZEC notes is computed identically to the Orchard protocol deployed in NU5 [#zip-0224]_. Value Balance Verification -------------------------- @@ -132,12 +128,11 @@ Value Balance Verification In order to verify the balance of the different Assets, the verifier MUST perform exactly the same process as for the Orchard protocol [#protocol-binding]_. The main reason why no changes to this process are needed is that no custom Assets can be unshielded, so all custom Assets are contained within the shielded pool. This means that the net balance of the input and output values is zero, with only one Asset identifier of value balance published, that of ZEC, :math:`\mathsf{v^{balanceOrchard}}`. No net amount of any other Asset identifier will be revealed, and the number of Asset identifiers in the transaction is also hidden. The only exception to this is in the case that an Asset is *burnt*, as we will see below in the `burn mechanism`_. For a total of :math:`n` Actions in a transfer, the prover MUST still sign the `SIGHASH` of the transaction using the binding signature key - -:math:`\mathsf{bsk} = \sum_{\mathsf{ \forall i\in \{1,...,n\}}} \mathsf{rcv_{i}}` +:math:`\mathsf{bsk} = \sum_{\mathsf{ \forall i\in \{1,...,n\}}} \mathsf{rcv_{i}}`. Then the verifier MUST compute -:math:`\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} = \sum \mathsf{rcv_{i}^{net}}\mathcal{R}^{\mathsf{Orchard}}` +.. math:: \mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} = \sum \mathsf{rcv_{i}^{net}}\mathcal{R}^{\mathsf{Orchard}} and use it to verify the `bindingSignature` on the `SIGHASH` message, as described in §4.14 of the Zcash Specification [#protocol-binding]_. @@ -187,7 +182,7 @@ the input and output note are of the same :math:`\mathsf{AssetId}`: - The Value Commitment Integrity should be changed - Replace the input note value by a generic value, `v'`, as :math:`\mathsf{cv^net} = \mathsf{ValueCommit_rcv^OrchardZSA(v’ - v^new, AssetId)}` - Add a boolean ``split`` variable as an auxiliary witness. This variable is to be activated ``split = 1`` if the Action in question is a split and ``split = 0`` if the Action is actually spending an input note: - - If ``split = 1`` then set `v' = 0` otherwise `v'=v^old` from the auxiliary input. + - If ``split = 1`` then set :math:`\mathsf{v}' = 0` otherwise :math:`\mathsf{v}'=\mathsf{v^{old}}` from the auxiliary input. - The Merkle Path Validity should check the existence of the note commitment as usual (and not like with dummy notes): - Check that (path, pos) is a valid Merkle path of depth :math:`\mathsf{MerkleDepth^Orchard}`, from :math:`\mathsf{cm^old}` to the anchor :math:`\mathsf{rt^Orchard}`. - The Nullifier Integrity will be changed to prevent the identification of notes @@ -213,7 +208,7 @@ Backward Compatibility In order to have a "clean" backwards compatibility with the ZEC notes, we have designed the circuit to support both ZEC and ZSA notes. As we specify above, there are three main reasons we can do this: - The input notes with an Asset identifer denote the custom Assets, generating a note commitment that includes the Asset identifer; whereas the notes without an identifier, denote the ZEC notes, and generate a note commitment that does not include the Asset identifier, in order to maintain the referencability to the Merkle tree - The value commitment is abstracted to allow for the value base-point as a variable private input to the proof -- The ZEC-based actions will still include dummy input notes, whereas the ZSA-based actions will include split input notes +- The ZEC-based actions will still include dummy input notes, whereas the ZSA-based actions will include split input notes. Burn Mechanism @@ -228,13 +223,13 @@ We require that for every :math:`\mathsf{valueBalance_{AssetId}}` provided as ab For every custom Asset that is burnt, we add to the `assetBurn` vector the tuple :math:`(\mathsf{valueBalance_{AssetId}, AssetId})` such that the validator of the transaction can compute the value commitment with the corresponding value base point of that Asset. This ensures that the values are all balanced out with respect to the Asset identifiers in the transfer. -:math:`\mathsf{assetBurn = [(v^{AssetId}, AssetId)}| \forall \mathsf{AssetId} \textit{ s.t.}\mathsf{v^{AssetId}\neq 0}]` +:math:`\mathsf{assetBurn = \{ (v^{AssetId}, AssetId)}\ |\ \forall\ \mathsf{AssetId}\ \textit{s.t.}\ \mathsf{v^{AssetId}} \neq 0 \}` The value balances for each Asset identifier in `assetBurn` represents the amount of that Asset identifier that is being burnt. In the case of ZEC, the value balance represents either the transaction fee, or the amount of ZEC changing anonymity pools (to Sapling or Transparent). Finally, the validator needs to verify the Balance and Binding Signature by adding the value balances for all Assets, as committed using their respective :math:`\mathsf{AssetId}` as the value base point of the Pedersen Commitment. This is done as follows -:math:`\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} - \sum_{\forall \mathsf{AssetId}\textit{ s.t. }\mathsf{v^{AssetId}\neq 0}} \mathsf{ValueCommit_0^{ORchardZSA}(v^{AssetId}, AssetId) } = \sum \mathsf{rcv_{i,j}^{net}}\mathcal{R}^{\mathsf{Orchard}}` +:math:`\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} - \sum_{\forall \mathsf{AssetId}\textit{ s.t. }\mathsf{v^{AssetId}\neq 0}} \mathsf{ValueCommit_0^{OrchardZSA}(v^{AssetId}, AssetId) } = \sum \mathsf{rcv_{i,j}^{net}}\mathcal{R}^{\mathsf{Orchard}}` In the case that the balance of all the action values related to a specific Asset will be zero, there will be no value added to the vector. This way, the number of Assets, nor their identifiers will be revealed, except in the case that an Asset is burnt. @@ -242,7 +237,7 @@ In the case that the balance of all the action values related to a specific Asse ZSA Transaction Structure ========================= -Similar to version 5 transaction format, with the following modifications to the Orchard bundle, as defined in [#protocol-transactionstructure]_: +The transaction format is similar to the version 5 transaction format described in the Zcash specification [#protocol-transactionstructure]_, with the following additions to the Orchard bundle: +-----------------+-------------+-----------------------------------+-------------------------+ | Bytes | Name | Data Type | Description | @@ -253,7 +248,7 @@ Similar to version 5 transaction format, with the following modifications to the | | | | 8 bytes of valueBalance | +-----------------+-------------+-----------------------------------+-------------------------+ -And in terms of the action size, the ZSA action size differs from the Orchard action size by 32 bytes (given by the addition of the :math:`\mathsf{AssetId}`). This implies that the size goes from 820 bytes in the Orchard action to 852 bytes in the ZSA action. +In terms of the action size, the ZSA action size differs from the Orchard action size by 32 bytes (due to the addition of the :math:`\mathsf{AssetId}`). This implies that the size goes from 820 bytes in the Orchard action to 852 bytes in the ZSA action. Other Considerations ==================== @@ -267,8 +262,8 @@ Security and Privacy -------------------- - Even if the Orchard protocol and ZSA protocol do not share the same anonymity pool (nodes can keep track of the notes that where published with different transaction structures), the migration from one to the other is done automatically and seamlessly. The Orchard bundle will be replaced by the ZSA bundle and all ZEC notes will be fully spendable with the new transaction structure. -- When including new Assets we would like to maintain the amount and identifiers of Assets private, which is achieved with the design -- We prevent the "roadblock" attack on the Asset identifer by ensuring the output notes receive an Asset identifier that exists on the global state +- When including new Assets we would like to maintain the amount and identifiers of Assets private, which is achieved with the design. +- We prevent the "roadblock" attack on the Asset identifer by ensuring the output notes receive an Asset identifier that exists on the global state. Deplopyment ----------- @@ -293,10 +288,12 @@ References .. [#zip-0224] `ZIP 224: Orchard `_ .. [#zip-0226] `ZIP 226: Transfer and Burn of Zcash Shielded Assets `_ .. [#zip-0227] `ZIP 227: Issuance of Zcash Shielded Assets `_ +.. [#protocol-notes] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 3.2: Notes `_ .. [#protocol-actions] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 3.7: Action Transfers and their Descriptions `_ -.. [#protocol-binding] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.14: Balance and Binding Signature (Orchard) `_ +.. [#protocol-binding] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.14: Balance and Binding Signature (Orchard) `_ .. [#protocol-pallasandvesta] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.9.6: Pallas and Vesta `_ .. [#pasta-evidence] `Pallas/Vesta supporting evidence `_ +.. [#protocol-concretesinsemillahash] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.1.9: Sinsemilla hash function `_ .. [#protocol-concretesinsemillacommit] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.8.4: Sinsemilla commitments `_ .. [#protocol-concretevaluecommit] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.8.3: Homomorphic Pedersen commitments (Sapling and Orchard) `_ .. [#protocol-dummynotes] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.8.3: Dummy Notes (Orchard) `_ From 9b2e51ae2d66da7b45bb695dab4d26d4accd8636 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Tue, 10 Jan 2023 08:23:14 +0530 Subject: [PATCH 042/101] edits to ZIP 226 and ZIP 227 --- zip-0226.html | 9 ++++++--- zip-0226.rst | 4 +++- zip-0227.html | 30 ++++++++++++++++++++---------- zip-0227.rst | 17 +++++++++-------- 4 files changed, 38 insertions(+), 22 deletions(-) diff --git a/zip-0226.html b/zip-0226.html index 8a3de2998..310ba3847 100644 --- a/zip-0226.html +++ b/zip-0226.html @@ -102,9 +102,12 @@ \(\mathsf{AssetId}\) . So a ZSA note is a tuple \((\mathsf{g_d, pk_d, v, \rho, \psi, AssetId})\) - , where - \(\mathsf{AssetId}\) - is the unique random element of the Pallas group 9 that identifies each Asset in the Orchard protocol.

    + , where

    +
      +
    • + \(\mathsf{AssetId} : \mathbb{P}^*\) + is the unique random element of the Pallas group 9 that identifies each Asset in the Orchard protocol.
    • +

    Let \(\mathsf{Note^{OrchardZSA}}\) be the type of a ZSA note, i.e. diff --git a/zip-0226.rst b/zip-0226.rst index 840f9538f..55891e420 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -80,7 +80,9 @@ Note Structure & Commitment --------------------------- First, we need to adapt the components that define the Assets, i.e.: *notes*. A ZSA note differs from an Orchard note [#protocol-notes]_ by additionally including the identifier of the Asset, :math:`\mathsf{AssetId}`. So a ZSA note is a tuple :math:`(\mathsf{g_d, pk_d, v, \rho, \psi, AssetId})`, -where :math:`\mathsf{AssetId}` is the unique random element of the Pallas group [#protocol-pallasandvesta]_ that identifies each Asset in the Orchard protocol. +where + +- :math:`\mathsf{AssetId} : \mathbb{P}^*` is the unique random element of the Pallas group [#protocol-pallasandvesta]_ that identifies each Asset in the Orchard protocol. Let :math:`\mathsf{Note^{OrchardZSA}}` be the type of a ZSA note, i.e. :math:`\mathsf{Note^{OrchardZSA}} := \mathsf{Note^{Orchard}} \times \mathbb{P}^{*}`. diff --git a/zip-0227.html b/zip-0227.html index 9fccd6854..126e2a55e 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -90,7 +90,7 @@ , as a public verification key:

    \(\mathsf{ik := SpendAuthSig^{Orchard}.DerivePublic(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 7, and can further be in 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.

    +

    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 7. 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.

    Asset Identifier

    For every new Asset, there must be a new and unique identifier of the Asset. Every Asset is defined by the Asset description, @@ -117,7 +117,7 @@

    \(\mathsf{AssetIdHash^{Orchard}(ik, asset\_desc)} := \mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv",} \mathsf{ik}\texttt{||}\mathsf{asset\_desc} \texttt{)}\)

    where \(\mathsf{GroupHash^{\mathbb{P}}}\) - is the Group Hash into the group of points on the Pallas curve defined in the protocol spec 9

    + is the Group Hash into the group of points on the Pallas curve defined in the protocol specification 9.

    Global Issuance State

    Issuance requires the following additions to the global state:

    @@ -192,7 +192,7 @@ \(\mathsf{isk}\) , that validates the issuance . -

    The issuance bundle is then added within the transaction format as a new bundle. This structure will be added to the v6 transaction format.

    +

    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 10.

    1618 ZIP 317b: ZSA Extension Proportional Fee Mechanism
    @@ -238,17 +238,19 @@
    • encode \(\mathsf{asset\_desc}\) - as 512 byte-string
    • + as 512 byte-string.
    • compute \(\mathsf{AssetId}\) as - \(GroupHash^{\mathbb{P}}(ik || asset\_desc)\) + \(\mathsf{AssetIdHash(ik, asset\_desc)}\)
    • set the finalize boolean as desired (if more more issuance actions are to be created for this Asset identifier, set finalize = 0, otherwise set finalize = 1)
    • -
    • For each recipient i: +
    • For each recipient + \(i\) + :
      • generate a ZSA output note as - \(\mathsf{ note_i =(d_i, {pk_d}_i, v_i, \rho_i, \psi_i, \mathsf{AssetId}, rcm_i)}\) + \(\mathsf{note}_i =(\mathsf{d}_i, \mathsf{pk}_{\mathsf{d},i}, \mathsf{v}_i, \rho_i, \psi_i, \mathsf{AssetId}, \mathsf{rcm}_i)\)
    • @@ -273,7 +275,7 @@

    Asset Features

      -
    • By using the 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, +
    • By using the 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,
      • by setting finalize = 1 from the first issuance action for that Asset type, 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.
      @@ -408,7 +410,7 @@ \(\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 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.

    +

    Bridging Assets 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.

    Other Considerations

    Implementing Zcash Nodes

    @@ -419,7 +421,7 @@ in order to properly keep track of the total supply for different Asset types. 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 317b 6.

    +

    The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317b 6.

    Future Work

    In future versions of this ZIP, the protocol may also include a "key rotation" mechanism. This would allow an issuer to change the underlying @@ -514,6 +516,14 @@

    + + + + + + + +
    10Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 7.1: Transaction Encoding and Consensus (Transaction Version 5)
    diff --git a/zip-0227.rst b/zip-0227.rst index 2ee61f6a0..028450fad 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -98,7 +98,7 @@ The two keys are derived in an analogous manner to the spend authorizing key and .. math:: \mathsf{ik := SpendAuthSig^{Orchard}.DerivePublic(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 [#zip-0032]_, and can further be in 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. +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 [#zip-0032]_. 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. Asset Identifier ---------------- @@ -118,7 +118,7 @@ In the case of the Orchard protocol, we define .. math:: \mathsf{AssetIdHash^{Orchard}(ik, asset\_desc)} := \mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv",} \mathsf{ik}\texttt{||}\mathsf{asset\_desc} \texttt{)} -where :math:`\mathsf{GroupHash^{\mathbb{P}}}` is the Group Hash into the group of points on the Pallas curve defined in the protocol spec [#protocol-concretegrouphashpallasandvesta]_ +where :math:`\mathsf{GroupHash^{\mathbb{P}}}` is the Group Hash into the group of points on the Pallas curve defined in the protocol specification [#protocol-concretegrouphashpallasandvesta]_. Global Issuance State --------------------- @@ -158,7 +158,7 @@ An issuance bundle, `IssueBundle`, is the aggregate of all the issuance-related - `actions`: an array of issuance actions, of type `IssueAction`. - `authorization`: the signature of the transaction SIGHASH, signed by the issuance authorizing key, :math:`\mathsf{isk}`, that validates the issuance . -The issuance bundle is then added within the transaction format as a new bundle. This structure will be added to the v6 transaction format. +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 [#protocol-transactionstructure]_. ======= ==================== ========================== ========================================================================= Bytes Name Data Type Description @@ -175,12 +175,12 @@ The issuer program performs the following operations For all actions `IssueAction`: -- encode :math:`\mathsf{asset\_desc}` as 512 byte-string -- compute :math:`\mathsf{AssetId}` as :math:`GroupHash^{\mathbb{P}}(ik || asset\_desc)` +- encode :math:`\mathsf{asset\_desc}` as 512 byte-string. +- compute :math:`\mathsf{AssetId}` as :math:`\mathsf{AssetIdHash(ik, asset\_desc)}` - set the ``finalize`` boolean as desired (if more more issuance actions are to be created for this Asset identifier, set ``finalize = 0``, otherwise set ``finalize = 1``) -- For each recipient ``i``: +- For each recipient :math:`i`: - - generate a ZSA output note as :math:`\mathsf{ note_i =(d_i, {pk_d}_i, v_i, \rho_i, \psi_i, \mathsf{AssetId}, rcm_i)}` + - generate a ZSA output note as :math:`\mathsf{note}_i =(\mathsf{d}_i, \mathsf{pk}_{\mathsf{d},i}, \mathsf{v}_i, \rho_i, \psi_i, \mathsf{AssetId}, \mathsf{rcm}_i)` - encode the `IssueAction` into the vector `vIssueActions` of the bundle @@ -380,4 +380,5 @@ References .. [#zip-0317b] `ZIP 317b: ZSA Extension Proportional Fee Mechanism `_ .. [#zip-0032] `ZIP 32: Shielded Hierarchical Deterministic Wallets `_ .. [#zip-0316] `ZIP 316: Unified Addresses and Unified Viewing Keys `_ -.. [#protocol-concretegrouphashpallasandvesta] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.9.8: Group Hash into Pallas and Vesta `_ \ No newline at end of file +.. [#protocol-concretegrouphashpallasandvesta] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.9.8: Group Hash into Pallas and Vesta `_ +.. [#protocol-transactionstructure] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 7.1: Transaction Encoding and Consensus (Transaction Version 5) `_ \ No newline at end of file From c0caa9c4947943c682d5ab4ed21dbf7cc97c8634 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Wed, 11 Jan 2023 15:23:38 +0530 Subject: [PATCH 043/101] correcting small error --- zip-0226.html | 4 ++-- zip-0226.rst | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/zip-0226.html b/zip-0226.html index 310ba3847..ec672ecc8 100644 --- a/zip-0226.html +++ b/zip-0226.html @@ -105,13 +105,13 @@ , where

    • - \(\mathsf{AssetId} : \mathbb{P}^*\) + \(\mathsf{AssetId} : \mathbb{P}\) is the unique random element of the Pallas group 9 that identifies each Asset in the Orchard protocol.

    Let \(\mathsf{Note^{OrchardZSA}}\) be the type of a ZSA note, i.e. - \(\mathsf{Note^{OrchardZSA}} := \mathsf{Note^{Orchard}} \times \mathbb{P}^{*}\) + \(\mathsf{Note^{OrchardZSA}} := \mathsf{Note^{Orchard}} \times \mathbb{P}\) .

    In this case, the instance of the note commitment scheme, \(\mathsf{NoteCommit^{OrchardZSA}_{rcm}}\) diff --git a/zip-0226.rst b/zip-0226.rst index 55891e420..7bd4285db 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -82,10 +82,10 @@ Note Structure & Commitment First, we need to adapt the components that define the Assets, i.e.: *notes*. A ZSA note differs from an Orchard note [#protocol-notes]_ by additionally including the identifier of the Asset, :math:`\mathsf{AssetId}`. So a ZSA note is a tuple :math:`(\mathsf{g_d, pk_d, v, \rho, \psi, AssetId})`, where -- :math:`\mathsf{AssetId} : \mathbb{P}^*` is the unique random element of the Pallas group [#protocol-pallasandvesta]_ that identifies each Asset in the Orchard protocol. +- :math:`\mathsf{AssetId} : \mathbb{P}` is the unique random element of the Pallas group [#protocol-pallasandvesta]_ that identifies each Asset in the Orchard protocol. Let :math:`\mathsf{Note^{OrchardZSA}}` be the type of a ZSA note, i.e. -:math:`\mathsf{Note^{OrchardZSA}} := \mathsf{Note^{Orchard}} \times \mathbb{P}^{*}`. +:math:`\mathsf{Note^{OrchardZSA}} := \mathsf{Note^{Orchard}} \times \mathbb{P}`. In this case, the instance of the note commitment scheme, :math:`\mathsf{NoteCommit^{OrchardZSA}_{rcm}}`, will differ from :math:`\mathsf{NoteCommit^{Orchard}_{rcm}}` in that for non-ZEC Assets, the Asset identifier will be added as an input to the commitment computation. As we will see, the nested structure of the Sinsemilla-based commitment [#protocol-concretesinsemillacommit]_ allows us to add the Asset identifier as a final recursive step, and hence keep a single instance of the Sinsemilla hash function in the circuit for the note commitment verification. From c44d3106e36c1c83719e3e17f23f5ebc7d85b245 Mon Sep 17 00:00:00 2001 From: Vivek Arte <46618816+vivek-arte@users.noreply.github.com> Date: Wed, 25 Jan 2023 01:22:13 +0530 Subject: [PATCH 044/101] Update zip-0226.rst Co-authored-by: Daira Hopwood --- zip-0226.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zip-0226.rst b/zip-0226.rst index 7bd4285db..928dc2336 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -29,7 +29,8 @@ We define the following additional terms: - Asset: A type of note that can be transferred on the Zcash block chain, identified by the :math:`\mathsf{AssetId}` parameter. - ZEC is the default (and currently the only defined) Asset for the Zcash mainnet. - - We use the term "custom Asset" to refer to any Asset other than ZEC. + - TAZ is the default (and currently the only defined) Asset for the Zcash testnet. + - We use the term "Custom Asset" to refer to any Asset other than ZEC and TAZ. - Zcash Shielded Asset: an Asset with issuance defined on the Zcash block chain, and, for now, belonging to the Orchard shielded pool. - Wrapped Asset: a Zcash Shielded Asset with native issuance defined outside the Zcash block chain. From df1f240e274ccb89a0b8f970eccb42930e1feaf9 Mon Sep 17 00:00:00 2001 From: Vivek Arte <46618816+vivek-arte@users.noreply.github.com> Date: Wed, 25 Jan 2023 01:23:06 +0530 Subject: [PATCH 045/101] Update zip-0226.rst Co-authored-by: Daira Hopwood --- zip-0226.rst | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/zip-0226.rst b/zip-0226.rst index 928dc2336..606d05b15 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -40,9 +40,12 @@ We define the following additional terms: Abstract ======== -ZIP 226 and ZIP 227 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 [#zip-0227]_. The transfer and burn of such Assets is defined in ZIP 226 [#zip-0226]_. +ZIP 226 and ZIP 227 propose in conjunction the Zcash Shielded Assets (ZSA) protocol — a set +of protocol features that enable the creation, transfer, and burn of Custom Assets on the Zcash chain. + +Creation of such Assets is defined in ZIP 227 [#zip-0227]_. Transfer and burn of such Assets is defined +in ZIP 226 [#zip-0226]_. The ZSA protocol is proposed to be instantiated by a modification to the +Orchard protocol, as specified in these ZIPs. Motivation ========== From 5ea0ad47c6e06b83cd3690214c3f10c2bfbc639a Mon Sep 17 00:00:00 2001 From: Vivek Arte <46618816+vivek-arte@users.noreply.github.com> Date: Wed, 25 Jan 2023 01:23:43 +0530 Subject: [PATCH 046/101] Update zip-0226.rst Co-authored-by: Daira Hopwood --- zip-0226.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zip-0226.rst b/zip-0226.rst index 606d05b15..2d4f306af 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -50,7 +50,10 @@ Orchard protocol, as specified in these ZIPs. Motivation ========== -The Orchard protocol deployed in NU5 does not support custom Assets. Enabling multi-asset support on the Zcash chain will open the door for a host of applications, and enhance the ecosystem with application developers and Asset custody institutions for issuance and bridging purposes. +None of the currently deployed Zcash transfer protocols support Custom Assets. Enabling +multi-asset support on the Zcash chain will open the door for a host of applications, and +enhance the ecosystem with application developers and Asset custody institutions for +issuance and bridging purposes. Overview ======== From 47bc7798116cceba2ea11db3a4dd007a3adacc02 Mon Sep 17 00:00:00 2001 From: Vivek Arte <46618816+vivek-arte@users.noreply.github.com> Date: Wed, 25 Jan 2023 01:24:23 +0530 Subject: [PATCH 047/101] Update zip-0226.rst Co-authored-by: Daira Hopwood --- zip-0226.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zip-0226.rst b/zip-0226.rst index 2d4f306af..9abcf562a 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -59,7 +59,7 @@ Overview ======== In order to be able to represent different Asset identifiers in Orchard, we need to define a new data field that uniquely represents the identifier of the Asset in question, which we call :math:`\mathsf{AssetId}`. -The Asset identifier will be used to enforce the balance of an Action Description [#protocol-actions]_ is preserved across Assets (see the Orchard Binding Signature [#protocol-binding]_), and by extension the balance of an Orchard transaction. That is, the sum of all the :math:`\mathsf{value^{net}}` from each Action Description, computed as :math:`\mathsf{value^{old}-value^{new}}`, must be balanced **only with respect to the same Asset identifier**. This is specially important since we will allow different Action Descriptions to transfer notes of different Asset identifiers, where the overall balance is checked without revealing which Assets (or how many different identifiers) are being transferred. +The Asset identifier will be used to enforce that the balance of an Action Description [#protocol-actions]_ is preserved across Assets (see the Orchard Binding Signature [#protocol-binding]_), and by extension the balance of an Orchard transaction. That is, the sum of all the :math:`\mathsf{value^{net}}` from each Action Description, computed as :math:`\mathsf{value^{old}-value^{new}}`, must be balanced **only with respect to the same Asset identifier**. This is specially important since we will allow different Action Descriptions to transfer notes of different Asset identifiers, where the overall balance is checked without revealing which (or how many distinct) Assets are being transferred. As was initially proposed by Jack Grigg and Daira Hopwood [#initial-zsa-issue]_, we propose to make this happen by changing the value base point, :math:`\mathcal{V}^{\mathsf{Orchard}}`, in the Homomorphic Pedersen Commitment that generates the value commitment, :math:`\mathsf{cv^{net}}`, of the *net value* in an Orchard Action. From 46d603b867bac8b2f0afb72de994822ccf70af68 Mon Sep 17 00:00:00 2001 From: Vivek Arte <46618816+vivek-arte@users.noreply.github.com> Date: Wed, 25 Jan 2023 01:25:23 +0530 Subject: [PATCH 048/101] Update zip-0226.rst Co-authored-by: Daira Hopwood --- zip-0226.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zip-0226.rst b/zip-0226.rst index 9abcf562a..b8150e8d7 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -61,7 +61,7 @@ In order to be able to represent different Asset identifiers in Orchard, we need The Asset identifier will be used to enforce that the balance of an Action Description [#protocol-actions]_ is preserved across Assets (see the Orchard Binding Signature [#protocol-binding]_), and by extension the balance of an Orchard transaction. That is, the sum of all the :math:`\mathsf{value^{net}}` from each Action Description, computed as :math:`\mathsf{value^{old}-value^{new}}`, must be balanced **only with respect to the same Asset identifier**. This is specially important since we will allow different Action Descriptions to transfer notes of different Asset identifiers, where the overall balance is checked without revealing which (or how many distinct) Assets are being transferred. -As was initially proposed by Jack Grigg and Daira Hopwood [#initial-zsa-issue]_, we propose to make this happen by changing the value base point, :math:`\mathcal{V}^{\mathsf{Orchard}}`, in the Homomorphic Pedersen Commitment that generates the value commitment, :math:`\mathsf{cv^{net}}`, of the *net value* in an Orchard Action. +As was initially proposed by Jack Grigg and Daira Hopwood [#initial-zsa-issue]_ [#generalized-value-commitments]_, we propose to make this happen by changing the value base point, :math:`\mathcal{V}^{\mathsf{Orchard}}`, in the Homomorphic Pedersen Commitment that derives the value commitment, :math:`\mathsf{cv^{net}}`, of the *net value* in an Orchard Action. Because in a single transaction all value commitments are balanced, there must be as many different value base points as there are Asset identifiers in the transaction. We propose to make the :math:`\mathsf{AssetId}` identifier an auxiliary input to the proof for each Action statement [#protocol-actionstatement]_, represented already as a point on the Pallas curve. The circuit then should check that the same :math:`\mathsf{AssetId}` is used in the old note commitment and the new note commitment [#protocol-concretesinsemillacommit]_, **and** as the base point :math:`\mathcal{V}^\mathsf{Orchard}` in the value commitment [#protocol-concretevaluecommit]_. This ensures (1) that the input and output notes are of the same :math:`\mathsf{AssetId}`, and (2) that only actions with the same Asset identifier will balance out in the binding and balance signatures. From 2352b639ba8e296e1c154b9b2b084843d9ab5574 Mon Sep 17 00:00:00 2001 From: Vivek Arte <46618816+vivek-arte@users.noreply.github.com> Date: Wed, 25 Jan 2023 01:25:38 +0530 Subject: [PATCH 049/101] Update zip-0226.rst Co-authored-by: Daira Hopwood --- zip-0226.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/zip-0226.rst b/zip-0226.rst index b8150e8d7..b27cfe260 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -309,4 +309,5 @@ References .. [#protocol-actionstatement] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.17.4: Action Statement (Orchard) `_ .. [#protocol-transactionstructure] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 7.1: Transaction Encoding and Consensus (Transaction Version 5) `_ .. [#initial-zsa-issue] `User-Defined Assets and Wrapped Assets `_ +.. [#generalized-value-commitments] `Comment on Generalized Value Commitments `_ .. [#zip-0317b] `ZIP 317b: ZSA Extension Proportional Fee Mechanism `_ \ No newline at end of file From 0b35efaaa7ca0e24c3d17823d034d58806f8d45b Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Wed, 25 Jan 2023 01:32:10 +0530 Subject: [PATCH 050/101] updating html file to match rst file changed during review --- zip-0226.html | 60 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 25 deletions(-) diff --git a/zip-0226.html b/zip-0226.html index ec672ecc8..593a856b3 100644 --- a/zip-0226.html +++ b/zip-0226.html @@ -31,7 +31,8 @@ parameter.

    • ZEC is the default (and currently the only defined) Asset for the Zcash mainnet.
    • -
    • We use the term "custom Asset" to refer to any Asset other than ZEC.
    • +
    • TAZ is the default (and currently the only defined) Asset for the Zcash testnet.
    • +
    • We use the term "Custom Asset" to refer to any Asset other than ZEC and TAZ.
  • Zcash Shielded Asset: an Asset with issuance defined on the Zcash block chain, and, for now, belonging to the Orchard shielded pool.
  • @@ -43,35 +44,36 @@

    Abstract

    -

    ZIP 226 and ZIP 227 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 5. The transfer and burn of such Assets is defined in ZIP 226 4.

    +

    ZIP 226 and ZIP 227 propose in conjunction the Zcash Shielded Assets (ZSA) protocol &mdash; a set of protocol features that enable the creation, transfer, and burn of Custom Assets on the Zcash chain.

    +

    Creation of such Assets is defined in ZIP 227 5. Transfer and burn of such Assets is defined in ZIP 226 4. The ZSA protocol is proposed to be instantiated by a modification to the Orchard protocol, as specified in these ZIPs.

    Motivation

    -

    The Orchard protocol deployed in NU5 does not support custom Assets. Enabling multi-asset support on the Zcash chain will open the door for a host of applications, and enhance the ecosystem with application developers and Asset custody institutions for issuance and bridging purposes.

    +

    None of the currently deployed Zcash transfer protocols support Custom Assets. Enabling multi-asset support on the Zcash chain will open the door for a host of applications, and enhance the ecosystem with application developers and Asset custody institutions for issuance and bridging purposes.

    Overview

    In order to be able to represent different Asset identifiers in Orchard, we need to define a new data field that uniquely represents the identifier of the Asset in question, which we call \(\mathsf{AssetId}\) .

    -

    The Asset identifier will be used to enforce the balance of an Action Description 7 is preserved across Assets (see the Orchard Binding Signature 8), and by extension the balance of an Orchard transaction. That is, the sum of all the +

    The Asset identifier will be used to enforce that the balance of an Action Description 7 is preserved across Assets (see the Orchard Binding Signature 8), and by extension the balance of an Orchard transaction. That is, the sum of all the \(\mathsf{value^{net}}\) from each Action Description, computed as \(\mathsf{value^{old}-value^{new}}\) - , must be balanced only with respect to the same Asset identifier. This is specially important since we will allow different Action Descriptions to transfer notes of different Asset identifiers, where the overall balance is checked without revealing which Assets (or how many different identifiers) are being transferred.

    -

    As was initially proposed by Jack Grigg and Daira Hopwood 17, we propose to make this happen by changing the value base point, + , must be balanced only with respect to the same Asset identifier. This is specially important since we will allow different Action Descriptions to transfer notes of different Asset identifiers, where the overall balance is checked without revealing which (or how many distinct) Assets are being transferred.

    +

    As was initially proposed by Jack Grigg and Daira Hopwood 17 18, we propose to make this happen by changing the value base point, \(\mathcal{V}^{\mathsf{Orchard}}\) - , in the Homomorphic Pedersen Commitment that generates the value commitment, + , in the Homomorphic Pedersen Commitment that derives the value commitment, \(\mathsf{cv^{net}}\) , of the net value in an Orchard Action.

    Because in a single transaction all value commitments are balanced, there must be as many different value base points as there are Asset identifiers in the transaction. We propose to make the \(\mathsf{AssetId}\) - identifier an auxiliary input to the proof for each Action statement 15, represented already as a point on the Pallas curve. The circuit then should check that the same + identifier an auxiliary input to the proof for each Action statement 15, represented already as a point on the Pallas curve. The circuit then should check that the same \(\mathsf{AssetId}\) - is used in the old note commitment and the new note commitment 12, and as the base point + is used in the old note commitment and the new note commitment 12, and as the base point \(\mathcal{V}^\mathsf{Orchard}\) - in the value commitment 13. This ensures (1) that the input and output notes are of the same + in the value commitment 13. This ensures (1) that the input and output notes are of the same \(\mathsf{AssetId}\) , and (2) that only actions with the same Asset identifier will balance out in the binding and balance signatures.

    -

    In order to ensure the security of the transfers, and as we will explain below, we are redefining input dummy notes 14 for custom Assets, as we need to enforce that the +

    In order to ensure the security of the transfers, and as we will explain below, we are redefining input dummy notes 14 for custom Assets, as we need to enforce that the \(\mathsf{AssetId}\) of the output note of that split Action is the output of a PRF.

    Finally, in this ZIP we also describe the burn mechanism, which is a direct extension of the transfer mechanism. The burn process uses a similar mechanism to what is used in Orchard to unshield ZEC, by using the @@ -98,7 +100,7 @@ , from one shielded protocol to another.

    Note Structure & Commitment

    -

    First, we need to adapt the components that define the Assets, i.e.: notes. A ZSA note differs from an Orchard note 6 by additionally including the identifier of the Asset, +

    First, we need to adapt the components that define the Assets, i.e.: notes. A ZSA note differs from an Orchard note 6 by additionally including the identifier of the Asset, \(\mathsf{AssetId}\) . So a ZSA note is a tuple \((\mathsf{g_d, pk_d, v, \rho, \psi, AssetId})\) @@ -106,7 +108,7 @@

    • \(\mathsf{AssetId} : \mathbb{P}\) - is the unique random element of the Pallas group 9 that identifies each Asset in the Orchard protocol.
    • + is the unique random element of the Pallas group 9 that identifies each Asset in the Orchard protocol.

    Let \(\mathsf{Note^{OrchardZSA}}\) @@ -117,13 +119,13 @@ \(\mathsf{NoteCommit^{OrchardZSA}_{rcm}}\) , will differ from \(\mathsf{NoteCommit^{Orchard}_{rcm}}\) - in that for non-ZEC Assets, the Asset identifier will be added as an input to the commitment computation. As we will see, the nested structure of the Sinsemilla-based commitment 12 allows us to add the Asset identifier as a final recursive step, and hence keep a single instance of the Sinsemilla hash function in the circuit for the note commitment verification.

    -

    The commitment output is still indistinguishable from the original Orchard ZEC note commitments, by definition of the Sinsemilla hash function 11. ZSA note commitments will therefore be added to the same Orchard Note Commitment Tree. In essence, we have:

    + in that for non-ZEC Assets, the Asset identifier will be added as an input to the commitment computation. As we will see, the nested structure of the Sinsemilla-based commitment 12 allows us to add the Asset identifier as a final recursive step, and hence keep a single instance of the Sinsemilla hash function in the circuit for the note commitment verification.

    +

    The commitment output is still indistinguishable from the original Orchard ZEC note commitments, by definition of the Sinsemilla hash function 11. ZSA note commitments will therefore be added to the same Orchard Note Commitment Tree. In essence, we have:

    \(\mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, AssetId)} \in \mathsf{NoteCommit^{Orchard}.Output}\)

    The nullifier is generated in the same manner as in the Orchard protocol.

    Value Commitment

    -

    The Orchard Protocol uses a Sinsemilla-based Homomorphic Pedersen Commitment 13 to perform the value commitment, which is instantiated as

    +

    The Orchard Protocol uses a Sinsemilla-based Homomorphic Pedersen Commitment 13 to perform the value commitment, which is instantiated as

    \(\mathsf{cv^{net}:=ValueCommit^{Orchard}_{rcv}(v^{net})}:= \mathsf{[v^{net}]}\mathcal{V}^{\mathsf{Orchard}}+[\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}}\)

    where \(\mathsf{v^{net} = v^{old} - v^{new}}\) @@ -152,16 +154,16 @@ \(\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}}:=\mathsf{AssetId}\) , where the Asset identifier \(\mathsf{AssetId}\) - is computed as defined in ZIP 227 5, and

    + is computed as defined in ZIP 227 5, and

    \(\mathcal{R}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv", "r")}\) .

    We define \(\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{ZEC}} :=\mathcal{V}^{\mathsf{Orchard}}\) - so that the value commitment for ZEC notes is computed identically to the Orchard protocol deployed in NU5 3.

    + so that the value commitment for ZEC notes is computed identically to the Orchard protocol deployed in NU5 3.

    Value Balance Verification

    -

    In order to verify the balance of the different Assets, the verifier MUST perform exactly the same process as for the Orchard protocol 8. The main reason why no changes to this process are needed is that no custom Assets can be unshielded, so all custom Assets are contained within the shielded pool. This means that the net balance of the input and output values is zero, with only one Asset identifier of value balance published, that of ZEC, +

    In order to verify the balance of the different Assets, the verifier MUST perform exactly the same process as for the Orchard protocol 8. The main reason why no changes to this process are needed is that no custom Assets can be unshielded, so all custom Assets are contained within the shielded pool. This means that the net balance of the input and output values is zero, with only one Asset identifier of value balance published, that of ZEC, \(\mathsf{v^{balanceOrchard}}\) . No net amount of any other Asset identifier will be revealed, and the number of Asset identifiers in the transaction is also hidden. The only exception to this is in the case that an Asset is burnt, as we will see below in the burn mechanism.

    For a total of @@ -171,13 +173,13 @@ .

    Then the verifier MUST compute

    \(\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} = \sum \mathsf{rcv_{i}^{net}}\mathcal{R}^{\mathsf{Orchard}}\)
    -

    and use it to verify the bindingSignature on the SIGHASH message, as described in §4.14 of the Zcash Specification 8.

    +

    and use it to verify the bindingSignature on the SIGHASH message, as described in §4.14 of the Zcash Specification 8.

    As in the Orchard protocol, the binding signature verification key, \(\mathsf{bvk}\) , will only be valid (and hence verify the signature correctly), as long as the committed values sum to zero. In contrast, in this protocol, the committed values only sum to zero per Asset identifier, as the Pedersen commitments add up homomorphically only with respect to the same value base point.

    Split Notes

    -

    One of the key functionalities in a UTXO-based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This requires a 1-to-many (Orchard) transaction. However, because each Action represents an input and an output, the resulting transaction must have multiple inputs. In order to cope with this today, the Actions that have not been assigned input notes are instead given dummy spend notes 14, which we call split Actions and split notes respectively. Basically, the input note is “faked” inside of the proof in order to hide which Action contains the real spend note.

    +

    One of the key functionalities in a UTXO-based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This requires a 1-to-many (Orchard) transaction. However, because each Action represents an input and an output, the resulting transaction must have multiple inputs. In order to cope with this today, the Actions that have not been assigned input notes are instead given dummy spend notes 14, which we call split Actions and split notes respectively. Basically, the input note is “faked” inside of the proof in order to hide which Action contains the real spend note.

    This, however, brings some issues when it comes to adding multiple Asset identifiers, as the output note of the split Actions cannot be of any Asset identifier, it must be enforced to be an actual output of a GroupHash computation (in fact we want it to be of the same identifier as the original input note, but the binding signature takes care that the proper balancing is performed). If not, then the prover could essentially input a multiple (or linear combination) of an existing identifier, with the goal to attack the network by overflowing the ZEC value balance and hence counterfeiting ZEC funds.

    In order to prevent this, we make some modifications to the circuit. Specifically we remove the dummy note functionality for custom Assets and we enforce that every input note to an ZSA Action must be proven to exist in the set of note commitments in the note commitment tree. We then enforce this real note to be “unspendable” in the sense that its value will be zeroed in split Actions and the nullifier will be randomized, making the note not spendable in the specific Action. Then, the proof itself ensures that the output note is of the same identifier as the input note. In the circuit, the split note functionality will be activated by a boolean private input to the proof.

    This creates a chain of induction that ensures that the value base points of all output notes of a transfer are actual outputs of a GroupHash, as they originate in the Issuance protocol which is publicly verified. If this were not done then it would be possible to violate balance, for example by using a value base point derived from those of other Assets.

    @@ -196,7 +198,7 @@

    Circuit Statement

    -

    The advantage of the design described above, with respect to the circuit statement, is that every ZSA Action statement is kept closely similar to the Orchard Action statement 15, except for a few additions that ensure the security of the Asset identifier system.

    +

    The advantage of the design described above, with respect to the circuit statement, is that every ZSA Action statement is kept closely similar to the Orchard Action statement 15, except for a few additions that ensure the security of the Asset identifier system.

    Asset Identifier Equality: the following constraints must be added to ensure that the input and output note are of the same \(\mathsf{AssetId}\) :

    @@ -362,7 +364,7 @@

    Note: Even if this mechanism allows having transparent ↔ shielded Asset transfers in theory, the transparent protocol will not be changed with this ZIP to adapt to a multiple Asset structure. This means that unless future consensus rules changes do allow it, unshielding will not be possible for custom Assets.

    ZSA Transaction Structure

    -

    The transaction format is similar to the version 5 transaction format described in the Zcash specification 16, with the following additions to the Orchard bundle:

    +

    The transaction format is similar to the version 5 transaction format described in the Zcash specification 16, with the following additions to the Orchard bundle:

    @@ -393,7 +395,7 @@

    Other Considerations

    Transaction Fees

    -

    The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317b 18.

    +

    The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317b 19.

    Security and Privacy

      @@ -554,10 +556,18 @@
    - +
    + + + +
    18Comment on Generalized Value Commitments
    + + + + From 97eacabbef9377ede457bf6faff92cc53513cd9f Mon Sep 17 00:00:00 2001 From: Vivek Arte <46618816+vivek-arte@users.noreply.github.com> Date: Wed, 25 Jan 2023 17:46:32 +0530 Subject: [PATCH 051/101] Update zip-0226.rst Co-authored-by: Daira Hopwood --- zip-0226.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zip-0226.rst b/zip-0226.rst index b27cfe260..5285d3e62 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -32,10 +32,10 @@ We define the following additional terms: - TAZ is the default (and currently the only defined) Asset for the Zcash testnet. - We use the term "Custom Asset" to refer to any Asset other than ZEC and TAZ. -- Zcash Shielded Asset: an Asset with issuance defined on the Zcash block chain, and, for now, belonging to the Orchard shielded pool. -- Wrapped Asset: a Zcash Shielded Asset with native issuance defined outside the Zcash block chain. -- Split Input: an Action input identifying a Zcash Shielded Asset note, used to ensure that the output note of that Action is of a validly issued :math:`\mathsf{AssetId}` when there is no corresponding real input note to spend. The Action does not spend the note identified by the Split Input. -- Split Action: a Zcash Shielded Asset Action that contains a Split Input. +- Native Asset: a Custom Asset with issuance defined on the Zcash block chain. +- Wrapped Asset: a Custom Asset with native issuance defined outside the Zcash block chain. +- Split Input: an Action input identifying a Custom Asset note, used to ensure that the output note of that Action is of a validly issued :math:`\mathsf{AssetId}` when there is no corresponding real input note to spend. The Action does not spend the note identified by the Split Input. +- Split Action: an Action that contains a Split Input. Abstract ======== From e08fc8423729f79fdb26b456983cde29a5a7299f Mon Sep 17 00:00:00 2001 From: Vivek Arte <46618816+vivek-arte@users.noreply.github.com> Date: Fri, 27 Jan 2023 19:40:31 +0530 Subject: [PATCH 052/101] Apply suggestions from ZIP review Co-authored-by: Deirdre Connolly --- zip-0226.rst | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/zip-0226.rst b/zip-0226.rst index 5285d3e62..3a541db84 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -57,7 +57,7 @@ issuance and bridging purposes. Overview ======== -In order to be able to represent different Asset identifiers in Orchard, we need to define a new data field that uniquely represents the identifier of the Asset in question, which we call :math:`\mathsf{AssetId}`. +In order to be able to represent different Asset identifiers in Orchard, we need to define a new data field in a note that uniquely represents the identifier of the Asset in question, which we call :math:`\mathsf{AssetId^{Orchard}}`. The Asset identifier will be used to enforce that the balance of an Action Description [#protocol-actions]_ is preserved across Assets (see the Orchard Binding Signature [#protocol-binding]_), and by extension the balance of an Orchard transaction. That is, the sum of all the :math:`\mathsf{value^{net}}` from each Action Description, computed as :math:`\mathsf{value^{old}-value^{new}}`, must be balanced **only with respect to the same Asset identifier**. This is specially important since we will allow different Action Descriptions to transfer notes of different Asset identifiers, where the overall balance is checked without revealing which (or how many distinct) Assets are being transferred. @@ -77,7 +77,7 @@ Most of the protocol is kept the same as the Orchard protocol released with NU5, Asset Identifiers ----------------- -For every new Asset, there must be a new and unique identifier of the Asset. Every Asset is defined by the *Asset description*, :math:`\mathsf{asset\_desc}`, which is a global byte string (valid across all -future- Zcash protocols). From this Asset description the specific Asset identifier, :math:`\mathsf{AssetId}`, is derived with a `GroupHash` and used within the output notes, as defined by the specific protocol (e.g.: for now Orchard-style, using Pallas curve). +For every new Asset, there must be a new and unique identifier of the Asset. Every Asset is defined by the *Asset description*, :math:`\mathsf{asset\_desc}`, which is a global byte string (scoped across all future versions of Zcash). From this Asset description the specific Asset identifier, :math:`\mathsf{AssetId}`, is derived with a `GroupHash` and used within the output notes, as defined by the specific protocol (e.g.: for now Orchard-style, using Pallas curve). This :math:`\mathsf{AssetId}` will be the base point of the value commitment for the specific custom Asset. Note that the :math:`\mathsf{AssetId}` of the ZEC Asset will be kept as the original value base point, :math:`\mathcal{V}^\mathsf{Orchard}`. @@ -86,13 +86,13 @@ In future network and protocol upgrades, the same Asset description string can b Note Structure & Commitment --------------------------- -First, we need to adapt the components that define the Assets, i.e.: *notes*. A ZSA note differs from an Orchard note [#protocol-notes]_ by additionally including the identifier of the Asset, :math:`\mathsf{AssetId}`. So a ZSA note is a tuple :math:`(\mathsf{g_d, pk_d, v, \rho, \psi, AssetId})`, +A ZSA note differs from an Orchard note [#protocol-notes]_ by additionally including the identifier of the Asset, :math:`\mathsf{AssetId}`. So a ZSA note is a tuple :math:`(\mathsf{g_d, pk_d, v, \rho, \psi, AssetId})`, where - :math:`\mathsf{AssetId} : \mathbb{P}` is the unique random element of the Pallas group [#protocol-pallasandvesta]_ that identifies each Asset in the Orchard protocol. Let :math:`\mathsf{Note^{OrchardZSA}}` be the type of a ZSA note, i.e. -:math:`\mathsf{Note^{OrchardZSA}} := \mathsf{Note^{Orchard}} \times \mathbb{P}`. +:math:`\mathsf{Note^{OrchardZSA}} := \mathsf{Note^{Orchard}} \times \mathbb{P*}`. In this case, the instance of the note commitment scheme, :math:`\mathsf{NoteCommit^{OrchardZSA}_{rcm}}`, will differ from :math:`\mathsf{NoteCommit^{Orchard}_{rcm}}` in that for non-ZEC Assets, the Asset identifier will be added as an input to the commitment computation. As we will see, the nested structure of the Sinsemilla-based commitment [#protocol-concretesinsemillacommit]_ allows us to add the Asset identifier as a final recursive step, and hence keep a single instance of the Sinsemilla hash function in the circuit for the note commitment verification. @@ -198,7 +198,7 @@ the input and output note are of the same :math:`\mathsf{AssetId}`: - Replace the :math:`\psi_{old}` value with a generic :math:`\psi'` as :math:`\mathsf{nf_old = DeriveNullifier_nk}(\rho^\mathsf{old}, \psi', \mathsf{cm^old})` - if :math:`split = 0` then constrain :math:`\psi' = \psi^{old}`. (Otherwise :math:`\psi'` should be sampled randomly.) -**Enabling Backwards Compatibility with ZEC Notes:** the following constraints must be added to enable backwards compatibility with the Orchard ZEC notes. +**Enabling Backwards Compatibility with ZEC Notes:** the following constraints must be added to enable backwards compatibility with Orchard ZEC notes. The old note commitment is computed using a “rolling-aggregate” Sinsemilla commitment. This means that the commitment is computed by adding new chunks or windows to the accumulated value. This method will be used in order to maintain a single commitment instance for the old note commitment, that will be used both for Orchard ZEC notes and for ZSA notes. The original Orchard ZEC notes will be conserved and not actually be converted into ZSA notes, as we will always need to compute them. @@ -217,7 +217,7 @@ Backward Compatibility In order to have a "clean" backwards compatibility with the ZEC notes, we have designed the circuit to support both ZEC and ZSA notes. As we specify above, there are three main reasons we can do this: - The input notes with an Asset identifer denote the custom Assets, generating a note commitment that includes the Asset identifer; whereas the notes without an identifier, denote the ZEC notes, and generate a note commitment that does not include the Asset identifier, in order to maintain the referencability to the Merkle tree - The value commitment is abstracted to allow for the value base-point as a variable private input to the proof -- The ZEC-based actions will still include dummy input notes, whereas the ZSA-based actions will include split input notes. +- The ZEC-based Actions will still include dummy input notes, whereas the ZSA-based Actions will include split input notes. Burn Mechanism @@ -234,18 +234,19 @@ For every custom Asset that is burnt, we add to the `assetBurn` vector the tuple :math:`\mathsf{assetBurn = \{ (v^{AssetId}, AssetId)}\ |\ \forall\ \mathsf{AssetId}\ \textit{s.t.}\ \mathsf{v^{AssetId}} \neq 0 \}` -The value balances for each Asset identifier in `assetBurn` represents the amount of that Asset identifier that is being burnt. In the case of ZEC, the value balance represents either the transaction fee, or the amount of ZEC changing anonymity pools (to Sapling or Transparent). +The value balances for each Asset identifier in `assetBurn` represents the amount of that Asset identifier that is being burnt. In the case of ZEC, the value balance represents either the transaction fee, or the amount of ZEC changing pools (eg: to Sapling or Transparent). Finally, the validator needs to verify the Balance and Binding Signature by adding the value balances for all Assets, as committed using their respective :math:`\mathsf{AssetId}` as the value base point of the Pedersen Commitment. This is done as follows :math:`\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} - \sum_{\forall \mathsf{AssetId}\textit{ s.t. }\mathsf{v^{AssetId}\neq 0}} \mathsf{ValueCommit_0^{OrchardZSA}(v^{AssetId}, AssetId) } = \sum \mathsf{rcv_{i,j}^{net}}\mathcal{R}^{\mathsf{Orchard}}` -In the case that the balance of all the action values related to a specific Asset will be zero, there will be no value added to the vector. This way, the number of Assets, nor their identifiers will be revealed, except in the case that an Asset is burnt. +In the case that the balance of all the Action values related to a specific Asset will be zero, there will be no value added to the vector. This way, neither the number of Assets, nor their identifiers, will be revealed, except in the case that an Asset is burnt. **Note:** Even if this mechanism allows having transparent ↔ shielded Asset transfers in theory, the transparent protocol will not be changed with this ZIP to adapt to a multiple Asset structure. This means that unless future consensus rules changes do allow it, unshielding will not be possible for custom Assets. ZSA Transaction Structure ========================= + The transaction format is similar to the version 5 transaction format described in the Zcash specification [#protocol-transactionstructure]_, with the following additions to the Orchard bundle: +-----------------+-------------+-----------------------------------+-------------------------+ @@ -257,7 +258,7 @@ The transaction format is similar to the version 5 transaction format described | | | | 8 bytes of valueBalance | +-----------------+-------------+-----------------------------------+-------------------------+ -In terms of the action size, the ZSA action size differs from the Orchard action size by 32 bytes (due to the addition of the :math:`\mathsf{AssetId}`). This implies that the size goes from 820 bytes in the Orchard action to 852 bytes in the ZSA action. +In terms of the Action size, the ZSA action size differs from the Orchard action size by 32 bytes (due to the addition of the :math:`\mathsf{AssetId}`). This implies that the size goes from 820 bytes in the Orchard action to 852 bytes in the ZSA Action. Other Considerations ==================== @@ -274,7 +275,7 @@ Security and Privacy - When including new Assets we would like to maintain the amount and identifiers of Assets private, which is achieved with the design. - We prevent the "roadblock" attack on the Asset identifer by ensuring the output notes receive an Asset identifier that exists on the global state. -Deplopyment +Deployment ----------- The Zcash Shielded Assets protocol should be deployed by replacing the Orchard protocol in a subsequent Network Upgrade. The design of this protocol ensures that there is no need to use any turnstile mechanism, being that Orchard-based ZEC notes can be used directly within the ZSA Actions. From b1ce706e4277788145c701ee7a2af86939c39155 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Wed, 25 Jan 2023 18:53:27 +0530 Subject: [PATCH 053/101] adding key components spec link --- zip-0226.html | 8 ++++---- zip-0227.html | 32 ++++++++++++++++++++------------ zip-0227.rst | 7 ++++--- 3 files changed, 28 insertions(+), 19 deletions(-) diff --git a/zip-0226.html b/zip-0226.html index 593a856b3..c001e1ecf 100644 --- a/zip-0226.html +++ b/zip-0226.html @@ -35,12 +35,12 @@
  • We use the term "Custom Asset" to refer to any Asset other than ZEC and TAZ.
  • -
  • Zcash Shielded Asset: an Asset with issuance defined on the Zcash block chain, and, for now, belonging to the Orchard shielded pool.
  • -
  • Wrapped Asset: a Zcash Shielded Asset with native issuance defined outside the Zcash block chain.
  • -
  • Split Input: an Action input identifying a Zcash Shielded Asset note, used to ensure that the output note of that Action is of a validly issued +
  • Native Asset: a Custom Asset with issuance defined on the Zcash block chain.
  • +
  • Wrapped Asset: a Custom Asset with native issuance defined outside the Zcash block chain.
  • +
  • Split Input: an Action input identifying a Custom Asset note, used to ensure that the output note of that Action is of a validly issued \(\mathsf{AssetId}\) when there is no corresponding real input note to spend. The Action does not spend the note identified by the Split Input.
  • -
  • Split Action: a Zcash Shielded Asset Action that contains a Split Input.
  • +
  • Split Action: an Action that contains a Split Input.
  • Abstract

    diff --git a/zip-0227.html b/zip-0227.html index 126e2a55e..a3aafa099 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -68,16 +68,16 @@

    The issuance mechanism 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. In fact, the protocol described below enables what we hope will be a useful set of applications. The design decision is not to have a chosen name to describe the custom Asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”.

    Issuance Keys

    -

    There are two keys relevant to the Issuer:

    +

    The ZSA Protocol adds the following two keys to the key components 9:

    1. The issuance authorizing key, denoted as \(\mathsf{isk}\) - , is the key that is used to sign the issuance transaction. This key is used to authorize the issuance of a specific Asset type, and is only used by the issuer. Throughout we also call this key the issuer signature key.
    2. + , is the key that is used to sign the issuance transaction. This key is used to authorize the issuance of a specific Asset type, and is only used by the issuer.
    3. The issuance validating key, denoted as \(\mathsf{ik}\) - , is the key that is used to validate the issuance transaction. This key is used to validate the issuance of a specific Asset type, and is used by all block chain users (specifically the Asset owners and consensus validators) to associate the Asset in question with the issuer. Throughout we also call this key the issuer verification key.
    4. + , is the key that is used to validate the issuance transaction. This key is used to validate the issuance of a specific Asset type, and is used by all block chain users (specifically the Asset owners and consensus validators) to associate the Asset in question with the issuer.
    -

    The two keys are derived in an analogous manner to the spend authorizing key and spend validating key, using the same signature scheme, as described in ZIP 32 7 and in accordance with ZIP 316 8.

    +

    The two keys are derived in an analogous manner to the spend authorizing key and spend validating key, using the same signature scheme, as described in ZIP 32 7 and in accordance with ZIP 316 8.

    • The issuance authorizing key is derived directly from the spending key, \(\mathsf{sk}\) @@ -90,7 +90,7 @@ , as a public verification key:
    \(\mathsf{ik := SpendAuthSig^{Orchard}.DerivePublic(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 7. 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.

    +

    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 7. 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.

    Asset Identifier

    For every new Asset, there must be a new and unique identifier of the Asset. Every Asset is defined by the Asset description, @@ -117,7 +117,7 @@

    \(\mathsf{AssetIdHash^{Orchard}(ik, asset\_desc)} := \mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv",} \mathsf{ik}\texttt{||}\mathsf{asset\_desc} \texttt{)}\)

    where \(\mathsf{GroupHash^{\mathbb{P}}}\) - is the Group Hash into the group of points on the Pallas curve defined in the protocol specification 9.

    + is the Group Hash into the group of points on the Pallas curve defined in the protocol specification 10.

    Global Issuance State

    Issuance requires the following additions to the global state:

    @@ -192,7 +192,7 @@ \(\mathsf{isk}\) , that validates the issuance . -

    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 10.

    +

    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 11.

    19 ZIP 317b: ZSA Extension Proportional Fee Mechanism
    @@ -275,7 +275,7 @@

    Asset Features

      -
    • By using the 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, +
    • By using the 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,
      • by setting finalize = 1 from the first issuance action for that Asset type, 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.
      @@ -410,7 +410,7 @@ \(\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 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.

    +

    Bridging Assets 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.

    Other Considerations

    Implementing Zcash Nodes

    @@ -421,7 +421,7 @@ in order to properly keep track of the total supply for different Asset types. 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 317b 6.

    +

    The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317b 6.

    Future Work

    In future versions of this ZIP, the protocol may also include a "key rotation" mechanism. This would allow an issuer to change the underlying @@ -508,10 +508,18 @@

    - +
    + + + +
    9Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 3.1: Payment Addresses and Keys
    + + + + @@ -519,7 +527,7 @@
    10 Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.9.8: Group Hash into Pallas and Vesta
    - + diff --git a/zip-0227.rst b/zip-0227.rst index 028450fad..287eceb01 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -82,11 +82,11 @@ The issuance mechanism is broad enough for issuers to either create Assets on Zc Issuance Keys ------------- -There are two keys relevant to the Issuer: +The ZSA Protocol adds the following two keys to the key components [#protocol-addressesandkeys]_: -1. The issuance authorizing key, denoted as :math:`\mathsf{isk}`, is the key that is used to sign the issuance transaction. This key is used to authorize the issuance of a specific Asset type, and is only used by the issuer. Throughout we also call this key the issuer signature key. +1. The issuance authorizing key, denoted as :math:`\mathsf{isk}`, is the key that is used to sign the issuance transaction. This key is used to authorize the issuance of a specific Asset type, and is only used by the issuer. -2. The issuance validating key, denoted as :math:`\mathsf{ik}`, is the key that is used to validate the issuance transaction. This key is used to validate the issuance of a specific Asset type, and is used by all block chain users (specifically the Asset owners and consensus validators) to associate the Asset in question with the issuer. Throughout we also call this key the issuer verification key. +2. The issuance validating key, denoted as :math:`\mathsf{ik}`, is the key that is used to validate the issuance transaction. This key is used to validate the issuance of a specific Asset type, and is used by all block chain users (specifically the Asset owners and consensus validators) to associate the Asset in question with the issuer. The two keys are derived in an analogous manner to the spend authorizing key and spend validating key, using the same signature scheme, as described in ZIP 32 [#zip-0032]_ and in accordance with ZIP 316 [#zip-0316]_. @@ -380,5 +380,6 @@ References .. [#zip-0317b] `ZIP 317b: ZSA Extension Proportional Fee Mechanism `_ .. [#zip-0032] `ZIP 32: Shielded Hierarchical Deterministic Wallets `_ .. [#zip-0316] `ZIP 316: Unified Addresses and Unified Viewing Keys `_ +.. [#protocol-addressesandkeys] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 3.1: Payment Addresses and Keys `_ .. [#protocol-concretegrouphashpallasandvesta] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.9.8: Group Hash into Pallas and Vesta `_ .. [#protocol-transactionstructure] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 7.1: Transaction Encoding and Consensus (Transaction Version 5) `_ \ No newline at end of file From 4a6b4af8f97882a73721f62418ddf5d41c6f3705 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Fri, 27 Jan 2023 19:13:24 +0530 Subject: [PATCH 054/101] changes to ZIP 226 --- zip-0226.html | 36 ++++++++++++++++++------------------ zip-0226.rst | 10 +++++----- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/zip-0226.html b/zip-0226.html index c001e1ecf..261406349 100644 --- a/zip-0226.html +++ b/zip-0226.html @@ -51,8 +51,8 @@

    None of the currently deployed Zcash transfer protocols support Custom Assets. Enabling multi-asset support on the Zcash chain will open the door for a host of applications, and enhance the ecosystem with application developers and Asset custody institutions for issuance and bridging purposes.

    Overview

    -

    In order to be able to represent different Asset identifiers in Orchard, we need to define a new data field that uniquely represents the identifier of the Asset in question, which we call - \(\mathsf{AssetId}\) +

    In order to be able to represent different Asset identifiers in Orchard, we need to define a new data field in a note that uniquely represents the identifier of the Asset in question, which we call + \(\mathsf{AssetId^{Orchard}}\) .

    The Asset identifier will be used to enforce that the balance of an Action Description 7 is preserved across Assets (see the Orchard Binding Signature 8), and by extension the balance of an Orchard transaction. That is, the sum of all the \(\mathsf{value^{net}}\) @@ -85,7 +85,7 @@

    Asset Identifiers

    For every new Asset, there must be a new and unique identifier of the Asset. Every Asset is defined by the Asset description, \(\mathsf{asset\_desc}\) - , which is a global byte string (valid across all -future- Zcash protocols). From this Asset description the specific Asset identifier, + , which is a global byte string (scoped across all future versions of Zcash). From this Asset description the specific Asset identifier, \(\mathsf{AssetId}\) , is derived with a GroupHash and used within the output notes, as defined by the specific protocol (e.g.: for now Orchard-style, using Pallas curve).

    This @@ -100,26 +100,26 @@ , from one shielded protocol to another.

    Note Structure & Commitment

    -

    First, we need to adapt the components that define the Assets, i.e.: notes. A ZSA note differs from an Orchard note 6 by additionally including the identifier of the Asset, +

    Let + \(\mathsf{Note^{OrchardZSA}}\) + be the type of a ZSA note, i.e. + \(\mathsf{Note^{OrchardZSA}} := \mathsf{Note^{Orchard}} \times \mathbb{P*}\) + .

    +

    A ZSA note differs from an Orchard note 6 by additionally including the identifier of the Asset, \(\mathsf{AssetId}\) . So a ZSA note is a tuple \((\mathsf{g_d, pk_d, v, \rho, \psi, AssetId})\) , where

    • - \(\mathsf{AssetId} : \mathbb{P}\) + \(\mathsf{AssetId} : \mathbb{P*}\) is the unique random element of the Pallas group 9 that identifies each Asset in the Orchard protocol.
    -

    Let - \(\mathsf{Note^{OrchardZSA}}\) - be the type of a ZSA note, i.e. - \(\mathsf{Note^{OrchardZSA}} := \mathsf{Note^{Orchard}} \times \mathbb{P}\) - .

    In this case, the instance of the note commitment scheme, \(\mathsf{NoteCommit^{OrchardZSA}_{rcm}}\) , will differ from \(\mathsf{NoteCommit^{Orchard}_{rcm}}\) - in that for non-ZEC Assets, the Asset identifier will be added as an input to the commitment computation. As we will see, the nested structure of the Sinsemilla-based commitment 12 allows us to add the Asset identifier as a final recursive step, and hence keep a single instance of the Sinsemilla hash function in the circuit for the note commitment verification.

    + in that for Custom Assets, the Asset identifier will be added as an input to the commitment computation. As we will see, the nested structure of the Sinsemilla-based commitment 12 allows us to add the Asset identifier as a final recursive step, and hence keep a single instance of the Sinsemilla hash function in the circuit for the note commitment verification.

    The commitment output is still indistinguishable from the original Orchard ZEC note commitments, by definition of the Sinsemilla hash function 11. ZSA note commitments will therefore be added to the same Orchard Note Commitment Tree. In essence, we have:

    \(\mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, AssetId)} \in \mathsf{NoteCommit^{Orchard}.Output}\)

    The nullifier is generated in the same manner as in the Orchard protocol.

    @@ -290,7 +290,7 @@ -

    Enabling Backwards Compatibility with ZEC Notes: the following constraints must be added to enable backwards compatibility with the Orchard ZEC notes.

    +

    Enabling Backwards Compatibility with ZEC Notes: the following constraints must be added to enable backwards compatibility with Orchard ZEC notes.

    The old note commitment is computed using a “rolling-aggregate” Sinsemilla commitment. This means that the commitment is computed by adding new chunks or windows to the accumulated value. This method will be used in order to maintain a single commitment instance for the old note commitment, that will be used both for Orchard ZEC notes and for ZSA notes. The original Orchard ZEC notes will be conserved and not actually be converted into ZSA notes, as we will always need to compute them.

    • @@ -332,7 +332,7 @@

    Backward Compatibility

    -

    In order to have a "clean" backwards compatibility with the ZEC notes, we have designed the circuit to support both ZEC and ZSA notes. As we specify above, there are three main reasons we can do this: - The input notes with an Asset identifer denote the custom Assets, generating a note commitment that includes the Asset identifer; whereas the notes without an identifier, denote the ZEC notes, and generate a note commitment that does not include the Asset identifier, in order to maintain the referencability to the Merkle tree - The value commitment is abstracted to allow for the value base-point as a variable private input to the proof - The ZEC-based actions will still include dummy input notes, whereas the ZSA-based actions will include split input notes.

    +

    In order to have a "clean" backwards compatibility with the ZEC notes, we have designed the circuit to support both ZEC and ZSA notes. As we specify above, there are three main reasons we can do this: - The input notes with an Asset identifer denote the custom Assets, generating a note commitment that includes the Asset identifer; whereas the notes without an identifier, denote the ZEC notes, and generate a note commitment that does not include the Asset identifier, in order to maintain the referencability to the Merkle tree - The value commitment is abstracted to allow for the value base-point as a variable private input to the proof - The ZEC-based Actions will still include dummy input notes, whereas the ZSA-based Actions will include split input notes.

    Burn Mechanism

    @@ -353,14 +353,14 @@

    \(\mathsf{assetBurn = \{ (v^{AssetId}, AssetId)}\ |\ \forall\ \mathsf{AssetId}\ \textit{s.t.}\ \mathsf{v^{AssetId}} \neq 0 \}\)

    -

    The value balances for each Asset identifier in assetBurn represents the amount of that Asset identifier that is being burnt. In the case of ZEC, the value balance represents either the transaction fee, or the amount of ZEC changing anonymity pools (to Sapling or Transparent).

    +

    The value balances for each Asset identifier in assetBurn represents the amount of that Asset identifier that is being burnt. In the case of ZEC, the value balance represents either the transaction fee, or the amount of ZEC changing pools (eg: to Sapling or Transparent).

    Finally, the validator needs to verify the Balance and Binding Signature by adding the value balances for all Assets, as committed using their respective \(\mathsf{AssetId}\) as the value base point of the Pedersen Commitment. This is done as follows

    \(\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} - \sum_{\forall \mathsf{AssetId}\textit{ s.t. }\mathsf{v^{AssetId}\neq 0}} \mathsf{ValueCommit_0^{OrchardZSA}(v^{AssetId}, AssetId) } = \sum \mathsf{rcv_{i,j}^{net}}\mathcal{R}^{\mathsf{Orchard}}\)

    -

    In the case that the balance of all the action values related to a specific Asset will be zero, there will be no value added to the vector. This way, the number of Assets, nor their identifiers will be revealed, except in the case that an Asset is burnt.

    +

    In the case that the balance of all the Action values related to a specific Asset will be zero, there will be no value added to the vector. This way, neither the number of Assets, nor their identifiers, will be revealed, except in the case that an Asset is burnt.

    Note: Even if this mechanism allows having transparent ↔ shielded Asset transfers in theory, the transparent protocol will not be changed with this ZIP to adapt to a multiple Asset structure. This means that unless future consensus rules changes do allow it, unshielding will not be possible for custom Assets.

    ZSA Transaction Structure

    @@ -389,9 +389,9 @@
    1011 Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 7.1: Transaction Encoding and Consensus (Transaction Version 5)
    -

    In terms of the action size, the ZSA action size differs from the Orchard action size by 32 bytes (due to the addition of the +

    In terms of the Action size, the ZSA action size differs from the Orchard action size by 32 bytes (due to the addition of the \(\mathsf{AssetId}\) - ). This implies that the size goes from 820 bytes in the Orchard action to 852 bytes in the ZSA action.

    + ). This implies that the size goes from 820 bytes in the Orchard action to 852 bytes in the ZSA Action.

    Other Considerations

    Transaction Fees

    @@ -404,7 +404,7 @@
  • We prevent the "roadblock" attack on the Asset identifer by ensuring the output notes receive an Asset identifier that exists on the global state.
  • -

    Deplopyment

    +

    Deployment

    The Zcash Shielded Assets protocol should be deployed by replacing the Orchard protocol in a subsequent Network Upgrade. The design of this protocol ensures that there is no need to use any turnstile mechanism, being that Orchard-based ZEC notes can be used directly within the ZSA Actions.

    diff --git a/zip-0226.rst b/zip-0226.rst index 3a541db84..df1617c92 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -86,15 +86,15 @@ In future network and protocol upgrades, the same Asset description string can b Note Structure & Commitment --------------------------- +Let :math:`\mathsf{Note^{OrchardZSA}}` be the type of a ZSA note, i.e. +:math:`\mathsf{Note^{OrchardZSA}} := \mathsf{Note^{Orchard}} \times \mathbb{P*}`. + A ZSA note differs from an Orchard note [#protocol-notes]_ by additionally including the identifier of the Asset, :math:`\mathsf{AssetId}`. So a ZSA note is a tuple :math:`(\mathsf{g_d, pk_d, v, \rho, \psi, AssetId})`, where -- :math:`\mathsf{AssetId} : \mathbb{P}` is the unique random element of the Pallas group [#protocol-pallasandvesta]_ that identifies each Asset in the Orchard protocol. - -Let :math:`\mathsf{Note^{OrchardZSA}}` be the type of a ZSA note, i.e. -:math:`\mathsf{Note^{OrchardZSA}} := \mathsf{Note^{Orchard}} \times \mathbb{P*}`. +- :math:`\mathsf{AssetId} : \mathbb{P*}` is the unique random element of the Pallas group [#protocol-pallasandvesta]_ that identifies each Asset in the Orchard protocol. -In this case, the instance of the note commitment scheme, :math:`\mathsf{NoteCommit^{OrchardZSA}_{rcm}}`, will differ from :math:`\mathsf{NoteCommit^{Orchard}_{rcm}}` in that for non-ZEC Assets, the Asset identifier will be added as an input to the commitment computation. As we will see, the nested structure of the Sinsemilla-based commitment [#protocol-concretesinsemillacommit]_ allows us to add the Asset identifier as a final recursive step, and hence keep a single instance of the Sinsemilla hash function in the circuit for the note commitment verification. +In this case, the instance of the note commitment scheme, :math:`\mathsf{NoteCommit^{OrchardZSA}_{rcm}}`, will differ from :math:`\mathsf{NoteCommit^{Orchard}_{rcm}}` in that for Custom Assets, the Asset identifier will be added as an input to the commitment computation. As we will see, the nested structure of the Sinsemilla-based commitment [#protocol-concretesinsemillacommit]_ allows us to add the Asset identifier as a final recursive step, and hence keep a single instance of the Sinsemilla hash function in the circuit for the note commitment verification. The commitment output is still indistinguishable from the original Orchard ZEC note commitments, by definition of the Sinsemilla hash function [#protocol-concretesinsemillahash]_. ZSA note commitments will therefore be added to the same Orchard Note Commitment Tree. In essence, we have: From b45bcf8518f299bd6e24d08b8a1f2c8d93a1f55a Mon Sep 17 00:00:00 2001 From: Vivek Arte <46618816+vivek-arte@users.noreply.github.com> Date: Sat, 28 Jan 2023 12:15:42 +0530 Subject: [PATCH 055/101] Update zip-0226.rst Co-authored-by: str4d --- zip-0226.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zip-0226.rst b/zip-0226.rst index df1617c92..28da5ecc8 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -105,7 +105,7 @@ The nullifier is generated in the same manner as in the Orchard protocol. Value Commitment ---------------- -The Orchard Protocol uses a Sinsemilla-based Homomorphic Pedersen Commitment [#protocol-concretevaluecommit]_ to perform the value commitment, which is instantiated as +The Orchard Protocol uses a Homomorphic Pedersen Commitment [#protocol-concretevaluecommit]_ to perform the value commitment, which is instantiated as .. math:: \mathsf{cv^{net}:=ValueCommit^{Orchard}_{rcv}(v^{net})}:= \mathsf{[v^{net}]}\mathcal{V}^{\mathsf{Orchard}}+[\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}} From b54785369c83c1fc0d3f967403539ebbb1f683c9 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Sat, 28 Jan 2023 12:16:25 +0530 Subject: [PATCH 056/101] added note plaintext updates to ZIP 226 --- zip-0226.html | 8 +++++++- zip-0226.rst | 7 ++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/zip-0226.html b/zip-0226.html index 261406349..beac6c394 100644 --- a/zip-0226.html +++ b/zip-0226.html @@ -113,7 +113,9 @@
    • \(\mathsf{AssetId} : \mathbb{P*}\) - is the unique random element of the Pallas group 9 that identifies each Asset in the Orchard protocol.
    • + is the unique random element of the Pallas group 9 that identifies each Asset in the Orchard protocol. The byte representation of the Asset identifier is defined as + \(\mathsf{assetID} : \mathbb{B}^{\mathbb{Y}[32]} := \mathsf{repr}_{\mathbb{P}}(\mathsf{AssetId})\) + .

    In this case, the instance of the note commitment scheme, \(\mathsf{NoteCommit^{OrchardZSA}_{rcm}}\) @@ -123,6 +125,10 @@

    The commitment output is still indistinguishable from the original Orchard ZEC note commitments, by definition of the Sinsemilla hash function 11. ZSA note commitments will therefore be added to the same Orchard Note Commitment Tree. In essence, we have:

    \(\mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, AssetId)} \in \mathsf{NoteCommit^{Orchard}.Output}\)

    The nullifier is generated in the same manner as in the Orchard protocol.

    +

    The ZSA note plaintext also includes the Asset identifier in addition to the components in the Orchard note plaintext. It consists of

    +

    + \((\mathsf{leadByte} : \mathbb{B}^{\mathbb{Y}}, \mathsf{d} : \mathbb{B}^{[l_{\mathsf{d}}]}, \mathsf{v} : \{0 .. 2^{l_{\mathsf{value}}} - 1\}, \mathsf{rseed} : \mathbb{B}^{\mathbb{Y}[32]}, \mathsf{assetID} : \mathbb{B}^{\mathbb{Y}[32]}, \mathsf{memo} : \mathbb{B}^{\mathbb{Y}[512]})\) +

    Value Commitment

    The Orchard Protocol uses a Sinsemilla-based Homomorphic Pedersen Commitment 13 to perform the value commitment, which is instantiated as

    diff --git a/zip-0226.rst b/zip-0226.rst index 28da5ecc8..6fd52ae43 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -92,7 +92,7 @@ Let :math:`\mathsf{Note^{OrchardZSA}}` be the type of a ZSA note, i.e. A ZSA note differs from an Orchard note [#protocol-notes]_ by additionally including the identifier of the Asset, :math:`\mathsf{AssetId}`. So a ZSA note is a tuple :math:`(\mathsf{g_d, pk_d, v, \rho, \psi, AssetId})`, where -- :math:`\mathsf{AssetId} : \mathbb{P*}` is the unique random element of the Pallas group [#protocol-pallasandvesta]_ that identifies each Asset in the Orchard protocol. +- :math:`\mathsf{AssetId} : \mathbb{P*}` is the unique random element of the Pallas group [#protocol-pallasandvesta]_ that identifies each Asset in the Orchard protocol. The byte representation of the Asset identifier is defined as :math:`\mathsf{assetID} : \mathbb{B}^{\mathbb{Y}[32]} := \mathsf{repr}_{\mathbb{P}}(\mathsf{AssetId})`. In this case, the instance of the note commitment scheme, :math:`\mathsf{NoteCommit^{OrchardZSA}_{rcm}}`, will differ from :math:`\mathsf{NoteCommit^{Orchard}_{rcm}}` in that for Custom Assets, the Asset identifier will be added as an input to the commitment computation. As we will see, the nested structure of the Sinsemilla-based commitment [#protocol-concretesinsemillacommit]_ allows us to add the Asset identifier as a final recursive step, and hence keep a single instance of the Sinsemilla hash function in the circuit for the note commitment verification. @@ -102,6 +102,11 @@ The commitment output is still indistinguishable from the original Orchard ZEC n The nullifier is generated in the same manner as in the Orchard protocol. +The ZSA note plaintext also includes the Asset identifier in addition to the components in the Orchard note plaintext. +It consists of + +:math:`(\mathsf{leadByte} : \mathbb{B}^{\mathbb{Y}}, \mathsf{d} : \mathbb{B}^{[l_{\mathsf{d}}]}, \mathsf{v} : \{0 .. 2^{l_{\mathsf{value}}} - 1\}, \mathsf{rseed} : \mathbb{B}^{\mathbb{Y}[32]}, \mathsf{assetID} : \mathbb{B}^{\mathbb{Y}[32]}, \mathsf{memo} : \mathbb{B}^{\mathbb{Y}[512]})` + Value Commitment ---------------- From 0f62ddafc618c2ba8db486b76675461401391bb0 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Sat, 28 Jan 2023 19:53:02 +0530 Subject: [PATCH 057/101] added html file update of ZIP 226 --- zip-0226.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zip-0226.html b/zip-0226.html index beac6c394..eb9dec8c9 100644 --- a/zip-0226.html +++ b/zip-0226.html @@ -131,7 +131,7 @@

    Value Commitment

    -

    The Orchard Protocol uses a Sinsemilla-based Homomorphic Pedersen Commitment 13 to perform the value commitment, which is instantiated as

    +

    The Orchard Protocol uses a Homomorphic Pedersen Commitment 13 to perform the value commitment, which is instantiated as

    \(\mathsf{cv^{net}:=ValueCommit^{Orchard}_{rcv}(v^{net})}:= \mathsf{[v^{net}]}\mathcal{V}^{\mathsf{Orchard}}+[\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}}\)

    where \(\mathsf{v^{net} = v^{old} - v^{new}}\) From 6e24472d4469936b4f3ffb4780f5dc78521aca41 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Mon, 30 Jan 2023 08:03:44 +0530 Subject: [PATCH 058/101] further edits and rearrangements --- zip-0226.html | 122 +++++++++++++++++++++++++++----------------------- zip-0226.rst | 40 ++++++++--------- 2 files changed, 85 insertions(+), 77 deletions(-) diff --git a/zip-0226.html b/zip-0226.html index eb9dec8c9..562755a72 100644 --- a/zip-0226.html +++ b/zip-0226.html @@ -54,28 +54,30 @@

    In order to be able to represent different Asset identifiers in Orchard, we need to define a new data field in a note that uniquely represents the identifier of the Asset in question, which we call \(\mathsf{AssetId^{Orchard}}\) .

    -

    The Asset identifier will be used to enforce that the balance of an Action Description 7 is preserved across Assets (see the Orchard Binding Signature 8), and by extension the balance of an Orchard transaction. That is, the sum of all the +

    The Asset identifier will be used to enforce that the balance of an Action Description 8 is preserved across Assets (see the Orchard Binding Signature 9), and by extension the balance of an Orchard transaction. That is, the sum of all the \(\mathsf{value^{net}}\) from each Action Description, computed as \(\mathsf{value^{old}-value^{new}}\) , must be balanced only with respect to the same Asset identifier. This is specially important since we will allow different Action Descriptions to transfer notes of different Asset identifiers, where the overall balance is checked without revealing which (or how many distinct) Assets are being transferred.

    -

    As was initially proposed by Jack Grigg and Daira Hopwood 17 18, we propose to make this happen by changing the value base point, +

    As was initially proposed by Jack Grigg and Daira Hopwood 19 20, we propose to make this happen by changing the value base point, \(\mathcal{V}^{\mathsf{Orchard}}\) , in the Homomorphic Pedersen Commitment that derives the value commitment, \(\mathsf{cv^{net}}\) , of the net value in an Orchard Action.

    Because in a single transaction all value commitments are balanced, there must be as many different value base points as there are Asset identifiers in the transaction. We propose to make the \(\mathsf{AssetId}\) - identifier an auxiliary input to the proof for each Action statement 15, represented already as a point on the Pallas curve. The circuit then should check that the same + identifier an auxiliary input to the proof for each Action statement 17, represented already as a point on the Pallas curve. The circuit then should check that the same \(\mathsf{AssetId}\) - is used in the old note commitment and the new note commitment 12, and as the base point + is used in the old note commitment and the new note commitment 14, and as the base point \(\mathcal{V}^\mathsf{Orchard}\) - in the value commitment 13. This ensures (1) that the input and output notes are of the same + in the value commitment 15. This ensures (1) that the input and output notes are of the same \(\mathsf{AssetId}\) , and (2) that only actions with the same Asset identifier will balance out in the binding and balance signatures.

    -

    In order to ensure the security of the transfers, and as we will explain below, we are redefining input dummy notes 14 for custom Assets, as we need to enforce that the +

    In order to ensure the security of the transfers, and as we will explain below, we are redefining input dummy notes 16 for Custom Assets, as we need to enforce that the \(\mathsf{AssetId}\) - of the output note of that split Action is the output of a PRF.

    + of the output note of that split Action is the output of a valid + \(\mathsf{AssetIdHash}\) + computation defined in ZIP 227 5.

    Finally, in this ZIP we also describe the burn mechanism, which is a direct extension of the transfer mechanism. The burn process uses a similar mechanism to what is used in Orchard to unshield ZEC, by using the \(\mathsf{valueBalance}\) of the Asset in question. Burning Assets is useful for many purposes, including bridging of Wrapped Assets and removing supply of Assets.

    @@ -87,7 +89,7 @@ \(\mathsf{asset\_desc}\) , which is a global byte string (scoped across all future versions of Zcash). From this Asset description the specific Asset identifier, \(\mathsf{AssetId}\) - , is derived with a GroupHash and used within the output notes, as defined by the specific protocol (e.g.: for now Orchard-style, using Pallas curve).

    + , is derived as defined in ZIP 227 5.

    This \(\mathsf{AssetId}\) will be the base point of the value commitment for the specific custom Asset. Note that the @@ -105,7 +107,7 @@ be the type of a ZSA note, i.e. \(\mathsf{Note^{OrchardZSA}} := \mathsf{Note^{Orchard}} \times \mathbb{P*}\) .

    -

    A ZSA note differs from an Orchard note 6 by additionally including the identifier of the Asset, +

    A ZSA note differs from an Orchard note 6 by additionally including the identifier of the Asset, \(\mathsf{AssetId}\) . So a ZSA note is a tuple \((\mathsf{g_d, pk_d, v, \rho, \psi, AssetId})\) @@ -113,7 +115,7 @@

    • \(\mathsf{AssetId} : \mathbb{P*}\) - is the unique random element of the Pallas group 9 that identifies each Asset in the Orchard protocol. The byte representation of the Asset identifier is defined as + is the unique random element of the Pallas group 11 that identifies each Asset in the Orchard protocol, as . The byte representation of the Asset identifier is defined as \(\mathsf{assetID} : \mathbb{B}^{\mathbb{Y}[32]} := \mathsf{repr}_{\mathbb{P}}(\mathsf{AssetId})\) .
    @@ -121,30 +123,19 @@ \(\mathsf{NoteCommit^{OrchardZSA}_{rcm}}\) , will differ from \(\mathsf{NoteCommit^{Orchard}_{rcm}}\) - in that for Custom Assets, the Asset identifier will be added as an input to the commitment computation. As we will see, the nested structure of the Sinsemilla-based commitment 12 allows us to add the Asset identifier as a final recursive step, and hence keep a single instance of the Sinsemilla hash function in the circuit for the note commitment verification.

    -

    The commitment output is still indistinguishable from the original Orchard ZEC note commitments, by definition of the Sinsemilla hash function 11. ZSA note commitments will therefore be added to the same Orchard Note Commitment Tree. In essence, we have:

    + in that for Custom Assets, the Asset identifier will be added as an input to the commitment computation. As we will see, the nested structure of the Sinsemilla-based commitment 14 allows us to add the Asset identifier as a final recursive step, and hence keep a single instance of the Sinsemilla hash function in the circuit for the note commitment verification.

    +

    The commitment output is still indistinguishable from the original Orchard ZEC note commitments, by definition of the Sinsemilla hash function 13. ZSA note commitments will therefore be added to the same Orchard Note Commitment Tree. In essence, we have:

    \(\mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, AssetId)} \in \mathsf{NoteCommit^{Orchard}.Output}\)
    -

    The nullifier is generated in the same manner as in the Orchard protocol.

    -

    The ZSA note plaintext also includes the Asset identifier in addition to the components in the Orchard note plaintext. It consists of

    -

    - \((\mathsf{leadByte} : \mathbb{B}^{\mathbb{Y}}, \mathsf{d} : \mathbb{B}^{[l_{\mathsf{d}}]}, \mathsf{v} : \{0 .. 2^{l_{\mathsf{value}}} - 1\}, \mathsf{rseed} : \mathbb{B}^{\mathbb{Y}[32]}, \mathsf{assetID} : \mathbb{B}^{\mathbb{Y}[32]}, \mathsf{memo} : \mathbb{B}^{\mathbb{Y}[512]})\) -

    +

    The nullifier is generated in the same manner as in the Orchard protocol 10.

    +

    The ZSA note plaintext also includes the Asset identifier in addition to the components in the Orchard note plaintext 7. It consists of

    +
    \((\mathsf{leadByte} : \mathbb{B}^{\mathbb{Y}}, \mathsf{d} : \mathbb{B}^{[l_{\mathsf{d}}]}, \mathsf{v} : \{0 .. 2^{l_{\mathsf{value}}} - 1\}, \mathsf{rseed} : \mathbb{B}^{\mathbb{Y}[32]}, \mathsf{assetID} : \mathbb{B}^{\mathbb{Y}[32]}, \mathsf{memo} : \mathbb{B}^{\mathbb{Y}[512]})\)

    Value Commitment

    -

    The Orchard Protocol uses a Homomorphic Pedersen Commitment 13 to perform the value commitment, which is instantiated as

    -
    \(\mathsf{cv^{net}:=ValueCommit^{Orchard}_{rcv}(v^{net})}:= \mathsf{[v^{net}]}\mathcal{V}^{\mathsf{Orchard}}+[\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}}\)
    -

    where - \(\mathsf{v^{net} = v^{old} - v^{new}}\) - ; - \(\mathcal{V}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}(\texttt{"z.cash:Orchard-cv", "v")}\) - ; and - \(\mathcal{R}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}(\texttt{"z.cash:Orchard-cv", "r")}\) - .

    -

    In the case of the Orchard protocol, we see that the base points +

    The Orchard Protocol uses a Homomorphic Pedersen Commitment 15 to perform the value commitment, with fixed base points \(\mathcal{V}^{\mathsf{Orchard}}\) and \(\mathcal{R}^{\mathsf{Orchard}}\) - are fixed for every value commitment, as the values represent the amount of ZEC being transferred.

    + as the values represent the amount of ZEC being transferred.

    In the case of the ZSA protocol, the value of different Asset identifiers in a given transaction will be committed using a different value base point. This enables the final balance of the transaction to be securely computed, such that each Asset identifier is balanced independently, as Assets with different identifiers are not meant to be mutually fungible. The value commitment then becomes

    \(\mathsf{cv^{net}:=ValueCommit^{OrchardZSA}_{rcv}(v^{net}_{AssetId},\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}})}:= \mathsf{[v^{net}_{AssetId}]}\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}}+[\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}}\)

    where @@ -160,18 +151,16 @@ \(\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}}:=\mathsf{AssetId}\) , where the Asset identifier \(\mathsf{AssetId}\) - is computed as defined in ZIP 227 5, and

    + is computed as defined in ZIP 227 5, and

    \(\mathcal{R}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv", "r")}\) - .

    + , as in the Orchard protocol.

    We define \(\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{ZEC}} :=\mathcal{V}^{\mathsf{Orchard}}\) - so that the value commitment for ZEC notes is computed identically to the Orchard protocol deployed in NU5 3.

    + so that the value commitment for ZEC notes is computed identically to the Orchard protocol deployed in NU5 3.

    Value Balance Verification

    -

    In order to verify the balance of the different Assets, the verifier MUST perform exactly the same process as for the Orchard protocol 8. The main reason why no changes to this process are needed is that no custom Assets can be unshielded, so all custom Assets are contained within the shielded pool. This means that the net balance of the input and output values is zero, with only one Asset identifier of value balance published, that of ZEC, - \(\mathsf{v^{balanceOrchard}}\) - . No net amount of any other Asset identifier will be revealed, and the number of Asset identifiers in the transaction is also hidden. The only exception to this is in the case that an Asset is burnt, as we will see below in the burn mechanism.

    +

    In order to verify the balance of the different Assets, the verifier MUST perform exactly the same process as for the Orchard protocol 9.

    For a total of \(n\) Actions in a transfer, the prover MUST still sign the SIGHASH of the transaction using the binding signature key @@ -179,13 +168,18 @@ .

    Then the verifier MUST compute

    \(\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} = \sum \mathsf{rcv_{i}^{net}}\mathcal{R}^{\mathsf{Orchard}}\)
    -

    and use it to verify the bindingSignature on the SIGHASH message, as described in §4.14 of the Zcash Specification 8.

    -

    As in the Orchard protocol, the binding signature verification key, - \(\mathsf{bvk}\) - , will only be valid (and hence verify the signature correctly), as long as the committed values sum to zero. In contrast, in this protocol, the committed values only sum to zero per Asset identifier, as the Pedersen commitments add up homomorphically only with respect to the same value base point.

    +

    and use it to verify the bindingSignature on the SIGHASH message.

    +

    Rationale for Value Balance Verification

    +

    The main reason why no changes to the Orchard process are needed is that no Custom Assets can be unshielded, so all custom Assets are contained within the shielded pool. This means that the net balance of the input and output values is zero, with only one Asset identifier of value balance published, that of ZEC, + \(\mathsf{v^{balanceOrchard}}\) + . No net amount of any other Asset identifier will be revealed, and the number of Asset identifiers in the transaction is also hidden. The only exception to this is in the case that an Asset is burnt, as we will see below in the burn mechanism.

    +

    As in the Orchard protocol, the binding signature verification key, + \(\mathsf{bvk}\) + , will only be valid (and hence verify the signature correctly), as long as the committed values sum to zero. In contrast, in this protocol, the committed values only sum to zero per Asset identifier, as the Pedersen commitments add up homomorphically only with respect to the same value base point.

    +

    Split Notes

    -

    One of the key functionalities in a UTXO-based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This requires a 1-to-many (Orchard) transaction. However, because each Action represents an input and an output, the resulting transaction must have multiple inputs. In order to cope with this today, the Actions that have not been assigned input notes are instead given dummy spend notes 14, which we call split Actions and split notes respectively. Basically, the input note is “faked” inside of the proof in order to hide which Action contains the real spend note.

    +

    One of the key functionalities in a UTXO-based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This requires a 1-to-many (Orchard) transaction. However, because each Action represents an input and an output, the resulting transaction must have multiple inputs. In order to cope with this today, the Actions that have not been assigned input notes are instead given dummy spend notes 16, which we call split Actions and split notes respectively. Basically, the input note is “faked” inside of the proof in order to hide which Action contains the real spend note.

    This, however, brings some issues when it comes to adding multiple Asset identifiers, as the output note of the split Actions cannot be of any Asset identifier, it must be enforced to be an actual output of a GroupHash computation (in fact we want it to be of the same identifier as the original input note, but the binding signature takes care that the proper balancing is performed). If not, then the prover could essentially input a multiple (or linear combination) of an existing identifier, with the goal to attack the network by overflowing the ZEC value balance and hence counterfeiting ZEC funds.

    In order to prevent this, we make some modifications to the circuit. Specifically we remove the dummy note functionality for custom Assets and we enforce that every input note to an ZSA Action must be proven to exist in the set of note commitments in the note commitment tree. We then enforce this real note to be “unspendable” in the sense that its value will be zeroed in split Actions and the nullifier will be randomized, making the note not spendable in the specific Action. Then, the proof itself ensures that the output note is of the same identifier as the input note. In the circuit, the split note functionality will be activated by a boolean private input to the proof.

    This creates a chain of induction that ensures that the value base points of all output notes of a transfer are actual outputs of a GroupHash, as they originate in the Issuance protocol which is publicly verified. If this were not done then it would be possible to violate balance, for example by using a value base point derived from those of other Assets.

    @@ -204,7 +198,7 @@

    Circuit Statement

    -

    The advantage of the design described above, with respect to the circuit statement, is that every ZSA Action statement is kept closely similar to the Orchard Action statement 15, except for a few additions that ensure the security of the Asset identifier system.

    +

    The advantage of the design described above, with respect to the circuit statement, is that every ZSA Action statement is kept closely similar to the Orchard Action statement 17, except for a few additions that ensure the security of the Asset identifier system.

    Asset Identifier Equality: the following constraints must be added to ensure that the input and output note are of the same \(\mathsf{AssetId}\) :

    @@ -370,7 +364,7 @@

    Note: Even if this mechanism allows having transparent ↔ shielded Asset transfers in theory, the transparent protocol will not be changed with this ZIP to adapt to a multiple Asset structure. This means that unless future consensus rules changes do allow it, unshielding will not be possible for custom Assets.

    ZSA Transaction Structure

    -

    The transaction format is similar to the version 5 transaction format described in the Zcash specification 16, with the following additions to the Orchard bundle:

    +

    The transaction format is similar to the version 5 transaction format described in the Zcash specification 18, with the following additions to the Orchard bundle:

    @@ -401,7 +395,7 @@

    Other Considerations

    Transaction Fees

    -

    The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317b 19.

    +

    The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317b 21.

    Security and Privacy

      @@ -474,10 +468,18 @@
    - +
    + + + +
    7Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.5: Encodings of Note Plaintexts and Memo Fields
    + + + + @@ -485,15 +487,23 @@
    8 Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 3.7: Action Transfers and their Descriptions
    - - + + + + +
    8Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.14: Balance and Binding Signature (Orchard)9Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.14: Balance and Binding Signature (Orchard)
    + + + + +
    10Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.16: Note Commitments and Nullifiers
    - + @@ -501,7 +511,7 @@
    911 Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.9.6: Pallas and Vesta
    - + @@ -509,7 +519,7 @@
    1012 Pallas/Vesta supporting evidence
    - + @@ -517,7 +527,7 @@
    1113 Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.1.9: Sinsemilla hash function
    - + @@ -525,7 +535,7 @@
    1214 Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.8.4: Sinsemilla commitments
    - + @@ -533,7 +543,7 @@
    1315 Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.8.3: Homomorphic Pedersen commitments (Sapling and Orchard)
    - + @@ -541,7 +551,7 @@
    1416 Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.8.3: Dummy Notes (Orchard)
    - + @@ -549,7 +559,7 @@
    1517 Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.17.4: Action Statement (Orchard)
    - + @@ -557,7 +567,7 @@
    1618 Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 7.1: Transaction Encoding and Consensus (Transaction Version 5)
    - + @@ -565,7 +575,7 @@
    1719 User-Defined Assets and Wrapped Assets
    - + @@ -573,7 +583,7 @@
    1820 Comment on Generalized Value Commitments
    - + diff --git a/zip-0226.rst b/zip-0226.rst index 6fd52ae43..783d530b8 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -65,7 +65,7 @@ As was initially proposed by Jack Grigg and Daira Hopwood [#initial-zsa-issue]_ Because in a single transaction all value commitments are balanced, there must be as many different value base points as there are Asset identifiers in the transaction. We propose to make the :math:`\mathsf{AssetId}` identifier an auxiliary input to the proof for each Action statement [#protocol-actionstatement]_, represented already as a point on the Pallas curve. The circuit then should check that the same :math:`\mathsf{AssetId}` is used in the old note commitment and the new note commitment [#protocol-concretesinsemillacommit]_, **and** as the base point :math:`\mathcal{V}^\mathsf{Orchard}` in the value commitment [#protocol-concretevaluecommit]_. This ensures (1) that the input and output notes are of the same :math:`\mathsf{AssetId}`, and (2) that only actions with the same Asset identifier will balance out in the binding and balance signatures. -In order to ensure the security of the transfers, and as we will explain below, we are redefining input dummy notes [#protocol-dummynotes]_ for custom Assets, as we need to enforce that the :math:`\mathsf{AssetId}` of the output note of that split Action is the output of a PRF. +In order to ensure the security of the transfers, and as we will explain below, we are redefining input dummy notes [#protocol-dummynotes]_ for Custom Assets, as we need to enforce that the :math:`\mathsf{AssetId}` of the output note of that split Action is the output of a valid :math:`\mathsf{AssetIdHash}` computation defined in ZIP 227 [#zip-0227]_. Finally, in this ZIP we also describe the *burn* mechanism, which is a direct extension of the transfer mechanism. The burn process uses a similar mechanism to what is used in Orchard to unshield ZEC, by using the :math:`\mathsf{valueBalance}` of the Asset in question. Burning Assets is useful for many purposes, including bridging of Wrapped Assets and removing supply of Assets. @@ -77,7 +77,7 @@ Most of the protocol is kept the same as the Orchard protocol released with NU5, Asset Identifiers ----------------- -For every new Asset, there must be a new and unique identifier of the Asset. Every Asset is defined by the *Asset description*, :math:`\mathsf{asset\_desc}`, which is a global byte string (scoped across all future versions of Zcash). From this Asset description the specific Asset identifier, :math:`\mathsf{AssetId}`, is derived with a `GroupHash` and used within the output notes, as defined by the specific protocol (e.g.: for now Orchard-style, using Pallas curve). +For every new Asset, there must be a new and unique identifier of the Asset. Every Asset is defined by the *Asset description*, :math:`\mathsf{asset\_desc}`, which is a global byte string (scoped across all future versions of Zcash). From this Asset description the specific Asset identifier, :math:`\mathsf{AssetId}`, is derived as defined in ZIP 227 [#zip-0227]_. This :math:`\mathsf{AssetId}` will be the base point of the value commitment for the specific custom Asset. Note that the :math:`\mathsf{AssetId}` of the ZEC Asset will be kept as the original value base point, :math:`\mathcal{V}^\mathsf{Orchard}`. @@ -92,7 +92,7 @@ Let :math:`\mathsf{Note^{OrchardZSA}}` be the type of a ZSA note, i.e. A ZSA note differs from an Orchard note [#protocol-notes]_ by additionally including the identifier of the Asset, :math:`\mathsf{AssetId}`. So a ZSA note is a tuple :math:`(\mathsf{g_d, pk_d, v, \rho, \psi, AssetId})`, where -- :math:`\mathsf{AssetId} : \mathbb{P*}` is the unique random element of the Pallas group [#protocol-pallasandvesta]_ that identifies each Asset in the Orchard protocol. The byte representation of the Asset identifier is defined as :math:`\mathsf{assetID} : \mathbb{B}^{\mathbb{Y}[32]} := \mathsf{repr}_{\mathbb{P}}(\mathsf{AssetId})`. +- :math:`\mathsf{AssetId} : \mathbb{P*}` is the unique random element of the Pallas group [#protocol-pallasandvesta]_ that identifies each Asset in the Orchard protocol, as . The byte representation of the Asset identifier is defined as :math:`\mathsf{assetID} : \mathbb{B}^{\mathbb{Y}[32]} := \mathsf{repr}_{\mathbb{P}}(\mathsf{AssetId})`. In this case, the instance of the note commitment scheme, :math:`\mathsf{NoteCommit^{OrchardZSA}_{rcm}}`, will differ from :math:`\mathsf{NoteCommit^{Orchard}_{rcm}}` in that for Custom Assets, the Asset identifier will be added as an input to the commitment computation. As we will see, the nested structure of the Sinsemilla-based commitment [#protocol-concretesinsemillacommit]_ allows us to add the Asset identifier as a final recursive step, and hence keep a single instance of the Sinsemilla hash function in the circuit for the note commitment verification. @@ -100,27 +100,17 @@ The commitment output is still indistinguishable from the original Orchard ZEC n .. math:: \mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, AssetId)} \in \mathsf{NoteCommit^{Orchard}.Output} -The nullifier is generated in the same manner as in the Orchard protocol. +The nullifier is generated in the same manner as in the Orchard protocol [#protocol-commitmentsandnullifiers]_. -The ZSA note plaintext also includes the Asset identifier in addition to the components in the Orchard note plaintext. +The ZSA note plaintext also includes the Asset identifier in addition to the components in the Orchard note plaintext [#protocol-notept]_. It consists of -:math:`(\mathsf{leadByte} : \mathbb{B}^{\mathbb{Y}}, \mathsf{d} : \mathbb{B}^{[l_{\mathsf{d}}]}, \mathsf{v} : \{0 .. 2^{l_{\mathsf{value}}} - 1\}, \mathsf{rseed} : \mathbb{B}^{\mathbb{Y}[32]}, \mathsf{assetID} : \mathbb{B}^{\mathbb{Y}[32]}, \mathsf{memo} : \mathbb{B}^{\mathbb{Y}[512]})` +.. math:: (\mathsf{leadByte} : \mathbb{B}^{\mathbb{Y}}, \mathsf{d} : \mathbb{B}^{[l_{\mathsf{d}}]}, \mathsf{v} : \{0 .. 2^{l_{\mathsf{value}}} - 1\}, \mathsf{rseed} : \mathbb{B}^{\mathbb{Y}[32]}, \mathsf{assetID} : \mathbb{B}^{\mathbb{Y}[32]}, \mathsf{memo} : \mathbb{B}^{\mathbb{Y}[512]}) Value Commitment ---------------- -The Orchard Protocol uses a Homomorphic Pedersen Commitment [#protocol-concretevaluecommit]_ to perform the value commitment, which is instantiated as - -.. math:: \mathsf{cv^{net}:=ValueCommit^{Orchard}_{rcv}(v^{net})}:= \mathsf{[v^{net}]}\mathcal{V}^{\mathsf{Orchard}}+[\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}} - -where :math:`\mathsf{v^{net} = v^{old} - v^{new}}`; -:math:`\mathcal{V}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}(\texttt{"z.cash:Orchard-cv", "v")}`; and -:math:`\mathcal{R}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}(\texttt{"z.cash:Orchard-cv", "r")}`. - -In the case of the Orchard protocol, we see that the base points :math:`\mathcal{V}^{\mathsf{Orchard}}` and -:math:`\mathcal{R}^{\mathsf{Orchard}}` are fixed for every value commitment, as the values represent the amount of ZEC -being transferred. +The Orchard Protocol uses a Homomorphic Pedersen Commitment [#protocol-concretevaluecommit]_ to perform the value commitment, with fixed base points :math:`\mathcal{V}^{\mathsf{Orchard}}` and :math:`\mathcal{R}^{\mathsf{Orchard}}` as the values represent the amount of ZEC being transferred. In the case of the ZSA protocol, the value of different Asset identifiers in a given transaction will be committed using a **different value base point**. This enables the final balance of the transaction to be securely computed, such that each Asset identifier is balanced independently, as Assets with different identifiers are not meant to be mutually fungible. The value commitment then becomes @@ -132,14 +122,14 @@ where :math:`\mathsf{v^{net}_{AssetId}} = \mathsf{v^{old}_{AssetId} - v^{new}_{A :math:`\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}}:=\mathsf{AssetId}`, where the Asset identifier :math:`\mathsf{AssetId}` is computed as defined in ZIP 227 [#zip-0227]_, and -:math:`\mathcal{R}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv", "r")}`. +:math:`\mathcal{R}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv", "r")}`, as in the Orchard protocol. We define :math:`\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{ZEC}} :=\mathcal{V}^{\mathsf{Orchard}}` so that the value commitment for ZEC notes is computed identically to the Orchard protocol deployed in NU5 [#zip-0224]_. Value Balance Verification -------------------------- -In order to verify the balance of the different Assets, the verifier MUST perform exactly the same process as for the Orchard protocol [#protocol-binding]_. The main reason why no changes to this process are needed is that no custom Assets can be unshielded, so all custom Assets are contained within the shielded pool. This means that the net balance of the input and output values is zero, with only one Asset identifier of value balance published, that of ZEC, :math:`\mathsf{v^{balanceOrchard}}`. No net amount of any other Asset identifier will be revealed, and the number of Asset identifiers in the transaction is also hidden. The only exception to this is in the case that an Asset is *burnt*, as we will see below in the `burn mechanism`_. +In order to verify the balance of the different Assets, the verifier MUST perform exactly the same process as for the Orchard protocol [#protocol-binding]_. For a total of :math:`n` Actions in a transfer, the prover MUST still sign the `SIGHASH` of the transaction using the binding signature key :math:`\mathsf{bsk} = \sum_{\mathsf{ \forall i\in \{1,...,n\}}} \mathsf{rcv_{i}}`. @@ -148,10 +138,16 @@ Then the verifier MUST compute .. math:: \mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} = \sum \mathsf{rcv_{i}^{net}}\mathcal{R}^{\mathsf{Orchard}} -and use it to verify the `bindingSignature` on the `SIGHASH` message, as described in §4.14 of the Zcash Specification [#protocol-binding]_. +and use it to verify the `bindingSignature` on the `SIGHASH` message. + +Rationale for Value Balance Verification +'''''''''''''''''''''''''''''''''''''''' + +The main reason why no changes to the Orchard process are needed is that no Custom Assets can be unshielded, so all custom Assets are contained within the shielded pool. This means that the net balance of the input and output values is zero, with only one Asset identifier of value balance published, that of ZEC, :math:`\mathsf{v^{balanceOrchard}}`. No net amount of any other Asset identifier will be revealed, and the number of Asset identifiers in the transaction is also hidden. The only exception to this is in the case that an Asset is *burnt*, as we will see below in the `burn mechanism`_. As in the Orchard protocol, the binding signature verification key, :math:`\mathsf{bvk}`, will only be valid (and hence verify the signature correctly), as long as the committed values sum to zero. In contrast, in this protocol, the committed values only sum to zero **per Asset identifier**, as the Pedersen commitments add up homomorphically only with respect to the same value base point. + Split Notes ----------- @@ -304,8 +300,10 @@ References .. [#zip-0226] `ZIP 226: Transfer and Burn of Zcash Shielded Assets `_ .. [#zip-0227] `ZIP 227: Issuance of Zcash Shielded Assets `_ .. [#protocol-notes] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 3.2: Notes `_ +.. [#protocol-notept] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.5: Encodings of Note Plaintexts and Memo Fields `_ .. [#protocol-actions] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 3.7: Action Transfers and their Descriptions `_ -.. [#protocol-binding] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.14: Balance and Binding Signature (Orchard) `_ +.. [#protocol-binding] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.14: Balance and Binding Signature (Orchard) `_ +.. [#protocol-commitmentsandnullifiers] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.16: Note Commitments and Nullifiers `_ .. [#protocol-pallasandvesta] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.9.6: Pallas and Vesta `_ .. [#pasta-evidence] `Pallas/Vesta supporting evidence `_ .. [#protocol-concretesinsemillahash] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.1.9: Sinsemilla hash function `_ From aac639dec70eddcbd1e96bcb9fc158081183ed28 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Mon, 30 Jan 2023 12:02:38 +0530 Subject: [PATCH 059/101] edits to ZIP 226 based on review comments --- zip-0226.html | 24 ++++++++++++++---------- zip-0226.rst | 8 ++++---- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/zip-0226.html b/zip-0226.html index 562755a72..11e83e532 100644 --- a/zip-0226.html +++ b/zip-0226.html @@ -170,7 +170,7 @@
    \(\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} = \sum \mathsf{rcv_{i}^{net}}\mathcal{R}^{\mathsf{Orchard}}\)

    and use it to verify the bindingSignature on the SIGHASH message.

    Rationale for Value Balance Verification

    -

    The main reason why no changes to the Orchard process are needed is that no Custom Assets can be unshielded, so all custom Assets are contained within the shielded pool. This means that the net balance of the input and output values is zero, with only one Asset identifier of value balance published, that of ZEC, +

    The main reason why no changes to the Orchard process are needed is that no Custom Assets can be unshielded, so all Custom Assets are contained within the shielded pool. This means that the net balance of the input and output values is zero, with only one Asset identifier of value balance published, that of ZEC, \(\mathsf{v^{balanceOrchard}}\) . No net amount of any other Asset identifier will be revealed, and the number of Asset identifiers in the transaction is also hidden. The only exception to this is in the case that an Asset is burnt, as we will see below in the burn mechanism.

    As in the Orchard protocol, the binding signature verification key, @@ -181,7 +181,7 @@

    Split Notes

    One of the key functionalities in a UTXO-based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This requires a 1-to-many (Orchard) transaction. However, because each Action represents an input and an output, the resulting transaction must have multiple inputs. In order to cope with this today, the Actions that have not been assigned input notes are instead given dummy spend notes 16, which we call split Actions and split notes respectively. Basically, the input note is “faked” inside of the proof in order to hide which Action contains the real spend note.

    This, however, brings some issues when it comes to adding multiple Asset identifiers, as the output note of the split Actions cannot be of any Asset identifier, it must be enforced to be an actual output of a GroupHash computation (in fact we want it to be of the same identifier as the original input note, but the binding signature takes care that the proper balancing is performed). If not, then the prover could essentially input a multiple (or linear combination) of an existing identifier, with the goal to attack the network by overflowing the ZEC value balance and hence counterfeiting ZEC funds.

    -

    In order to prevent this, we make some modifications to the circuit. Specifically we remove the dummy note functionality for custom Assets and we enforce that every input note to an ZSA Action must be proven to exist in the set of note commitments in the note commitment tree. We then enforce this real note to be “unspendable” in the sense that its value will be zeroed in split Actions and the nullifier will be randomized, making the note not spendable in the specific Action. Then, the proof itself ensures that the output note is of the same identifier as the input note. In the circuit, the split note functionality will be activated by a boolean private input to the proof.

    +

    In order to prevent this, we make some modifications to the circuit. Specifically we remove the dummy note functionality for Custom Assets and we enforce that every input note to an ZSA Action must be proven to exist in the set of note commitments in the note commitment tree. We then enforce this real note to be “unspendable” in the sense that its value will be zeroed in split Actions and the nullifier will be randomized, making the note not spendable in the specific Action. Then, the proof itself ensures that the output note is of the same identifier as the input note. In the circuit, the split note functionality will be activated by a boolean private input to the proof.

    This creates a chain of induction that ensures that the value base points of all output notes of a transfer are actual outputs of a GroupHash, as they originate in the Issuance protocol which is publicly verified. If this were not done then it would be possible to violate balance, for example by using a value base point derived from those of other Assets.

    Note that we do not care about whether the note identified by a Split Input is owned by the sender, or whether it was nullified before.

    Wallets and other clients have a choice to make to ensure the Asset type is preserved for the output note of a Split Action:

    @@ -206,12 +206,16 @@
  • The Asset identifier, \(\mathsf{AssetId}\) , for the note is witnessed once, as an auxiliary input.
  • -
  • The witnessed Asset identifier, - \(\mathsf{AssetId}\) - , is added to the old note commitment input.
  • -
  • The witnessed Asset identifier, - \(\mathsf{AssetId}\) - , is added to the new note commitment input.
  • +
  • In the Old note commitment integrity constraint in the Orchard Action statement 17, + \(\mathsf{NoteCommit^{Orchard}_{rcm^{old}}(repr_{\mathbb{P}}(g_d^{old}), repr_{\mathbb{P}}(pk_d^{old}), v^{old}, \rho^{old}, \psi^{old})}\) + is replaced with + \(\mathsf{NoteCommit^{OrchardZSA}_{rcm^{old}}(repr_{\mathbb{P}}(g_d^{old}), repr_{\mathbb{P}}(pk_d^{old}), v^{old}, \rho^{old}, \psi^{old}, AssetId)}\) + .
  • +
  • In the New note commitment integrity constraint in the Orchard Action statement 17, + \(\mathsf{NoteCommit^{Orchard}_{rcm^{new}}(repr_{\mathbb{P}}(g_d^{new}), repr_{\mathbb{P}}(pk_d^{new}), v^{new}, \rho^{new}, \psi^{new})}\) + is replaced with + \(\mathsf{NoteCommit^{OrchardZSA}_{rcm^{new}}(repr_{\mathbb{P}}(g_d^{new}), repr_{\mathbb{P}}(pk_d^{new}), v^{new}, \rho^{new}, \psi^{new}, AssetId)}\) + .
  • Correct Value Commitment: the following constraints must be added to ensure that the value commitment is computed using the witnessed Asset identifier, as represented in the notes:

      @@ -364,7 +368,7 @@

      Note: Even if this mechanism allows having transparent ↔ shielded Asset transfers in theory, the transparent protocol will not be changed with this ZIP to adapt to a multiple Asset structure. This means that unless future consensus rules changes do allow it, unshielding will not be possible for custom Assets.

    ZSA Transaction Structure

    -

    The transaction format is similar to the version 5 transaction format described in the Zcash specification 18, with the following additions to the Orchard bundle:

    +

    The transaction format is similar to the version 5 transaction format described in the Zcash specification 18, with the following additions to the Orchard bundle:

    1921 ZIP 317b: ZSA Extension Proportional Fee Mechanism
    @@ -395,7 +399,7 @@

    Other Considerations

    Transaction Fees

    -

    The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317b 21.

    +

    The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317b 21.

    Security and Privacy

      diff --git a/zip-0226.rst b/zip-0226.rst index 783d530b8..8abc2f525 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -143,7 +143,7 @@ and use it to verify the `bindingSignature` on the `SIGHASH` message. Rationale for Value Balance Verification '''''''''''''''''''''''''''''''''''''''' -The main reason why no changes to the Orchard process are needed is that no Custom Assets can be unshielded, so all custom Assets are contained within the shielded pool. This means that the net balance of the input and output values is zero, with only one Asset identifier of value balance published, that of ZEC, :math:`\mathsf{v^{balanceOrchard}}`. No net amount of any other Asset identifier will be revealed, and the number of Asset identifiers in the transaction is also hidden. The only exception to this is in the case that an Asset is *burnt*, as we will see below in the `burn mechanism`_. +The main reason why no changes to the Orchard process are needed is that no Custom Assets can be unshielded, so all Custom Assets are contained within the shielded pool. This means that the net balance of the input and output values is zero, with only one Asset identifier of value balance published, that of ZEC, :math:`\mathsf{v^{balanceOrchard}}`. No net amount of any other Asset identifier will be revealed, and the number of Asset identifiers in the transaction is also hidden. The only exception to this is in the case that an Asset is *burnt*, as we will see below in the `burn mechanism`_. As in the Orchard protocol, the binding signature verification key, :math:`\mathsf{bvk}`, will only be valid (and hence verify the signature correctly), as long as the committed values sum to zero. In contrast, in this protocol, the committed values only sum to zero **per Asset identifier**, as the Pedersen commitments add up homomorphically only with respect to the same value base point. @@ -155,7 +155,7 @@ One of the key functionalities in a UTXO-based protocol is the fact that input n This, however, brings some issues when it comes to adding multiple Asset identifiers, as the output note of the split Actions *cannot* be of *any* Asset identifier, it must be enforced to be an actual output of a GroupHash computation (in fact we want it to be of the same identifier as the original input note, but the binding signature takes care that the proper balancing is performed). If not, then the prover could essentially input a multiple (or linear combination) of an existing identifier, with the goal to attack the network by overflowing the ZEC value balance and hence counterfeiting ZEC funds. -In order to prevent this, we make some modifications to the circuit. Specifically we remove the dummy note functionality for custom Assets and we enforce that *every* input note to an ZSA Action must be proven to exist in the set of note commitments in the note commitment tree. We then enforce this real note to be “unspendable” in the sense that its value +In order to prevent this, we make some modifications to the circuit. Specifically we remove the dummy note functionality for Custom Assets and we enforce that *every* input note to an ZSA Action must be proven to exist in the set of note commitments in the note commitment tree. We then enforce this real note to be “unspendable” in the sense that its value will be zeroed in split Actions and the nullifier will be randomized, making the note not spendable in the specific Action. Then, the proof itself ensures that the output note is of the same identifier as the input note. In the circuit, the split note functionality will be activated by a boolean private input to the proof. This creates a chain of induction that ensures that the value base points of all output notes of a transfer are actual outputs of a GroupHash, as they originate in the Issuance protocol which is publicly verified. If this were not done then it would be possible to violate balance, for example by using a value base point derived from those of other Assets. @@ -179,8 +179,8 @@ The advantage of the design described above, with respect to the circuit stateme the input and output note are of the same :math:`\mathsf{AssetId}`: - The Asset identifier, :math:`\mathsf{AssetId}`, for the note is witnessed once, as an auxiliary input. -- The witnessed Asset identifier, :math:`\mathsf{AssetId}`, is added to the old note commitment input. -- The witnessed Asset identifier, :math:`\mathsf{AssetId}`, is added to the new note commitment input. +- In the Old note commitment integrity constraint in the Orchard Action statement [#protocol-actionstatement]_, :math:`\mathsf{NoteCommit^{Orchard}_{rcm^{old}}(repr_{\mathbb{P}}(g_d^{old}), repr_{\mathbb{P}}(pk_d^{old}), v^{old}, \rho^{old}, \psi^{old})}` is replaced with :math:`\mathsf{NoteCommit^{OrchardZSA}_{rcm^{old}}(repr_{\mathbb{P}}(g_d^{old}), repr_{\mathbb{P}}(pk_d^{old}), v^{old}, \rho^{old}, \psi^{old}, AssetId)}`. +- In the New note commitment integrity constraint in the Orchard Action statement [#protocol-actionstatement]_, :math:`\mathsf{NoteCommit^{Orchard}_{rcm^{new}}(repr_{\mathbb{P}}(g_d^{new}), repr_{\mathbb{P}}(pk_d^{new}), v^{new}, \rho^{new}, \psi^{new})}` is replaced with :math:`\mathsf{NoteCommit^{OrchardZSA}_{rcm^{new}}(repr_{\mathbb{P}}(g_d^{new}), repr_{\mathbb{P}}(pk_d^{new}), v^{new}, \rho^{new}, \psi^{new}, AssetId)}`. **Correct Value Commitment:** the following constraints must be added to ensure that the value commitment is computed using the witnessed Asset identifier, as represented in the notes: From 29baf46b6f3b46440eb0c9a3730de30150ef9582 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Mon, 30 Jan 2023 19:18:54 +0530 Subject: [PATCH 060/101] further edits based on review comments --- zip-0226.html | 8 +++++--- zip-0226.rst | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/zip-0226.html b/zip-0226.html index 11e83e532..34aedd2fb 100644 --- a/zip-0226.html +++ b/zip-0226.html @@ -233,8 +233,10 @@
      The Value Commitment Integrity should be changed
        -
      • Replace the input note value by a generic value, v', as - \(\mathsf{cv^net} = \mathsf{ValueCommit_rcv^OrchardZSA(v’ - v^new, AssetId)}\) +
      • Replace the input note value by a generic value, + \(\mathsf{v}'\) + , as + \(\mathsf{cv^{net}} = \mathsf{ValueCommit_rcv^{OrchardZSA}(v’ - v^new, AssetId)}\)
      @@ -283,7 +285,7 @@ \(\mathsf{nf_old = DeriveNullifier_nk}(\rho^\mathsf{old}, \psi', \mathsf{cm^old})\)
    • if - \(split = 0\) + \(\mathtt{split} = 0\) then constrain \(\psi' = \psi^{old}\) . (Otherwise diff --git a/zip-0226.rst b/zip-0226.rst index 8abc2f525..ead633cad 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -190,14 +190,14 @@ the input and output note are of the same :math:`\mathsf{AssetId}`: **Enforce Secure Identifier for Split Actions:** the following constraints must be added to prevent senders from changing the Asset identifier for the output note in a Split Action: - The Value Commitment Integrity should be changed - - Replace the input note value by a generic value, `v'`, as :math:`\mathsf{cv^net} = \mathsf{ValueCommit_rcv^OrchardZSA(v’ - v^new, AssetId)}` + - Replace the input note value by a generic value, :math:`\mathsf{v}'`, as :math:`\mathsf{cv^{net}} = \mathsf{ValueCommit_rcv^{OrchardZSA}(v’ - v^new, AssetId)}` - Add a boolean ``split`` variable as an auxiliary witness. This variable is to be activated ``split = 1`` if the Action in question is a split and ``split = 0`` if the Action is actually spending an input note: - If ``split = 1`` then set :math:`\mathsf{v}' = 0` otherwise :math:`\mathsf{v}'=\mathsf{v^{old}}` from the auxiliary input. - The Merkle Path Validity should check the existence of the note commitment as usual (and not like with dummy notes): - Check that (path, pos) is a valid Merkle path of depth :math:`\mathsf{MerkleDepth^Orchard}`, from :math:`\mathsf{cm^old}` to the anchor :math:`\mathsf{rt^Orchard}`. - The Nullifier Integrity will be changed to prevent the identification of notes - Replace the :math:`\psi_{old}` value with a generic :math:`\psi'` as :math:`\mathsf{nf_old = DeriveNullifier_nk}(\rho^\mathsf{old}, \psi', \mathsf{cm^old})` - - if :math:`split = 0` then constrain :math:`\psi' = \psi^{old}`. (Otherwise :math:`\psi'` should be sampled randomly.) + - if :math:`\mathtt{split} = 0` then constrain :math:`\psi' = \psi^{old}`. (Otherwise :math:`\psi'` should be sampled randomly.) **Enabling Backwards Compatibility with ZEC Notes:** the following constraints must be added to enable backwards compatibility with Orchard ZEC notes. From 5ffb6841d66c2c21150e2304c2acc938adedb2d1 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Mon, 30 Jan 2023 19:55:28 +0530 Subject: [PATCH 061/101] edits to ZIP 227 based on review comments --- zip-0227.html | 6 ++---- zip-0227.rst | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/zip-0227.html b/zip-0227.html index a3aafa099..d1509f493 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -53,6 +53,7 @@
    • The issuance mechanism should enable public tracking of the supply of the Assets on the Zcash block chain.
    • Issuing or changing the attributes of a specific Asset should require cryptographic authorization.
    • The Asset identification should be unique (among all shielded pools) and different issuer public keys should not be able to generate the same Asset identifier.
    • +
    • An issuer should be able to issue different Assets in the same transaction.

    Specification

    @@ -403,10 +404,7 @@

    Issuer Key or AssetId Compromise

    The design of this protocol does not allow for a rotation of the issuer validating key, that would allow for replacing the key of a specific Asset (see Future Work). In case of compromise, the following actions are recommended:

      -
    • If an Asset identifier is compromised (and not the issuer validating key), the finalize boolean for that Asset should be set to 0 and a new - \(\mathsf{AssetId}\) - generated instead.
    • -
    • If an issuer validating key is compromised, the finalize boolean for all the Assets issued with that key should be set to 0 and the issuer should change to a new issuance authorizing key, and issue new Assets, each with a new +
    • If an issuer validating key is compromised, the 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}\) .
    diff --git a/zip-0227.rst b/zip-0227.rst index 287eceb01..3262914a3 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -59,6 +59,7 @@ Requirements - The issuance mechanism should enable public tracking of the supply of the Assets on the Zcash block chain. - Issuing or changing the attributes of a specific Asset should require cryptographic authorization. - The Asset identification should be unique (among all shielded pools) and different issuer public keys should not be able to generate the same Asset identifier. +- An issuer should be able to issue different Assets in the same transaction. Specification @@ -329,8 +330,7 @@ Security and Privacy Considerations The design of this protocol does not allow for a rotation of the issuer validating key, that would allow for replacing the key of a specific Asset (see Future Work). In case of compromise, the following actions are recommended: -- If an Asset identifier is compromised (and not the issuer validating key), the ``finalize`` boolean for that Asset should be set to `0` and a new :math:`\mathsf{AssetId}` generated instead. -- If an issuer validating key is compromised, the ``finalize`` boolean for all the Assets issued with that key should be set to `0` and the issuer should change to a new issuance authorizing key, and issue new Assets, each with a new :math:`\mathsf{AssetId}`. +- If an issuer validating key is compromised, the ``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 :math:`\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 [#zip-0226]_. 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. From 3fab71291134be8752a627c584267d8d3b63f069 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Mon, 30 Jan 2023 20:07:08 +0530 Subject: [PATCH 062/101] edits --- zip-0226.html | 2 +- zip-0226.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/zip-0226.html b/zip-0226.html index 34aedd2fb..9fd070a5f 100644 --- a/zip-0226.html +++ b/zip-0226.html @@ -115,7 +115,7 @@
    • \(\mathsf{AssetId} : \mathbb{P*}\) - is the unique random element of the Pallas group 11 that identifies each Asset in the Orchard protocol, as . The byte representation of the Asset identifier is defined as + is the unique random element of the Pallas group 11 that identifies each Asset in the Orchard protocol. The byte representation of the Asset identifier is defined as \(\mathsf{assetID} : \mathbb{B}^{\mathbb{Y}[32]} := \mathsf{repr}_{\mathbb{P}}(\mathsf{AssetId})\) .
    diff --git a/zip-0226.rst b/zip-0226.rst index ead633cad..e4e67d9b6 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -92,7 +92,7 @@ Let :math:`\mathsf{Note^{OrchardZSA}}` be the type of a ZSA note, i.e. A ZSA note differs from an Orchard note [#protocol-notes]_ by additionally including the identifier of the Asset, :math:`\mathsf{AssetId}`. So a ZSA note is a tuple :math:`(\mathsf{g_d, pk_d, v, \rho, \psi, AssetId})`, where -- :math:`\mathsf{AssetId} : \mathbb{P*}` is the unique random element of the Pallas group [#protocol-pallasandvesta]_ that identifies each Asset in the Orchard protocol, as . The byte representation of the Asset identifier is defined as :math:`\mathsf{assetID} : \mathbb{B}^{\mathbb{Y}[32]} := \mathsf{repr}_{\mathbb{P}}(\mathsf{AssetId})`. +- :math:`\mathsf{AssetId} : \mathbb{P*}` is the unique random element of the Pallas group [#protocol-pallasandvesta]_ that identifies each Asset in the Orchard protocol. The byte representation of the Asset identifier is defined as :math:`\mathsf{assetID} : \mathbb{B}^{\mathbb{Y}[32]} := \mathsf{repr}_{\mathbb{P}}(\mathsf{AssetId})`. In this case, the instance of the note commitment scheme, :math:`\mathsf{NoteCommit^{OrchardZSA}_{rcm}}`, will differ from :math:`\mathsf{NoteCommit^{Orchard}_{rcm}}` in that for Custom Assets, the Asset identifier will be added as an input to the commitment computation. As we will see, the nested structure of the Sinsemilla-based commitment [#protocol-concretesinsemillacommit]_ allows us to add the Asset identifier as a final recursive step, and hence keep a single instance of the Sinsemilla hash function in the circuit for the note commitment verification. From 2f7d9738bdb95698ba7fc3bc9b39ebc87fe26761 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Tue, 31 Jan 2023 11:39:08 +0530 Subject: [PATCH 063/101] minor edit --- zip-0226.html | 30 +++++++++++++++--------------- zip-0226.rst | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/zip-0226.html b/zip-0226.html index 9fd070a5f..9e3512195 100644 --- a/zip-0226.html +++ b/zip-0226.html @@ -115,7 +115,7 @@
    • \(\mathsf{AssetId} : \mathbb{P*}\) - is the unique random element of the Pallas group 11 that identifies each Asset in the Orchard protocol. The byte representation of the Asset identifier is defined as + is the unique random element of the Pallas group 11 that identifies each Asset in the Orchard protocol, as defined in ZIP 227 5. The byte representation of the Asset identifier is defined as \(\mathsf{assetID} : \mathbb{B}^{\mathbb{Y}[32]} := \mathsf{repr}_{\mathbb{P}}(\mathsf{AssetId})\) .
    @@ -123,15 +123,15 @@ \(\mathsf{NoteCommit^{OrchardZSA}_{rcm}}\) , will differ from \(\mathsf{NoteCommit^{Orchard}_{rcm}}\) - in that for Custom Assets, the Asset identifier will be added as an input to the commitment computation. As we will see, the nested structure of the Sinsemilla-based commitment 14 allows us to add the Asset identifier as a final recursive step, and hence keep a single instance of the Sinsemilla hash function in the circuit for the note commitment verification.

    -

    The commitment output is still indistinguishable from the original Orchard ZEC note commitments, by definition of the Sinsemilla hash function 13. ZSA note commitments will therefore be added to the same Orchard Note Commitment Tree. In essence, we have:

    + in that for Custom Assets, the Asset identifier will be added as an input to the commitment computation. As we will see, the nested structure of the Sinsemilla-based commitment 14 allows us to add the Asset identifier as a final recursive step, and hence keep a single instance of the Sinsemilla hash function in the circuit for the note commitment verification.

    +

    The commitment output is still indistinguishable from the original Orchard ZEC note commitments, by definition of the Sinsemilla hash function 13. ZSA note commitments will therefore be added to the same Orchard Note Commitment Tree. In essence, we have:

    \(\mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, AssetId)} \in \mathsf{NoteCommit^{Orchard}.Output}\)
    -

    The nullifier is generated in the same manner as in the Orchard protocol 10.

    -

    The ZSA note plaintext also includes the Asset identifier in addition to the components in the Orchard note plaintext 7. It consists of

    +

    The nullifier is generated in the same manner as in the Orchard protocol 10.

    +

    The ZSA note plaintext also includes the Asset identifier in addition to the components in the Orchard note plaintext 7. It consists of

    \((\mathsf{leadByte} : \mathbb{B}^{\mathbb{Y}}, \mathsf{d} : \mathbb{B}^{[l_{\mathsf{d}}]}, \mathsf{v} : \{0 .. 2^{l_{\mathsf{value}}} - 1\}, \mathsf{rseed} : \mathbb{B}^{\mathbb{Y}[32]}, \mathsf{assetID} : \mathbb{B}^{\mathbb{Y}[32]}, \mathsf{memo} : \mathbb{B}^{\mathbb{Y}[512]})\)

    Value Commitment

    -

    The Orchard Protocol uses a Homomorphic Pedersen Commitment 15 to perform the value commitment, with fixed base points +

    The Orchard Protocol uses a Homomorphic Pedersen Commitment 15 to perform the value commitment, with fixed base points \(\mathcal{V}^{\mathsf{Orchard}}\) and \(\mathcal{R}^{\mathsf{Orchard}}\) @@ -151,16 +151,16 @@ \(\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}}:=\mathsf{AssetId}\) , where the Asset identifier \(\mathsf{AssetId}\) - is computed as defined in ZIP 227 5, and

    + is computed as defined in ZIP 227 5, and

    \(\mathcal{R}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv", "r")}\) , as in the Orchard protocol.

    We define \(\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{ZEC}} :=\mathcal{V}^{\mathsf{Orchard}}\) - so that the value commitment for ZEC notes is computed identically to the Orchard protocol deployed in NU5 3.

    + so that the value commitment for ZEC notes is computed identically to the Orchard protocol deployed in NU5 3.

    Value Balance Verification

    -

    In order to verify the balance of the different Assets, the verifier MUST perform exactly the same process as for the Orchard protocol 9.

    +

    In order to verify the balance of the different Assets, the verifier MUST perform exactly the same process as for the Orchard protocol 9.

    For a total of \(n\) Actions in a transfer, the prover MUST still sign the SIGHASH of the transaction using the binding signature key @@ -179,7 +179,7 @@

    Split Notes

    -

    One of the key functionalities in a UTXO-based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This requires a 1-to-many (Orchard) transaction. However, because each Action represents an input and an output, the resulting transaction must have multiple inputs. In order to cope with this today, the Actions that have not been assigned input notes are instead given dummy spend notes 16, which we call split Actions and split notes respectively. Basically, the input note is “faked” inside of the proof in order to hide which Action contains the real spend note.

    +

    One of the key functionalities in a UTXO-based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This requires a 1-to-many (Orchard) transaction. However, because each Action represents an input and an output, the resulting transaction must have multiple inputs. In order to cope with this today, the Actions that have not been assigned input notes are instead given dummy spend notes 16, which we call split Actions and split notes respectively. Basically, the input note is “faked” inside of the proof in order to hide which Action contains the real spend note.

    This, however, brings some issues when it comes to adding multiple Asset identifiers, as the output note of the split Actions cannot be of any Asset identifier, it must be enforced to be an actual output of a GroupHash computation (in fact we want it to be of the same identifier as the original input note, but the binding signature takes care that the proper balancing is performed). If not, then the prover could essentially input a multiple (or linear combination) of an existing identifier, with the goal to attack the network by overflowing the ZEC value balance and hence counterfeiting ZEC funds.

    In order to prevent this, we make some modifications to the circuit. Specifically we remove the dummy note functionality for Custom Assets and we enforce that every input note to an ZSA Action must be proven to exist in the set of note commitments in the note commitment tree. We then enforce this real note to be “unspendable” in the sense that its value will be zeroed in split Actions and the nullifier will be randomized, making the note not spendable in the specific Action. Then, the proof itself ensures that the output note is of the same identifier as the input note. In the circuit, the split note functionality will be activated by a boolean private input to the proof.

    This creates a chain of induction that ensures that the value base points of all output notes of a transfer are actual outputs of a GroupHash, as they originate in the Issuance protocol which is publicly verified. If this were not done then it would be possible to violate balance, for example by using a value base point derived from those of other Assets.

    @@ -198,7 +198,7 @@

    Circuit Statement

    -

    The advantage of the design described above, with respect to the circuit statement, is that every ZSA Action statement is kept closely similar to the Orchard Action statement 17, except for a few additions that ensure the security of the Asset identifier system.

    +

    The advantage of the design described above, with respect to the circuit statement, is that every ZSA Action statement is kept closely similar to the Orchard Action statement 17, except for a few additions that ensure the security of the Asset identifier system.

    Asset Identifier Equality: the following constraints must be added to ensure that the input and output note are of the same \(\mathsf{AssetId}\) :

    @@ -206,12 +206,12 @@
  • The Asset identifier, \(\mathsf{AssetId}\) , for the note is witnessed once, as an auxiliary input.
  • -
  • In the Old note commitment integrity constraint in the Orchard Action statement 17, +
  • In the Old note commitment integrity constraint in the Orchard Action statement 17, \(\mathsf{NoteCommit^{Orchard}_{rcm^{old}}(repr_{\mathbb{P}}(g_d^{old}), repr_{\mathbb{P}}(pk_d^{old}), v^{old}, \rho^{old}, \psi^{old})}\) is replaced with \(\mathsf{NoteCommit^{OrchardZSA}_{rcm^{old}}(repr_{\mathbb{P}}(g_d^{old}), repr_{\mathbb{P}}(pk_d^{old}), v^{old}, \rho^{old}, \psi^{old}, AssetId)}\) .
  • -
  • In the New note commitment integrity constraint in the Orchard Action statement 17, +
  • In the New note commitment integrity constraint in the Orchard Action statement 17, \(\mathsf{NoteCommit^{Orchard}_{rcm^{new}}(repr_{\mathbb{P}}(g_d^{new}), repr_{\mathbb{P}}(pk_d^{new}), v^{new}, \rho^{new}, \psi^{new})}\) is replaced with \(\mathsf{NoteCommit^{OrchardZSA}_{rcm^{new}}(repr_{\mathbb{P}}(g_d^{new}), repr_{\mathbb{P}}(pk_d^{new}), v^{new}, \rho^{new}, \psi^{new}, AssetId)}\) @@ -370,7 +370,7 @@

    Note: Even if this mechanism allows having transparent ↔ shielded Asset transfers in theory, the transparent protocol will not be changed with this ZIP to adapt to a multiple Asset structure. This means that unless future consensus rules changes do allow it, unshielding will not be possible for custom Assets.

  • ZSA Transaction Structure

    -

    The transaction format is similar to the version 5 transaction format described in the Zcash specification 18, with the following additions to the Orchard bundle:

    +

    The transaction format is similar to the version 5 transaction format described in the Zcash specification 18, with the following additions to the Orchard bundle:

    @@ -401,7 +401,7 @@

    Other Considerations

    Transaction Fees

    -

    The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317b 21.

    +

    The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317b 21.

    Security and Privacy

      diff --git a/zip-0226.rst b/zip-0226.rst index e4e67d9b6..08c337dbd 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -92,7 +92,7 @@ Let :math:`\mathsf{Note^{OrchardZSA}}` be the type of a ZSA note, i.e. A ZSA note differs from an Orchard note [#protocol-notes]_ by additionally including the identifier of the Asset, :math:`\mathsf{AssetId}`. So a ZSA note is a tuple :math:`(\mathsf{g_d, pk_d, v, \rho, \psi, AssetId})`, where -- :math:`\mathsf{AssetId} : \mathbb{P*}` is the unique random element of the Pallas group [#protocol-pallasandvesta]_ that identifies each Asset in the Orchard protocol. The byte representation of the Asset identifier is defined as :math:`\mathsf{assetID} : \mathbb{B}^{\mathbb{Y}[32]} := \mathsf{repr}_{\mathbb{P}}(\mathsf{AssetId})`. +- :math:`\mathsf{AssetId} : \mathbb{P*}` is the unique random element of the Pallas group [#protocol-pallasandvesta]_ that identifies each Asset in the Orchard protocol, as defined in ZIP 227 [#zip-0227]_. The byte representation of the Asset identifier is defined as :math:`\mathsf{assetID} : \mathbb{B}^{\mathbb{Y}[32]} := \mathsf{repr}_{\mathbb{P}}(\mathsf{AssetId})`. In this case, the instance of the note commitment scheme, :math:`\mathsf{NoteCommit^{OrchardZSA}_{rcm}}`, will differ from :math:`\mathsf{NoteCommit^{Orchard}_{rcm}}` in that for Custom Assets, the Asset identifier will be added as an input to the commitment computation. As we will see, the nested structure of the Sinsemilla-based commitment [#protocol-concretesinsemillacommit]_ allows us to add the Asset identifier as a final recursive step, and hence keep a single instance of the Sinsemilla hash function in the circuit for the note commitment verification. From 4f074e9790d24b9dd5d35ab77ac394fb834d25b9 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Tue, 31 Jan 2023 12:08:21 +0530 Subject: [PATCH 064/101] edits based on review meeting --- zip-0226.html | 2 +- zip-0226.rst | 2 +- zip-0227.html | 28 ++++++++++++++-------------- zip-0227.rst | 26 +++++++++++++------------- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/zip-0226.html b/zip-0226.html index 9e3512195..2a5eb7765 100644 --- a/zip-0226.html +++ b/zip-0226.html @@ -184,7 +184,7 @@

      In order to prevent this, we make some modifications to the circuit. Specifically we remove the dummy note functionality for Custom Assets and we enforce that every input note to an ZSA Action must be proven to exist in the set of note commitments in the note commitment tree. We then enforce this real note to be “unspendable” in the sense that its value will be zeroed in split Actions and the nullifier will be randomized, making the note not spendable in the specific Action. Then, the proof itself ensures that the output note is of the same identifier as the input note. In the circuit, the split note functionality will be activated by a boolean private input to the proof.

      This creates a chain of induction that ensures that the value base points of all output notes of a transfer are actual outputs of a GroupHash, as they originate in the Issuance protocol which is publicly verified. If this were not done then it would be possible to violate balance, for example by using a value base point derived from those of other Assets.

      Note that we do not care about whether the note identified by a Split Input is owned by the sender, or whether it was nullified before.

      -

      Wallets and other clients have a choice to make to ensure the Asset type is preserved for the output note of a Split Action:

      +

      Wallets and other clients have a choice to make to ensure the Asset identifier is preserved for the output note of a Split Action:

      1. The Split Input note could be another note of the same Asset identifier that is being spent by this transaction (but not by this Split Input).
      2. The Split Input note could be a different unspent note of the same diff --git a/zip-0226.rst b/zip-0226.rst index 08c337dbd..9431255d0 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -162,7 +162,7 @@ This creates a chain of induction that ensures that the value base points of all Note that we do not care about whether the note identified by a Split Input is owned by the sender, or whether it was nullified before. -Wallets and other clients have a choice to make to ensure the Asset type is preserved for the output note of a Split Action: +Wallets and other clients have a choice to make to ensure the Asset identifier is preserved for the output note of a Split Action: 1. The Split Input note could be another note of the same Asset identifier that is being spent by this transaction (but not by this Split Input). 2. The Split Input note could be a different unspent note of the same :math:`\mathsf{AssetId}` (note that the note will not actually be spent). diff --git a/zip-0227.html b/zip-0227.html index d1509f493..b7e20e8bd 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -59,7 +59,7 @@

        Specification

        As explained, the issuance protocol allows for a single issuance action to be sent to many receivers, by generating as many output notes as distinct recipients. Furthermore, every bundle can contain many issuance actions.

        Overview

        -

        This specification enables only transparent issuance, since as a first step, transparency is important to properly test the applications that will be most used in the Zcash ecosystem, while enabling tracking of supply of Assets. Any user of the block chain can issue new Asset types, yet only a single issuer (a set of keys) can issue that specific Asset type, as the Asset identifiers are tied to the issuer keys.

        +

        This specification enables only transparent issuance, since as a first step, transparency is important to properly test the applications that will be most used in the Zcash ecosystem, while enabling tracking of supply of Assets. Any user of the block chain can issue new Asset identifiers, yet only a single issuer (a set of keys) can issue that specific Asset identifer, as the Asset identifiers are tied to the issuer keys.

        The protocol was designed with three main properties in mind:

        • At the time of issuance, the issuer can already allocate all the tokens to the corresponding owners by creating the corresponding (shielded) output notes to the respective addresses. As is implied, the issuance mechanism is itself transparent, but the allocation is totally private.
        • @@ -73,10 +73,10 @@
          1. The issuance authorizing key, denoted as \(\mathsf{isk}\) - , is the key that is used to sign the issuance transaction. This key is used to authorize the issuance of a specific Asset type, and is only used by the issuer.
          2. + , is the key that is used to sign the issuance transaction. This key is used to authorize the issuance of a specific Asset identifier, and is only used by the issuer.
          3. The issuance validating key, denoted as \(\mathsf{ik}\) - , is the key that is used to validate the issuance transaction. This key is used to validate the issuance of a specific Asset type, and is used by all block chain users (specifically the Asset owners and consensus validators) to associate the Asset in question with the issuer.
          4. + , is the key that is used to validate the issuance transaction. This key is used to validate the issuance of a specific Asset identifier, and is used by all block chain users (specifically the Asset owners and consensus validators) to associate the Asset in question with the issuer.

          The two keys are derived in an analogous manner to the spend authorizing key and spend validating key, using the same signature scheme, as described in ZIP 32 7 and in accordance with ZIP 316 8.

            @@ -101,7 +101,7 @@ , is derived using an Asset identifier hash, \(\mathsf{AssetIdHash}\) that is defined by the specific protocol (e.g. for now Orchard-style, using Pallas curve), and used within the output notes.

            -

            The main requirement for the Asset identifier is for it to be collision-free, as two different issuers MUST not be able to issue the same Asset type. One way to achieve this is to make the identifier dependent on the issuer keys, as the issuer keys are unique to each issuer. We achieve this by deriving the Asset identifier, +

            The main requirement for the Asset identifier is for it to be collision-free, as two different issuers MUST not be able to issue the same Asset identifier. One way to achieve this is to make the identifier dependent on the issuer keys, as the issuer keys are unique to each issuer. We achieve this by deriving the Asset identifier, \(\mathsf{AssetId}\) as follows:

            \(\mathsf{AssetId} = \mathsf{AssetIdHash(ik, asset\_desc)}\)
            @@ -278,7 +278,7 @@
            • By using the 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,
                -
              • by setting finalize = 1 from the first issuance action for that Asset type, 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.
              • +
              • by setting 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 @@ -305,30 +305,30 @@
              • check that \(\mathsf{asset\_desc}\) - is a string with 0 < byte size <= 512
              • + is a string with 0 < byte size <= 512.
              • retrieve \(\mathsf{AssetId}\) from the first note in the sequence and check that \(\mathsf{AssetId = GroupHash^{\mathbb{P}}(ik || asset\_desc)}\) - is properly derived
              • + is properly derived.
              • check that the \(\mathsf{AssetId}\) - does not exist in the previously_finalized set in the global state
              • + does not exist in the previously_finalized set in the global state.
              • check that every note in the IssueAction contains the same \(\mathsf{AssetId}\) - and also that every note is of type Note and is properly constructed as + and is properly constructed as \(note = (\mathsf{g_d, pk_d, v, \rho, \psi, AssetId})\) -
              • + .

              If all of the above checks pass, do the following:

              • For each note, compute the note commitment as \(cm = \mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, AssetId)}\) and
              • -
              • add cm to the Merkle tree of note commitments, NoteCommitmentTree
              • +
              • add cm to the Merkle tree of note commitments, NoteCommitmentTree.
              • If finalize = 1, add \(\mathsf{AssetId}\) - to the previously_finalized set in the global state
              • + to the previously_finalized set in the global state.
        @@ -392,7 +392,7 @@

        UTF-8 encoding of the Asset description string.

    T.1c: isFinalized
    -

    1-bit representation of a boolean flag that is set to 'true' if the Asset type was finalized in this action and 'false' otherwise. 'True' is represented as 1, 'false' as 0.

    +

    1-bit representation of a boolean flag that is set to 'true' if the Asset identifier was finalized in this action and 'false' otherwise. 'True' is represented as 1, 'false' as 0.

    T.2 issuerVerificationKey

    @@ -416,7 +416,7 @@ \(\mathsf{AssetId}\) to \(\mathsf{issuanceSupplyInfoMap := (totalSupply, finalize)}\) - in order to properly keep track of the total supply for different Asset types. This is useful for wallets and other applications that need to keep track of the total supply of Assets.

    + 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 317b 6.

    diff --git a/zip-0227.rst b/zip-0227.rst index 3262914a3..24de7bee6 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -70,7 +70,7 @@ As explained, the issuance protocol allows for a single issuance action to be se Overview -------- -This specification enables only *transparent* issuance, since as a first step, transparency is important to properly test the applications that will be most used in the Zcash ecosystem, while enabling tracking of supply of Assets. Any user of the block chain can issue new Asset types, yet only a single issuer (a set of keys) can issue that specific Asset type, as the Asset identifiers are tied to the issuer keys. +This specification enables only *transparent* issuance, since as a first step, transparency is important to properly test the applications that will be most used in the Zcash ecosystem, while enabling tracking of supply of Assets. Any user of the block chain can issue new Asset identifiers, yet only a single issuer (a set of keys) can issue that specific Asset identifer, as the Asset identifiers are tied to the issuer keys. The protocol was designed with three main properties in mind: @@ -85,9 +85,9 @@ Issuance Keys The ZSA Protocol adds the following two keys to the key components [#protocol-addressesandkeys]_: -1. The issuance authorizing key, denoted as :math:`\mathsf{isk}`, is the key that is used to sign the issuance transaction. This key is used to authorize the issuance of a specific Asset type, and is only used by the issuer. +1. The issuance authorizing key, denoted as :math:`\mathsf{isk}`, is the key that is used to sign the issuance transaction. This key is used to authorize the issuance of a specific Asset identifier, and is only used by the issuer. -2. The issuance validating key, denoted as :math:`\mathsf{ik}`, is the key that is used to validate the issuance transaction. This key is used to validate the issuance of a specific Asset type, and is used by all block chain users (specifically the Asset owners and consensus validators) to associate the Asset in question with the issuer. +2. The issuance validating key, denoted as :math:`\mathsf{ik}`, is the key that is used to validate the issuance transaction. This key is used to validate the issuance of a specific Asset identifier, and is used by all block chain users (specifically the Asset owners and consensus validators) to associate the Asset in question with the issuer. The two keys are derived in an analogous manner to the spend authorizing key and spend validating key, using the same signature scheme, as described in ZIP 32 [#zip-0032]_ and in accordance with ZIP 316 [#zip-0316]_. @@ -106,7 +106,7 @@ Asset Identifier For every new Asset, there must be a new and unique identifier of the Asset. Every Asset is defined by the Asset description, :math:`\mathsf{asset\_desc}`, which is a global byte string (valid across all -future- Zcash shielded protocols). From this Asset description, the specific Asset identifier, :math:`\mathsf{AssetId}`, is derived using an Asset identifier hash, :math:`\mathsf{AssetIdHash}` that is defined by the specific protocol (e.g. for now Orchard-style, using Pallas curve), and used within the output notes. -The main requirement for the Asset identifier is for it to be collision-free, as two different issuers MUST not be able to issue the same Asset type. One way to achieve this is to make the identifier dependent on the issuer keys, as the issuer keys are unique to each issuer. We achieve this by deriving the Asset identifier, :math:`\mathsf{AssetId}` as follows: +The main requirement for the Asset identifier is for it to be collision-free, as two different issuers MUST not be able to issue the same Asset identifier. One way to achieve this is to make the identifier dependent on the issuer keys, as the issuer keys are unique to each issuer. We achieve this by deriving the Asset identifier, :math:`\mathsf{AssetId}` as follows: .. math:: \mathsf{AssetId} = \mathsf{AssetIdHash(ik, asset\_desc)} @@ -206,7 +206,7 @@ Issuers can wrap Assets defined in other chains and issue them at once in a sing - By using the ``finalize`` boolean and the burning mechanism defined in [#zip-0226]_, issuers can control the supply production of any Asset associated to their issuer keys. For example, - - by setting ``finalize = 1`` from the first issuance action for that Asset type, 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. + - by setting ``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 @@ -224,16 +224,16 @@ For the IssueBundle: For each `IssueAction` in `IssueBundle`: -- check that :math:`\mathsf{asset\_desc}` is a string with `0 < byte size <= 512` -- retrieve :math:`\mathsf{AssetId}` from the first note in the sequence and check that :math:`\mathsf{AssetId = GroupHash^{\mathbb{P}}(ik || asset\_desc)}` is properly derived -- check that the :math:`\mathsf{AssetId}` does not exist in the ``previously_finalized`` set in the global state -- check that every note in the `IssueAction` contains the same :math:`\mathsf{AssetId}` and also that every note is of type `Note` and is properly constructed as :math:`note = (\mathsf{g_d, pk_d, v, \rho, \psi, AssetId})` +- check that :math:`\mathsf{asset\_desc}` is a string with `0 < byte size <= 512`. +- retrieve :math:`\mathsf{AssetId}` from the first note in the sequence and check that :math:`\mathsf{AssetId = GroupHash^{\mathbb{P}}(ik || asset\_desc)}` is properly derived. +- check that the :math:`\mathsf{AssetId}` does not exist in the ``previously_finalized`` set in the global state. +- check that every note in the `IssueAction` contains the same :math:`\mathsf{AssetId}` and is properly constructed as :math:`note = (\mathsf{g_d, pk_d, v, \rho, \psi, AssetId})`. If all of the above checks pass, do the following: - For each note, compute the note commitment as :math:`cm = \mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, AssetId)}` and -- add `cm` to the Merkle tree of note commitments, `NoteCommitmentTree` -- If ``finalize = 1``, add :math:`\mathsf{AssetId}` to the ``previously_finalized`` set in the global state +- add `cm` to the Merkle tree of note commitments, `NoteCommitmentTree`. +- If ``finalize = 1``, add :math:`\mathsf{AssetId}` to the ``previously_finalized`` set in the global state. Rationale @@ -315,7 +315,7 @@ UTF-8 encoding of the Asset description string. T.1c: isFinalized ''''''''''''''''' -1-bit representation of a boolean flag that is set to 'true' if the Asset type was finalized in this action and 'false' otherwise. 'True' is represented as 1, 'false' as 0. +1-bit representation of a boolean flag that is set to 'true' if the Asset identifier was finalized in this action and 'false' otherwise. 'True' is represented as 1, 'false' as 0. T.2 issuerVerificationKey @@ -341,7 +341,7 @@ 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 `issuanceSupplyInfoMap` from :math:`\mathsf{AssetId}` to :math:`\mathsf{issuanceSupplyInfoMap := (totalSupply, finalize)}` in order to properly keep track of the total supply for different Asset types. This is useful for wallets and other applications that need to keep track of the total supply of Assets. +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 `issuanceSupplyInfoMap` from :math:`\mathsf{AssetId}` to :math:`\mathsf{issuanceSupplyInfoMap := (totalSupply, 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 -------------- From 61126211672f281e6ae18fbd15b1ec410e78c8f7 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Tue, 31 Jan 2023 12:55:09 +0530 Subject: [PATCH 065/101] editing Security and Privacy Considerations, and Fee Mechanism considerations --- zip-0226.html | 11 ++++++++--- zip-0226.rst | 9 ++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/zip-0226.html b/zip-0226.html index 2a5eb7765..d1f02c2a7 100644 --- a/zip-0226.html +++ b/zip-0226.html @@ -115,7 +115,7 @@
    • \(\mathsf{AssetId} : \mathbb{P*}\) - is the unique random element of the Pallas group 11 that identifies each Asset in the Orchard protocol, as defined in ZIP 227 5. The byte representation of the Asset identifier is defined as + is the unique element of the Pallas group 11 that identifies each Asset in the Orchard protocol, as defined in ZIP 227 5. The byte representation of the Asset identifier is defined as \(\mathsf{assetID} : \mathbb{B}^{\mathbb{Y}[32]} := \mathsf{repr}_{\mathbb{P}}(\mathsf{AssetId})\) .
    @@ -401,13 +401,18 @@

    Other Considerations

    Transaction Fees

    -

    The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317b 21.

    +

    The fee mechanism for the upgrades proposed in this ZIP will follow the mechanism described in ZIP 317 for the ZSA protocol upgrade 21.

    Security and Privacy

    • Even if the Orchard protocol and ZSA protocol do not share the same anonymity pool (nodes can keep track of the notes that where published with different transaction structures), the migration from one to the other is done automatically and seamlessly. The Orchard bundle will be replaced by the ZSA bundle and all ZEC notes will be fully spendable with the new transaction structure.
    • When including new Assets we would like to maintain the amount and identifiers of Assets private, which is achieved with the design.
    • We prevent the "roadblock" attack on the Asset identifer by ensuring the output notes receive an Asset identifier that exists on the global state.
    • +
    • 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 the use of a petname system or a list of well-known Assets. +
        +
      • One proposal for a petname system for the zcashd wallet is the use of an additional configuration file that stores a mapping of names to Asset identifiers. This allows clients to rename the Assets in a way they find useful. Default versions of this file with well-known Assets listed can be made available online as a starting point for clients.
      • +
      +

    Deployment

    @@ -590,7 +595,7 @@
    - +
    21ZIP 317b: ZSA Extension Proportional Fee MechanismZIP 317: Proportional Transfer Fee Mechanism - Pull Request #667 for ZSA Protocol ZIPs
    diff --git a/zip-0226.rst b/zip-0226.rst index 9431255d0..ff3552175 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -92,7 +92,7 @@ Let :math:`\mathsf{Note^{OrchardZSA}}` be the type of a ZSA note, i.e. A ZSA note differs from an Orchard note [#protocol-notes]_ by additionally including the identifier of the Asset, :math:`\mathsf{AssetId}`. So a ZSA note is a tuple :math:`(\mathsf{g_d, pk_d, v, \rho, \psi, AssetId})`, where -- :math:`\mathsf{AssetId} : \mathbb{P*}` is the unique random element of the Pallas group [#protocol-pallasandvesta]_ that identifies each Asset in the Orchard protocol, as defined in ZIP 227 [#zip-0227]_. The byte representation of the Asset identifier is defined as :math:`\mathsf{assetID} : \mathbb{B}^{\mathbb{Y}[32]} := \mathsf{repr}_{\mathbb{P}}(\mathsf{AssetId})`. +- :math:`\mathsf{AssetId} : \mathbb{P*}` is the unique element of the Pallas group [#protocol-pallasandvesta]_ that identifies each Asset in the Orchard protocol, as defined in ZIP 227 [#zip-0227]_. The byte representation of the Asset identifier is defined as :math:`\mathsf{assetID} : \mathbb{B}^{\mathbb{Y}[32]} := \mathsf{repr}_{\mathbb{P}}(\mathsf{AssetId})`. In this case, the instance of the note commitment scheme, :math:`\mathsf{NoteCommit^{OrchardZSA}_{rcm}}`, will differ from :math:`\mathsf{NoteCommit^{Orchard}_{rcm}}` in that for Custom Assets, the Asset identifier will be added as an input to the commitment computation. As we will see, the nested structure of the Sinsemilla-based commitment [#protocol-concretesinsemillacommit]_ allows us to add the Asset identifier as a final recursive step, and hence keep a single instance of the Sinsemilla hash function in the circuit for the note commitment verification. @@ -267,7 +267,7 @@ Other Considerations Transaction Fees ---------------- -The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317b [#zip-0317b]_. +The fee mechanism for the upgrades proposed in this ZIP will follow the mechanism described in ZIP 317 for the ZSA protocol upgrade [#zip-0317b]_. Security and Privacy -------------------- @@ -275,6 +275,9 @@ Security and Privacy - Even if the Orchard protocol and ZSA protocol do not share the same anonymity pool (nodes can keep track of the notes that where published with different transaction structures), the migration from one to the other is done automatically and seamlessly. The Orchard bundle will be replaced by the ZSA bundle and all ZEC notes will be fully spendable with the new transaction structure. - When including new Assets we would like to maintain the amount and identifiers of Assets private, which is achieved with the design. - We prevent the "roadblock" attack on the Asset identifer by ensuring the output notes receive an Asset identifier that exists on the global state. +- 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 the use of a petname system or a list of well-known Assets. + + - One proposal for a petname system for the zcashd wallet is the use of an additional configuration file that stores a mapping of names to Asset identifiers. This allows clients to rename the Assets in a way they find useful. Default versions of this file with well-known Assets listed can be made available online as a starting point for clients. Deployment ----------- @@ -314,4 +317,4 @@ References .. [#protocol-transactionstructure] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 7.1: Transaction Encoding and Consensus (Transaction Version 5) `_ .. [#initial-zsa-issue] `User-Defined Assets and Wrapped Assets `_ .. [#generalized-value-commitments] `Comment on Generalized Value Commitments `_ -.. [#zip-0317b] `ZIP 317b: ZSA Extension Proportional Fee Mechanism `_ \ No newline at end of file +.. [#zip-0317b] `ZIP 317: Proportional Transfer Fee Mechanism - Pull Request #667 for ZSA Protocol ZIPs `_ \ No newline at end of file From 619943fd567172650e672f6df3b68bc6d4bde590 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Wed, 1 Feb 2023 18:05:40 +0530 Subject: [PATCH 066/101] Including Asset Base and redefining Asset Identifier throughout the ZIPs --- zip-0226.html | 240 ++++++++++++++++++++++++-------------------------- zip-0226.rst | 125 +++++++++++++------------- zip-0227.html | 83 +++++++++-------- zip-0227.rst | 54 ++++++------ 4 files changed, 250 insertions(+), 252 deletions(-) diff --git a/zip-0226.html b/zip-0226.html index d1f02c2a7..245e40c59 100644 --- a/zip-0226.html +++ b/zip-0226.html @@ -51,33 +51,35 @@

    None of the currently deployed Zcash transfer protocols support Custom Assets. Enabling multi-asset support on the Zcash chain will open the door for a host of applications, and enhance the ecosystem with application developers and Asset custody institutions for issuance and bridging purposes.

    Overview

    -

    In order to be able to represent different Asset identifiers in Orchard, we need to define a new data field in a note that uniquely represents the identifier of the Asset in question, which we call - \(\mathsf{AssetId^{Orchard}}\) - .

    -

    The Asset identifier will be used to enforce that the balance of an Action Description 8 is preserved across Assets (see the Orchard Binding Signature 9), and by extension the balance of an Orchard transaction. That is, the sum of all the +

    In order to be able to represent different Assets, we need to define a data field that uniquely represents the Asset in question, which we call the Asset Identifier + \(\mathsf{AssetId}\) + . This Asset Identifier is stored in Orchard-based ZSA notes as an Asset Base + \(\mathsf{AssetBase}^{\mathsf{Orchard}}\) + . These terms are formally defined in ZIP 227 5.

    +

    The Asset Identifier (via means of the Asset Base) will be used to enforce that the balance of an Action Description 8 is preserved across Assets (see the Orchard Binding Signature 9), and by extension the balance of an Orchard transaction. That is, the sum of all the \(\mathsf{value^{net}}\) from each Action Description, computed as \(\mathsf{value^{old}-value^{new}}\) - , must be balanced only with respect to the same Asset identifier. This is specially important since we will allow different Action Descriptions to transfer notes of different Asset identifiers, where the overall balance is checked without revealing which (or how many distinct) Assets are being transferred.

    -

    As was initially proposed by Jack Grigg and Daira Hopwood 19 20, we propose to make this happen by changing the value base point, + , must be balanced only with respect to the same Asset Identifier. This is specially important since we will allow different Action Descriptions to transfer notes of different Asset Identifiers, where the overall balance is checked without revealing which (or how many distinct) Assets are being transferred.

    +

    As was initially proposed by Jack Grigg and Daira Hopwood 19 20, we propose to make this happen by changing the value base point, \(\mathcal{V}^{\mathsf{Orchard}}\) , in the Homomorphic Pedersen Commitment that derives the value commitment, \(\mathsf{cv^{net}}\) , of the net value in an Orchard Action.

    -

    Because in a single transaction all value commitments are balanced, there must be as many different value base points as there are Asset identifiers in the transaction. We propose to make the - \(\mathsf{AssetId}\) - identifier an auxiliary input to the proof for each Action statement 17, represented already as a point on the Pallas curve. The circuit then should check that the same - \(\mathsf{AssetId}\) - is used in the old note commitment and the new note commitment 14, and as the base point +

    Because in a single transaction all value commitments are balanced, there must be as many different value base points as there are Asset Identifiers in the transaction. We propose to make the Asset Base + \(\mathsf{AssetBase}^{\mathsf{Orchard}}\) + an auxiliary input to the proof for each Action statement 17, represented already as a point on the Pallas curve. The circuit then should check that the same + \(\mathsf{AssetBase}^{\mathsf{Orchard}}\) + is used in the old note commitment and the new note commitment 14, and as the base point \(\mathcal{V}^\mathsf{Orchard}\) - in the value commitment 15. This ensures (1) that the input and output notes are of the same - \(\mathsf{AssetId}\) - , and (2) that only actions with the same Asset identifier will balance out in the binding and balance signatures.

    -

    In order to ensure the security of the transfers, and as we will explain below, we are redefining input dummy notes 16 for Custom Assets, as we need to enforce that the - \(\mathsf{AssetId}\) + in the value commitment 15. This ensures (1) that the input and output notes are of the same + \(\mathsf{AssetBase}^{\mathsf{Orchard}}\) + , and (2) that only actions with the same Asset Base will balance out in the binding and balance signatures.

    +

    In order to ensure the security of the transfers, and as we will explain below, we are redefining input dummy notes 16 for Custom Assets, as we need to enforce that the + \(\mathsf{AssetBase}^{\mathsf{Orchard}}\) of the output note of that split Action is the output of a valid - \(\mathsf{AssetIdHash}\) - computation defined in ZIP 227 5.

    + \(\mathsf{ZSAValueBase^{Orchard}}\) + computation defined in ZIP 227 5.

    Finally, in this ZIP we also describe the burn mechanism, which is a direct extension of the transfer mechanism. The burn process uses a similar mechanism to what is used in Orchard to unshield ZEC, by using the \(\mathsf{valueBalance}\) of the Asset in question. Burning Assets is useful for many purposes, including bridging of Wrapped Assets and removing supply of Assets.

    @@ -85,21 +87,23 @@

    Specification

    Most of the protocol is kept the same as the Orchard protocol released with NU5, except for the following.

    Asset Identifiers

    -

    For every new Asset, there must be a new and unique identifier of the Asset. Every Asset is defined by the Asset description, +

    For every new Asset, there must be a new and unique Asset Identifier. Every Asset is defined by an Asset description, \(\mathsf{asset\_desc}\) - , which is a global byte string (scoped across all future versions of Zcash). From this Asset description the specific Asset identifier, + , which is a global byte string (scoped across all future versions of Zcash). From this Asset description and the issuance key of the issuer, the specific Asset Identifier, \(\mathsf{AssetId}\) - , is derived as defined in ZIP 227 5.

    + and the Asset Base ( + \(\mathsf{AssetBase}^{\mathsf{Orchard}}\) + for the Orchard-based ZSA protocol) are derived as defined in ZIP 227 5.

    This - \(\mathsf{AssetId}\) - will be the base point of the value commitment for the specific custom Asset. Note that the - \(\mathsf{AssetId}\) + \(\mathsf{AssetBase}^{\mathsf{Orchard}}\) + will be the base point of the value commitment for the specific Custom Asset. Note that the + \(\mathsf{AssetBase}^{\mathsf{Orchard}}\) of the ZEC Asset will be kept as the original value base point, \(\mathcal{V}^\mathsf{Orchard}\) .

    -

    In future network and protocol upgrades, the same Asset description string can be carried on, with potentially a mapping into a different shielded protocol. In that case, the turnstile should know how to transform the Asset identifier, +

    In future network and protocol upgrades, the same Asset description string can be carried on, with potentially a mapping into a different shielded protocol. In that case, the turnstile should know how to transform the Asset Identifier, \(\mathsf{AssetId}\) - , from one shielded protocol to another.

    + and the Asset Base from one shielded protocol to another.

    Note Structure & Commitment

    Let @@ -107,60 +111,58 @@ be the type of a ZSA note, i.e. \(\mathsf{Note^{OrchardZSA}} := \mathsf{Note^{Orchard}} \times \mathbb{P*}\) .

    -

    A ZSA note differs from an Orchard note 6 by additionally including the identifier of the Asset, - \(\mathsf{AssetId}\) +

    A ZSA note differs from an Orchard note 6 by additionally including the Asset Base, + \(\mathsf{AssetBase}^{\mathsf{Orchard}}\) . So a ZSA note is a tuple - \((\mathsf{g_d, pk_d, v, \rho, \psi, AssetId})\) + \((\mathsf{g_d, pk_d, v, \rho, \psi, \mathsf{AssetBase}^{\mathsf{Orchard}}})\) , where

    • - \(\mathsf{AssetId} : \mathbb{P*}\) - is the unique element of the Pallas group 11 that identifies each Asset in the Orchard protocol, as defined in ZIP 227 5. The byte representation of the Asset identifier is defined as - \(\mathsf{assetID} : \mathbb{B}^{\mathbb{Y}[32]} := \mathsf{repr}_{\mathbb{P}}(\mathsf{AssetId})\) + \(\mathsf{AssetBase}^{\mathsf{Orchard}} : \mathbb{P*}\) + is the unique element of the Pallas group 11 that identifies each Asset in the Orchard protocol, defined as the Asset Base in ZIP 227 5. The byte representation of the Asset Base is defined as + \(\mathsf{asset\_base} : \mathbb{B}^{\mathbb{Y}[32]} := \mathsf{repr}_{\mathbb{P}}(\mathsf{AssetBase}^{\mathsf{Orchard}})\) .

    In this case, the instance of the note commitment scheme, \(\mathsf{NoteCommit^{OrchardZSA}_{rcm}}\) , will differ from \(\mathsf{NoteCommit^{Orchard}_{rcm}}\) - in that for Custom Assets, the Asset identifier will be added as an input to the commitment computation. As we will see, the nested structure of the Sinsemilla-based commitment 14 allows us to add the Asset identifier as a final recursive step, and hence keep a single instance of the Sinsemilla hash function in the circuit for the note commitment verification.

    -

    The commitment output is still indistinguishable from the original Orchard ZEC note commitments, by definition of the Sinsemilla hash function 13. ZSA note commitments will therefore be added to the same Orchard Note Commitment Tree. In essence, we have:

    -
    \(\mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, AssetId)} \in \mathsf{NoteCommit^{Orchard}.Output}\)
    -

    The nullifier is generated in the same manner as in the Orchard protocol 10.

    -

    The ZSA note plaintext also includes the Asset identifier in addition to the components in the Orchard note plaintext 7. It consists of

    -
    \((\mathsf{leadByte} : \mathbb{B}^{\mathbb{Y}}, \mathsf{d} : \mathbb{B}^{[l_{\mathsf{d}}]}, \mathsf{v} : \{0 .. 2^{l_{\mathsf{value}}} - 1\}, \mathsf{rseed} : \mathbb{B}^{\mathbb{Y}[32]}, \mathsf{assetID} : \mathbb{B}^{\mathbb{Y}[32]}, \mathsf{memo} : \mathbb{B}^{\mathbb{Y}[512]})\)
    + in that for Custom Assets, the Asset Base will be added as an input to the commitment computation. As we will see, the nested structure of the Sinsemilla-based commitment 14 allows us to add the Asset Base as a final recursive step, and hence keep a single instance of the Sinsemilla hash function in the circuit for the note commitment verification.

    +

    The commitment output is still indistinguishable from the original Orchard ZEC note commitments, by definition of the Sinsemilla hash function 13. ZSA note commitments will therefore be added to the same Orchard Note Commitment Tree. In essence, we have:

    +
    \(\mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, \mathsf{AssetBase}^{\mathsf{Orchard}})} \in \mathsf{NoteCommit^{Orchard}.Output}\)
    +

    The nullifier is generated in the same manner as in the Orchard protocol 10.

    +

    The ZSA note plaintext also includes the Asset Base in addition to the components in the Orchard note plaintext 7. It consists of

    +
    \((\mathsf{leadByte} : \mathbb{B}^{\mathbb{Y}}, \mathsf{d} : \mathbb{B}^{[l_{\mathsf{d}}]}, \mathsf{v} : \{0 .. 2^{l_{\mathsf{value}}} - 1\}, \mathsf{rseed} : \mathbb{B}^{\mathbb{Y}[32]}, \mathsf{asset\_base} : \mathbb{B}^{\mathbb{Y}[32]}, \mathsf{memo} : \mathbb{B}^{\mathbb{Y}[512]})\)

    Value Commitment

    -

    The Orchard Protocol uses a Homomorphic Pedersen Commitment 15 to perform the value commitment, with fixed base points +

    The Orchard Protocol uses a Homomorphic Pedersen Commitment 15 to perform the value commitment, with fixed base points \(\mathcal{V}^{\mathsf{Orchard}}\) and \(\mathcal{R}^{\mathsf{Orchard}}\) as the values represent the amount of ZEC being transferred.

    -

    In the case of the ZSA protocol, the value of different Asset identifiers in a given transaction will be committed using a different value base point. This enables the final balance of the transaction to be securely computed, such that each Asset identifier is balanced independently, as Assets with different identifiers are not meant to be mutually fungible. The value commitment then becomes

    -
    \(\mathsf{cv^{net}:=ValueCommit^{OrchardZSA}_{rcv}(v^{net}_{AssetId},\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}})}:= \mathsf{[v^{net}_{AssetId}]}\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}}+[\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}}\)
    +

    In the case of the ZSA protocol, the value of different Asset Identifiers in a given transaction will be committed using a different value base point. This enables the final balance of the transaction to be securely computed, such that each Asset Identifier is balanced independently, as different Assets are not meant to be mutually fungible. The value commitment then becomes

    +
    \(\mathsf{cv^{net}:=ValueCommit^{OrchardZSA}_{rcv}(v^{net}_{AssetId}, \mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}})}:= \mathsf{[v^{net}_{AssetId}]}\mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}} + [\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}}\)

    where \(\mathsf{v^{net}_{AssetId}} = \mathsf{v^{old}_{AssetId} - v^{new}_{AssetId}}\) such that \(\mathsf{v^{old}_{AssetId}}\) and \(\mathsf{v^{new}_{AssetId}}\) - are the values of the old and new notes of identifier + are the values of the old and new notes of Asset Identifier \(\mathsf{AssetId}\) respectively,

    - \(\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}}:=\mathsf{AssetId}\) - , where the Asset identifier - \(\mathsf{AssetId}\) - is computed as defined in ZIP 227 5, and

    + \(\mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}}\) + is defined in ZIP 227 5, and

    \(\mathcal{R}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv", "r")}\) , as in the Orchard protocol.

    We define - \(\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{ZEC}} :=\mathcal{V}^{\mathsf{Orchard}}\) - so that the value commitment for ZEC notes is computed identically to the Orchard protocol deployed in NU5 3.

    + \(\mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{ZEC}} :=\mathcal{V}^{\mathsf{Orchard}}\) + so that the value commitment for ZEC notes is computed identically to the Orchard protocol deployed in NU5 3.

    Value Balance Verification

    -

    In order to verify the balance of the different Assets, the verifier MUST perform exactly the same process as for the Orchard protocol 9.

    +

    In order to verify the balance of the different Assets, the verifier MUST perform exactly the same process as for the Orchard protocol 9.

    For a total of \(n\) Actions in a transfer, the prover MUST still sign the SIGHASH of the transaction using the binding signature key @@ -170,63 +172,59 @@

    \(\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} = \sum \mathsf{rcv_{i}^{net}}\mathcal{R}^{\mathsf{Orchard}}\)

    and use it to verify the bindingSignature on the SIGHASH message.

    Rationale for Value Balance Verification

    -

    The main reason why no changes to the Orchard process are needed is that no Custom Assets can be unshielded, so all Custom Assets are contained within the shielded pool. This means that the net balance of the input and output values is zero, with only one Asset identifier of value balance published, that of ZEC, +

    The main reason why no changes to the Orchard process are needed is that no Custom Assets can be unshielded, so all Custom Assets are contained within the shielded pool. This means that the net balance of the input and output values is zero, with only one Asset of value balance published, that of ZEC, \(\mathsf{v^{balanceOrchard}}\) - . No net amount of any other Asset identifier will be revealed, and the number of Asset identifiers in the transaction is also hidden. The only exception to this is in the case that an Asset is burnt, as we will see below in the burn mechanism.

    + . No net amount of any other Asset will be revealed, and the number of Assets in the transaction is also hidden. The only exception to this is in the case that an Asset is burnt, as we will see below in the burn mechanism.

    As in the Orchard protocol, the binding signature verification key, \(\mathsf{bvk}\) - , will only be valid (and hence verify the signature correctly), as long as the committed values sum to zero. In contrast, in this protocol, the committed values only sum to zero per Asset identifier, as the Pedersen commitments add up homomorphically only with respect to the same value base point.

    + , will only be valid (and hence verify the signature correctly), as long as the committed values sum to zero. In contrast, in this protocol, the committed values only sum to zero per Asset Base, as the Pedersen commitments add up homomorphically only with respect to the same value base point.

    Split Notes

    -

    One of the key functionalities in a UTXO-based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This requires a 1-to-many (Orchard) transaction. However, because each Action represents an input and an output, the resulting transaction must have multiple inputs. In order to cope with this today, the Actions that have not been assigned input notes are instead given dummy spend notes 16, which we call split Actions and split notes respectively. Basically, the input note is “faked” inside of the proof in order to hide which Action contains the real spend note.

    -

    This, however, brings some issues when it comes to adding multiple Asset identifiers, as the output note of the split Actions cannot be of any Asset identifier, it must be enforced to be an actual output of a GroupHash computation (in fact we want it to be of the same identifier as the original input note, but the binding signature takes care that the proper balancing is performed). If not, then the prover could essentially input a multiple (or linear combination) of an existing identifier, with the goal to attack the network by overflowing the ZEC value balance and hence counterfeiting ZEC funds.

    -

    In order to prevent this, we make some modifications to the circuit. Specifically we remove the dummy note functionality for Custom Assets and we enforce that every input note to an ZSA Action must be proven to exist in the set of note commitments in the note commitment tree. We then enforce this real note to be “unspendable” in the sense that its value will be zeroed in split Actions and the nullifier will be randomized, making the note not spendable in the specific Action. Then, the proof itself ensures that the output note is of the same identifier as the input note. In the circuit, the split note functionality will be activated by a boolean private input to the proof.

    +

    One of the key functionalities in a UTXO-based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This requires a 1-to-many (Orchard) transaction. However, because each Action represents an input and an output, the resulting transaction must have multiple inputs. In order to cope with this today, the Actions that have not been assigned input notes are instead given dummy spend notes 16, which we call split Actions and split notes respectively. Basically, the input note is “faked” inside of the proof in order to hide which Action contains the real spend note.

    +

    This, however, brings some issues when it comes to adding multiple Asset Identifiers, as the output note of the split Actions cannot contain any Asset Base, but it must be enforced to be an actual output of a GroupHash computation (in fact we want it to be of the same Asset Base as the original input note, but the binding signature takes care that the proper balancing is performed). If not, then the prover could essentially input a multiple (or linear combination) of an existing Asset Base, with the goal to attack the network by overflowing the ZEC value balance and hence counterfeiting ZEC funds.

    +

    In order to prevent this, we make some modifications to the circuit. Specifically we remove the dummy note functionality for Custom Assets and we enforce that every input note to an ZSA Action must be proven to exist in the set of note commitments in the note commitment tree. We then enforce this real note to be “unspendable” in the sense that its value will be zeroed in split Actions and the nullifier will be randomized, making the note not spendable in the specific Action. Then, the proof itself ensures that the output note is of the same Asset Base as the input note. In the circuit, the split note functionality will be activated by a boolean private input to the proof.

    This creates a chain of induction that ensures that the value base points of all output notes of a transfer are actual outputs of a GroupHash, as they originate in the Issuance protocol which is publicly verified. If this were not done then it would be possible to violate balance, for example by using a value base point derived from those of other Assets.

    Note that we do not care about whether the note identified by a Split Input is owned by the sender, or whether it was nullified before.

    -

    Wallets and other clients have a choice to make to ensure the Asset identifier is preserved for the output note of a Split Action:

    +

    Wallets and other clients have a choice to make to ensure the Asset Base is preserved for the output note of a Split Action:

      -
    1. The Split Input note could be another note of the same Asset identifier that is being spent by this transaction (but not by this Split Input).
    2. -
    3. The Split Input note could be a different unspent note of the same - \(\mathsf{AssetId}\) - (note that the note will not actually be spent).
    4. -
    5. The Split Input note could be an already spent note of the same - \(\mathsf{AssetId}\) - (note that by zeroing the value in the circuit, we prevent double spending).
    6. +
    7. The Split Input note could be another note containing the same Asset Base that is being spent by this transaction (but not by this Split Input).
    8. +
    9. The Split Input note could be a different unspent note containing the same Asset Base (note that the note will not actually be spent).
    10. +
    11. The Split Input note could be an already spent note containing the same Asset Base (note that by zeroing the value in the circuit, we prevent double spending).

    The specific circuit changes are presented below.

    Circuit Statement

    -

    The advantage of the design described above, with respect to the circuit statement, is that every ZSA Action statement is kept closely similar to the Orchard Action statement 17, except for a few additions that ensure the security of the Asset identifier system.

    +

    The advantage of the design described above, with respect to the circuit statement, is that every ZSA Action statement is kept closely similar to the Orchard Action statement 17, except for a few additions that ensure the security of the Asset Identifier system.

    Asset Identifier Equality: the following constraints must be added to ensure that the input and output note are of the same \(\mathsf{AssetId}\) :

      -
    • The Asset identifier, - \(\mathsf{AssetId}\) +
    • The Asset Base, + \(\mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}}\) , for the note is witnessed once, as an auxiliary input.
    • -
    • In the Old note commitment integrity constraint in the Orchard Action statement 17, +
    • In the Old note commitment integrity constraint in the Orchard Action statement 17, \(\mathsf{NoteCommit^{Orchard}_{rcm^{old}}(repr_{\mathbb{P}}(g_d^{old}), repr_{\mathbb{P}}(pk_d^{old}), v^{old}, \rho^{old}, \psi^{old})}\) is replaced with - \(\mathsf{NoteCommit^{OrchardZSA}_{rcm^{old}}(repr_{\mathbb{P}}(g_d^{old}), repr_{\mathbb{P}}(pk_d^{old}), v^{old}, \rho^{old}, \psi^{old}, AssetId)}\) + \(\mathsf{NoteCommit^{OrchardZSA}_{rcm^{old}}(repr_{\mathbb{P}}(g_d^{old}), repr_{\mathbb{P}}(pk_d^{old}), v^{old}, \rho^{old}, \psi^{old}, \mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}})}\) .
    • -
    • In the New note commitment integrity constraint in the Orchard Action statement 17, +
    • In the New note commitment integrity constraint in the Orchard Action statement 17, \(\mathsf{NoteCommit^{Orchard}_{rcm^{new}}(repr_{\mathbb{P}}(g_d^{new}), repr_{\mathbb{P}}(pk_d^{new}), v^{new}, \rho^{new}, \psi^{new})}\) is replaced with - \(\mathsf{NoteCommit^{OrchardZSA}_{rcm^{new}}(repr_{\mathbb{P}}(g_d^{new}), repr_{\mathbb{P}}(pk_d^{new}), v^{new}, \rho^{new}, \psi^{new}, AssetId)}\) + \(\mathsf{NoteCommit^{OrchardZSA}_{rcm^{new}}(repr_{\mathbb{P}}(g_d^{new}), repr_{\mathbb{P}}(pk_d^{new}), v^{new}, \rho^{new}, \psi^{new}, \mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}})}\) .
    -

    Correct Value Commitment: the following constraints must be added to ensure that the value commitment is computed using the witnessed Asset identifier, as represented in the notes:

    +

    Correct Value Commitment: the following constraints must be added to ensure that the value commitment is computed using the witnessed Asset Base, as represented in the notes:

    • The fixed-base multiplication constraints between the value and the value base point of the value commitment, \(\mathsf{cv}\) , is replaced with a variable-base multiplication between the two.
    • The witness to the value base point, as defined in the value base equation is the auxiliary input - \(\mathsf{AssetId}\) + \(\mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}}\) .
    -

    Enforce Secure Identifier for Split Actions: the following constraints must be added to prevent senders from changing the Asset identifier for the output note in a Split Action:

    +

    Enforce Secure Identifier for Split Actions: the following constraints must be added to prevent senders from changing the Asset Base for the output note in a Split Action:

    • @@ -236,7 +234,7 @@
    • Replace the input note value by a generic value, \(\mathsf{v}'\) , as - \(\mathsf{cv^{net}} = \mathsf{ValueCommit_rcv^{OrchardZSA}(v’ - v^new, AssetId)}\) + \(\mathsf{cv^{net}} = \mathsf{ValueCommit_rcv^{OrchardZSA}(v’ - v^new, \mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}})}\)
    @@ -298,47 +296,39 @@

    Enabling Backwards Compatibility with ZEC Notes: the following constraints must be added to enable backwards compatibility with Orchard ZEC notes.

    The old note commitment is computed using a “rolling-aggregate” Sinsemilla commitment. This means that the commitment is computed by adding new chunks or windows to the accumulated value. This method will be used in order to maintain a single commitment instance for the old note commitment, that will be used both for Orchard ZEC notes and for ZSA notes. The original Orchard ZEC notes will be conserved and not actually be converted into ZSA notes, as we will always need to compute them.

    +

    The input note in the old note commitment integrity check must either include an Asset Base (ZSA note) or not (ZEC-Orchard note). If the note is an old note, from before the upgrade, the commitment is computed in the original Orchard fashion. If the note is a new ZSA note, there are two cases:

    • -
      The input note in the old note commitment integrity must either include an Asset identifier (ZSA note) or not (ZEC-Orchard note)
      +
      If the Asset Base auxiliary input present but set to + \(\mathsf{AssetBase}^{\mathsf{Orchard}}\) + = + \(\mathcal{V}^\mathsf{Orchard}\) +
        -
      • -
        -
        If the Asset identifier auxiliary input is set - \(\mathsf{AssetId}\) - = - \(\mathcal{V}^\mathsf{Orchard}\) -
        -
        -
          -
        • NoteCommitment has a “compatibility” path that computes the note commitment as in plain Orchard (i.e.: without including the identifier)
        • -
        • This path also uses the original domain separator for ZEC note commitment
        • -
        -
        -
        -
      • -
      • -
        -
        Else,
        -
        -
          -
        • The NoteCommitment adds the identfier, - \(\mathsf{AssetId}\) - , as a final “chunk” of the Sinsemilla commitment
        • -
        • The NoteCommitment uses a different domain separator for ZSA note commitment
        • -
        -
        -
        -
      • +
      • NoteCommitment has a “compatibility” path that computes the note commitment as in plain Orchard (i.e.: without including the Asset Base)
      • +
      • This path also uses the original domain separator for ZEC note commitment
      • +
      +
      +
      +
    • +
    • +
      +
      Else,
      +
      +
        +
      • The note commitment adds the identfier, + \(\mathsf{AssetId}\) + , as a final “chunk” of the Sinsemilla commitment
      • +
      • The note commitment uses a different domain separator for ZSA note commitment

    Backward Compatibility

    -

    In order to have a "clean" backwards compatibility with the ZEC notes, we have designed the circuit to support both ZEC and ZSA notes. As we specify above, there are three main reasons we can do this: - The input notes with an Asset identifer denote the custom Assets, generating a note commitment that includes the Asset identifer; whereas the notes without an identifier, denote the ZEC notes, and generate a note commitment that does not include the Asset identifier, in order to maintain the referencability to the Merkle tree - The value commitment is abstracted to allow for the value base-point as a variable private input to the proof - The ZEC-based Actions will still include dummy input notes, whereas the ZSA-based Actions will include split input notes.

    +

    In order to have a "clean" backwards compatibility with the ZEC notes, we have designed the circuit to support both ZEC and ZSA notes. As we specify above, there are three main reasons we can do this: - The input notes with an Asset Base denote the Custom Assets, generating a note commitment that includes the Asset identifer; whereas the notes without an Asset Base denote the ZEC notes from before the protocol upgrade, and generate a note commitment that does not include the Asset Base, in order to maintain the referencability to the Merkle tree - The value commitment is abstracted to allow for the value base-point as a variable private input to the proof - The ZEC-based Actions will still include dummy input notes, whereas the ZSA-based Actions will include split input notes.

    Burn Mechanism

    @@ -346,7 +336,7 @@

    In essence, the burn mechanism is a transparent / revealing extension to the transfer protocol that enables a specific amount of any Asset identifier to be sent into “oblivion”. Our burn mechanism does NOT send Assets to a non-spendable address, it simply reduces the total number of units of a given Asset in circulation at the consensus level. It is enforced at the consensus level, by using an extension of the value balance mechanism used for ZEC Assets.

    First, contrary to the strict transfer transaction, we allow the sender to include a \(\mathsf{valueBalance_{AssetId}}\) - variable for every Asset identifier that is being burnt. As we will show in the transaction structure, this is separate from the regular + variable for every Asset Identifier that is being burnt. As we will show in the transaction structure, this is separate from the regular \(\mathsf{valueBalance^Orchard}\) that is the default transparent value for the ZEC Asset. We require that for every \(\mathsf{valueBalance_{AssetId}}\) @@ -355,22 +345,22 @@ . This is enforced via a consensus rule.

    For every custom Asset that is burnt, we add to the assetBurn vector the tuple \((\mathsf{valueBalance_{AssetId}, AssetId})\) - such that the validator of the transaction can compute the value commitment with the corresponding value base point of that Asset. This ensures that the values are all balanced out with respect to the Asset identifiers in the transfer.

    + such that the validator of the transaction can compute the value commitment with the corresponding value base point of that Asset. This ensures that the values are all balanced out with respect to the Asset Identifiers in the transfer.

    \(\mathsf{assetBurn = \{ (v^{AssetId}, AssetId)}\ |\ \forall\ \mathsf{AssetId}\ \textit{s.t.}\ \mathsf{v^{AssetId}} \neq 0 \}\)

    -

    The value balances for each Asset identifier in assetBurn represents the amount of that Asset identifier that is being burnt. In the case of ZEC, the value balance represents either the transaction fee, or the amount of ZEC changing pools (eg: to Sapling or Transparent).

    +

    The value balances for each Asset Identifier in assetBurn represents the amount of that Asset that is being burnt. In the case of ZEC, the value balance represents either the transaction fee, or the amount of ZEC changing pools (eg: to Sapling or Transparent).

    Finally, the validator needs to verify the Balance and Binding Signature by adding the value balances for all Assets, as committed using their respective \(\mathsf{AssetId}\) as the value base point of the Pedersen Commitment. This is done as follows

    \(\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} - \sum_{\forall \mathsf{AssetId}\textit{ s.t. }\mathsf{v^{AssetId}\neq 0}} \mathsf{ValueCommit_0^{OrchardZSA}(v^{AssetId}, AssetId) } = \sum \mathsf{rcv_{i,j}^{net}}\mathcal{R}^{\mathsf{Orchard}}\)

    -

    In the case that the balance of all the Action values related to a specific Asset will be zero, there will be no value added to the vector. This way, neither the number of Assets, nor their identifiers, will be revealed, except in the case that an Asset is burnt.

    -

    Note: Even if this mechanism allows having transparent ↔ shielded Asset transfers in theory, the transparent protocol will not be changed with this ZIP to adapt to a multiple Asset structure. This means that unless future consensus rules changes do allow it, unshielding will not be possible for custom Assets.

    +

    In the case that the balance of all the Action values related to a specific Asset will be zero, there will be no value added to the vector. This way, neither the number of Assets nor their Asset Identifiers will be revealed, except in the case that an Asset is burnt.

    +

    Note: Even if this mechanism allows having transparent ↔ shielded Asset transfers in theory, the transparent protocol will not be changed with this ZIP to adapt to a multiple Asset structure. This means that unless future consensus rules changes do allow it, unshielding will not be possible for Custom Assets.

    ZSA Transaction Structure

    -

    The transaction format is similar to the version 5 transaction format described in the Zcash specification 18, with the following additions to the Orchard bundle:

    +

    The transaction format is similar to the version 5 transaction format described in the Zcash specification 18, with the following additions to the Orchard bundle:

    @@ -401,16 +391,16 @@

    Other Considerations

    Transaction Fees

    -

    The fee mechanism for the upgrades proposed in this ZIP will follow the mechanism described in ZIP 317 for the ZSA protocol upgrade 21.

    +

    The fee mechanism for the upgrades proposed in this ZIP will follow the mechanism described in ZIP 317 for the ZSA protocol upgrade 21.

    Security and Privacy

    • Even if the Orchard protocol and ZSA protocol do not share the same anonymity pool (nodes can keep track of the notes that where published with different transaction structures), the migration from one to the other is done automatically and seamlessly. The Orchard bundle will be replaced by the ZSA bundle and all ZEC notes will be fully spendable with the new transaction structure.
    • When including new Assets we would like to maintain the amount and identifiers of Assets private, which is achieved with the design.
    • -
    • We prevent the "roadblock" attack on the Asset identifer by ensuring the output notes receive an Asset identifier that exists on the global state.
    • +
    • We prevent the "roadblock" attack on the Asset Identifer by ensuring the output notes receive an Asset Base that exists on the global state.
    • 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 the use of a petname system or a list of well-known Assets.
        -
      • One proposal for a petname system for the zcashd wallet is the use of an additional configuration file that stores a mapping of names to Asset identifiers. This allows clients to rename the Assets in a way they find useful. Default versions of this file with well-known Assets listed can be made available online as a starting point for clients.
      • +
      • One proposal for a petname system for the zcashd wallet is the use of an additional configuration file that stores a mapping of names to Asset Identifiers. This allows clients to rename the Assets in a way they find useful. Default versions of this file with well-known Assets listed can be made available online as a starting point for clients.
    @@ -475,7 +465,7 @@
    - +
    6Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 3.2: NotesZcash Protocol Specification, Version 2022.3.8. Section 3.2: Notes
    @@ -483,7 +473,7 @@ 7 - Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.5: Encodings of Note Plaintexts and Memo Fields + Zcash Protocol Specification, Version 2022.3.8. Section 5.5: Encodings of Note Plaintexts and Memo Fields @@ -491,7 +481,7 @@ 8 - Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 3.7: Action Transfers and their Descriptions + Zcash Protocol Specification, Version 2022.3.8. Section 3.7: Action Transfers and their Descriptions @@ -499,7 +489,7 @@ 9 - Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.14: Balance and Binding Signature (Orchard) + Zcash Protocol Specification, Version 2022.3.8. Section 4.14: Balance and Binding Signature (Orchard) @@ -507,7 +497,7 @@ 10 - Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.16: Note Commitments and Nullifiers + Zcash Protocol Specification, Version 2022.3.8. Section 4.16: Note Commitments and Nullifiers @@ -515,7 +505,7 @@ 11 - Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.9.6: Pallas and Vesta + Zcash Protocol Specification, Version 2022.3.8. Section 5.4.9.6: Pallas and Vesta @@ -531,7 +521,7 @@ 13 - Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.1.9: Sinsemilla hash function + Zcash Protocol Specification, Version 2022.3.8. Section 5.4.1.9: Sinsemilla hash function @@ -539,7 +529,7 @@ 14 - Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.8.4: Sinsemilla commitments + Zcash Protocol Specification, Version 2022.3.8. Section 5.4.8.4: Sinsemilla commitments @@ -547,7 +537,7 @@ 15 - Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.8.3: Homomorphic Pedersen commitments (Sapling and Orchard) + Zcash Protocol Specification, Version 2022.3.8. Section 5.4.8.3: Homomorphic Pedersen commitments (Sapling and Orchard) @@ -555,7 +545,7 @@ 16 - Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.8.3: Dummy Notes (Orchard) + Zcash Protocol Specification, Version 2022.3.8. Section 4.8.3: Dummy Notes (Orchard) @@ -563,7 +553,7 @@ 17 - Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.17.4: Action Statement (Orchard) + Zcash Protocol Specification, Version 2022.3.8. Section 4.17.4: Action Statement (Orchard) @@ -571,7 +561,7 @@ 18 - Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 7.1: Transaction Encoding and Consensus (Transaction Version 5) + Zcash Protocol Specification, Version 2022.3.8. Section 7.1: Transaction Encoding and Consensus (Transaction Version 5) diff --git a/zip-0226.rst b/zip-0226.rst index ff3552175..f2e3d89d6 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -57,15 +57,17 @@ issuance and bridging purposes. Overview ======== -In order to be able to represent different Asset identifiers in Orchard, we need to define a new data field in a note that uniquely represents the identifier of the Asset in question, which we call :math:`\mathsf{AssetId^{Orchard}}`. +In order to be able to represent different Assets, we need to define a data field that uniquely represents the Asset in question, which we call the Asset Identifier :math:`\mathsf{AssetId}`. +This Asset Identifier is stored in Orchard-based ZSA notes as an Asset Base :math:`\mathsf{AssetBase}^{\mathsf{Orchard}}`. +These terms are formally defined in ZIP 227 [#zip-0227]_. -The Asset identifier will be used to enforce that the balance of an Action Description [#protocol-actions]_ is preserved across Assets (see the Orchard Binding Signature [#protocol-binding]_), and by extension the balance of an Orchard transaction. That is, the sum of all the :math:`\mathsf{value^{net}}` from each Action Description, computed as :math:`\mathsf{value^{old}-value^{new}}`, must be balanced **only with respect to the same Asset identifier**. This is specially important since we will allow different Action Descriptions to transfer notes of different Asset identifiers, where the overall balance is checked without revealing which (or how many distinct) Assets are being transferred. +The Asset Identifier (via means of the Asset Base) will be used to enforce that the balance of an Action Description [#protocol-actions]_ is preserved across Assets (see the Orchard Binding Signature [#protocol-binding]_), and by extension the balance of an Orchard transaction. That is, the sum of all the :math:`\mathsf{value^{net}}` from each Action Description, computed as :math:`\mathsf{value^{old}-value^{new}}`, must be balanced **only with respect to the same Asset Identifier**. This is specially important since we will allow different Action Descriptions to transfer notes of different Asset Identifiers, where the overall balance is checked without revealing which (or how many distinct) Assets are being transferred. As was initially proposed by Jack Grigg and Daira Hopwood [#initial-zsa-issue]_ [#generalized-value-commitments]_, we propose to make this happen by changing the value base point, :math:`\mathcal{V}^{\mathsf{Orchard}}`, in the Homomorphic Pedersen Commitment that derives the value commitment, :math:`\mathsf{cv^{net}}`, of the *net value* in an Orchard Action. -Because in a single transaction all value commitments are balanced, there must be as many different value base points as there are Asset identifiers in the transaction. We propose to make the :math:`\mathsf{AssetId}` identifier an auxiliary input to the proof for each Action statement [#protocol-actionstatement]_, represented already as a point on the Pallas curve. The circuit then should check that the same :math:`\mathsf{AssetId}` is used in the old note commitment and the new note commitment [#protocol-concretesinsemillacommit]_, **and** as the base point :math:`\mathcal{V}^\mathsf{Orchard}` in the value commitment [#protocol-concretevaluecommit]_. This ensures (1) that the input and output notes are of the same :math:`\mathsf{AssetId}`, and (2) that only actions with the same Asset identifier will balance out in the binding and balance signatures. +Because in a single transaction all value commitments are balanced, there must be as many different value base points as there are Asset Identifiers in the transaction. We propose to make the Asset Base :math:`\mathsf{AssetBase}^{\mathsf{Orchard}}` an auxiliary input to the proof for each Action statement [#protocol-actionstatement]_, represented already as a point on the Pallas curve. The circuit then should check that the same :math:`\mathsf{AssetBase}^{\mathsf{Orchard}}` is used in the old note commitment and the new note commitment [#protocol-concretesinsemillacommit]_, **and** as the base point :math:`\mathcal{V}^\mathsf{Orchard}` in the value commitment [#protocol-concretevaluecommit]_. This ensures (1) that the input and output notes are of the same :math:`\mathsf{AssetBase}^{\mathsf{Orchard}}`, and (2) that only actions with the same Asset Base will balance out in the binding and balance signatures. -In order to ensure the security of the transfers, and as we will explain below, we are redefining input dummy notes [#protocol-dummynotes]_ for Custom Assets, as we need to enforce that the :math:`\mathsf{AssetId}` of the output note of that split Action is the output of a valid :math:`\mathsf{AssetIdHash}` computation defined in ZIP 227 [#zip-0227]_. +In order to ensure the security of the transfers, and as we will explain below, we are redefining input dummy notes [#protocol-dummynotes]_ for Custom Assets, as we need to enforce that the :math:`\mathsf{AssetBase}^{\mathsf{Orchard}}` of the output note of that split Action is the output of a valid :math:`\mathsf{ZSAValueBase^{Orchard}}` computation defined in ZIP 227 [#zip-0227]_. Finally, in this ZIP we also describe the *burn* mechanism, which is a direct extension of the transfer mechanism. The burn process uses a similar mechanism to what is used in Orchard to unshield ZEC, by using the :math:`\mathsf{valueBalance}` of the Asset in question. Burning Assets is useful for many purposes, including bridging of Wrapped Assets and removing supply of Assets. @@ -77,11 +79,11 @@ Most of the protocol is kept the same as the Orchard protocol released with NU5, Asset Identifiers ----------------- -For every new Asset, there must be a new and unique identifier of the Asset. Every Asset is defined by the *Asset description*, :math:`\mathsf{asset\_desc}`, which is a global byte string (scoped across all future versions of Zcash). From this Asset description the specific Asset identifier, :math:`\mathsf{AssetId}`, is derived as defined in ZIP 227 [#zip-0227]_. +For every new Asset, there must be a new and unique Asset Identifier. Every Asset is defined by an *Asset description*, :math:`\mathsf{asset\_desc}`, which is a global byte string (scoped across all future versions of Zcash). From this Asset description and the issuance key of the issuer, the specific Asset Identifier, :math:`\mathsf{AssetId}` and the Asset Base (:math:`\mathsf{AssetBase}^{\mathsf{Orchard}}` for the Orchard-based ZSA protocol) are derived as defined in ZIP 227 [#zip-0227]_. -This :math:`\mathsf{AssetId}` will be the base point of the value commitment for the specific custom Asset. Note that the :math:`\mathsf{AssetId}` of the ZEC Asset will be kept as the original value base point, :math:`\mathcal{V}^\mathsf{Orchard}`. +This :math:`\mathsf{AssetBase}^{\mathsf{Orchard}}` will be the base point of the value commitment for the specific Custom Asset. Note that the :math:`\mathsf{AssetBase}^{\mathsf{Orchard}}` of the ZEC Asset will be kept as the original value base point, :math:`\mathcal{V}^\mathsf{Orchard}`. -In future network and protocol upgrades, the same Asset description string can be carried on, with potentially a mapping into a different shielded protocol. In that case, the turnstile should know how to transform the Asset identifier, :math:`\mathsf{AssetId}`, from one shielded protocol to another. +In future network and protocol upgrades, the same Asset description string can be carried on, with potentially a mapping into a different shielded protocol. In that case, the turnstile should know how to transform the Asset Identifier, :math:`\mathsf{AssetId}` and the Asset Base from one shielded protocol to another. Note Structure & Commitment --------------------------- @@ -89,42 +91,42 @@ Note Structure & Commitment Let :math:`\mathsf{Note^{OrchardZSA}}` be the type of a ZSA note, i.e. :math:`\mathsf{Note^{OrchardZSA}} := \mathsf{Note^{Orchard}} \times \mathbb{P*}`. -A ZSA note differs from an Orchard note [#protocol-notes]_ by additionally including the identifier of the Asset, :math:`\mathsf{AssetId}`. So a ZSA note is a tuple :math:`(\mathsf{g_d, pk_d, v, \rho, \psi, AssetId})`, +A ZSA note differs from an Orchard note [#protocol-notes]_ by additionally including the Asset Base, :math:`\mathsf{AssetBase}^{\mathsf{Orchard}}`. So a ZSA note is a tuple :math:`(\mathsf{g_d, pk_d, v, \rho, \psi, \mathsf{AssetBase}^{\mathsf{Orchard}}})`, where -- :math:`\mathsf{AssetId} : \mathbb{P*}` is the unique element of the Pallas group [#protocol-pallasandvesta]_ that identifies each Asset in the Orchard protocol, as defined in ZIP 227 [#zip-0227]_. The byte representation of the Asset identifier is defined as :math:`\mathsf{assetID} : \mathbb{B}^{\mathbb{Y}[32]} := \mathsf{repr}_{\mathbb{P}}(\mathsf{AssetId})`. +- :math:`\mathsf{AssetBase}^{\mathsf{Orchard}} : \mathbb{P*}` is the unique element of the Pallas group [#protocol-pallasandvesta]_ that identifies each Asset in the Orchard protocol, defined as the Asset Base in ZIP 227 [#zip-0227]_. The byte representation of the Asset Base is defined as :math:`\mathsf{asset\_base} : \mathbb{B}^{\mathbb{Y}[32]} := \mathsf{repr}_{\mathbb{P}}(\mathsf{AssetBase}^{\mathsf{Orchard}})`. -In this case, the instance of the note commitment scheme, :math:`\mathsf{NoteCommit^{OrchardZSA}_{rcm}}`, will differ from :math:`\mathsf{NoteCommit^{Orchard}_{rcm}}` in that for Custom Assets, the Asset identifier will be added as an input to the commitment computation. As we will see, the nested structure of the Sinsemilla-based commitment [#protocol-concretesinsemillacommit]_ allows us to add the Asset identifier as a final recursive step, and hence keep a single instance of the Sinsemilla hash function in the circuit for the note commitment verification. +In this case, the instance of the note commitment scheme, :math:`\mathsf{NoteCommit^{OrchardZSA}_{rcm}}`, will differ from :math:`\mathsf{NoteCommit^{Orchard}_{rcm}}` in that for Custom Assets, the Asset Base will be added as an input to the commitment computation. As we will see, the nested structure of the Sinsemilla-based commitment [#protocol-concretesinsemillacommit]_ allows us to add the Asset Base as a final recursive step, and hence keep a single instance of the Sinsemilla hash function in the circuit for the note commitment verification. The commitment output is still indistinguishable from the original Orchard ZEC note commitments, by definition of the Sinsemilla hash function [#protocol-concretesinsemillahash]_. ZSA note commitments will therefore be added to the same Orchard Note Commitment Tree. In essence, we have: -.. math:: \mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, AssetId)} \in \mathsf{NoteCommit^{Orchard}.Output} +.. math:: \mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, \mathsf{AssetBase}^{\mathsf{Orchard}})} \in \mathsf{NoteCommit^{Orchard}.Output} The nullifier is generated in the same manner as in the Orchard protocol [#protocol-commitmentsandnullifiers]_. -The ZSA note plaintext also includes the Asset identifier in addition to the components in the Orchard note plaintext [#protocol-notept]_. +The ZSA note plaintext also includes the Asset Base in addition to the components in the Orchard note plaintext [#protocol-notept]_. It consists of -.. math:: (\mathsf{leadByte} : \mathbb{B}^{\mathbb{Y}}, \mathsf{d} : \mathbb{B}^{[l_{\mathsf{d}}]}, \mathsf{v} : \{0 .. 2^{l_{\mathsf{value}}} - 1\}, \mathsf{rseed} : \mathbb{B}^{\mathbb{Y}[32]}, \mathsf{assetID} : \mathbb{B}^{\mathbb{Y}[32]}, \mathsf{memo} : \mathbb{B}^{\mathbb{Y}[512]}) +.. math:: (\mathsf{leadByte} : \mathbb{B}^{\mathbb{Y}}, \mathsf{d} : \mathbb{B}^{[l_{\mathsf{d}}]}, \mathsf{v} : \{0 .. 2^{l_{\mathsf{value}}} - 1\}, \mathsf{rseed} : \mathbb{B}^{\mathbb{Y}[32]}, \mathsf{asset\_base} : \mathbb{B}^{\mathbb{Y}[32]}, \mathsf{memo} : \mathbb{B}^{\mathbb{Y}[512]}) Value Commitment ---------------- The Orchard Protocol uses a Homomorphic Pedersen Commitment [#protocol-concretevaluecommit]_ to perform the value commitment, with fixed base points :math:`\mathcal{V}^{\mathsf{Orchard}}` and :math:`\mathcal{R}^{\mathsf{Orchard}}` as the values represent the amount of ZEC being transferred. -In the case of the ZSA protocol, the value of different Asset identifiers in a given transaction will be committed using a **different value base point**. This enables the final balance of the transaction to be securely computed, such that each Asset identifier is balanced independently, as Assets with different identifiers are not meant to be mutually fungible. The value commitment then becomes +In the case of the ZSA protocol, the value of different Asset Identifiers in a given transaction will be committed using a **different value base point**. This enables the final balance of the transaction to be securely computed, such that each Asset Identifier is balanced independently, as different Assets are not meant to be mutually fungible. The value commitment then becomes -.. math:: \mathsf{cv^{net}:=ValueCommit^{OrchardZSA}_{rcv}(v^{net}_{AssetId},\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}})}:= \mathsf{[v^{net}_{AssetId}]}\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}}+[\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}} +.. math:: \mathsf{cv^{net}:=ValueCommit^{OrchardZSA}_{rcv}(v^{net}_{AssetId}, \mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}})}:= \mathsf{[v^{net}_{AssetId}]}\mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}} + [\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}} -where :math:`\mathsf{v^{net}_{AssetId}} = \mathsf{v^{old}_{AssetId} - v^{new}_{AssetId}}` such that :math:`\mathsf{v^{old}_{AssetId}}` and :math:`\mathsf{v^{new}_{AssetId}}` are the values of the old and new notes of identifier :math:`\mathsf{AssetId}` respectively, +where :math:`\mathsf{v^{net}_{AssetId}} = \mathsf{v^{old}_{AssetId} - v^{new}_{AssetId}}` such that :math:`\mathsf{v^{old}_{AssetId}}` and :math:`\mathsf{v^{new}_{AssetId}}` are the values of the old and new notes of Asset Identifier :math:`\mathsf{AssetId}` respectively, .. _`value base`: -:math:`\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{AssetId}}:=\mathsf{AssetId}`, where the Asset identifier :math:`\mathsf{AssetId}` is computed as defined in ZIP 227 [#zip-0227]_, and +:math:`\mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}}` is defined in ZIP 227 [#zip-0227]_, and :math:`\mathcal{R}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv", "r")}`, as in the Orchard protocol. -We define :math:`\mathcal{V}^{\mathsf{OrchardZSA}}_{\mathsf{ZEC}} :=\mathcal{V}^{\mathsf{Orchard}}` so that the value commitment for ZEC notes is computed identically to the Orchard protocol deployed in NU5 [#zip-0224]_. +We define :math:`\mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{ZEC}} :=\mathcal{V}^{\mathsf{Orchard}}` so that the value commitment for ZEC notes is computed identically to the Orchard protocol deployed in NU5 [#zip-0224]_. Value Balance Verification -------------------------- @@ -143,9 +145,9 @@ and use it to verify the `bindingSignature` on the `SIGHASH` message. Rationale for Value Balance Verification '''''''''''''''''''''''''''''''''''''''' -The main reason why no changes to the Orchard process are needed is that no Custom Assets can be unshielded, so all Custom Assets are contained within the shielded pool. This means that the net balance of the input and output values is zero, with only one Asset identifier of value balance published, that of ZEC, :math:`\mathsf{v^{balanceOrchard}}`. No net amount of any other Asset identifier will be revealed, and the number of Asset identifiers in the transaction is also hidden. The only exception to this is in the case that an Asset is *burnt*, as we will see below in the `burn mechanism`_. +The main reason why no changes to the Orchard process are needed is that no Custom Assets can be unshielded, so all Custom Assets are contained within the shielded pool. This means that the net balance of the input and output values is zero, with only one Asset of value balance published, that of ZEC, :math:`\mathsf{v^{balanceOrchard}}`. No net amount of any other Asset will be revealed, and the number of Assets in the transaction is also hidden. The only exception to this is in the case that an Asset is *burnt*, as we will see below in the `burn mechanism`_. -As in the Orchard protocol, the binding signature verification key, :math:`\mathsf{bvk}`, will only be valid (and hence verify the signature correctly), as long as the committed values sum to zero. In contrast, in this protocol, the committed values only sum to zero **per Asset identifier**, as the Pedersen commitments add up homomorphically only with respect to the same value base point. +As in the Orchard protocol, the binding signature verification key, :math:`\mathsf{bvk}`, will only be valid (and hence verify the signature correctly), as long as the committed values sum to zero. In contrast, in this protocol, the committed values only sum to zero **per Asset Base**, as the Pedersen commitments add up homomorphically only with respect to the same value base point. Split Notes @@ -153,44 +155,44 @@ Split Notes One of the key functionalities in a UTXO-based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This requires a 1-to-many (Orchard) transaction. However, because each Action represents an input and an output, the resulting transaction must have multiple inputs. In order to cope with this today, the Actions that have not been assigned input notes are instead given *dummy spend notes* [#protocol-dummynotes]_, which we call split Actions and split notes respectively. Basically, the input note is “faked” inside of the proof in order to hide which Action contains the *real* spend note. -This, however, brings some issues when it comes to adding multiple Asset identifiers, as the output note of the split Actions *cannot* be of *any* Asset identifier, it must be enforced to be an actual output of a GroupHash computation (in fact we want it to be of the same identifier as the original input note, but the binding signature takes care that the proper balancing is performed). If not, then the prover could essentially input a multiple (or linear combination) of an existing identifier, with the goal to attack the network by overflowing the ZEC value balance and hence counterfeiting ZEC funds. +This, however, brings some issues when it comes to adding multiple Asset Identifiers, as the output note of the split Actions *cannot* contain *any* Asset Base, but it must be enforced to be an actual output of a GroupHash computation (in fact we want it to be of the same Asset Base as the original input note, but the binding signature takes care that the proper balancing is performed). If not, then the prover could essentially input a multiple (or linear combination) of an existing Asset Base, with the goal to attack the network by overflowing the ZEC value balance and hence counterfeiting ZEC funds. In order to prevent this, we make some modifications to the circuit. Specifically we remove the dummy note functionality for Custom Assets and we enforce that *every* input note to an ZSA Action must be proven to exist in the set of note commitments in the note commitment tree. We then enforce this real note to be “unspendable” in the sense that its value -will be zeroed in split Actions and the nullifier will be randomized, making the note not spendable in the specific Action. Then, the proof itself ensures that the output note is of the same identifier as the input note. In the circuit, the split note functionality will be activated by a boolean private input to the proof. +will be zeroed in split Actions and the nullifier will be randomized, making the note not spendable in the specific Action. Then, the proof itself ensures that the output note is of the same Asset Base as the input note. In the circuit, the split note functionality will be activated by a boolean private input to the proof. This creates a chain of induction that ensures that the value base points of all output notes of a transfer are actual outputs of a GroupHash, as they originate in the Issuance protocol which is publicly verified. If this were not done then it would be possible to violate balance, for example by using a value base point derived from those of other Assets. Note that we do not care about whether the note identified by a Split Input is owned by the sender, or whether it was nullified before. -Wallets and other clients have a choice to make to ensure the Asset identifier is preserved for the output note of a Split Action: +Wallets and other clients have a choice to make to ensure the Asset Base is preserved for the output note of a Split Action: -1. The Split Input note could be another note of the same Asset identifier that is being spent by this transaction (but not by this Split Input). -2. The Split Input note could be a different unspent note of the same :math:`\mathsf{AssetId}` (note that the note will not actually be spent). -3. The Split Input note could be an already spent note of the same :math:`\mathsf{AssetId}` (note that by zeroing the value in the circuit, we prevent double spending). +1. The Split Input note could be another note containing the same Asset Base that is being spent by this transaction (but not by this Split Input). +2. The Split Input note could be a different unspent note containing the same Asset Base (note that the note will not actually be spent). +3. The Split Input note could be an already spent note containing the same Asset Base (note that by zeroing the value in the circuit, we prevent double spending). The specific circuit changes are presented below. Circuit Statement ================= -The advantage of the design described above, with respect to the circuit statement, is that every *ZSA Action statement* is kept closely similar to the Orchard Action statement [#protocol-actionstatement]_, except for a few additions that ensure the security of the Asset identifier system. +The advantage of the design described above, with respect to the circuit statement, is that every *ZSA Action statement* is kept closely similar to the Orchard Action statement [#protocol-actionstatement]_, except for a few additions that ensure the security of the Asset Identifier system. **Asset Identifier Equality:** the following constraints must be added to ensure that the input and output note are of the same :math:`\mathsf{AssetId}`: -- The Asset identifier, :math:`\mathsf{AssetId}`, for the note is witnessed once, as an auxiliary input. -- In the Old note commitment integrity constraint in the Orchard Action statement [#protocol-actionstatement]_, :math:`\mathsf{NoteCommit^{Orchard}_{rcm^{old}}(repr_{\mathbb{P}}(g_d^{old}), repr_{\mathbb{P}}(pk_d^{old}), v^{old}, \rho^{old}, \psi^{old})}` is replaced with :math:`\mathsf{NoteCommit^{OrchardZSA}_{rcm^{old}}(repr_{\mathbb{P}}(g_d^{old}), repr_{\mathbb{P}}(pk_d^{old}), v^{old}, \rho^{old}, \psi^{old}, AssetId)}`. -- In the New note commitment integrity constraint in the Orchard Action statement [#protocol-actionstatement]_, :math:`\mathsf{NoteCommit^{Orchard}_{rcm^{new}}(repr_{\mathbb{P}}(g_d^{new}), repr_{\mathbb{P}}(pk_d^{new}), v^{new}, \rho^{new}, \psi^{new})}` is replaced with :math:`\mathsf{NoteCommit^{OrchardZSA}_{rcm^{new}}(repr_{\mathbb{P}}(g_d^{new}), repr_{\mathbb{P}}(pk_d^{new}), v^{new}, \rho^{new}, \psi^{new}, AssetId)}`. +- The Asset Base, :math:`\mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}}`, for the note is witnessed once, as an auxiliary input. +- In the Old note commitment integrity constraint in the Orchard Action statement [#protocol-actionstatement]_, :math:`\mathsf{NoteCommit^{Orchard}_{rcm^{old}}(repr_{\mathbb{P}}(g_d^{old}), repr_{\mathbb{P}}(pk_d^{old}), v^{old}, \rho^{old}, \psi^{old})}` is replaced with :math:`\mathsf{NoteCommit^{OrchardZSA}_{rcm^{old}}(repr_{\mathbb{P}}(g_d^{old}), repr_{\mathbb{P}}(pk_d^{old}), v^{old}, \rho^{old}, \psi^{old}, \mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}})}`. +- In the New note commitment integrity constraint in the Orchard Action statement [#protocol-actionstatement]_, :math:`\mathsf{NoteCommit^{Orchard}_{rcm^{new}}(repr_{\mathbb{P}}(g_d^{new}), repr_{\mathbb{P}}(pk_d^{new}), v^{new}, \rho^{new}, \psi^{new})}` is replaced with :math:`\mathsf{NoteCommit^{OrchardZSA}_{rcm^{new}}(repr_{\mathbb{P}}(g_d^{new}), repr_{\mathbb{P}}(pk_d^{new}), v^{new}, \rho^{new}, \psi^{new}, \mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}})}`. -**Correct Value Commitment:** the following constraints must be added to ensure that the value commitment is computed using the witnessed Asset identifier, as represented in the notes: +**Correct Value Commitment:** the following constraints must be added to ensure that the value commitment is computed using the witnessed Asset Base, as represented in the notes: - The fixed-base multiplication constraints between the value and the value base point of the value commitment, :math:`\mathsf{cv}`, is replaced with a variable-base multiplication between the two. -- The witness to the value base point, as defined in the `value base`_ equation is the auxiliary input :math:`\mathsf{AssetId}`. +- The witness to the value base point, as defined in the `value base`_ equation is the auxiliary input :math:`\mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}}`. -**Enforce Secure Identifier for Split Actions:** the following constraints must be added to prevent senders from changing the Asset identifier for the output note in a Split Action: +**Enforce Secure Identifier for Split Actions:** the following constraints must be added to prevent senders from changing the Asset Base for the output note in a Split Action: - The Value Commitment Integrity should be changed - - Replace the input note value by a generic value, :math:`\mathsf{v}'`, as :math:`\mathsf{cv^{net}} = \mathsf{ValueCommit_rcv^{OrchardZSA}(v’ - v^new, AssetId)}` + - Replace the input note value by a generic value, :math:`\mathsf{v}'`, as :math:`\mathsf{cv^{net}} = \mathsf{ValueCommit_rcv^{OrchardZSA}(v’ - v^new, \mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}})}` - Add a boolean ``split`` variable as an auxiliary witness. This variable is to be activated ``split = 1`` if the Action in question is a split and ``split = 0`` if the Action is actually spending an input note: - If ``split = 1`` then set :math:`\mathsf{v}' = 0` otherwise :math:`\mathsf{v}'=\mathsf{v^{old}}` from the auxiliary input. - The Merkle Path Validity should check the existence of the note commitment as usual (and not like with dummy notes): @@ -203,20 +205,21 @@ the input and output note are of the same :math:`\mathsf{AssetId}`: The old note commitment is computed using a “rolling-aggregate” Sinsemilla commitment. This means that the commitment is computed by adding new chunks or windows to the accumulated value. This method will be used in order to maintain a single commitment instance for the old note commitment, that will be used both for Orchard ZEC notes and for ZSA notes. The original Orchard ZEC notes will be conserved and not actually be converted into ZSA notes, as we will always need to compute them. -- The input note in the old note commitment integrity must either include an Asset identifier (ZSA note) or not (ZEC-Orchard note) - - If the Asset identifier auxiliary input is set :math:`\mathsf{AssetId}` = :math:`\mathcal{V}^\mathsf{Orchard}` - - NoteCommitment has a “compatibility” path that computes the note commitment as in plain Orchard (i.e.: without including the identifier) - - This path also uses the original domain separator for ZEC note commitment - - Else, - - The NoteCommitment adds the identfier, :math:`\mathsf{AssetId}`, as a final “chunk” of the Sinsemilla commitment - - The NoteCommitment uses a different domain separator for ZSA note commitment +The input note in the old note commitment integrity check must either include an Asset Base (ZSA note) or not (ZEC-Orchard note). If the note is an old note, from before the upgrade, the commitment is computed in the original Orchard fashion. If the note is a new ZSA note, there are two cases: + +- If the Asset Base auxiliary input present but set to :math:`\mathsf{AssetBase}^{\mathsf{Orchard}}` = :math:`\mathcal{V}^\mathsf{Orchard}` + - NoteCommitment has a “compatibility” path that computes the note commitment as in plain Orchard (i.e.: without including the Asset Base) + - This path also uses the original domain separator for ZEC note commitment +- Else, + - The note commitment adds the identfier, :math:`\mathsf{AssetId}`, as a final “chunk” of the Sinsemilla commitment + - The note commitment uses a different domain separator for ZSA note commitment Backward Compatibility ---------------------- In order to have a "clean" backwards compatibility with the ZEC notes, we have designed the circuit to support both ZEC and ZSA notes. As we specify above, there are three main reasons we can do this: -- The input notes with an Asset identifer denote the custom Assets, generating a note commitment that includes the Asset identifer; whereas the notes without an identifier, denote the ZEC notes, and generate a note commitment that does not include the Asset identifier, in order to maintain the referencability to the Merkle tree +- The input notes with an Asset Base denote the Custom Assets, generating a note commitment that includes the Asset identifer; whereas the notes without an Asset Base denote the ZEC notes from before the protocol upgrade, and generate a note commitment that does not include the Asset Base, in order to maintain the referencability to the Merkle tree - The value commitment is abstracted to allow for the value base-point as a variable private input to the proof - The ZEC-based Actions will still include dummy input notes, whereas the ZSA-based Actions will include split input notes. @@ -227,23 +230,23 @@ The burn mechanism may be needed for off-boarding the Wrapped Assets from the ch In essence, the burn mechanism is a transparent / revealing extension to the transfer protocol that enables a specific amount of any Asset identifier to be sent into “oblivion”. Our burn mechanism does NOT send Assets to a non-spendable address, it simply reduces the total number of units of a given Asset in circulation at the consensus level. It is enforced at the consensus level, by using an extension of the value balance mechanism used for ZEC Assets. -First, contrary to the strict transfer transaction, we allow the sender to include a :math:`\mathsf{valueBalance_{AssetId}}` variable for every Asset identifier that is being burnt. As we will show in the transaction structure, this is separate from the regular :math:`\mathsf{valueBalance^Orchard}` that is the default transparent value for the ZEC Asset. +First, contrary to the strict transfer transaction, we allow the sender to include a :math:`\mathsf{valueBalance_{AssetId}}` variable for every Asset Identifier that is being burnt. As we will show in the transaction structure, this is separate from the regular :math:`\mathsf{valueBalance^Orchard}` that is the default transparent value for the ZEC Asset. We require that for every :math:`\mathsf{valueBalance_{AssetId}}` provided as above by the sender, :math:`\mathsf{valueBalance_{AssetId}} \neq 0`. This is enforced via a consensus rule. -For every custom Asset that is burnt, we add to the `assetBurn` vector the tuple :math:`(\mathsf{valueBalance_{AssetId}, AssetId})` such that the validator of the transaction can compute the value commitment with the corresponding value base point of that Asset. This ensures that the values are all balanced out with respect to the Asset identifiers in the transfer. +For every custom Asset that is burnt, we add to the `assetBurn` vector the tuple :math:`(\mathsf{valueBalance_{AssetId}, AssetId})` such that the validator of the transaction can compute the value commitment with the corresponding value base point of that Asset. This ensures that the values are all balanced out with respect to the Asset Identifiers in the transfer. :math:`\mathsf{assetBurn = \{ (v^{AssetId}, AssetId)}\ |\ \forall\ \mathsf{AssetId}\ \textit{s.t.}\ \mathsf{v^{AssetId}} \neq 0 \}` -The value balances for each Asset identifier in `assetBurn` represents the amount of that Asset identifier that is being burnt. In the case of ZEC, the value balance represents either the transaction fee, or the amount of ZEC changing pools (eg: to Sapling or Transparent). +The value balances for each Asset Identifier in `assetBurn` represents the amount of that Asset that is being burnt. In the case of ZEC, the value balance represents either the transaction fee, or the amount of ZEC changing pools (eg: to Sapling or Transparent). Finally, the validator needs to verify the Balance and Binding Signature by adding the value balances for all Assets, as committed using their respective :math:`\mathsf{AssetId}` as the value base point of the Pedersen Commitment. This is done as follows :math:`\mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} - \sum_{\forall \mathsf{AssetId}\textit{ s.t. }\mathsf{v^{AssetId}\neq 0}} \mathsf{ValueCommit_0^{OrchardZSA}(v^{AssetId}, AssetId) } = \sum \mathsf{rcv_{i,j}^{net}}\mathcal{R}^{\mathsf{Orchard}}` -In the case that the balance of all the Action values related to a specific Asset will be zero, there will be no value added to the vector. This way, neither the number of Assets, nor their identifiers, will be revealed, except in the case that an Asset is burnt. +In the case that the balance of all the Action values related to a specific Asset will be zero, there will be no value added to the vector. This way, neither the number of Assets nor their Asset Identifiers will be revealed, except in the case that an Asset is burnt. -**Note:** Even if this mechanism allows having transparent ↔ shielded Asset transfers in theory, the transparent protocol will not be changed with this ZIP to adapt to a multiple Asset structure. This means that unless future consensus rules changes do allow it, unshielding will not be possible for custom Assets. +**Note:** Even if this mechanism allows having transparent ↔ shielded Asset transfers in theory, the transparent protocol will not be changed with this ZIP to adapt to a multiple Asset structure. This means that unless future consensus rules changes do allow it, unshielding will not be possible for Custom Assets. ZSA Transaction Structure ========================= @@ -274,10 +277,10 @@ Security and Privacy - Even if the Orchard protocol and ZSA protocol do not share the same anonymity pool (nodes can keep track of the notes that where published with different transaction structures), the migration from one to the other is done automatically and seamlessly. The Orchard bundle will be replaced by the ZSA bundle and all ZEC notes will be fully spendable with the new transaction structure. - When including new Assets we would like to maintain the amount and identifiers of Assets private, which is achieved with the design. -- We prevent the "roadblock" attack on the Asset identifer by ensuring the output notes receive an Asset identifier that exists on the global state. +- We prevent the "roadblock" attack on the Asset Identifer by ensuring the output notes receive an Asset Base that exists on the global state. - 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 the use of a petname system or a list of well-known Assets. - - One proposal for a petname system for the zcashd wallet is the use of an additional configuration file that stores a mapping of names to Asset identifiers. This allows clients to rename the Assets in a way they find useful. Default versions of this file with well-known Assets listed can be made available online as a starting point for clients. + - One proposal for a petname system for the zcashd wallet is the use of an additional configuration file that stores a mapping of names to Asset Identifiers. This allows clients to rename the Assets in a way they find useful. Default versions of this file with well-known Assets listed can be made available online as a starting point for clients. Deployment ----------- @@ -302,19 +305,19 @@ References .. [#zip-0224] `ZIP 224: Orchard `_ .. [#zip-0226] `ZIP 226: Transfer and Burn of Zcash Shielded Assets `_ .. [#zip-0227] `ZIP 227: Issuance of Zcash Shielded Assets `_ -.. [#protocol-notes] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 3.2: Notes `_ -.. [#protocol-notept] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.5: Encodings of Note Plaintexts and Memo Fields `_ -.. [#protocol-actions] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 3.7: Action Transfers and their Descriptions `_ -.. [#protocol-binding] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.14: Balance and Binding Signature (Orchard) `_ -.. [#protocol-commitmentsandnullifiers] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.16: Note Commitments and Nullifiers `_ -.. [#protocol-pallasandvesta] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.9.6: Pallas and Vesta `_ +.. [#protocol-notes] `Zcash Protocol Specification, Version 2022.3.8. Section 3.2: Notes `_ +.. [#protocol-notept] `Zcash Protocol Specification, Version 2022.3.8. Section 5.5: Encodings of Note Plaintexts and Memo Fields `_ +.. [#protocol-actions] `Zcash Protocol Specification, Version 2022.3.8. Section 3.7: Action Transfers and their Descriptions `_ +.. [#protocol-binding] `Zcash Protocol Specification, Version 2022.3.8. Section 4.14: Balance and Binding Signature (Orchard) `_ +.. [#protocol-commitmentsandnullifiers] `Zcash Protocol Specification, Version 2022.3.8. Section 4.16: Note Commitments and Nullifiers `_ +.. [#protocol-pallasandvesta] `Zcash Protocol Specification, Version 2022.3.8. Section 5.4.9.6: Pallas and Vesta `_ .. [#pasta-evidence] `Pallas/Vesta supporting evidence `_ -.. [#protocol-concretesinsemillahash] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.1.9: Sinsemilla hash function `_ -.. [#protocol-concretesinsemillacommit] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.8.4: Sinsemilla commitments `_ -.. [#protocol-concretevaluecommit] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.8.3: Homomorphic Pedersen commitments (Sapling and Orchard) `_ -.. [#protocol-dummynotes] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.8.3: Dummy Notes (Orchard) `_ -.. [#protocol-actionstatement] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 4.17.4: Action Statement (Orchard) `_ -.. [#protocol-transactionstructure] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 7.1: Transaction Encoding and Consensus (Transaction Version 5) `_ +.. [#protocol-concretesinsemillahash] `Zcash Protocol Specification, Version 2022.3.8. Section 5.4.1.9: Sinsemilla hash function `_ +.. [#protocol-concretesinsemillacommit] `Zcash Protocol Specification, Version 2022.3.8. Section 5.4.8.4: Sinsemilla commitments `_ +.. [#protocol-concretevaluecommit] `Zcash Protocol Specification, Version 2022.3.8. Section 5.4.8.3: Homomorphic Pedersen commitments (Sapling and Orchard) `_ +.. [#protocol-dummynotes] `Zcash Protocol Specification, Version 2022.3.8. Section 4.8.3: Dummy Notes (Orchard) `_ +.. [#protocol-actionstatement] `Zcash Protocol Specification, Version 2022.3.8. Section 4.17.4: Action Statement (Orchard) `_ +.. [#protocol-transactionstructure] `Zcash Protocol Specification, Version 2022.3.8. Section 7.1: Transaction Encoding and Consensus (Transaction Version 5) `_ .. [#initial-zsa-issue] `User-Defined Assets and Wrapped Assets `_ .. [#generalized-value-commitments] `Comment on Generalized Value Commitments `_ .. [#zip-0317b] `ZIP 317: Proportional Transfer Fee Mechanism - Pull Request #667 for ZSA Protocol ZIPs `_ \ No newline at end of file diff --git a/zip-0227.html b/zip-0227.html index b7e20e8bd..be4167654 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -27,7 +27,7 @@

    The terms "Asset", "custom Asset", and "Wrapped Asset" in this document are to be interpreted as described in ZIP 226 4.

    We define the following additional terms:

      -
    • Issuance Action: an instance of a single issuance of a Zcash Shielded Asset. It defines the issuance of a single Asset identifier.
    • +
    • Issuance Action: an instance of a single issuance of a Zcash Shielded Asset. It defines the issuance of a single Asset Identifier.
    • Issuance Bundle: the bundle in the transaction that contains all the issuance actions of that transaction.
    @@ -52,19 +52,19 @@
  • Any user of the Zcash block chain can issue custom Assets on chain.
  • The issuance mechanism should enable public tracking of the supply of the Assets on the Zcash block chain.
  • Issuing or changing the attributes of a specific Asset should require cryptographic authorization.
  • -
  • The Asset identification should be unique (among all shielded pools) and different issuer public keys should not be able to generate the same Asset identifier.
  • +
  • The Asset identification should be unique (among all shielded pools) and different issuer public keys should not be able to generate the same Asset Identifier.
  • An issuer should be able to issue different Assets in the same transaction.
  • Specification

    As explained, the issuance protocol allows for a single issuance action to be sent to many receivers, by generating as many output notes as distinct recipients. Furthermore, every bundle can contain many issuance actions.

    Overview

    -

    This specification enables only transparent issuance, since as a first step, transparency is important to properly test the applications that will be most used in the Zcash ecosystem, while enabling tracking of supply of Assets. Any user of the block chain can issue new Asset identifiers, yet only a single issuer (a set of keys) can issue that specific Asset identifer, as the Asset identifiers are tied to the issuer keys.

    +

    This specification enables only transparent issuance, since as a first step, transparency is important to properly test the applications that will be most used in the Zcash ecosystem, while enabling tracking of supply of Assets. Any user of the block chain can issue new Asset Identifiers, yet only a single issuer (a set of keys) can issue that specific Asset Identifer, as the Asset Identifiers are tied to the issuer keys.

    The protocol was designed with three main properties in mind:

    • At the time of issuance, the issuer can already allocate all the tokens to the corresponding owners by creating the corresponding (shielded) output notes to the respective addresses. As is implied, the issuance mechanism is itself transparent, but the allocation is totally private.
    • -
    • In a single issuance bundle, the issuer can publish many issuance actions, or in other words, create multiple custom Assets.
    • -
    • Every issuance action contains the finalize boolean that defines whether that specific custom Asset can have further tokens issued or not.
    • +
    • In a single issuance bundle, the issuer can publish many issuance actions, or in other words, create multiple Custom Assets.
    • +
    • Every issuance action contains the finalize boolean that defines whether that specific Custom Asset can have further tokens issued or not.

    The issuance mechanism 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. In fact, the protocol described below enables what we hope will be a useful set of applications. The design decision is not to have a chosen name to describe the custom Asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”.

    @@ -73,10 +73,10 @@
    1. The issuance authorizing key, denoted as \(\mathsf{isk}\) - , is the key that is used to sign the issuance transaction. This key is used to authorize the issuance of a specific Asset identifier, and is only used by the issuer.
    2. + , is the key that is used to sign the issuance transaction. This key is used to authorize the issuance of a specific Asset Identifier, and is only used by the issuer.
    3. The issuance validating key, denoted as \(\mathsf{ik}\) - , is the key that is used to validate the issuance transaction. This key is used to validate the issuance of a specific Asset identifier, and is used by all block chain users (specifically the Asset owners and consensus validators) to associate the Asset in question with the issuer.
    4. + , is the key that is used to validate the issuance transaction. This key is used to validate the issuance of a specific Asset Identifier, and is used by all block chain users (specifically the Asset owners and consensus validators) to associate the Asset in question with the issuer.

    The two keys are derived in an analogous manner to the spend authorizing key and spend validating key, using the same signature scheme, as described in ZIP 32 7 and in accordance with ZIP 316 8.

      @@ -94,31 +94,38 @@

      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 7. 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.

    Asset Identifier

    -

    For every new Asset, there must be a new and unique identifier of the Asset. Every Asset is defined by the Asset description, +

    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})\) + , where + \(\mathsf{ik}\) + is the issuance key and \(\mathsf{asset\_desc}\) - , which is a global byte string (valid across all -future- Zcash shielded protocols). From this Asset description, the specific Asset identifier, - \(\mathsf{AssetId}\) - , is derived using an Asset identifier hash, - \(\mathsf{AssetIdHash}\) - that is defined by the specific protocol (e.g. for now Orchard-style, using Pallas curve), and used within the output notes.

    -

    The main requirement for the Asset identifier is for it to be collision-free, as two different issuers MUST not be able to issue the same Asset identifier. One way to achieve this is to make the identifier dependent on the issuer keys, as the issuer keys are unique to each issuer. We achieve this by deriving the Asset identifier, - \(\mathsf{AssetId}\) - as follows:

    -
    \(\mathsf{AssetId} = \mathsf{AssetIdHash(ik, asset\_desc)}\)
    -

    where

    + is a byte string.

    +

    A given Asset Identifier is used across all Zcash protocols that support ZSAs -- that is, the Orchard-based ZSA protocol and potentially future Zcash shielded protocols. For this Asset Identifier, we derive a specific Asset Base within each such shielded protocol (for example + \(\mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}}\) + for the Orchard-based ZSA protocol), using the applicable hash-to-curve algorithm. This Asset Base is included in shielded notes.

    +

    Let

    • \(\mathsf{asset\_desc}\) - is the Asset description, a UTF-8 encoded string of up to 512 bytes, which includes any information pertaining to the issuance.
    • + be the asset description, a UTF-8 encoded string of up to 512 bytes, which includes any information pertaining to the issuance.
    • \(\mathsf{ik}\) - is the issuance validating key of the issuer, used to verify the signature on the transaction SIGHASH and is defined above.
    • + be the issuance validating key of the issuer, a public key used to verify the signature on the issuance transaction's SIGHASH. +
    +

    Define + \(\mathsf{AssetBase^{Protocol}_{\mathsf{AssetId}}} := \mathsf{ZSAValueBase^{Protocol}}(\mathsf{EncodeAssetId}(\mathsf{AssetId}))\) + , where

    +
      +
    • + \(\mathsf{EncodeAssetId}(\mathsf{AssetId}) = \mathsf{EncodeAssetId}(\mathsf{ik}, \mathsf{asset\_desc}) := [0x00, \mathsf{length}(\mathsf{ik})] || \mathsf{ik} || \mathsf{asset\_desc}\!\) + .
    -

    In the case of the Orchard protocol, we define

    -
    \(\mathsf{AssetIdHash^{Orchard}(ik, asset\_desc)} := \mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv",} \mathsf{ik}\texttt{||}\mathsf{asset\_desc} \texttt{)}\)
    -

    where - \(\mathsf{GroupHash^{\mathbb{P}}}\) - is the Group Hash into the group of points on the Pallas curve defined in the protocol specification 10.

    +

    In the case of Orchard, we define + \(\mathsf{ZSAValueBase^{Orchard}}(\mathsf{asset\_id}) := \mathsf{GroupHash}^\mathbb{P}(\texttt{"z.cash:OrchardZSA"}, \mathsf{asset\_id})\) + where + \(\mathsf{GroupHash}^\mathbb{P}\) + is defined as in 10.

    Global Issuance State

    Issuance requires the following additions to the global state:

    @@ -241,18 +248,16 @@ \(\mathsf{asset\_desc}\) as 512 byte-string.
  • compute - \(\mathsf{AssetId}\) - as - \(\mathsf{AssetIdHash(ik, asset\_desc)}\) + \(\mathsf{AssetBase^{Protocol}} := \mathsf{ZSAValueBase^{Protocol}}(\mathsf{EncodeAssetId}(\mathsf{ik}, \mathsf{asset\_desc}))\)
  • -
  • set the finalize boolean as desired (if more more issuance actions are to be created for this Asset identifier, set finalize = 0, otherwise set finalize = 1)
  • +
  • set the finalize boolean as desired (if more more issuance actions are to be created for this Asset Identifier, set finalize = 0, otherwise set finalize = 1)
  • For each recipient \(i\) :
      -
    • generate a ZSA output note as - \(\mathsf{note}_i =(\mathsf{d}_i, \mathsf{pk}_{\mathsf{d},i}, \mathsf{v}_i, \rho_i, \psi_i, \mathsf{AssetId}, \mathsf{rcm}_i)\) -
    • +
    • generate a ZSA output note that includes the Asset Base. For an Orchard-based ZSA note this is + \(\mathsf{note}_i = (\mathsf{d}_i, \mathsf{pk}_{\mathsf{d},i}, \mathsf{v}_i, \rho_i, \psi_i, \mathsf{AssetBase^{Orchard}}, \mathsf{rcm}_i)\!\) + .
  • encode the IssueAction into the vector vIssueActions of the bundle
  • @@ -278,7 +283,7 @@
    • By using the 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,
        -
      • by setting 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.
      • +
      • by setting 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 @@ -392,7 +397,7 @@

      UTF-8 encoding of the Asset description string.

    T.1c: isFinalized
    -

    1-bit representation of a boolean flag that is set to 'true' if the Asset identifier was finalized in this action and 'false' otherwise. 'True' is represented as 1, 'false' as 0.

    +

    1-bit representation of a boolean flag that is set to 'true' if the Asset Identifier was finalized in this action and 'false' otherwise. 'True' is represented as 1, 'false' as 0.

    T.2 issuerVerificationKey

    @@ -416,7 +421,7 @@ \(\mathsf{AssetId}\) to \(\mathsf{issuanceSupplyInfoMap := (totalSupply, 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.

    + 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 317b 6.

    @@ -424,7 +429,7 @@

    Future Work

    In future versions of this ZIP, the protocol may also include a "key rotation" mechanism. This would allow an issuer to change the underlying \(\mathsf{ik}\) - of a given Asset, in case the original one was compromised, without having to change the Asset identifier altogether.

    + of a given Asset, in case the original one was compromised, without having to change the Asset Identifier altogether.

    Test Vectors

    @@ -510,7 +515,7 @@ 9 - Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 3.1: Payment Addresses and Keys + Zcash Protocol Specification, Version 2022.3.8. Section 3.1: Payment Addresses and Keys @@ -518,7 +523,7 @@ 10 - Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.9.8: Group Hash into Pallas and Vesta + Zcash Protocol Specification, Version 2022.3.8. Section 5.4.9.8: Group Hash into Pallas and Vesta @@ -526,7 +531,7 @@ 11 - Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 7.1: Transaction Encoding and Consensus (Transaction Version 5) + Zcash Protocol Specification, Version 2022.3.8. Section 7.1: Transaction Encoding and Consensus (Transaction Version 5) diff --git a/zip-0227.rst b/zip-0227.rst index 24de7bee6..45e5edcf4 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -27,7 +27,7 @@ The terms "Asset", "custom Asset", and "Wrapped Asset" in this document are to b We define the following additional terms: -- Issuance Action: an instance of a single issuance of a Zcash Shielded Asset. It defines the issuance of a single Asset identifier. +- Issuance Action: an instance of a single issuance of a Zcash Shielded Asset. It defines the issuance of a single Asset Identifier. - Issuance Bundle: the bundle in the transaction that contains all the issuance actions of that transaction. Abstract @@ -58,7 +58,7 @@ Requirements - Any user of the Zcash block chain can issue custom Assets on chain. - The issuance mechanism should enable public tracking of the supply of the Assets on the Zcash block chain. - Issuing or changing the attributes of a specific Asset should require cryptographic authorization. -- The Asset identification should be unique (among all shielded pools) and different issuer public keys should not be able to generate the same Asset identifier. +- The Asset identification should be unique (among all shielded pools) and different issuer public keys should not be able to generate the same Asset Identifier. - An issuer should be able to issue different Assets in the same transaction. @@ -70,13 +70,13 @@ As explained, the issuance protocol allows for a single issuance action to be se Overview -------- -This specification enables only *transparent* issuance, since as a first step, transparency is important to properly test the applications that will be most used in the Zcash ecosystem, while enabling tracking of supply of Assets. Any user of the block chain can issue new Asset identifiers, yet only a single issuer (a set of keys) can issue that specific Asset identifer, as the Asset identifiers are tied to the issuer keys. +This specification enables only *transparent* issuance, since as a first step, transparency is important to properly test the applications that will be most used in the Zcash ecosystem, while enabling tracking of supply of Assets. Any user of the block chain can issue new Asset Identifiers, yet only a single issuer (a set of keys) can issue that specific Asset Identifer, as the Asset Identifiers are tied to the issuer keys. The protocol was designed with three main properties in mind: - At the time of issuance, the issuer can already allocate all the tokens to the corresponding owners by creating the corresponding (shielded) output notes to the respective addresses. As is implied, the issuance mechanism is itself transparent, but the allocation is totally private. -- In a single issuance bundle, the issuer can publish many issuance actions, or in other words, create multiple custom Assets. -- Every issuance action contains the ``finalize`` boolean that defines whether that specific custom Asset can have further tokens issued or not. +- In a single issuance bundle, the issuer can publish many issuance actions, or in other words, create multiple Custom Assets. +- Every issuance action contains the ``finalize`` boolean that defines whether that specific Custom Asset can have further tokens issued or not. The issuance mechanism 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. In fact, the protocol described below enables what we hope will be a useful set of applications. The design decision is not to have a chosen name to describe the custom Asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”. @@ -85,9 +85,9 @@ Issuance Keys The ZSA Protocol adds the following two keys to the key components [#protocol-addressesandkeys]_: -1. The issuance authorizing key, denoted as :math:`\mathsf{isk}`, is the key that is used to sign the issuance transaction. This key is used to authorize the issuance of a specific Asset identifier, and is only used by the issuer. +1. The issuance authorizing key, denoted as :math:`\mathsf{isk}`, is the key that is used to sign the issuance transaction. This key is used to authorize the issuance of a specific Asset Identifier, and is only used by the issuer. -2. The issuance validating key, denoted as :math:`\mathsf{ik}`, is the key that is used to validate the issuance transaction. This key is used to validate the issuance of a specific Asset identifier, and is used by all block chain users (specifically the Asset owners and consensus validators) to associate the Asset in question with the issuer. +2. The issuance validating key, denoted as :math:`\mathsf{ik}`, is the key that is used to validate the issuance transaction. This key is used to validate the issuance of a specific Asset Identifier, and is used by all block chain users (specifically the Asset owners and consensus validators) to associate the Asset in question with the issuer. The two keys are derived in an analogous manner to the spend authorizing key and spend validating key, using the same signature scheme, as described in ZIP 32 [#zip-0032]_ and in accordance with ZIP 316 [#zip-0316]_. @@ -104,22 +104,22 @@ This allows the issuer to use the same wallet it usually uses to transfer Assets Asset Identifier ---------------- -For every new Asset, there must be a new and unique identifier of the Asset. Every Asset is defined by the Asset description, :math:`\mathsf{asset\_desc}`, which is a global byte string (valid across all -future- Zcash shielded protocols). From this Asset description, the specific Asset identifier, :math:`\mathsf{AssetId}`, is derived using an Asset identifier hash, :math:`\mathsf{AssetIdHash}` that is defined by the specific protocol (e.g. for now Orchard-style, using Pallas curve), and used within the output notes. +For every new Asset, there must be a new and unique Asset Identifier. We define this to be a globally unique pair :math:`(\mathsf{ik}, \mathsf{asset\_desc})`, where :math:`\mathsf{ik}` is the issuance key and :math:`\mathsf{asset\_desc}` is a byte string. -The main requirement for the Asset identifier is for it to be collision-free, as two different issuers MUST not be able to issue the same Asset identifier. One way to achieve this is to make the identifier dependent on the issuer keys, as the issuer keys are unique to each issuer. We achieve this by deriving the Asset identifier, :math:`\mathsf{AssetId}` as follows: +A given Asset Identifier is used across all Zcash protocols that support ZSAs -- that is, the Orchard-based ZSA protocol and potentially future Zcash shielded protocols. For this Asset Identifier, we derive a specific Asset Base within each such shielded protocol (for example :math:`\mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}}` for the Orchard-based ZSA protocol), using the applicable hash-to-curve algorithm. This Asset Base is included in shielded notes. -.. math:: \mathsf{AssetId} = \mathsf{AssetIdHash(ik, asset\_desc)} +Let -where - -- :math:`\mathsf{asset\_desc}` is the Asset description, a UTF-8 encoded string of up to 512 bytes, which includes any information pertaining to the issuance. -- :math:`\mathsf{ik}` is the issuance validating key of the issuer, used to verify the signature on the transaction SIGHASH and is defined above. +- :math:`\mathsf{asset\_desc}` be the asset description, a UTF-8 encoded string of up to 512 bytes, which includes any information pertaining to the issuance. +- :math:`\mathsf{ik}` be the issuance validating key of the issuer, a public key used to verify the signature on the issuance transaction's SIGHASH. -In the case of the Orchard protocol, we define +Define :math:`\mathsf{AssetBase^{Protocol}_{\mathsf{AssetId}}} := \mathsf{ZSAValueBase^{Protocol}}(\mathsf{EncodeAssetId}(\mathsf{AssetId}))`, +where -.. math:: \mathsf{AssetIdHash^{Orchard}(ik, asset\_desc)} := \mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv",} \mathsf{ik}\texttt{||}\mathsf{asset\_desc} \texttt{)} +- :math:`\mathsf{EncodeAssetId}(\mathsf{AssetId}) = \mathsf{EncodeAssetId}(\mathsf{ik}, \mathsf{asset\_desc}) := [0x00, \mathsf{length}(\mathsf{ik})] || \mathsf{ik} || \mathsf{asset\_desc}\!`. -where :math:`\mathsf{GroupHash^{\mathbb{P}}}` is the Group Hash into the group of points on the Pallas curve defined in the protocol specification [#protocol-concretegrouphashpallasandvesta]_. +In the case of Orchard, we define :math:`\mathsf{ZSAValueBase^{Orchard}}(\mathsf{asset\_id}) := \mathsf{GroupHash}^\mathbb{P}(\texttt{"z.cash:OrchardZSA"}, \mathsf{asset\_id})` +where :math:`\mathsf{GroupHash}^\mathbb{P}` is defined as in [#protocol-concretegrouphashpallasandvesta]_. Global Issuance State --------------------- @@ -177,11 +177,11 @@ The issuer program performs the following operations For all actions `IssueAction`: - encode :math:`\mathsf{asset\_desc}` as 512 byte-string. -- compute :math:`\mathsf{AssetId}` as :math:`\mathsf{AssetIdHash(ik, asset\_desc)}` -- set the ``finalize`` boolean as desired (if more more issuance actions are to be created for this Asset identifier, set ``finalize = 0``, otherwise set ``finalize = 1``) +- compute :math:`\mathsf{AssetBase^{Protocol}} := \mathsf{ZSAValueBase^{Protocol}}(\mathsf{EncodeAssetId}(\mathsf{ik}, \mathsf{asset\_desc}))` +- set the ``finalize`` boolean as desired (if more more issuance actions are to be created for this Asset Identifier, set ``finalize = 0``, otherwise set ``finalize = 1``) - For each recipient :math:`i`: - - generate a ZSA output note as :math:`\mathsf{note}_i =(\mathsf{d}_i, \mathsf{pk}_{\mathsf{d},i}, \mathsf{v}_i, \rho_i, \psi_i, \mathsf{AssetId}, \mathsf{rcm}_i)` + - generate a ZSA output note that includes the Asset Base. For an Orchard-based ZSA note this is :math:`\mathsf{note}_i = (\mathsf{d}_i, \mathsf{pk}_{\mathsf{d},i}, \mathsf{v}_i, \rho_i, \psi_i, \mathsf{AssetBase^{Orchard}}, \mathsf{rcm}_i)\!`. - encode the `IssueAction` into the vector `vIssueActions` of the bundle @@ -206,7 +206,7 @@ Issuers can wrap Assets defined in other chains and issue them at once in a sing - By using the ``finalize`` boolean and the burning mechanism defined in [#zip-0226]_, issuers can control the supply production of any Asset associated to their issuer keys. For example, - - by setting ``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. + - by setting ``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 @@ -315,7 +315,7 @@ UTF-8 encoding of the Asset description string. T.1c: isFinalized ''''''''''''''''' -1-bit representation of a boolean flag that is set to 'true' if the Asset identifier was finalized in this action and 'false' otherwise. 'True' is represented as 1, 'false' as 0. +1-bit representation of a boolean flag that is set to 'true' if the Asset Identifier was finalized in this action and 'false' otherwise. 'True' is represented as 1, 'false' as 0. T.2 issuerVerificationKey @@ -341,7 +341,7 @@ 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 `issuanceSupplyInfoMap` from :math:`\mathsf{AssetId}` to :math:`\mathsf{issuanceSupplyInfoMap := (totalSupply, 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. +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 `issuanceSupplyInfoMap` from :math:`\mathsf{AssetId}` to :math:`\mathsf{issuanceSupplyInfoMap := (totalSupply, 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 -------------- @@ -351,7 +351,7 @@ The fee mechanism described in this ZIP will follow the mechanism described in Z Future Work ----------- -In future versions of this ZIP, the protocol may also include a "key rotation" mechanism. This would allow an issuer to change the underlying :math:`\mathsf{ik}` of a given Asset, in case the original one was compromised, without having to change the Asset identifier altogether. +In future versions of this ZIP, the protocol may also include a "key rotation" mechanism. This would allow an issuer to change the underlying :math:`\mathsf{ik}` of a given Asset, in case the original one was compromised, without having to change the Asset Identifier altogether. Test Vectors ============ @@ -380,6 +380,6 @@ References .. [#zip-0317b] `ZIP 317b: ZSA Extension Proportional Fee Mechanism `_ .. [#zip-0032] `ZIP 32: Shielded Hierarchical Deterministic Wallets `_ .. [#zip-0316] `ZIP 316: Unified Addresses and Unified Viewing Keys `_ -.. [#protocol-addressesandkeys] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 3.1: Payment Addresses and Keys `_ -.. [#protocol-concretegrouphashpallasandvesta] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 5.4.9.8: Group Hash into Pallas and Vesta `_ -.. [#protocol-transactionstructure] `Zcash Protocol Specification, Version 2021.2.16 [NU5 proposal]. Section 7.1: Transaction Encoding and Consensus (Transaction Version 5) `_ \ No newline at end of file +.. [#protocol-addressesandkeys] `Zcash Protocol Specification, Version 2022.3.8. Section 3.1: Payment Addresses and Keys `_ +.. [#protocol-concretegrouphashpallasandvesta] `Zcash Protocol Specification, Version 2022.3.8. Section 5.4.9.8: Group Hash into Pallas and Vesta `_ +.. [#protocol-transactionstructure] `Zcash Protocol Specification, Version 2022.3.8. Section 7.1: Transaction Encoding and Consensus (Transaction Version 5) `_ \ No newline at end of file From 5ad0d7a47a326af61b87a302c30393916b75279c Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Fri, 3 Feb 2023 02:03:19 +0530 Subject: [PATCH 067/101] Including Asset Digest throughout the ZIPs --- zip-0226.html | 6 +++--- zip-0226.rst | 6 +++--- zip-0227.html | 18 ++++++++++++++---- zip-0227.rst | 13 +++++++++---- 4 files changed, 29 insertions(+), 14 deletions(-) diff --git a/zip-0226.html b/zip-0226.html index 245e40c59..419ba6bd7 100644 --- a/zip-0226.html +++ b/zip-0226.html @@ -56,7 +56,7 @@ . This Asset Identifier is stored in Orchard-based ZSA notes as an Asset Base \(\mathsf{AssetBase}^{\mathsf{Orchard}}\) . These terms are formally defined in ZIP 227 5.

    -

    The Asset Identifier (via means of the Asset Base) will be used to enforce that the balance of an Action Description 8 is preserved across Assets (see the Orchard Binding Signature 9), and by extension the balance of an Orchard transaction. That is, the sum of all the +

    The Asset Identifier (via means of theAsset Digest and Asset Base) will be used to enforce that the balance of an Action Description 8 is preserved across Assets (see the Orchard Binding Signature 9), and by extension the balance of an Orchard transaction. That is, the sum of all the \(\mathsf{value^{net}}\) from each Action Description, computed as \(\mathsf{value^{old}-value^{new}}\) @@ -91,7 +91,7 @@ \(\mathsf{asset\_desc}\) , which is a global byte string (scoped across all future versions of Zcash). From this Asset description and the issuance key of the issuer, the specific Asset Identifier, \(\mathsf{AssetId}\) - and the Asset Base ( + , the Asset Digest, and the Asset Base ( \(\mathsf{AssetBase}^{\mathsf{Orchard}}\) for the Orchard-based ZSA protocol) are derived as defined in ZIP 227 5.

    This @@ -103,7 +103,7 @@ .

    In future network and protocol upgrades, the same Asset description string can be carried on, with potentially a mapping into a different shielded protocol. In that case, the turnstile should know how to transform the Asset Identifier, \(\mathsf{AssetId}\) - and the Asset Base from one shielded protocol to another.

    + , the Asset Digest, and the Asset Base from one shielded protocol to another.

    Note Structure & Commitment

    Let diff --git a/zip-0226.rst b/zip-0226.rst index f2e3d89d6..886a6a4ec 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -61,7 +61,7 @@ In order to be able to represent different Assets, we need to define a data fiel This Asset Identifier is stored in Orchard-based ZSA notes as an Asset Base :math:`\mathsf{AssetBase}^{\mathsf{Orchard}}`. These terms are formally defined in ZIP 227 [#zip-0227]_. -The Asset Identifier (via means of the Asset Base) will be used to enforce that the balance of an Action Description [#protocol-actions]_ is preserved across Assets (see the Orchard Binding Signature [#protocol-binding]_), and by extension the balance of an Orchard transaction. That is, the sum of all the :math:`\mathsf{value^{net}}` from each Action Description, computed as :math:`\mathsf{value^{old}-value^{new}}`, must be balanced **only with respect to the same Asset Identifier**. This is specially important since we will allow different Action Descriptions to transfer notes of different Asset Identifiers, where the overall balance is checked without revealing which (or how many distinct) Assets are being transferred. +The Asset Identifier (via means of theAsset Digest and Asset Base) will be used to enforce that the balance of an Action Description [#protocol-actions]_ is preserved across Assets (see the Orchard Binding Signature [#protocol-binding]_), and by extension the balance of an Orchard transaction. That is, the sum of all the :math:`\mathsf{value^{net}}` from each Action Description, computed as :math:`\mathsf{value^{old}-value^{new}}`, must be balanced **only with respect to the same Asset Identifier**. This is specially important since we will allow different Action Descriptions to transfer notes of different Asset Identifiers, where the overall balance is checked without revealing which (or how many distinct) Assets are being transferred. As was initially proposed by Jack Grigg and Daira Hopwood [#initial-zsa-issue]_ [#generalized-value-commitments]_, we propose to make this happen by changing the value base point, :math:`\mathcal{V}^{\mathsf{Orchard}}`, in the Homomorphic Pedersen Commitment that derives the value commitment, :math:`\mathsf{cv^{net}}`, of the *net value* in an Orchard Action. @@ -79,11 +79,11 @@ Most of the protocol is kept the same as the Orchard protocol released with NU5, Asset Identifiers ----------------- -For every new Asset, there must be a new and unique Asset Identifier. Every Asset is defined by an *Asset description*, :math:`\mathsf{asset\_desc}`, which is a global byte string (scoped across all future versions of Zcash). From this Asset description and the issuance key of the issuer, the specific Asset Identifier, :math:`\mathsf{AssetId}` and the Asset Base (:math:`\mathsf{AssetBase}^{\mathsf{Orchard}}` for the Orchard-based ZSA protocol) are derived as defined in ZIP 227 [#zip-0227]_. +For every new Asset, there must be a new and unique Asset Identifier. Every Asset is defined by an *Asset description*, :math:`\mathsf{asset\_desc}`, which is a global byte string (scoped across all future versions of Zcash). From this Asset description and the issuance key of the issuer, the specific Asset Identifier, :math:`\mathsf{AssetId}` , the Asset Digest, and the Asset Base (:math:`\mathsf{AssetBase}^{\mathsf{Orchard}}` for the Orchard-based ZSA protocol) are derived as defined in ZIP 227 [#zip-0227]_. This :math:`\mathsf{AssetBase}^{\mathsf{Orchard}}` will be the base point of the value commitment for the specific Custom Asset. Note that the :math:`\mathsf{AssetBase}^{\mathsf{Orchard}}` of the ZEC Asset will be kept as the original value base point, :math:`\mathcal{V}^\mathsf{Orchard}`. -In future network and protocol upgrades, the same Asset description string can be carried on, with potentially a mapping into a different shielded protocol. In that case, the turnstile should know how to transform the Asset Identifier, :math:`\mathsf{AssetId}` and the Asset Base from one shielded protocol to another. +In future network and protocol upgrades, the same Asset description string can be carried on, with potentially a mapping into a different shielded protocol. In that case, the turnstile should know how to transform the Asset Identifier, :math:`\mathsf{AssetId}`, the Asset Digest, and the Asset Base from one shielded protocol to another. Note Structure & Commitment --------------------------- diff --git a/zip-0227.html b/zip-0227.html index be4167654..63f614a18 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -101,7 +101,11 @@ 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 Orchard-based ZSA protocol and potentially future Zcash shielded protocols. For this Asset Identifier, we derive a specific Asset Base within each such shielded protocol (for example +

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

    Let

    @@ -114,13 +118,16 @@ be the issuance validating key of the issuer, a public key used to verify the signature on the issuance transaction's SIGHASH.

    Define - \(\mathsf{AssetBase^{Protocol}_{\mathsf{AssetId}}} := \mathsf{ZSAValueBase^{Protocol}}(\mathsf{EncodeAssetId}(\mathsf{AssetId}))\) + \(\mathsf{AssetDigest_{\mathsf{AssetId}}} := \mathsf{BLAKE2b\text{-}512}(\mathsf{EncodeAssetId}(\mathsf{AssetId}))\) , where

    • \(\mathsf{EncodeAssetId}(\mathsf{AssetId}) = \mathsf{EncodeAssetId}(\mathsf{ik}, \mathsf{asset\_desc}) := [0x00, \mathsf{length}(\mathsf{ik})] || \mathsf{ik} || \mathsf{asset\_desc}\!\) .
    +

    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\_id}) := \mathsf{GroupHash}^\mathbb{P}(\texttt{"z.cash:OrchardZSA"}, \mathsf{asset\_id})\) where @@ -248,7 +255,10 @@ \(\mathsf{asset\_desc}\) as 512 byte-string.

  • compute - \(\mathsf{AssetBase^{Protocol}} := \mathsf{ZSAValueBase^{Protocol}}(\mathsf{EncodeAssetId}(\mathsf{ik}, \mathsf{asset\_desc}))\) + \(\mathsf{AssetDigest} := \mathsf{BLAKE2b\text{-}512}(\mathsf{EncodeAssetId}(\mathsf{ik}, \mathsf{asset\_desc}))\) +
  • +
  • compute + \(\mathsf{AssetBase^{Protocol}} := \mathsf{ZSAValueBase^{Protocol}}(\mathsf{AssetDigest})\)
  • set the finalize boolean as desired (if more more issuance actions are to be created for this Asset Identifier, set finalize = 0, otherwise set finalize = 1)
  • For each recipient @@ -384,7 +394,7 @@

    Note value encoded as little-endian 8-byte representation of u64 raw value.

  • T.1a.3: asset
    -

    Asset ID encoded as 32-byte representation of Pallas point.

    +

    Asset Base encoded as 32-byte representation of Pallas point.

    T.1a.4: rho

    Nullifier encoded as 32-byte representation of Pallas point.

    diff --git a/zip-0227.rst b/zip-0227.rst index 45e5edcf4..527b98490 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -106,18 +106,22 @@ Asset Identifier For every new Asset, there must be a new and unique Asset Identifier. We define this to be a globally unique pair :math:`(\mathsf{ik}, \mathsf{asset\_desc})`, where :math:`\mathsf{ik}` is the issuance key and :math:`\mathsf{asset\_desc}` is a byte string. -A given Asset Identifier is used across all Zcash protocols that support ZSAs -- that is, the Orchard-based ZSA protocol and potentially future Zcash shielded protocols. For this Asset Identifier, we derive a specific Asset Base within each such shielded protocol (for example :math:`\mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}}` for the Orchard-based ZSA protocol), using the applicable hash-to-curve algorithm. This Asset Base is included in shielded notes. +A given Asset Identifier is used across all Zcash protocols that support ZSAs -- that is, the Orchard-based ZSA protocol and potentially future Zcash shielded protocols. For this Asset Identifier, we derive an Asset Digest, :math:`\mathsf{AssetDigest}`, which is simply is a :math:`\mathsf{BLAKE2b-512}` hash of the Asset Identifier. +From the Asset Digest, we derive a specific Asset Base within each such shielded protocol (for example :math:`\mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}}` for the Orchard-based ZSA protocol), using the applicable hash-to-curve algorithm. This Asset Base is included in shielded notes. Let - :math:`\mathsf{asset\_desc}` be the asset description, a UTF-8 encoded string of up to 512 bytes, which includes any information pertaining to the issuance. - :math:`\mathsf{ik}` be the issuance validating key of the issuer, a public key used to verify the signature on the issuance transaction's SIGHASH. -Define :math:`\mathsf{AssetBase^{Protocol}_{\mathsf{AssetId}}} := \mathsf{ZSAValueBase^{Protocol}}(\mathsf{EncodeAssetId}(\mathsf{AssetId}))`, +Define :math:`\mathsf{AssetDigest_{\mathsf{AssetId}}} := \mathsf{BLAKE2b\text{-}512}(\mathsf{EncodeAssetId}(\mathsf{AssetId}))`, where - :math:`\mathsf{EncodeAssetId}(\mathsf{AssetId}) = \mathsf{EncodeAssetId}(\mathsf{ik}, \mathsf{asset\_desc}) := [0x00, \mathsf{length}(\mathsf{ik})] || \mathsf{ik} || \mathsf{asset\_desc}\!`. +Define :math:`\mathsf{AssetBase^{Protocol}_{\mathsf{AssetId}}} := \mathsf{ZSAValueBase^{Protocol}}(\mathsf{AssetDigest}_{\mathsf{AssetId}})`, +where + In the case of Orchard, we define :math:`\mathsf{ZSAValueBase^{Orchard}}(\mathsf{asset\_id}) := \mathsf{GroupHash}^\mathbb{P}(\texttt{"z.cash:OrchardZSA"}, \mathsf{asset\_id})` where :math:`\mathsf{GroupHash}^\mathbb{P}` is defined as in [#protocol-concretegrouphashpallasandvesta]_. @@ -177,7 +181,8 @@ The issuer program performs the following operations For all actions `IssueAction`: - encode :math:`\mathsf{asset\_desc}` as 512 byte-string. -- compute :math:`\mathsf{AssetBase^{Protocol}} := \mathsf{ZSAValueBase^{Protocol}}(\mathsf{EncodeAssetId}(\mathsf{ik}, \mathsf{asset\_desc}))` +- compute :math:`\mathsf{AssetDigest} := \mathsf{BLAKE2b\text{-}512}(\mathsf{EncodeAssetId}(\mathsf{ik}, \mathsf{asset\_desc}))` +- compute :math:`\mathsf{AssetBase^{Protocol}} := \mathsf{ZSAValueBase^{Protocol}}(\mathsf{AssetDigest})` - set the ``finalize`` boolean as desired (if more more issuance actions are to be created for this Asset Identifier, set ``finalize = 0``, otherwise set ``finalize = 1``) - For each recipient :math:`i`: @@ -299,7 +304,7 @@ Note value encoded as little-endian 8-byte representation of u64 raw value. T.1a.3: asset ............. -Asset ID encoded as 32-byte representation of Pallas point. +Asset Base encoded as 32-byte representation of Pallas point. T.1a.4: rho ........... From 6760bbfa3a4a7fbb0eaf0925219404d07b0d5e9e Mon Sep 17 00:00:00 2001 From: Vivek Arte <46618816+vivek-arte@users.noreply.github.com> Date: Fri, 3 Feb 2023 10:33:21 +0530 Subject: [PATCH 068/101] Update zip-0226.rst Co-authored-by: Daira Hopwood --- zip-0226.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zip-0226.rst b/zip-0226.rst index 886a6a4ec..3ed45224d 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -58,7 +58,7 @@ issuance and bridging purposes. Overview ======== In order to be able to represent different Assets, we need to define a data field that uniquely represents the Asset in question, which we call the Asset Identifier :math:`\mathsf{AssetId}`. -This Asset Identifier is stored in Orchard-based ZSA notes as an Asset Base :math:`\mathsf{AssetBase}^{\mathsf{Orchard}}`. +This Asset Identifier maps to an Asset Base :math:`\mathsf{AssetBase}^{\mathsf{Orchard}}` that is stored in Orchard-based ZSA notes. These terms are formally defined in ZIP 227 [#zip-0227]_. The Asset Identifier (via means of theAsset Digest and Asset Base) will be used to enforce that the balance of an Action Description [#protocol-actions]_ is preserved across Assets (see the Orchard Binding Signature [#protocol-binding]_), and by extension the balance of an Orchard transaction. That is, the sum of all the :math:`\mathsf{value^{net}}` from each Action Description, computed as :math:`\mathsf{value^{old}-value^{new}}`, must be balanced **only with respect to the same Asset Identifier**. This is specially important since we will allow different Action Descriptions to transfer notes of different Asset Identifiers, where the overall balance is checked without revealing which (or how many distinct) Assets are being transferred. From a3a762fda5e21385808ba4246ea3daa1690706c4 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Fri, 3 Feb 2023 10:48:44 +0530 Subject: [PATCH 069/101] adding Daira's suggested comments and edits --- zip-0226.html | 6 +++--- zip-0226.rst | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/zip-0226.html b/zip-0226.html index 419ba6bd7..740dc0708 100644 --- a/zip-0226.html +++ b/zip-0226.html @@ -66,7 +66,7 @@ , in the Homomorphic Pedersen Commitment that derives the value commitment, \(\mathsf{cv^{net}}\) , of the net value in an Orchard Action.

    -

    Because in a single transaction all value commitments are balanced, there must be as many different value base points as there are Asset Identifiers in the transaction. We propose to make the Asset Base +

    Because in a single transaction all value commitments are balanced, there must be as many different value base points as there are Asset Identifiers for a given shielded protocol used in a transaction. We propose to make the Asset Base \(\mathsf{AssetBase}^{\mathsf{Orchard}}\) an auxiliary input to the proof for each Action statement 17, represented already as a point on the Pallas curve. The circuit then should check that the same \(\mathsf{AssetBase}^{\mathsf{Orchard}}\) @@ -74,7 +74,7 @@ \(\mathcal{V}^\mathsf{Orchard}\) in the value commitment 15. This ensures (1) that the input and output notes are of the same \(\mathsf{AssetBase}^{\mathsf{Orchard}}\) - , and (2) that only actions with the same Asset Base will balance out in the binding and balance signatures.

    + , and (2) that only actions with the same Asset Base will balance out in the Orchard binding signature.

    In order to ensure the security of the transfers, and as we will explain below, we are redefining input dummy notes 16 for Custom Assets, as we need to enforce that the \(\mathsf{AssetBase}^{\mathsf{Orchard}}\) of the output note of that split Action is the output of a valid @@ -400,7 +400,7 @@

  • We prevent the "roadblock" attack on the Asset Identifer by ensuring the output notes receive an Asset Base that exists on the global state.
  • 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 the use of a petname system or a list of well-known Assets.
      -
    • One proposal for a petname system for the zcashd wallet is the use of an additional configuration file that stores a mapping of names to Asset Identifiers. This allows clients to rename the Assets in a way they find useful. Default versions of this file with well-known Assets listed can be made available online as a starting point for clients.
    • +
    • One proposal for a petname system for the zcashd wallet is the use of an additional configuration file that stores a one-to-one mapping of names to Asset Identifiers. This allows clients to rename the Assets in a way they find useful. Default versions of this file with well-known Assets listed can be made available online as a starting point for clients.
  • diff --git a/zip-0226.rst b/zip-0226.rst index 3ed45224d..5884e6667 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -65,7 +65,7 @@ The Asset Identifier (via means of theAsset Digest and Asset Base) will be used As was initially proposed by Jack Grigg and Daira Hopwood [#initial-zsa-issue]_ [#generalized-value-commitments]_, we propose to make this happen by changing the value base point, :math:`\mathcal{V}^{\mathsf{Orchard}}`, in the Homomorphic Pedersen Commitment that derives the value commitment, :math:`\mathsf{cv^{net}}`, of the *net value* in an Orchard Action. -Because in a single transaction all value commitments are balanced, there must be as many different value base points as there are Asset Identifiers in the transaction. We propose to make the Asset Base :math:`\mathsf{AssetBase}^{\mathsf{Orchard}}` an auxiliary input to the proof for each Action statement [#protocol-actionstatement]_, represented already as a point on the Pallas curve. The circuit then should check that the same :math:`\mathsf{AssetBase}^{\mathsf{Orchard}}` is used in the old note commitment and the new note commitment [#protocol-concretesinsemillacommit]_, **and** as the base point :math:`\mathcal{V}^\mathsf{Orchard}` in the value commitment [#protocol-concretevaluecommit]_. This ensures (1) that the input and output notes are of the same :math:`\mathsf{AssetBase}^{\mathsf{Orchard}}`, and (2) that only actions with the same Asset Base will balance out in the binding and balance signatures. +Because in a single transaction all value commitments are balanced, there must be as many different value base points as there are Asset Identifiers for a given shielded protocol used in a transaction. We propose to make the Asset Base :math:`\mathsf{AssetBase}^{\mathsf{Orchard}}` an auxiliary input to the proof for each Action statement [#protocol-actionstatement]_, represented already as a point on the Pallas curve. The circuit then should check that the same :math:`\mathsf{AssetBase}^{\mathsf{Orchard}}` is used in the old note commitment and the new note commitment [#protocol-concretesinsemillacommit]_, **and** as the base point :math:`\mathcal{V}^\mathsf{Orchard}` in the value commitment [#protocol-concretevaluecommit]_. This ensures (1) that the input and output notes are of the same :math:`\mathsf{AssetBase}^{\mathsf{Orchard}}`, and (2) that only actions with the same Asset Base will balance out in the Orchard binding signature. In order to ensure the security of the transfers, and as we will explain below, we are redefining input dummy notes [#protocol-dummynotes]_ for Custom Assets, as we need to enforce that the :math:`\mathsf{AssetBase}^{\mathsf{Orchard}}` of the output note of that split Action is the output of a valid :math:`\mathsf{ZSAValueBase^{Orchard}}` computation defined in ZIP 227 [#zip-0227]_. @@ -280,7 +280,7 @@ Security and Privacy - We prevent the "roadblock" attack on the Asset Identifer by ensuring the output notes receive an Asset Base that exists on the global state. - 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 the use of a petname system or a list of well-known Assets. - - One proposal for a petname system for the zcashd wallet is the use of an additional configuration file that stores a mapping of names to Asset Identifiers. This allows clients to rename the Assets in a way they find useful. Default versions of this file with well-known Assets listed can be made available online as a starting point for clients. + - One proposal for a petname system for the zcashd wallet is the use of an additional configuration file that stores a one-to-one mapping of names to Asset Identifiers. This allows clients to rename the Assets in a way they find useful. Default versions of this file with well-known Assets listed can be made available online as a starting point for clients. Deployment ----------- From 6ebba3ffcb1562225d200c7cab81d0e6c3d9d1ab Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Fri, 3 Feb 2023 17:16:07 +0530 Subject: [PATCH 070/101] generating issuance keys independently of the Orchard spending key --- zip-0227.html | 81 +++++++++++++++++++++++++++++++++++++++++---------- zip-0227.rst | 31 +++++++++++++++----- 2 files changed, 90 insertions(+), 22 deletions(-) diff --git a/zip-0227.html b/zip-0227.html index 63f614a18..2f23c28e6 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -68,30 +68,57 @@

    The issuance mechanism 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. In fact, the protocol described below enables what we hope will be a useful set of applications. The design decision is not to have a chosen name to describe the custom Asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”.

    +

    Issuance Authorization Signature Scheme

    +

    The requirement of cryptographic authorization in order to issue new Assets or change attributes of existing Assets is met by using a signature to prove knowledge of the issuance key used to authorize the issuance of the Asset, similar to what is done with the Spend Authorization Signature 12.

    +

    We define the issuance authorization signature scheme + \(\mathsf{IssueAuthSig}\) + identically to the Orchard spend authorization signature scheme, + \(\mathsf{SpendAuthSig^{\mathsf{Orchard}}\) + , that is, as + \(RedPallas\) + with key re-randomization and with generator + \(\mathcal{P}_{\mathbb{G}} = \mathcal{G}^{\mathsf{Orchard}}\) + 13.

    +

    Issuance Keys

    -

    The ZSA Protocol adds the following two keys to the key components 9:

    +

    The ZSA Protocol adds the following three keys to the key components 9:

      -
    1. The issuance authorizing key, denoted as +
    2. The issuance master key, denoted as + \(\mathsf{sk}_{\mathsf{iss}}\) + , as the name suggests, is the master key that is used to derive the other two keys.
    3. +
    4. The issuance authorizing key is the key that is used to sign the issuance transaction, and is denoted as \(\mathsf{isk}\) - , is the key that is used to sign the issuance transaction. This key is used to authorize the issuance of a specific Asset Identifier, and is only used by the issuer.
    5. + . This key is used to authorize the issuance of a specific Asset Identifier, and is only used by the issuer.
    6. The issuance validating key, denoted as \(\mathsf{ik}\) , is the key that is used to validate the issuance transaction. This key is used to validate the issuance of a specific Asset Identifier, and is used by all block chain users (specifically the Asset owners and consensus validators) to associate the Asset in question with the issuer.
    -

    The two keys are derived in an analogous manner to the spend authorizing key and spend validating key, using the same signature scheme, as described in ZIP 32 7 and in accordance with ZIP 316 8.

    +

    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 11. In + \(\mathsf{zcashd}\) + , this key is derived in a manner similar to the generation of the Orchard master key in ZIP 32 7, as detailed below:

    +
      +
    • Let + \(S\) + be a seed byte sequence of a chosen length, which MUST be at least 32 bytes and at most 252 bytes. Compute the issuance master key + \(\mathsf{sk}_{\mathsf{iss}} := \mathsf{BLAKE2b\text{-}256}(\mathtt{''ZcashIP32Issuance''}, S)\) + .
    • +
    +

    The issuance authorizing key and issuance validating key are derived from the issuance master key in an analogous manner to the derivation of the Orchard spend authorizing key and Orchard spend validating key from the Orchard spending key 11, as described below.

      -
    • The issuance authorizing key is derived directly from the spending key, - \(\mathsf{sk}\) +
    • The issuance authorizing key is derived from the issuance master key, + \(\mathsf{sk}_{\mathsf{iss}}\) , as a private signature key:
    -
    \(\mathsf{isk := ToScalar^{Orchard}(︀ PRF^{expand}_{sk} ([0x0a])}\)
    +
    \(\mathsf{isk} := \mathsf{ToScalar}^{\mathsf{Orchard}}(︀ \mathsf{PRF}^{\mathsf{expand}}_{\mathsf{sk}_{\mathsf{iss}}} ([\mathsf{0x0a}]))\)
    • The issuance validating key is derived from the issuance authorizing key, \(\mathsf{isk}\) , as a public verification key:
    -
    \(\mathsf{ik := SpendAuthSig^{Orchard}.DerivePublic(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 7. 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.

    +
    \(\mathsf{ik} := \mathsf{IssueAuthSig}.\mathsf{DerivePublic}(\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 7. 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.

    Asset Identifier

    For every new Asset, there must be a new and unique Asset Identifier. We define this to be a globally unique pair @@ -132,7 +159,7 @@ \(\mathsf{ZSAValueBase^{Orchard}}(\mathsf{asset\_id}) := \mathsf{GroupHash}^\mathbb{P}(\texttt{"z.cash:OrchardZSA"}, \mathsf{asset\_id})\) where \(\mathsf{GroupHash}^\mathbb{P}\) - is defined as in 10.

    + is defined as in 10.

    Global Issuance State

    Issuance requires the following additions to the global state:

    @@ -207,7 +234,7 @@ \(\mathsf{isk}\) , that validates the issuance . -

    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 11.

    +

    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 14.

    @@ -291,7 +318,7 @@

    Asset Features

      -
    • By using the 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, +
    • By using the 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,
      • by setting 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.
      @@ -423,7 +450,7 @@ \(\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 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.

    +

    Bridging Assets 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.

    Other Considerations

    Implementing Zcash Nodes

    @@ -434,7 +461,7 @@ 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 317b 6.

    +

    The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317b 6.

    Future Work

    In future versions of this ZIP, the protocol may also include a "key rotation" mechanism. This would allow an issuer to change the underlying @@ -537,10 +564,34 @@

    - +
    + + + +
    11Zcash Protocol Specification, Version 2022.3.8. Section 4.2.3: Orchard Key Components
    + + + + + + + +
    12Zcash Protocol Specification, Version 2022.3.8. Section 4.15: Spend Authorization Signature (Sapling and Orchard)
    + + + + + + + +
    13Zcash Protocol Specification, Version 2022.3.8. Section 5.4.7.1: Spend Authorization Signature (Sapling and Orchard)
    + + + + diff --git a/zip-0227.rst b/zip-0227.rst index 527b98490..49b9b36ee 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -80,24 +80,38 @@ The protocol was designed with three main properties in mind: The issuance mechanism 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. In fact, the protocol described below enables what we hope will be a useful set of applications. The design decision is not to have a chosen name to describe the custom Asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”. +Issuance Authorization Signature Scheme +--------------------------------------- + +The requirement of cryptographic authorization in order to issue new Assets or change attributes of existing Assets is met by using a signature to prove knowledge of the issuance key used to authorize the issuance of the Asset, similar to what is done with the Spend Authorization Signature [#protocol-spendauthsig]_. + +We define the issuance authorization signature scheme :math:`\mathsf{IssueAuthSig}` identically to the Orchard spend authorization signature scheme, :math:`\mathsf{SpendAuthSig^{\mathsf{Orchard}}`, that is, as :math:`RedPallas` with key re-randomization and with generator :math:`\mathcal{P}_{\mathbb{G}} = \mathcal{G}^{\mathsf{Orchard}}` [#protocol-concretespendauthsig]_. + Issuance Keys ------------- -The ZSA Protocol adds the following two keys to the key components [#protocol-addressesandkeys]_: +The ZSA Protocol adds the following three keys to the key components [#protocol-addressesandkeys]_: + +1. The issuance master key, denoted as :math:`\mathsf{sk}_{\mathsf{iss}}`, as the name suggests, is the master key that is used to derive the other two keys. + +2. The issuance authorizing key is the key that is used to sign the issuance transaction, and is denoted as :math:`\mathsf{isk}`. This key is used to authorize the issuance of a specific Asset Identifier, and is only used by the issuer. + +3. The issuance validating key, denoted as :math:`\mathsf{ik}`, is the key that is used to validate the issuance transaction. This key is used to validate the issuance of a specific Asset Identifier, and is used by all block chain users (specifically the Asset owners and consensus validators) to associate the Asset in question with the issuer. -1. The issuance authorizing key, denoted as :math:`\mathsf{isk}`, is the key that is used to sign the issuance transaction. This key is used to authorize the issuance of a specific Asset Identifier, and is only used by the issuer. +The issuance master key is generated by choosing a bit sequence uniformly at random from :math:`\mathbb{B}^{\mathbb{Y}[32]}`, like the Orchard spending key [#protocol-orchardkeycomponents]_. +In :math:`\mathsf{zcashd}`, this key is derived in a manner similar to the generation of the Orchard master key in ZIP 32 [#zip-0032]_, as detailed below: -2. The issuance validating key, denoted as :math:`\mathsf{ik}`, is the key that is used to validate the issuance transaction. This key is used to validate the issuance of a specific Asset Identifier, and is used by all block chain users (specifically the Asset owners and consensus validators) to associate the Asset in question with the issuer. +- Let :math:`S` be a seed byte sequence of a chosen length, which MUST be at least 32 bytes and at most 252 bytes. Compute the issuance master key :math:`\mathsf{sk}_{\mathsf{iss}} := \mathsf{BLAKE2b\text{-}256}(\mathtt{''ZcashIP32Issuance''}, S)`. -The two keys are derived in an analogous manner to the spend authorizing key and spend validating key, using the same signature scheme, as described in ZIP 32 [#zip-0032]_ and in accordance with ZIP 316 [#zip-0316]_. +The issuance authorizing key and issuance validating key are derived from the issuance master key in an analogous manner to the derivation of the Orchard spend authorizing key and Orchard spend validating key from the Orchard spending key [#protocol-orchardkeycomponents]_, as described below. -- The issuance authorizing key is derived directly from the spending key, :math:`\mathsf{sk}`, as a private signature key: +- The issuance authorizing key is derived from the issuance master key, :math:`\mathsf{sk}_{\mathsf{iss}}`, as a private signature key: -.. math:: \mathsf{isk := ToScalar^{Orchard}(︀ PRF^{expand}_{sk} ([0x0a])} +.. math:: \mathsf{isk} := \mathsf{ToScalar}^{\mathsf{Orchard}}(︀ \mathsf{PRF}^{\mathsf{expand}}_{\mathsf{sk}_{\mathsf{iss}}} ([\mathsf{0x0a}])) - The issuance validating key is derived from the issuance authorizing key, :math:`\mathsf{isk}`, as a public verification key: -.. math:: \mathsf{ik := SpendAuthSig^{Orchard}.DerivePublic(isk)} +.. math:: \mathsf{ik} := \mathsf{IssueAuthSig}.\mathsf{DerivePublic}(\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 [#zip-0032]_. 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. @@ -387,4 +401,7 @@ References .. [#zip-0316] `ZIP 316: Unified Addresses and Unified Viewing Keys `_ .. [#protocol-addressesandkeys] `Zcash Protocol Specification, Version 2022.3.8. Section 3.1: Payment Addresses and Keys `_ .. [#protocol-concretegrouphashpallasandvesta] `Zcash Protocol Specification, Version 2022.3.8. Section 5.4.9.8: Group Hash into Pallas and Vesta `_ +.. [#protocol-orchardkeycomponents] `Zcash Protocol Specification, Version 2022.3.8. Section 4.2.3: Orchard Key Components `_ +.. [#protocol-spendauthsig] `Zcash Protocol Specification, Version 2022.3.8. Section 4.15: Spend Authorization Signature (Sapling and Orchard) `_ +.. [#protocol-concretespendauthsig] `Zcash Protocol Specification, Version 2022.3.8. Section 5.4.7.1: Spend Authorization Signature (Sapling and Orchard) `_ .. [#protocol-transactionstructure] `Zcash Protocol Specification, Version 2022.3.8. Section 7.1: Transaction Encoding and Consensus (Transaction Version 5) `_ \ No newline at end of file From 1494e0e4955d655ccdf83e40083c4823fe690ef8 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Mon, 13 Feb 2023 10:47:19 +0530 Subject: [PATCH 071/101] editing IssueAuthSig, plus other edits --- zip-0227.html | 42 +++++++++++++++++++++++------------------- zip-0227.rst | 10 ++++++---- 2 files changed, 29 insertions(+), 23 deletions(-) diff --git a/zip-0227.html b/zip-0227.html index 2f23c28e6..d379c772b 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -72,16 +72,20 @@

    The requirement of cryptographic authorization in order to issue new Assets or change attributes of existing Assets is met by using a signature to prove knowledge of the issuance key used to authorize the issuance of the Asset, similar to what is done with the Spend Authorization Signature 12.

    We define the issuance authorization signature scheme \(\mathsf{IssueAuthSig}\) - identically to the Orchard spend authorization signature scheme, - \(\mathsf{SpendAuthSig^{\mathsf{Orchard}}\) - , that is, as - \(RedPallas\) + similar to the Orchard spend authorization signature scheme, + \(\mathsf{SpendAuthSig}^{\mathsf{Orchard}}\) + 13. Specifically, we instantiate + \(\mathsf{IssueAuthSig}\) + as + \(\mathsf{RedPallas}\) with key re-randomization and with generator - \(\mathcal{P}_{\mathbb{G}} = \mathcal{G}^{\mathsf{Orchard}}\) - 13.

    + \(\mathcal{P}_{\mathbb{G}} = \mathcal{G}^{\mathsf{Issuance}} := \mathsf{GroupHash}^\mathbb{P}(\texttt{"z.cash:ZSA"}, \texttt{"Issuance"})\) + where + \(\mathsf{GroupHash}^\mathbb{P}\) + is defined as in 10.

    Issuance Keys

    -

    The ZSA Protocol adds the following three keys to the key components 9:

    +

    The ZSA Protocol adds the following three keys to the key components 9:

    1. The issuance master key, denoted as \(\mathsf{sk}_{\mathsf{iss}}\) @@ -95,9 +99,9 @@

    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 11. In + , like the Orchard spending key 11. In \(\mathsf{zcashd}\) - , this key is derived in a manner similar to the generation of the Orchard master key in ZIP 32 7, as detailed below:

    + , this key is derived in a manner similar to the generation of the Orchard master key in ZIP 32 7, as detailed below:

    • Let \(S\) @@ -105,7 +109,7 @@ \(\mathsf{sk}_{\mathsf{iss}} := \mathsf{BLAKE2b\text{-}256}(\mathtt{''ZcashIP32Issuance''}, S)\) .
    -

    The issuance authorizing key and issuance validating key are derived from the issuance master key in an analogous manner to the derivation of the Orchard spend authorizing key and Orchard spend validating key from the Orchard spending key 11, as described below.

    +

    The issuance authorizing key and issuance validating key are derived from the issuance master key in an analogous manner to the derivation of the Orchard spend authorizing key and Orchard spend validating key from the Orchard spending key 11, as described below.

    • The issuance authorizing key is derived from the issuance master key, \(\mathsf{sk}_{\mathsf{iss}}\) @@ -118,7 +122,7 @@ , as a public verification key:
    \(\mathsf{ik} := \mathsf{IssueAuthSig}.\mathsf{DerivePublic}(\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 7. 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.

    +

    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 7. 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.

    Asset Identifier

    For every new Asset, there must be a new and unique Asset Identifier. We define this to be a globally unique pair @@ -131,7 +135,7 @@

    A given Asset Identifier is used across all Zcash protocols that support ZSAs -- that is, the Orchard-based ZSA protocol and potentially future Zcash shielded protocols. For this Asset Identifier, we derive an Asset Digest, \(\mathsf{AssetDigest}\) , which is simply is a - \(\mathsf{BLAKE2b-512}\) + \(\mathsf{BLAKE2b-256}\) hash of the Asset Identifier. From the Asset Digest, we derive a specific Asset Base within each such shielded protocol (for example \(\mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}}\) for the Orchard-based ZSA protocol), using the applicable hash-to-curve algorithm. This Asset Base is included in shielded notes.

    @@ -145,11 +149,11 @@ be the issuance validating key of the issuer, a public key used to verify the signature on the issuance transaction's SIGHASH.

    Define - \(\mathsf{AssetDigest_{\mathsf{AssetId}}} := \mathsf{BLAKE2b\text{-}512}(\mathsf{EncodeAssetId}(\mathsf{AssetId}))\) + \(\mathsf{AssetDigest_{\mathsf{AssetId}}} := \mathsf{BLAKE2b\text{-}256}(\mathsf{EncodeAssetId}(\mathsf{AssetId}))\) , where

    • - \(\mathsf{EncodeAssetId}(\mathsf{AssetId}) = \mathsf{EncodeAssetId}(\mathsf{ik}, \mathsf{asset\_desc}) := [0x00, \mathsf{length}(\mathsf{ik})] || \mathsf{ik} || \mathsf{asset\_desc}\!\) + \(\mathsf{EncodeAssetId}(\mathsf{AssetId}) = \mathsf{EncodeAssetId}(\mathsf{ik}, \mathsf{asset\_desc}) := \mathsf{repr}_{\mathbb{P}}(\mathsf{ik}) || \mathsf{asset\_desc}\!\) .

    Define @@ -159,7 +163,7 @@ \(\mathsf{ZSAValueBase^{Orchard}}(\mathsf{asset\_id}) := \mathsf{GroupHash}^\mathbb{P}(\texttt{"z.cash:OrchardZSA"}, \mathsf{asset\_id})\) where \(\mathsf{GroupHash}^\mathbb{P}\) - is defined as in 10.

    + is defined as in 10.

    Global Issuance State

    Issuance requires the following additions to the global state:

    @@ -234,7 +238,7 @@ \(\mathsf{isk}\) , that validates the issuance . -

    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 14.

    +

    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 14.

    14 Zcash Protocol Specification, Version 2022.3.8. Section 7.1: Transaction Encoding and Consensus (Transaction Version 5)
    @@ -318,7 +322,7 @@

    Asset Features

      -
    • By using the 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, +
    • By using the 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,
      • by setting 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.
      @@ -450,7 +454,7 @@ \(\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 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.

    +

    Bridging Assets 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.

    Other Considerations

    Implementing Zcash Nodes

    @@ -461,7 +465,7 @@ 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 317b 6.

    +

    The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317b 6.

    Future Work

    In future versions of this ZIP, the protocol may also include a "key rotation" mechanism. This would allow an issuer to change the underlying diff --git a/zip-0227.rst b/zip-0227.rst index 49b9b36ee..1199179e0 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -85,7 +85,9 @@ Issuance Authorization Signature Scheme The requirement of cryptographic authorization in order to issue new Assets or change attributes of existing Assets is met by using a signature to prove knowledge of the issuance key used to authorize the issuance of the Asset, similar to what is done with the Spend Authorization Signature [#protocol-spendauthsig]_. -We define the issuance authorization signature scheme :math:`\mathsf{IssueAuthSig}` identically to the Orchard spend authorization signature scheme, :math:`\mathsf{SpendAuthSig^{\mathsf{Orchard}}`, that is, as :math:`RedPallas` with key re-randomization and with generator :math:`\mathcal{P}_{\mathbb{G}} = \mathcal{G}^{\mathsf{Orchard}}` [#protocol-concretespendauthsig]_. +We define the issuance authorization signature scheme :math:`\mathsf{IssueAuthSig}` similar to the Orchard spend authorization signature scheme, :math:`\mathsf{SpendAuthSig}^{\mathsf{Orchard}}` [#protocol-concretespendauthsig]_. +Specifically, we instantiate :math:`\mathsf{IssueAuthSig}` as :math:`\mathsf{RedPallas}` with key re-randomization and with generator :math:`\mathcal{P}_{\mathbb{G}} = \mathcal{G}^{\mathsf{Issuance}} := \mathsf{GroupHash}^\mathbb{P}(\texttt{"z.cash:ZSA"}, \texttt{"Issuance"})` where :math:`\mathsf{GroupHash}^\mathbb{P}` is defined as in [#protocol-concretegrouphashpallasandvesta]_. + Issuance Keys ------------- @@ -120,7 +122,7 @@ Asset Identifier For every new Asset, there must be a new and unique Asset Identifier. We define this to be a globally unique pair :math:`(\mathsf{ik}, \mathsf{asset\_desc})`, where :math:`\mathsf{ik}` is the issuance key and :math:`\mathsf{asset\_desc}` is a byte string. -A given Asset Identifier is used across all Zcash protocols that support ZSAs -- that is, the Orchard-based ZSA protocol and potentially future Zcash shielded protocols. For this Asset Identifier, we derive an Asset Digest, :math:`\mathsf{AssetDigest}`, which is simply is a :math:`\mathsf{BLAKE2b-512}` hash of the Asset Identifier. +A given Asset Identifier is used across all Zcash protocols that support ZSAs -- that is, the Orchard-based ZSA protocol and potentially future Zcash shielded protocols. For this Asset Identifier, we derive an Asset Digest, :math:`\mathsf{AssetDigest}`, which is simply is a :math:`\mathsf{BLAKE2b-256}` hash of the Asset Identifier. From the Asset Digest, we derive a specific Asset Base within each such shielded protocol (for example :math:`\mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}}` for the Orchard-based ZSA protocol), using the applicable hash-to-curve algorithm. This Asset Base is included in shielded notes. Let @@ -128,10 +130,10 @@ Let - :math:`\mathsf{asset\_desc}` be the asset description, a UTF-8 encoded string of up to 512 bytes, which includes any information pertaining to the issuance. - :math:`\mathsf{ik}` be the issuance validating key of the issuer, a public key used to verify the signature on the issuance transaction's SIGHASH. -Define :math:`\mathsf{AssetDigest_{\mathsf{AssetId}}} := \mathsf{BLAKE2b\text{-}512}(\mathsf{EncodeAssetId}(\mathsf{AssetId}))`, +Define :math:`\mathsf{AssetDigest_{\mathsf{AssetId}}} := \mathsf{BLAKE2b\text{-}256}(\mathsf{EncodeAssetId}(\mathsf{AssetId}))`, where -- :math:`\mathsf{EncodeAssetId}(\mathsf{AssetId}) = \mathsf{EncodeAssetId}(\mathsf{ik}, \mathsf{asset\_desc}) := [0x00, \mathsf{length}(\mathsf{ik})] || \mathsf{ik} || \mathsf{asset\_desc}\!`. +- :math:`\mathsf{EncodeAssetId}(\mathsf{AssetId}) = \mathsf{EncodeAssetId}(\mathsf{ik}, \mathsf{asset\_desc}) := \mathsf{repr}_{\mathbb{P}}(\mathsf{ik}) || \mathsf{asset\_desc}\!`. Define :math:`\mathsf{AssetBase^{Protocol}_{\mathsf{AssetId}}} := \mathsf{ZSAValueBase^{Protocol}}(\mathsf{AssetDigest}_{\mathsf{AssetId}})`, where From 087afea0b303bbaf733463d4735b6a91e5d9092f Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Mon, 13 Feb 2023 16:14:21 +0530 Subject: [PATCH 072/101] adding diagram for ZSA key components --- key_components_zsa.png | Bin 0 -> 61722 bytes key_components_zsa.svg | 270 +++++++++++++++++++++++++++++++++++++++++ zip-0227.html | 5 + zip-0227.rst | 12 +- 4 files changed, 286 insertions(+), 1 deletion(-) create mode 100644 key_components_zsa.png create mode 100644 key_components_zsa.svg diff --git a/key_components_zsa.png b/key_components_zsa.png new file mode 100644 index 0000000000000000000000000000000000000000..aa9fa5d21d48885d21a987130a4504a92b74614e GIT binary patch literal 61722 zcmeGES5%YT^F9s-klqEPOBGbAgdU1?P>O<5q_-d)X#wdN0R^dwM4AYKG%1l9N*+*( zgd#maC?X&&p$7>e|M)zg@7a6$p8fV(EV8n8n|;sBp1J0_^WvVl5i z1OP7a0RWWEbTs5|md8nZ_R7aKsp2-{^{Qz&C%sEiHAa+D4~mb^n&^? zQ$&S7P<}{xCCYGx(?EyKK>xnZgWD^~!nQge?{I8d>M?ejux@Hb#>N%cHG&`;s2%JM z=GP*Qa6HGofVtu2<)so*6gd)t!m$6Z-OwvGSGleKUwg_z&G)~LWr_@nDgQNNZ_dYT z|8>tAzdj}``d|Ba|Gm!tI^QY1{p^38UmGUS{NL2CD4GA)*OKr5P5l4&qj(ov7!aRg zEQRvpauIVebFn?(xrCwyQ-;LP#CzrRlNKDXs<^%$b0O3v-#9s|D`;9I|1Jusj?J;4_y1=PFK&m=en$kY-Gl|-wZN3XkEnM z0?JD&m3OHftXzJiE)cD1v30!QaLORCM^-;3=2_yrI#Vm#Z+<&Jk)Rp`=|hCnwLVlX z6$_;nWg0CFr^B(}@}uRO%f(o&CQTVmvdYjahU)4E!|a@0<^yJ@;za#<+`vmTPSh6w z0pnF28aiIqD2fUI1cufJ5+Z=F%;uB;sujyWeU%W!m;K%zo(UQ#yMc`W-0Z9hC@Plw znI!_?<|-IbAc9_%b@usB@(fEk8I*4+JUkX@lMqPx?C#u7(6YYn-pb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z}CaP@y!^@EAwBTV<26 zGq+OB8uZwik`2+ju!lXp4pTtaA@u|X9!Tm0zcegdcbv2QON=c#;eK1fi9i&TO^UIo*b zj|K(-6#iZc5WyGOz4#V=el_ip=l(mukYHAH43xjoXEl%Xmgl2Hub{}dORY+;1D!VQ zjU-#z74F|W!32Mvz*7u>qV8%=N|#snT_JtT_G@@J$HE)+6o4G6zaTOAQIHuHk_w*q zvYs4AL_=V&SpWsetXRT-X~^ApFd1)85)DfnX9?1|6oxAWz@U_4K{eu^}Xg4z^lel&qnE15<{o|5n_)Vg z$GvX*hQlPlBT?b6TVwRwtXs}N(&h{HJ`n%x+0)B0X{v9-=Viruo zXDJQX&CNHF3`d4ZVy^x_Ml!(C4*W5LOpR9>S#D3gJX7ZIT;@BRu#V;p4=ygEgO7bfC1JS zXhTm0U*8Lp>G|DGYWk3guUYx@(=CA2Z4j`e*)@>smA_O~B<2mXjdwM9y(x>&HyK<< zKf!FM8c3giwN>EnQbu0@lkDb6=VW;vX&5_9w93ZdvT1H=pzDnR^CYPpsV1pSfpO)U z&(6!gO6%&1?!!&!0<7oz_hR_&m2KOJU(bQSSnqKC=&_Dj&tW{U?EdQ_b8`^1r*vF>Vh8TtX z863oARZ~ML)w5zF^gcRC62nd-r+%qSUrr=tWtuwmRs<}FoA)>wJ(w3J$SZh;4qsjnIx@O5|bsv1`DIp0rhM9A%hk50K0uW;{X5v literal 0 HcmV?d00001 diff --git a/key_components_zsa.svg b/key_components_zsa.svg new file mode 100644 index 000000000..217acc635 --- /dev/null +++ b/key_components_zsa.svg @@ -0,0 +1,270 @@ + + + +image/svg+xmlskissIssuance validating keyIssuance master keyZSA Key ComponentsiskikIssuance authorizing key diff --git a/zip-0227.html b/zip-0227.html index d379c772b..36144e55c 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -123,6 +123,11 @@

    \(\mathsf{ik} := \mathsf{IssueAuthSig}.\mathsf{DerivePublic}(\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 7. 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.

    +

    The derivation of these keys are shown in the following diagram:

    +
    + +
    Diagram of Issuance Key Components for the ZSA Protocol
    +

    Asset Identifier

    For every new Asset, there must be a new and unique Asset Identifier. We define this to be a globally unique pair diff --git a/zip-0227.rst b/zip-0227.rst index 1199179e0..ea82a2745 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -117,6 +117,16 @@ The issuance authorizing key and issuance validating key are derived from the is 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 [#zip-0032]_. 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. +The derivation of these keys are shown in the following diagram: + +.. figure:: key_components_zsa.png + :width: 450px + :align: center + :figclass: align-center + + Diagram of Issuance Key Components for the ZSA Protocol + + Asset Identifier ---------------- @@ -197,7 +207,7 @@ The issuer program performs the following operations For all actions `IssueAction`: - encode :math:`\mathsf{asset\_desc}` as 512 byte-string. -- compute :math:`\mathsf{AssetDigest} := \mathsf{BLAKE2b\text{-}512}(\mathsf{EncodeAssetId}(\mathsf{ik}, \mathsf{asset\_desc}))` +- compute :math:`\mathsf{AssetDigest} := \mathsf{BLAKE2b\text{-}256}(\mathsf{EncodeAssetId}(\mathsf{ik}, \mathsf{asset\_desc}))` - compute :math:`\mathsf{AssetBase^{Protocol}} := \mathsf{ZSAValueBase^{Protocol}}(\mathsf{AssetDigest})` - set the ``finalize`` boolean as desired (if more more issuance actions are to be created for this Asset Identifier, set ``finalize = 0``, otherwise set ``finalize = 1``) - For each recipient :math:`i`: From ad11363b23bcb54418c92b0185c954e447ed1e80 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Mon, 13 Feb 2023 16:18:21 +0530 Subject: [PATCH 073/101] renaming to bring in line with other zip images --- ...nents_zsa.png => zip-0227-key-components-zsa.png | Bin ...nents_zsa.svg => zip-0227-key-components-zsa.svg | 0 zip-0227.html | 4 ++-- zip-0227.rst | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename key_components_zsa.png => zip-0227-key-components-zsa.png (100%) rename key_components_zsa.svg => zip-0227-key-components-zsa.svg (100%) diff --git a/key_components_zsa.png b/zip-0227-key-components-zsa.png similarity index 100% rename from key_components_zsa.png rename to zip-0227-key-components-zsa.png diff --git a/key_components_zsa.svg b/zip-0227-key-components-zsa.svg similarity index 100% rename from key_components_zsa.svg rename to zip-0227-key-components-zsa.svg diff --git a/zip-0227.html b/zip-0227.html index 36144e55c..44f419f1c 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -125,7 +125,7 @@

    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 7. 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.

    The derivation of these keys are shown in the following diagram:

    - +
    Diagram of Issuance Key Components for the ZSA Protocol
    @@ -291,7 +291,7 @@ \(\mathsf{asset\_desc}\) as 512 byte-string.
  • compute - \(\mathsf{AssetDigest} := \mathsf{BLAKE2b\text{-}512}(\mathsf{EncodeAssetId}(\mathsf{ik}, \mathsf{asset\_desc}))\) + \(\mathsf{AssetDigest} := \mathsf{BLAKE2b\text{-}256}(\mathsf{EncodeAssetId}(\mathsf{ik}, \mathsf{asset\_desc}))\)
  • compute \(\mathsf{AssetBase^{Protocol}} := \mathsf{ZSAValueBase^{Protocol}}(\mathsf{AssetDigest})\) diff --git a/zip-0227.rst b/zip-0227.rst index ea82a2745..f45310628 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -119,7 +119,7 @@ This allows the issuer to use the same wallet it usually uses to transfer Assets The derivation of these keys are shown in the following diagram: -.. figure:: key_components_zsa.png +.. figure:: zip-0227-key-components-zsa.png :width: 450px :align: center :figclass: align-center From 82325cfbc7eda247e5b8ca1da70adb1f8a860d50 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Mon, 13 Feb 2023 19:47:30 +0530 Subject: [PATCH 074/101] adding diagram for asset identifier etc relations --- zip-0227-asset-identifier-relation.png | Bin 0 -> 44943 bytes zip-0227-asset-identifier-relation.svg | 293 +++++++++++++++++++++++++ zip-0227.html | 5 + zip-0227.rst | 10 + 4 files changed, 308 insertions(+) create mode 100644 zip-0227-asset-identifier-relation.png create mode 100644 zip-0227-asset-identifier-relation.svg diff --git a/zip-0227-asset-identifier-relation.png b/zip-0227-asset-identifier-relation.png new file mode 100644 index 0000000000000000000000000000000000000000..d073f7aa80a0ddecd60084dc28a7502c111470b5 GIT binary patch literal 44943 zcmeFY^;=Va+y^{GQQ-?1AR(bhNIU5+0Y^$VsB?68qavcTBSs_5Na+R@Vc^ISqe01S zgv6MPdJgyV-2cGy^UZag3$}~xoPEyw^M1c-pPuV#&`_~Zfj}S{$g`&gAP^-A1iEzN zIwkN-ANLUv_;thMnYlLzbg$~-xD;#c{SSDO*+V*!EggCI|pjRLYZ=luidCuVzhj|<^fZmV2>&x28MH%Pvn$ocHnQ$DIk z(G1j7hYL1p&%-2KuD>(l^P|VT6H_ibSde{xaOK(B>BCL9P6)S%|PXAsX+Sawa@ z&5Is%_#_oJZ5=WDq?aD<6H$nV{}?_;@*oR0#3F(r$vzesU5F)@tL(XbCCoh7rGgqH z91ZSOHK2ira~m7u2|>+;d+>K$fwQJ;pr!UYcs|#bK0bJ8aQ(bZAHx$v*AJXR>8*xT zYE&$E0nVc3B!o;U|jsg|XE)v4T8cvB&&t_FI8 z_OQa(%AB8#)m8`{re3tnC8ztWXo}vnOs@HdIAKUnt+XDNL8OX`TeH+7Plf6)(KxZI zEBfD2KRROT_w%nmd3gAR`5>MUNOWwR@oTHBMs}IPsh>YLh3mM4lEiE<^ypg7{X#R) zGZd4di2(=XG(|@AKhX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%PJh(Fo2Ro!olq-DlohUYvidtQDW#jCY1t2uM_E=TiNgaavQJxQ->jM@aQl+fv zYc>QRr|>n^tg298@x$}%nMw$2#}Y+n&$YS7p`|2^5&*8ZjPUvEuZl?7AkII2e^G~C z96YkXf5y835q}2otLJfb;8C-fyrKtHiw6;egHhLxPQ*I5dGOT_lJd`c3B(Dwe}DWr zhs+WQ-eL_^JmgjT&mUuV#&_oa%hfjV2DZXQeNN#`e+~$p{6i;H_roD~8o8o*DDU^} zmKUv9fqqJbexW~j$yUszsHwyJ<_S$AK$Ci2Tc{ATiY_}!&5 ziH+LJEy_cb4&R^Zj9k(iY~ zJB*#@|J(qy!X8U`C?Nlz2LCn7!xIkqzZc4M|GoI{7_fo=I|l#1j{%OQ|1?sG2*_da PfEQR%{Z++Fi;w>Um{*4{ literal 0 HcmV?d00001 diff --git a/zip-0227-asset-identifier-relation.svg b/zip-0227-asset-identifier-relation.svg new file mode 100644 index 000000000..de18d9914 --- /dev/null +++ b/zip-0227-asset-identifier-relation.svg @@ -0,0 +1,293 @@ + + + +image/svg+xmlAssetDigestAssetIdAssetBaseAssetIdProtocolAssetIdAsset Digest diff --git a/zip-0227.html b/zip-0227.html index 44f419f1c..976cf9d31 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -169,6 +169,11 @@ where \(\mathsf{GroupHash}^\mathbb{P}\) is defined as in 10.

    +

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

    +
    + +
    Diagram relating the Asset Identifer, Asset Digest, and Asset Base in the ZSA Protocol
    +
  • Global Issuance State

    Issuance requires the following additions to the global state:

    diff --git a/zip-0227.rst b/zip-0227.rst index f45310628..b9cc251b4 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -151,6 +151,16 @@ where In the case of Orchard, we define :math:`\mathsf{ZSAValueBase^{Orchard}}(\mathsf{asset\_id}) := \mathsf{GroupHash}^\mathbb{P}(\texttt{"z.cash:OrchardZSA"}, \mathsf{asset\_id})` where :math:`\mathsf{GroupHash}^\mathbb{P}` is defined as in [#protocol-concretegrouphashpallasandvesta]_. +The relations between the Asset Identifier, Asset Digest, and Asset Base are shown in the following diagram: + +.. figure:: zip-0227-asset-identifier-relation.png + :width: 600px + :align: center + :figclass: align-center + + Diagram relating the Asset Identifer, Asset Digest, and Asset Base in the ZSA Protocol + + Global Issuance State --------------------- From 6c07f7bf8bfb931c85021f210bcdf7751f63a99e Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Tue, 14 Feb 2023 14:51:29 +0530 Subject: [PATCH 075/101] adding note commitment definition and instantiation --- zip-0226.html | 107 +++++++++++++++++++++++++++++++------------------- zip-0226.rst | 31 +++++++++++++-- 2 files changed, 95 insertions(+), 43 deletions(-) diff --git a/zip-0226.html b/zip-0226.html index 740dc0708..4b158ec7f 100644 --- a/zip-0226.html +++ b/zip-0226.html @@ -53,29 +53,29 @@

    Overview

    In order to be able to represent different Assets, we need to define a data field that uniquely represents the Asset in question, which we call the Asset Identifier \(\mathsf{AssetId}\) - . This Asset Identifier is stored in Orchard-based ZSA notes as an Asset Base + . This Asset Identifier maps to an Asset Base \(\mathsf{AssetBase}^{\mathsf{Orchard}}\) - . These terms are formally defined in ZIP 227 5.

    -

    The Asset Identifier (via means of theAsset Digest and Asset Base) will be used to enforce that the balance of an Action Description 8 is preserved across Assets (see the Orchard Binding Signature 9), and by extension the balance of an Orchard transaction. That is, the sum of all the + that is stored in Orchard-based ZSA notes. These terms are formally defined in ZIP 227 5.

    +

    The Asset Identifier (via means of theAsset Digest and Asset Base) will be used to enforce that the balance of an Action Description 8 is preserved across Assets (see the Orchard Binding Signature 10), and by extension the balance of an Orchard transaction. That is, the sum of all the \(\mathsf{value^{net}}\) from each Action Description, computed as \(\mathsf{value^{old}-value^{new}}\) , must be balanced only with respect to the same Asset Identifier. This is specially important since we will allow different Action Descriptions to transfer notes of different Asset Identifiers, where the overall balance is checked without revealing which (or how many distinct) Assets are being transferred.

    -

    As was initially proposed by Jack Grigg and Daira Hopwood 19 20, we propose to make this happen by changing the value base point, +

    As was initially proposed by Jack Grigg and Daira Hopwood 20 21, we propose to make this happen by changing the value base point, \(\mathcal{V}^{\mathsf{Orchard}}\) , in the Homomorphic Pedersen Commitment that derives the value commitment, \(\mathsf{cv^{net}}\) , of the net value in an Orchard Action.

    Because in a single transaction all value commitments are balanced, there must be as many different value base points as there are Asset Identifiers for a given shielded protocol used in a transaction. We propose to make the Asset Base \(\mathsf{AssetBase}^{\mathsf{Orchard}}\) - an auxiliary input to the proof for each Action statement 17, represented already as a point on the Pallas curve. The circuit then should check that the same + an auxiliary input to the proof for each Action statement 18, represented already as a point on the Pallas curve. The circuit then should check that the same \(\mathsf{AssetBase}^{\mathsf{Orchard}}\) - is used in the old note commitment and the new note commitment 14, and as the base point + is used in the old note commitment and the new note commitment 15, and as the base point \(\mathcal{V}^\mathsf{Orchard}\) - in the value commitment 15. This ensures (1) that the input and output notes are of the same + in the value commitment 16. This ensures (1) that the input and output notes are of the same \(\mathsf{AssetBase}^{\mathsf{Orchard}}\) , and (2) that only actions with the same Asset Base will balance out in the Orchard binding signature.

    -

    In order to ensure the security of the transfers, and as we will explain below, we are redefining input dummy notes 16 for Custom Assets, as we need to enforce that the +

    In order to ensure the security of the transfers, and as we will explain below, we are redefining input dummy notes 17 for Custom Assets, as we need to enforce that the \(\mathsf{AssetBase}^{\mathsf{Orchard}}\) of the output note of that split Action is the output of a valid \(\mathsf{ZSAValueBase^{Orchard}}\) @@ -119,23 +119,42 @@

    • \(\mathsf{AssetBase}^{\mathsf{Orchard}} : \mathbb{P*}\) - is the unique element of the Pallas group 11 that identifies each Asset in the Orchard protocol, defined as the Asset Base in ZIP 227 5. The byte representation of the Asset Base is defined as + is the unique element of the Pallas group 12 that identifies each Asset in the Orchard protocol, defined as the Asset Base in ZIP 227 5. The byte representation of the Asset Base is defined as \(\mathsf{asset\_base} : \mathbb{B}^{\mathbb{Y}[32]} := \mathsf{repr}_{\mathbb{P}}(\mathsf{AssetBase}^{\mathsf{Orchard}})\) .
    -

    In this case, the instance of the note commitment scheme, +

    Specifically, we define the note commitment scheme \(\mathsf{NoteCommit^{OrchardZSA}_{rcm}}\) - , will differ from - \(\mathsf{NoteCommit^{Orchard}_{rcm}}\) - in that for Custom Assets, the Asset Base will be added as an input to the commitment computation. As we will see, the nested structure of the Sinsemilla-based commitment 14 allows us to add the Asset Base as a final recursive step, and hence keep a single instance of the Sinsemilla hash function in the circuit for the note commitment verification.

    -

    The commitment output is still indistinguishable from the original Orchard ZEC note commitments, by definition of the Sinsemilla hash function 13. ZSA note commitments will therefore be added to the same Orchard Note Commitment Tree. In essence, we have:

    -
    \(\mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, \mathsf{AssetBase}^{\mathsf{Orchard}})} \in \mathsf{NoteCommit^{Orchard}.Output}\)
    -

    The nullifier is generated in the same manner as in the Orchard protocol 10.

    -

    The ZSA note plaintext also includes the Asset Base in addition to the components in the Orchard note plaintext 7. It consists of

    + as follows:

    +
    \(\mathsf{NoteCommit}^{\mathsf{OrchardZSA}} : \mathsf{NoteCommit}^{\mathsf{Orchard}}.\mathsf{Trapdoor} \times \mathbb{B}^{[l_{\mathbb{P}}]} \times \mathbb{B}^{[l_{\mathbb{P}}]} \times \{0 .. 2^{l_{\mathsf{value}}} - 1\} \times \mathbb{F}_{q_{\mathbb{P}}} \times \mathbb{F}_{q_{\mathbb{P}}} \times \mathbb{P*} \to \mathsf{NoteCommit}^{\mathsf{Orchard}}.\mathsf{Output}\)
    +

    where + \(\mathbb{P}, l_{\mathbb{P}}, q_{\mathbb{P}}\) + are as defined for the Pallas curve 12, and + \(\mathsf{NoteCommit}^{\mathsf{Orchard}}.\mathsf{Trapdoor}, \mathsf{Orchard}.\mathsf{Output}\) + are as defined in the Zcash protocol specification 9. This note commitment scheme is instantiated using the Sinsemilla Commitment 15 as follows:

    +
    \(\begin{align} +\mathsf{NoteCommit^{OrchardZSA}_{rcm}(g_{d}*, pk_{d}*, v, \rho, \psi, \mathsf{AssetBase}^{\mathsf{Orchard}})} +:=\begin{cases} +\mathsf{NoteCommit^{Orchard}_{rcm}(g_{d}*, pk_{d}*, v, \rho, \psi)}, &\text{if } \mathsf{AssetBase}^{\mathsf{Orchard}} = \mathcal{V}^{\mathsf{Orchard}} \\ +\mathsf{SinsemillaCommit}_{\mathsf{rcm}}( \texttt{"z.cash:ZSA-NoteCommit"}, +\mathsf{g_{d}*}\; \| \; \mathsf{pk_{d}*}\; \| \; \mathsf{I2LEBSP_{64}(v)}\; \| \; \mathsf{I2LEBSP}_{l^{\mathsf{Orchard}}_{\mathsf{base}}}(\rho)\; \| \; \mathsf{I2LEBSP}_{l^{\mathsf{Orchard}}_{\mathsf{base}}}(\psi)\; \| \; \mathsf{repr}_{\mathbb{P}}(\mathsf{AssetBase}^{\mathsf{Orchard}})) &\text{otherwise} +\end{cases} +\end{align}\)
    +

    The nullifier is generated in the same manner as in the Orchard protocol 11.

    +

    The ZSA note plaintext also includes the Asset Base in addition to the components in the Orchard note plaintext 7. It consists of

    \((\mathsf{leadByte} : \mathbb{B}^{\mathbb{Y}}, \mathsf{d} : \mathbb{B}^{[l_{\mathsf{d}}]}, \mathsf{v} : \{0 .. 2^{l_{\mathsf{value}}} - 1\}, \mathsf{rseed} : \mathbb{B}^{\mathbb{Y}[32]}, \mathsf{asset\_base} : \mathbb{B}^{\mathbb{Y}[32]}, \mathsf{memo} : \mathbb{B}^{\mathbb{Y}[512]})\)
    +

    Rationale for Note Commitment

    +

    In the ZSA protocol, the instance of the note commitment scheme, + \(\mathsf{NoteCommit^{OrchardZSA}_{rcm}}\) + , differs from the Orchard note commitment + \(\mathsf{NoteCommit^{Orchard}_{rcm}}\) + in that for Custom Assets, the Asset Base will be added as an input to the commitment computation. In the case where the Asset is the ZEC Asset, the commitment is computed identically to the Orchard note commitment, without making use of the ZEC Asset Base as an input. As we will see, the nested structure of the Sinsemilla-based commitment 15 allows us to add the Asset Base as a final recursive step, and hence keep a single instance of the Sinsemilla hash function in the circuit for the note commitment verification.

    +

    The note commitment output is still indistinguishable from the original Orchard ZEC note commitments, by definition of the Sinsemilla hash function 14. ZSA note commitments will therefore be added to the same Orchard Note Commitment Tree. In essence, we have:

    +
    \(\mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, \mathsf{AssetBase}^{\mathsf{Orchard}})} \in \mathsf{NoteCommit^{Orchard}.Output}\)
    +

    Value Commitment

    -

    The Orchard Protocol uses a Homomorphic Pedersen Commitment 15 to perform the value commitment, with fixed base points +

    The Orchard Protocol uses a Homomorphic Pedersen Commitment 16 to perform the value commitment, with fixed base points \(\mathcal{V}^{\mathsf{Orchard}}\) and \(\mathcal{R}^{\mathsf{Orchard}}\) @@ -153,16 +172,16 @@ respectively,

    \(\mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}}\) - is defined in ZIP 227 5, and

    + is defined in ZIP 227 5, and

    \(\mathcal{R}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv", "r")}\) , as in the Orchard protocol.

    We define \(\mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{ZEC}} :=\mathcal{V}^{\mathsf{Orchard}}\) - so that the value commitment for ZEC notes is computed identically to the Orchard protocol deployed in NU5 3.

    + so that the value commitment for ZEC notes is computed identically to the Orchard protocol deployed in NU5 3.

    Value Balance Verification

    -

    In order to verify the balance of the different Assets, the verifier MUST perform exactly the same process as for the Orchard protocol 9.

    +

    In order to verify the balance of the different Assets, the verifier MUST perform exactly the same process as for the Orchard protocol 10.

    For a total of \(n\) Actions in a transfer, the prover MUST still sign the SIGHASH of the transaction using the binding signature key @@ -181,7 +200,7 @@

    Split Notes

    -

    One of the key functionalities in a UTXO-based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This requires a 1-to-many (Orchard) transaction. However, because each Action represents an input and an output, the resulting transaction must have multiple inputs. In order to cope with this today, the Actions that have not been assigned input notes are instead given dummy spend notes 16, which we call split Actions and split notes respectively. Basically, the input note is “faked” inside of the proof in order to hide which Action contains the real spend note.

    +

    One of the key functionalities in a UTXO-based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This requires a 1-to-many (Orchard) transaction. However, because each Action represents an input and an output, the resulting transaction must have multiple inputs. In order to cope with this today, the Actions that have not been assigned input notes are instead given dummy spend notes 17, which we call split Actions and split notes respectively. Basically, the input note is “faked” inside of the proof in order to hide which Action contains the real spend note.

    This, however, brings some issues when it comes to adding multiple Asset Identifiers, as the output note of the split Actions cannot contain any Asset Base, but it must be enforced to be an actual output of a GroupHash computation (in fact we want it to be of the same Asset Base as the original input note, but the binding signature takes care that the proper balancing is performed). If not, then the prover could essentially input a multiple (or linear combination) of an existing Asset Base, with the goal to attack the network by overflowing the ZEC value balance and hence counterfeiting ZEC funds.

    In order to prevent this, we make some modifications to the circuit. Specifically we remove the dummy note functionality for Custom Assets and we enforce that every input note to an ZSA Action must be proven to exist in the set of note commitments in the note commitment tree. We then enforce this real note to be “unspendable” in the sense that its value will be zeroed in split Actions and the nullifier will be randomized, making the note not spendable in the specific Action. Then, the proof itself ensures that the output note is of the same Asset Base as the input note. In the circuit, the split note functionality will be activated by a boolean private input to the proof.

    This creates a chain of induction that ensures that the value base points of all output notes of a transfer are actual outputs of a GroupHash, as they originate in the Issuance protocol which is publicly verified. If this were not done then it would be possible to violate balance, for example by using a value base point derived from those of other Assets.

    @@ -196,7 +215,7 @@

    Circuit Statement

    -

    The advantage of the design described above, with respect to the circuit statement, is that every ZSA Action statement is kept closely similar to the Orchard Action statement 17, except for a few additions that ensure the security of the Asset Identifier system.

    +

    The advantage of the design described above, with respect to the circuit statement, is that every ZSA Action statement is kept closely similar to the Orchard Action statement 18, except for a few additions that ensure the security of the Asset Identifier system.

    Asset Identifier Equality: the following constraints must be added to ensure that the input and output note are of the same \(\mathsf{AssetId}\) :

    @@ -204,12 +223,12 @@
  • The Asset Base, \(\mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}}\) , for the note is witnessed once, as an auxiliary input.
  • -
  • In the Old note commitment integrity constraint in the Orchard Action statement 17, +
  • In the Old note commitment integrity constraint in the Orchard Action statement 18, \(\mathsf{NoteCommit^{Orchard}_{rcm^{old}}(repr_{\mathbb{P}}(g_d^{old}), repr_{\mathbb{P}}(pk_d^{old}), v^{old}, \rho^{old}, \psi^{old})}\) is replaced with \(\mathsf{NoteCommit^{OrchardZSA}_{rcm^{old}}(repr_{\mathbb{P}}(g_d^{old}), repr_{\mathbb{P}}(pk_d^{old}), v^{old}, \rho^{old}, \psi^{old}, \mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}})}\) .
  • -
  • In the New note commitment integrity constraint in the Orchard Action statement 17, +
  • In the New note commitment integrity constraint in the Orchard Action statement 18, \(\mathsf{NoteCommit^{Orchard}_{rcm^{new}}(repr_{\mathbb{P}}(g_d^{new}), repr_{\mathbb{P}}(pk_d^{new}), v^{new}, \rho^{new}, \psi^{new})}\) is replaced with \(\mathsf{NoteCommit^{OrchardZSA}_{rcm^{new}}(repr_{\mathbb{P}}(g_d^{new}), repr_{\mathbb{P}}(pk_d^{new}), v^{new}, \rho^{new}, \psi^{new}, \mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}})}\) @@ -360,7 +379,7 @@

    Note: Even if this mechanism allows having transparent ↔ shielded Asset transfers in theory, the transparent protocol will not be changed with this ZIP to adapt to a multiple Asset structure. This means that unless future consensus rules changes do allow it, unshielding will not be possible for Custom Assets.

  • ZSA Transaction Structure

    -

    The transaction format is similar to the version 5 transaction format described in the Zcash specification 18, with the following additions to the Orchard bundle:

    +

    The transaction format is similar to the version 5 transaction format described in the Zcash specification 19, with the following additions to the Orchard bundle:

    @@ -391,7 +410,7 @@

    Other Considerations

    Transaction Fees

    -

    The fee mechanism for the upgrades proposed in this ZIP will follow the mechanism described in ZIP 317 for the ZSA protocol upgrade 21.

    +

    The fee mechanism for the upgrades proposed in this ZIP will follow the mechanism described in ZIP 317 for the ZSA protocol upgrade 22.

    Security and Privacy

      @@ -485,10 +504,18 @@
    - +
    + + + +
    9Zcash Protocol Specification, Version 2022.3.8. Section 4.1.8: Commitment
    + + + + @@ -496,7 +523,7 @@
    10 Zcash Protocol Specification, Version 2022.3.8. Section 4.14: Balance and Binding Signature (Orchard)
    - + @@ -504,7 +531,7 @@
    1011 Zcash Protocol Specification, Version 2022.3.8. Section 4.16: Note Commitments and Nullifiers
    - + @@ -512,7 +539,7 @@
    1112 Zcash Protocol Specification, Version 2022.3.8. Section 5.4.9.6: Pallas and Vesta
    - + @@ -520,7 +547,7 @@
    1213 Pallas/Vesta supporting evidence
    - + @@ -528,7 +555,7 @@
    1314 Zcash Protocol Specification, Version 2022.3.8. Section 5.4.1.9: Sinsemilla hash function
    - + @@ -536,7 +563,7 @@
    1415 Zcash Protocol Specification, Version 2022.3.8. Section 5.4.8.4: Sinsemilla commitments
    - + @@ -544,7 +571,7 @@
    1516 Zcash Protocol Specification, Version 2022.3.8. Section 5.4.8.3: Homomorphic Pedersen commitments (Sapling and Orchard)
    - + @@ -552,7 +579,7 @@
    1617 Zcash Protocol Specification, Version 2022.3.8. Section 4.8.3: Dummy Notes (Orchard)
    - + @@ -560,7 +587,7 @@
    1718 Zcash Protocol Specification, Version 2022.3.8. Section 4.17.4: Action Statement (Orchard)
    - + @@ -568,7 +595,7 @@
    1819 Zcash Protocol Specification, Version 2022.3.8. Section 7.1: Transaction Encoding and Consensus (Transaction Version 5)
    - + @@ -576,7 +603,7 @@
    1920 User-Defined Assets and Wrapped Assets
    - + @@ -584,7 +611,7 @@
    2021 Comment on Generalized Value Commitments
    - + diff --git a/zip-0226.rst b/zip-0226.rst index 5884e6667..a197492e6 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -96,11 +96,21 @@ where - :math:`\mathsf{AssetBase}^{\mathsf{Orchard}} : \mathbb{P*}` is the unique element of the Pallas group [#protocol-pallasandvesta]_ that identifies each Asset in the Orchard protocol, defined as the Asset Base in ZIP 227 [#zip-0227]_. The byte representation of the Asset Base is defined as :math:`\mathsf{asset\_base} : \mathbb{B}^{\mathbb{Y}[32]} := \mathsf{repr}_{\mathbb{P}}(\mathsf{AssetBase}^{\mathsf{Orchard}})`. -In this case, the instance of the note commitment scheme, :math:`\mathsf{NoteCommit^{OrchardZSA}_{rcm}}`, will differ from :math:`\mathsf{NoteCommit^{Orchard}_{rcm}}` in that for Custom Assets, the Asset Base will be added as an input to the commitment computation. As we will see, the nested structure of the Sinsemilla-based commitment [#protocol-concretesinsemillacommit]_ allows us to add the Asset Base as a final recursive step, and hence keep a single instance of the Sinsemilla hash function in the circuit for the note commitment verification. +Specifically, we define the note commitment scheme :math:`\mathsf{NoteCommit^{OrchardZSA}_{rcm}}` as follows: -The commitment output is still indistinguishable from the original Orchard ZEC note commitments, by definition of the Sinsemilla hash function [#protocol-concretesinsemillahash]_. ZSA note commitments will therefore be added to the same Orchard Note Commitment Tree. In essence, we have: +.. math:: \mathsf{NoteCommit}^{\mathsf{OrchardZSA}} : \mathsf{NoteCommit}^{\mathsf{Orchard}}.\mathsf{Trapdoor} \times \mathbb{B}^{[l_{\mathbb{P}}]} \times \mathbb{B}^{[l_{\mathbb{P}}]} \times \{0 .. 2^{l_{\mathsf{value}}} - 1\} \times \mathbb{F}_{q_{\mathbb{P}}} \times \mathbb{F}_{q_{\mathbb{P}}} \times \mathbb{P*} \to \mathsf{NoteCommit}^{\mathsf{Orchard}}.\mathsf{Output} -.. math:: \mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, \mathsf{AssetBase}^{\mathsf{Orchard}})} \in \mathsf{NoteCommit^{Orchard}.Output} +where :math:`\mathbb{P}, l_{\mathbb{P}}, q_{\mathbb{P}}` are as defined for the Pallas curve [#protocol-pallasandvesta]_, and :math:`\mathsf{NoteCommit}^{\mathsf{Orchard}}.\mathsf{Trapdoor}, \mathsf{Orchard}.\mathsf{Output}` are as defined in the Zcash protocol specification [#protocol-abstractcommit]_. +This note commitment scheme is instantiated using the Sinsemilla Commitment [#protocol-concretesinsemillacommit]_ as follows: + +.. math:: \begin{align} + \mathsf{NoteCommit^{OrchardZSA}_{rcm}(g_{d}*, pk_{d}*, v, \rho, \psi, \mathsf{AssetBase}^{\mathsf{Orchard}})} + :=\begin{cases} + \mathsf{NoteCommit^{Orchard}_{rcm}(g_{d}*, pk_{d}*, v, \rho, \psi)}, &\text{if } \mathsf{AssetBase}^{\mathsf{Orchard}} = \mathcal{V}^{\mathsf{Orchard}} \\ + \mathsf{SinsemillaCommit}_{\mathsf{rcm}}( \texttt{"z.cash:ZSA-NoteCommit"}, + \mathsf{g_{d}*}\; \| \; \mathsf{pk_{d}*}\; \| \; \mathsf{I2LEBSP_{64}(v)}\; \| \; \mathsf{I2LEBSP}_{l^{\mathsf{Orchard}}_{\mathsf{base}}}(\rho)\; \| \; \mathsf{I2LEBSP}_{l^{\mathsf{Orchard}}_{\mathsf{base}}}(\psi)\; \| \; \mathsf{repr}_{\mathbb{P}}(\mathsf{AssetBase}^{\mathsf{Orchard}})) &\text{otherwise} + \end{cases} + \end{align} The nullifier is generated in the same manner as in the Orchard protocol [#protocol-commitmentsandnullifiers]_. @@ -109,6 +119,20 @@ It consists of .. math:: (\mathsf{leadByte} : \mathbb{B}^{\mathbb{Y}}, \mathsf{d} : \mathbb{B}^{[l_{\mathsf{d}}]}, \mathsf{v} : \{0 .. 2^{l_{\mathsf{value}}} - 1\}, \mathsf{rseed} : \mathbb{B}^{\mathbb{Y}[32]}, \mathsf{asset\_base} : \mathbb{B}^{\mathbb{Y}[32]}, \mathsf{memo} : \mathbb{B}^{\mathbb{Y}[512]}) +Rationale for Note Commitment +''''''''''''''''''''''''''''' + +In the ZSA protocol, the instance of the note commitment scheme, :math:`\mathsf{NoteCommit^{OrchardZSA}_{rcm}}`, differs from the Orchard note commitment :math:`\mathsf{NoteCommit^{Orchard}_{rcm}}` in that for Custom Assets, the Asset Base will be added as an input to the commitment computation. +In the case where the Asset is the ZEC Asset, the commitment is computed identically to the Orchard note commitment, without making use of the ZEC Asset Base as an input. +As we will see, the nested structure of the Sinsemilla-based commitment [#protocol-concretesinsemillacommit]_ allows us to add the Asset Base as a final recursive step, and hence keep a single instance of the Sinsemilla hash function in the circuit for the note commitment verification. + +The note commitment output is still indistinguishable from the original Orchard ZEC note commitments, by definition of the Sinsemilla hash function [#protocol-concretesinsemillahash]_. ZSA note commitments will therefore be added to the same Orchard Note Commitment Tree. In essence, we have: + +.. math:: \mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, \mathsf{AssetBase}^{\mathsf{Orchard}})} \in \mathsf{NoteCommit^{Orchard}.Output} + + + + Value Commitment ---------------- @@ -308,6 +332,7 @@ References .. [#protocol-notes] `Zcash Protocol Specification, Version 2022.3.8. Section 3.2: Notes `_ .. [#protocol-notept] `Zcash Protocol Specification, Version 2022.3.8. Section 5.5: Encodings of Note Plaintexts and Memo Fields `_ .. [#protocol-actions] `Zcash Protocol Specification, Version 2022.3.8. Section 3.7: Action Transfers and their Descriptions `_ +.. [#protocol-abstractcommit] `Zcash Protocol Specification, Version 2022.3.8. Section 4.1.8: Commitment `_ .. [#protocol-binding] `Zcash Protocol Specification, Version 2022.3.8. Section 4.14: Balance and Binding Signature (Orchard) `_ .. [#protocol-commitmentsandnullifiers] `Zcash Protocol Specification, Version 2022.3.8. Section 4.16: Note Commitments and Nullifiers `_ .. [#protocol-pallasandvesta] `Zcash Protocol Specification, Version 2022.3.8. Section 5.4.9.6: Pallas and Vesta `_ From a0808bed20b96600fe81ee83b8ac59b27d2924c0 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Thu, 16 Feb 2023 20:15:49 +0530 Subject: [PATCH 076/101] editing note commitment text for improved readability and more complete definitions --- zip-0226.html | 98 ++++++++++++++++++++++++++++++++------------------- zip-0226.rst | 14 ++++++-- 2 files changed, 73 insertions(+), 39 deletions(-) diff --git a/zip-0226.html b/zip-0226.html index 4b158ec7f..bdd02f56c 100644 --- a/zip-0226.html +++ b/zip-0226.html @@ -61,21 +61,21 @@ from each Action Description, computed as \(\mathsf{value^{old}-value^{new}}\) , must be balanced only with respect to the same Asset Identifier. This is specially important since we will allow different Action Descriptions to transfer notes of different Asset Identifiers, where the overall balance is checked without revealing which (or how many distinct) Assets are being transferred.

    -

    As was initially proposed by Jack Grigg and Daira Hopwood 20 21, we propose to make this happen by changing the value base point, +

    As was initially proposed by Jack Grigg and Daira Hopwood 22 23, we propose to make this happen by changing the value base point, \(\mathcal{V}^{\mathsf{Orchard}}\) , in the Homomorphic Pedersen Commitment that derives the value commitment, \(\mathsf{cv^{net}}\) , of the net value in an Orchard Action.

    Because in a single transaction all value commitments are balanced, there must be as many different value base points as there are Asset Identifiers for a given shielded protocol used in a transaction. We propose to make the Asset Base \(\mathsf{AssetBase}^{\mathsf{Orchard}}\) - an auxiliary input to the proof for each Action statement 18, represented already as a point on the Pallas curve. The circuit then should check that the same + an auxiliary input to the proof for each Action statement 20, represented already as a point on the Pallas curve. The circuit then should check that the same \(\mathsf{AssetBase}^{\mathsf{Orchard}}\) - is used in the old note commitment and the new note commitment 15, and as the base point + is used in the old note commitment and the new note commitment 17, and as the base point \(\mathcal{V}^\mathsf{Orchard}\) - in the value commitment 16. This ensures (1) that the input and output notes are of the same + in the value commitment 18. This ensures (1) that the input and output notes are of the same \(\mathsf{AssetBase}^{\mathsf{Orchard}}\) , and (2) that only actions with the same Asset Base will balance out in the Orchard binding signature.

    -

    In order to ensure the security of the transfers, and as we will explain below, we are redefining input dummy notes 17 for Custom Assets, as we need to enforce that the +

    In order to ensure the security of the transfers, and as we will explain below, we are redefining input dummy notes 19 for Custom Assets, as we need to enforce that the \(\mathsf{AssetBase}^{\mathsf{Orchard}}\) of the output note of that split Action is the output of a valid \(\mathsf{ZSAValueBase^{Orchard}}\) @@ -119,7 +119,7 @@

    • \(\mathsf{AssetBase}^{\mathsf{Orchard}} : \mathbb{P*}\) - is the unique element of the Pallas group 12 that identifies each Asset in the Orchard protocol, defined as the Asset Base in ZIP 227 5. The byte representation of the Asset Base is defined as + is the unique element of the Pallas group 14 that identifies each Asset in the Orchard protocol, defined as the Asset Base in ZIP 227 5. The byte representation of the Asset Base is defined as \(\mathsf{asset\_base} : \mathbb{B}^{\mathbb{Y}[32]} := \mathsf{repr}_{\mathbb{P}}(\mathsf{AssetBase}^{\mathsf{Orchard}})\) .
    @@ -129,32 +129,42 @@
    \(\mathsf{NoteCommit}^{\mathsf{OrchardZSA}} : \mathsf{NoteCommit}^{\mathsf{Orchard}}.\mathsf{Trapdoor} \times \mathbb{B}^{[l_{\mathbb{P}}]} \times \mathbb{B}^{[l_{\mathbb{P}}]} \times \{0 .. 2^{l_{\mathsf{value}}} - 1\} \times \mathbb{F}_{q_{\mathbb{P}}} \times \mathbb{F}_{q_{\mathbb{P}}} \times \mathbb{P*} \to \mathsf{NoteCommit}^{\mathsf{Orchard}}.\mathsf{Output}\)

    where \(\mathbb{P}, l_{\mathbb{P}}, q_{\mathbb{P}}\) - are as defined for the Pallas curve 12, and + are as defined for the Pallas curve 14, and \(\mathsf{NoteCommit}^{\mathsf{Orchard}}.\mathsf{Trapdoor}, \mathsf{Orchard}.\mathsf{Output}\) - are as defined in the Zcash protocol specification 9. This note commitment scheme is instantiated using the Sinsemilla Commitment 15 as follows:

    + are as defined in the Zcash protocol specification 9. This note commitment scheme is instantiated using the Sinsemilla Commitment 17 as follows:

    \(\begin{align} \mathsf{NoteCommit^{OrchardZSA}_{rcm}(g_{d}*, pk_{d}*, v, \rho, \psi, \mathsf{AssetBase}^{\mathsf{Orchard}})} :=\begin{cases} -\mathsf{NoteCommit^{Orchard}_{rcm}(g_{d}*, pk_{d}*, v, \rho, \psi)}, &\text{if } \mathsf{AssetBase}^{\mathsf{Orchard}} = \mathcal{V}^{\mathsf{Orchard}} \\ -\mathsf{SinsemillaCommit}_{\mathsf{rcm}}( \texttt{"z.cash:ZSA-NoteCommit"}, -\mathsf{g_{d}*}\; \| \; \mathsf{pk_{d}*}\; \| \; \mathsf{I2LEBSP_{64}(v)}\; \| \; \mathsf{I2LEBSP}_{l^{\mathsf{Orchard}}_{\mathsf{base}}}(\rho)\; \| \; \mathsf{I2LEBSP}_{l^{\mathsf{Orchard}}_{\mathsf{base}}}(\psi)\; \| \; \mathsf{repr}_{\mathbb{P}}(\mathsf{AssetBase}^{\mathsf{Orchard}})) &\text{otherwise} +\mathsf{NoteCommit^{Orchard}_{rcm}(g_{d}*, pk_{d}*, v, \rho, \psi)}, &\text{... if } \mathsf{AssetBase}^{\mathsf{Orchard}} = \mathcal{V}^{\mathsf{Orchard}} \\ +\mathsf{cm}_{\mathsf{ZSA}} &\text{... otherwise} \end{cases} \end{align}\)
    -

    The nullifier is generated in the same manner as in the Orchard protocol 11.

    -

    The ZSA note plaintext also includes the Asset Base in addition to the components in the Orchard note plaintext 7. It consists of

    +

    where (note that + \(\mathsf{repr}_{\mathbb{P}}\) + is as defined for the Pallas curve 14, + \(l^{\mathsf{Orchard}}_{\mathsf{base}}\) + is as defined in §5.3 13, and + \(\mathsf{I2LEBSP}\) + is as defined in §5.1 12 of the Zcash protocol specification):

    +
    \(\begin{align} +\mathsf{cm}_{\mathsf{ZSA}} &:= \mathsf{SinsemillaCommit}_{\mathsf{rcm}}( \texttt{"z.cash:ZSA-NoteCommit"}, \\ +&\mathsf{g_{d}*}\; \| \; \mathsf{pk_{d}*}\; \| \; \mathsf{I2LEBSP_{64}(v)}\; \| \; \mathsf{I2LEBSP}_{l^{\mathsf{Orchard}}_{\mathsf{base}}}(\rho)\; \| \; \mathsf{I2LEBSP}_{l^{\mathsf{Orchard}}_{\mathsf{base}}}(\psi)\; \| \; \mathsf{repr}_{\mathbb{P}}(\mathsf{AssetBase}^{\mathsf{Orchard}})) +\end{align}\)
    +

    The nullifier is generated in the same manner as in the Orchard protocol 11.

    +

    The ZSA note plaintext also includes the Asset Base in addition to the components in the Orchard note plaintext 7. It consists of

    \((\mathsf{leadByte} : \mathbb{B}^{\mathbb{Y}}, \mathsf{d} : \mathbb{B}^{[l_{\mathsf{d}}]}, \mathsf{v} : \{0 .. 2^{l_{\mathsf{value}}} - 1\}, \mathsf{rseed} : \mathbb{B}^{\mathbb{Y}[32]}, \mathsf{asset\_base} : \mathbb{B}^{\mathbb{Y}[32]}, \mathsf{memo} : \mathbb{B}^{\mathbb{Y}[512]})\)

    Rationale for Note Commitment

    In the ZSA protocol, the instance of the note commitment scheme, \(\mathsf{NoteCommit^{OrchardZSA}_{rcm}}\) , differs from the Orchard note commitment \(\mathsf{NoteCommit^{Orchard}_{rcm}}\) - in that for Custom Assets, the Asset Base will be added as an input to the commitment computation. In the case where the Asset is the ZEC Asset, the commitment is computed identically to the Orchard note commitment, without making use of the ZEC Asset Base as an input. As we will see, the nested structure of the Sinsemilla-based commitment 15 allows us to add the Asset Base as a final recursive step, and hence keep a single instance of the Sinsemilla hash function in the circuit for the note commitment verification.

    -

    The note commitment output is still indistinguishable from the original Orchard ZEC note commitments, by definition of the Sinsemilla hash function 14. ZSA note commitments will therefore be added to the same Orchard Note Commitment Tree. In essence, we have:

    + in that for Custom Assets, the Asset Base will be added as an input to the commitment computation. In the case where the Asset is the ZEC Asset, the commitment is computed identically to the Orchard note commitment, without making use of the ZEC Asset Base as an input. As we will see, the nested structure of the Sinsemilla-based commitment 17 allows us to add the Asset Base as a final recursive step, and hence keep a single instance of the Sinsemilla hash function in the circuit for the note commitment verification.

    +

    The note commitment output is still indistinguishable from the original Orchard ZEC note commitments, by definition of the Sinsemilla hash function 16. ZSA note commitments will therefore be added to the same Orchard Note Commitment Tree. In essence, we have:

    \(\mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, \mathsf{AssetBase}^{\mathsf{Orchard}})} \in \mathsf{NoteCommit^{Orchard}.Output}\)

    Value Commitment

    -

    The Orchard Protocol uses a Homomorphic Pedersen Commitment 16 to perform the value commitment, with fixed base points +

    The Orchard Protocol uses a Homomorphic Pedersen Commitment 18 to perform the value commitment, with fixed base points \(\mathcal{V}^{\mathsf{Orchard}}\) and \(\mathcal{R}^{\mathsf{Orchard}}\) @@ -172,16 +182,16 @@ respectively,

    \(\mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}}\) - is defined in ZIP 227 5, and

    + is defined in ZIP 227 5, and

    \(\mathcal{R}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv", "r")}\) , as in the Orchard protocol.

    We define \(\mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{ZEC}} :=\mathcal{V}^{\mathsf{Orchard}}\) - so that the value commitment for ZEC notes is computed identically to the Orchard protocol deployed in NU5 3.

    + so that the value commitment for ZEC notes is computed identically to the Orchard protocol deployed in NU5 3.

    Value Balance Verification

    -

    In order to verify the balance of the different Assets, the verifier MUST perform exactly the same process as for the Orchard protocol 10.

    +

    In order to verify the balance of the different Assets, the verifier MUST perform exactly the same process as for the Orchard protocol 10.

    For a total of \(n\) Actions in a transfer, the prover MUST still sign the SIGHASH of the transaction using the binding signature key @@ -200,7 +210,7 @@

    Split Notes

    -

    One of the key functionalities in a UTXO-based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This requires a 1-to-many (Orchard) transaction. However, because each Action represents an input and an output, the resulting transaction must have multiple inputs. In order to cope with this today, the Actions that have not been assigned input notes are instead given dummy spend notes 17, which we call split Actions and split notes respectively. Basically, the input note is “faked” inside of the proof in order to hide which Action contains the real spend note.

    +

    One of the key functionalities in a UTXO-based protocol is the fact that input notes are usually split in two (or more) output notes, as in most cases, not all the value in a single note is sent to a single output. This requires a 1-to-many (Orchard) transaction. However, because each Action represents an input and an output, the resulting transaction must have multiple inputs. In order to cope with this today, the Actions that have not been assigned input notes are instead given dummy spend notes 19, which we call split Actions and split notes respectively. Basically, the input note is “faked” inside of the proof in order to hide which Action contains the real spend note.

    This, however, brings some issues when it comes to adding multiple Asset Identifiers, as the output note of the split Actions cannot contain any Asset Base, but it must be enforced to be an actual output of a GroupHash computation (in fact we want it to be of the same Asset Base as the original input note, but the binding signature takes care that the proper balancing is performed). If not, then the prover could essentially input a multiple (or linear combination) of an existing Asset Base, with the goal to attack the network by overflowing the ZEC value balance and hence counterfeiting ZEC funds.

    In order to prevent this, we make some modifications to the circuit. Specifically we remove the dummy note functionality for Custom Assets and we enforce that every input note to an ZSA Action must be proven to exist in the set of note commitments in the note commitment tree. We then enforce this real note to be “unspendable” in the sense that its value will be zeroed in split Actions and the nullifier will be randomized, making the note not spendable in the specific Action. Then, the proof itself ensures that the output note is of the same Asset Base as the input note. In the circuit, the split note functionality will be activated by a boolean private input to the proof.

    This creates a chain of induction that ensures that the value base points of all output notes of a transfer are actual outputs of a GroupHash, as they originate in the Issuance protocol which is publicly verified. If this were not done then it would be possible to violate balance, for example by using a value base point derived from those of other Assets.

    @@ -215,7 +225,7 @@

    Circuit Statement

    -

    The advantage of the design described above, with respect to the circuit statement, is that every ZSA Action statement is kept closely similar to the Orchard Action statement 18, except for a few additions that ensure the security of the Asset Identifier system.

    +

    The advantage of the design described above, with respect to the circuit statement, is that every ZSA Action statement is kept closely similar to the Orchard Action statement 20, except for a few additions that ensure the security of the Asset Identifier system.

    Asset Identifier Equality: the following constraints must be added to ensure that the input and output note are of the same \(\mathsf{AssetId}\) :

    @@ -223,12 +233,12 @@
  • The Asset Base, \(\mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}}\) , for the note is witnessed once, as an auxiliary input.
  • -
  • In the Old note commitment integrity constraint in the Orchard Action statement 18, +
  • In the Old note commitment integrity constraint in the Orchard Action statement 20, \(\mathsf{NoteCommit^{Orchard}_{rcm^{old}}(repr_{\mathbb{P}}(g_d^{old}), repr_{\mathbb{P}}(pk_d^{old}), v^{old}, \rho^{old}, \psi^{old})}\) is replaced with \(\mathsf{NoteCommit^{OrchardZSA}_{rcm^{old}}(repr_{\mathbb{P}}(g_d^{old}), repr_{\mathbb{P}}(pk_d^{old}), v^{old}, \rho^{old}, \psi^{old}, \mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}})}\) .
  • -
  • In the New note commitment integrity constraint in the Orchard Action statement 18, +
  • In the New note commitment integrity constraint in the Orchard Action statement 20, \(\mathsf{NoteCommit^{Orchard}_{rcm^{new}}(repr_{\mathbb{P}}(g_d^{new}), repr_{\mathbb{P}}(pk_d^{new}), v^{new}, \rho^{new}, \psi^{new})}\) is replaced with \(\mathsf{NoteCommit^{OrchardZSA}_{rcm^{new}}(repr_{\mathbb{P}}(g_d^{new}), repr_{\mathbb{P}}(pk_d^{new}), v^{new}, \rho^{new}, \psi^{new}, \mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}})}\) @@ -379,7 +389,7 @@

    Note: Even if this mechanism allows having transparent ↔ shielded Asset transfers in theory, the transparent protocol will not be changed with this ZIP to adapt to a multiple Asset structure. This means that unless future consensus rules changes do allow it, unshielding will not be possible for Custom Assets.

  • ZSA Transaction Structure

    -

    The transaction format is similar to the version 5 transaction format described in the Zcash specification 19, with the following additions to the Orchard bundle:

    +

    The transaction format is similar to the version 5 transaction format described in the Zcash specification 21, with the following additions to the Orchard bundle:

    2122 ZIP 317: Proportional Transfer Fee Mechanism - Pull Request #667 for ZSA Protocol ZIPs
    @@ -410,7 +420,7 @@

    Other Considerations

    Transaction Fees

    -

    The fee mechanism for the upgrades proposed in this ZIP will follow the mechanism described in ZIP 317 for the ZSA protocol upgrade 22.

    +

    The fee mechanism for the upgrades proposed in this ZIP will follow the mechanism described in ZIP 317 for the ZSA protocol upgrade 24.

    Security and Privacy

      @@ -528,10 +538,26 @@
    - +
    + + + +
    12Zcash Protocol Specification, Version 2022.3.8. Section 5.1: Integers, Bit Sequences, and Endianness
    + + + + + + + +
    13Zcash Protocol Specification, Version 2022.3.8. Section 5.3: Constants
    + + + + @@ -539,7 +565,7 @@
    14 Zcash Protocol Specification, Version 2022.3.8. Section 5.4.9.6: Pallas and Vesta
    - + @@ -547,7 +573,7 @@
    1315 Pallas/Vesta supporting evidence
    - + @@ -555,7 +581,7 @@
    1416 Zcash Protocol Specification, Version 2022.3.8. Section 5.4.1.9: Sinsemilla hash function
    - + @@ -563,7 +589,7 @@
    1517 Zcash Protocol Specification, Version 2022.3.8. Section 5.4.8.4: Sinsemilla commitments
    - + @@ -571,7 +597,7 @@
    1618 Zcash Protocol Specification, Version 2022.3.8. Section 5.4.8.3: Homomorphic Pedersen commitments (Sapling and Orchard)
    - + @@ -579,7 +605,7 @@
    1719 Zcash Protocol Specification, Version 2022.3.8. Section 4.8.3: Dummy Notes (Orchard)
    - + @@ -587,7 +613,7 @@
    1820 Zcash Protocol Specification, Version 2022.3.8. Section 4.17.4: Action Statement (Orchard)
    - + @@ -595,7 +621,7 @@
    1921 Zcash Protocol Specification, Version 2022.3.8. Section 7.1: Transaction Encoding and Consensus (Transaction Version 5)
    - + @@ -603,7 +629,7 @@
    2022 User-Defined Assets and Wrapped Assets
    - + @@ -611,7 +637,7 @@
    2123 Comment on Generalized Value Commitments
    - + diff --git a/zip-0226.rst b/zip-0226.rst index a197492e6..942918377 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -106,12 +106,18 @@ This note commitment scheme is instantiated using the Sinsemilla Commitment [#pr .. math:: \begin{align} \mathsf{NoteCommit^{OrchardZSA}_{rcm}(g_{d}*, pk_{d}*, v, \rho, \psi, \mathsf{AssetBase}^{\mathsf{Orchard}})} :=\begin{cases} - \mathsf{NoteCommit^{Orchard}_{rcm}(g_{d}*, pk_{d}*, v, \rho, \psi)}, &\text{if } \mathsf{AssetBase}^{\mathsf{Orchard}} = \mathcal{V}^{\mathsf{Orchard}} \\ - \mathsf{SinsemillaCommit}_{\mathsf{rcm}}( \texttt{"z.cash:ZSA-NoteCommit"}, - \mathsf{g_{d}*}\; \| \; \mathsf{pk_{d}*}\; \| \; \mathsf{I2LEBSP_{64}(v)}\; \| \; \mathsf{I2LEBSP}_{l^{\mathsf{Orchard}}_{\mathsf{base}}}(\rho)\; \| \; \mathsf{I2LEBSP}_{l^{\mathsf{Orchard}}_{\mathsf{base}}}(\psi)\; \| \; \mathsf{repr}_{\mathbb{P}}(\mathsf{AssetBase}^{\mathsf{Orchard}})) &\text{otherwise} + \mathsf{NoteCommit^{Orchard}_{rcm}(g_{d}*, pk_{d}*, v, \rho, \psi)}, &\text{... if } \mathsf{AssetBase}^{\mathsf{Orchard}} = \mathcal{V}^{\mathsf{Orchard}} \\ + \mathsf{cm}_{\mathsf{ZSA}} &\text{... otherwise} \end{cases} \end{align} +where (note that :math:`\mathsf{repr}_{\mathbb{P}}` is as defined for the Pallas curve [#protocol-pallasandvesta]_, :math:`l^{\mathsf{Orchard}}_{\mathsf{base}}` is as defined in §5.3 [#protocol-constants]_, and :math:`\mathsf{I2LEBSP}` is as defined in §5.1 [#protocol-endian]_ of the Zcash protocol specification): + +.. math:: \begin{align} + \mathsf{cm}_{\mathsf{ZSA}} &:= \mathsf{SinsemillaCommit}_{\mathsf{rcm}}( \texttt{"z.cash:ZSA-NoteCommit"}, \\ + &\mathsf{g_{d}*}\; \| \; \mathsf{pk_{d}*}\; \| \; \mathsf{I2LEBSP_{64}(v)}\; \| \; \mathsf{I2LEBSP}_{l^{\mathsf{Orchard}}_{\mathsf{base}}}(\rho)\; \| \; \mathsf{I2LEBSP}_{l^{\mathsf{Orchard}}_{\mathsf{base}}}(\psi)\; \| \; \mathsf{repr}_{\mathbb{P}}(\mathsf{AssetBase}^{\mathsf{Orchard}})) + \end{align} + The nullifier is generated in the same manner as in the Orchard protocol [#protocol-commitmentsandnullifiers]_. The ZSA note plaintext also includes the Asset Base in addition to the components in the Orchard note plaintext [#protocol-notept]_. @@ -335,6 +341,8 @@ References .. [#protocol-abstractcommit] `Zcash Protocol Specification, Version 2022.3.8. Section 4.1.8: Commitment `_ .. [#protocol-binding] `Zcash Protocol Specification, Version 2022.3.8. Section 4.14: Balance and Binding Signature (Orchard) `_ .. [#protocol-commitmentsandnullifiers] `Zcash Protocol Specification, Version 2022.3.8. Section 4.16: Note Commitments and Nullifiers `_ +.. [#protocol-endian] `Zcash Protocol Specification, Version 2022.3.8. Section 5.1: Integers, Bit Sequences, and Endianness `_ +.. [#protocol-constants] `Zcash Protocol Specification, Version 2022.3.8. Section 5.3: Constants `_ .. [#protocol-pallasandvesta] `Zcash Protocol Specification, Version 2022.3.8. Section 5.4.9.6: Pallas and Vesta `_ .. [#pasta-evidence] `Pallas/Vesta supporting evidence `_ .. [#protocol-concretesinsemillahash] `Zcash Protocol Specification, Version 2022.3.8. Section 5.4.1.9: Sinsemilla hash function `_ From 94c407df5ec5c72b232ab38c19c58004e2c95223 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Thu, 16 Feb 2023 22:35:07 +0530 Subject: [PATCH 077/101] incorporating comment from PR#628 --- zip-0226.html | 2 +- zip-0226.rst | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/zip-0226.html b/zip-0226.html index bdd02f56c..898b9fcdc 100644 --- a/zip-0226.html +++ b/zip-0226.html @@ -324,7 +324,7 @@

    Enabling Backwards Compatibility with ZEC Notes: the following constraints must be added to enable backwards compatibility with Orchard ZEC notes.

    -

    The old note commitment is computed using a “rolling-aggregate” Sinsemilla commitment. This means that the commitment is computed by adding new chunks or windows to the accumulated value. This method will be used in order to maintain a single commitment instance for the old note commitment, that will be used both for Orchard ZEC notes and for ZSA notes. The original Orchard ZEC notes will be conserved and not actually be converted into ZSA notes, as we will always need to compute them.

    +

    The old note commitment is computed using a “rolling-aggregate” Sinsemilla commitment. This means that the commitment is computed by adding new chunks or windows to the accumulated value. This method will be used in order to maintain a single commitment instance for the old note commitment, that will be used both for Orchard ZEC notes and for ZSA notes. The original Orchard ZEC notes will be conserved and not actually be converted into ZSA notes, as we will always need to compute them. However, new notes will always be ZSA notes with an Asset Base.

    The input note in the old note commitment integrity check must either include an Asset Base (ZSA note) or not (ZEC-Orchard note). If the note is an old note, from before the upgrade, the commitment is computed in the original Orchard fashion. If the note is a new ZSA note, there are two cases:

    • diff --git a/zip-0226.rst b/zip-0226.rst index 942918377..b8d192b8c 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -234,6 +234,7 @@ the input and output note are of the same :math:`\mathsf{AssetId}`: **Enabling Backwards Compatibility with ZEC Notes:** the following constraints must be added to enable backwards compatibility with Orchard ZEC notes. The old note commitment is computed using a “rolling-aggregate” Sinsemilla commitment. This means that the commitment is computed by adding new chunks or windows to the accumulated value. This method will be used in order to maintain a single commitment instance for the old note commitment, that will be used both for Orchard ZEC notes and for ZSA notes. The original Orchard ZEC notes will be conserved and not actually be converted into ZSA notes, as we will always need to compute them. +However, new notes will always be ZSA notes with an Asset Base. The input note in the old note commitment integrity check must either include an Asset Base (ZSA note) or not (ZEC-Orchard note). If the note is an old note, from before the upgrade, the commitment is computed in the original Orchard fashion. If the note is a new ZSA note, there are two cases: From 4f391ea008111e6f9f11ccbfa05052f9e653424b Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Tue, 21 Feb 2023 13:24:01 +0530 Subject: [PATCH 078/101] updating issuance authorizing key derivation --- zip-0227.html | 6 ++++-- zip-0227.rst | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/zip-0227.html b/zip-0227.html index 976cf9d31..778e4d0a7 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -115,7 +115,7 @@ \(\mathsf{sk}_{\mathsf{iss}}\) , as a private signature key:
    -
    \(\mathsf{isk} := \mathsf{ToScalar}^{\mathsf{Orchard}}(︀ \mathsf{PRF}^{\mathsf{expand}}_{\mathsf{sk}_{\mathsf{iss}}} ([\mathsf{0x0a}]))\)
    +
    \(\mathsf{isk} := \mathsf{ToScalar}^{\mathsf{Orchard}}(︀ \mathsf{sk}_{\mathsf{iss}} )\)
    • The issuance validating key is derived from the issuance authorizing key, \(\mathsf{isk}\) @@ -321,7 +321,9 @@ as 32 byte-string
    • sign the SIGHASH of the transaction with the issuance authorizing key, \(\mathsf{isk}\) - , using the RedPallas signature scheme. The signature is then added to the issuance bundle.
    • + , 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 later computed by the validators and added to the NoteCommitmentTree.

    diff --git a/zip-0227.rst b/zip-0227.rst index b9cc251b4..31928bd0c 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -109,7 +109,7 @@ The issuance authorizing key and issuance validating key are derived from the is - The issuance authorizing key is derived from the issuance master key, :math:`\mathsf{sk}_{\mathsf{iss}}`, as a private signature key: -.. math:: \mathsf{isk} := \mathsf{ToScalar}^{\mathsf{Orchard}}(︀ \mathsf{PRF}^{\mathsf{expand}}_{\mathsf{sk}_{\mathsf{iss}}} ([\mathsf{0x0a}])) +.. math:: \mathsf{isk} := \mathsf{ToScalar}^{\mathsf{Orchard}}(︀ \mathsf{sk}_{\mathsf{iss}} ) - The issuance validating key is derived from the issuance authorizing key, :math:`\mathsf{isk}`, as a public verification key: @@ -230,7 +230,7 @@ For the `IssueBundle`: - encode the `vIssueActions` vector - encode the :math:`\mathsf{ik}` as 32 byte-string -- sign the `SIGHASH` of the transaction with the issuance authorizing key, :math:`\mathsf{isk}`, using the RedPallas signature scheme. The signature is then added to the issuance bundle. +- sign the `SIGHASH` of the transaction with the issuance authorizing key, :math:`\mathsf{isk}`, using the :math:`\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 later computed by the validators and added to the `NoteCommitmentTree`. From c4d78d525f1f0075589cf15e0feeff4d0be760b6 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Tue, 21 Feb 2023 13:40:13 +0530 Subject: [PATCH 079/101] reverting back to BLAKE2b-512 for AssetDigest, fixed some typos --- zip-0226.html | 4 ++-- zip-0226.rst | 4 ++-- zip-0227.html | 24 +++++++++++++++--------- zip-0227.rst | 14 +++++++------- 4 files changed, 26 insertions(+), 20 deletions(-) diff --git a/zip-0226.html b/zip-0226.html index 898b9fcdc..bb37cefe9 100644 --- a/zip-0226.html +++ b/zip-0226.html @@ -357,7 +357,7 @@

    Backward Compatibility

    -

    In order to have a "clean" backwards compatibility with the ZEC notes, we have designed the circuit to support both ZEC and ZSA notes. As we specify above, there are three main reasons we can do this: - The input notes with an Asset Base denote the Custom Assets, generating a note commitment that includes the Asset identifer; whereas the notes without an Asset Base denote the ZEC notes from before the protocol upgrade, and generate a note commitment that does not include the Asset Base, in order to maintain the referencability to the Merkle tree - The value commitment is abstracted to allow for the value base-point as a variable private input to the proof - The ZEC-based Actions will still include dummy input notes, whereas the ZSA-based Actions will include split input notes.

    +

    In order to have a "clean" backwards compatibility with the ZEC notes, we have designed the circuit to support both ZEC and ZSA notes. As we specify above, there are three main reasons we can do this: - The input notes with an Asset Base denote the Custom Assets, generating a note commitment that includes the Asset Identifier; whereas the notes without an Asset Base denote the ZEC notes from before the protocol upgrade, and generate a note commitment that does not include the Asset Base, in order to maintain the referencability to the Merkle tree - The value commitment is abstracted to allow for the value base-point as a variable private input to the proof - The ZEC-based Actions will still include dummy input notes, whereas the ZSA-based Actions will include split input notes.

    Burn Mechanism

    @@ -426,7 +426,7 @@
    • Even if the Orchard protocol and ZSA protocol do not share the same anonymity pool (nodes can keep track of the notes that where published with different transaction structures), the migration from one to the other is done automatically and seamlessly. The Orchard bundle will be replaced by the ZSA bundle and all ZEC notes will be fully spendable with the new transaction structure.
    • When including new Assets we would like to maintain the amount and identifiers of Assets private, which is achieved with the design.
    • -
    • We prevent the "roadblock" attack on the Asset Identifer by ensuring the output notes receive an Asset Base that exists on the global state.
    • +
    • We prevent the "roadblock" attack on the Asset Identifier by ensuring the output notes receive an Asset Base that exists on the global state.
    • 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 the use of a petname system or a list of well-known Assets.
      • One proposal for a petname system for the zcashd wallet is the use of an additional configuration file that stores a one-to-one mapping of names to Asset Identifiers. This allows clients to rename the Assets in a way they find useful. Default versions of this file with well-known Assets listed can be made available online as a starting point for clients.
      • diff --git a/zip-0226.rst b/zip-0226.rst index b8d192b8c..3002b231b 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -250,7 +250,7 @@ Backward Compatibility ---------------------- In order to have a "clean" backwards compatibility with the ZEC notes, we have designed the circuit to support both ZEC and ZSA notes. As we specify above, there are three main reasons we can do this: -- The input notes with an Asset Base denote the Custom Assets, generating a note commitment that includes the Asset identifer; whereas the notes without an Asset Base denote the ZEC notes from before the protocol upgrade, and generate a note commitment that does not include the Asset Base, in order to maintain the referencability to the Merkle tree +- The input notes with an Asset Base denote the Custom Assets, generating a note commitment that includes the Asset Identifier; whereas the notes without an Asset Base denote the ZEC notes from before the protocol upgrade, and generate a note commitment that does not include the Asset Base, in order to maintain the referencability to the Merkle tree - The value commitment is abstracted to allow for the value base-point as a variable private input to the proof - The ZEC-based Actions will still include dummy input notes, whereas the ZSA-based Actions will include split input notes. @@ -308,7 +308,7 @@ Security and Privacy - Even if the Orchard protocol and ZSA protocol do not share the same anonymity pool (nodes can keep track of the notes that where published with different transaction structures), the migration from one to the other is done automatically and seamlessly. The Orchard bundle will be replaced by the ZSA bundle and all ZEC notes will be fully spendable with the new transaction structure. - When including new Assets we would like to maintain the amount and identifiers of Assets private, which is achieved with the design. -- We prevent the "roadblock" attack on the Asset Identifer by ensuring the output notes receive an Asset Base that exists on the global state. +- We prevent the "roadblock" attack on the Asset Identifier by ensuring the output notes receive an Asset Base that exists on the global state. - 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 the use of a petname system or a list of well-known Assets. - One proposal for a petname system for the zcashd wallet is the use of an additional configuration file that stores a one-to-one mapping of names to Asset Identifiers. This allows clients to rename the Assets in a way they find useful. Default versions of this file with well-known Assets listed can be made available online as a starting point for clients. diff --git a/zip-0227.html b/zip-0227.html index 778e4d0a7..af6100915 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -59,7 +59,7 @@

        Specification

        As explained, the issuance protocol allows for a single issuance action to be sent to many receivers, by generating as many output notes as distinct recipients. Furthermore, every bundle can contain many issuance actions.

        Overview

        -

        This specification enables only transparent issuance, since as a first step, transparency is important to properly test the applications that will be most used in the Zcash ecosystem, while enabling tracking of supply of Assets. Any user of the block chain can issue new Asset Identifiers, yet only a single issuer (a set of keys) can issue that specific Asset Identifer, as the Asset Identifiers are tied to the issuer keys.

        +

        This specification enables only transparent issuance, since as a first step, transparency is important to properly test the applications that will be most used in the Zcash ecosystem, while enabling tracking of supply of Assets. Any user of the block chain can issue new Asset Identifiers, yet only a single issuer (a set of keys) can issue that specific Asset Identifier, as the Asset Identifiers are tied to the issuer keys.

        The protocol was designed with three main properties in mind:

        • At the time of issuance, the issuer can already allocate all the tokens to the corresponding owners by creating the corresponding (shielded) output notes to the respective addresses. As is implied, the issuance mechanism is itself transparent, but the allocation is totally private.
        • @@ -140,7 +140,7 @@

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

          @@ -154,7 +154,7 @@ be the issuance validating key of the issuer, a public key used to verify the signature on the issuance transaction's SIGHASH.

        Define - \(\mathsf{AssetDigest_{\mathsf{AssetId}}} := \mathsf{BLAKE2b\text{-}256}(\mathsf{EncodeAssetId}(\mathsf{AssetId}))\) + \(\mathsf{AssetDigest_{\mathsf{AssetId}}} := \textsf{BLAKE2b-512}(\mathtt{''ZZSA-AssetDigest''},\; \mathsf{EncodeAssetId}(\mathsf{AssetId}))\) , where

        • @@ -172,7 +172,7 @@

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

          -
          Diagram relating the Asset Identifer, Asset Digest, and Asset Base in the ZSA Protocol
          +
          Diagram relating the Asset Identifier, Asset Digest, and Asset Base in the ZSA Protocol

        Global Issuance State

        @@ -294,13 +294,19 @@
        • encode \(\mathsf{asset\_desc}\) - as 512 byte-string.
        • + as a UTF-8 byte string of size up to 512.
        • compute - \(\mathsf{AssetDigest} := \mathsf{BLAKE2b\text{-}256}(\mathsf{EncodeAssetId}(\mathsf{ik}, \mathsf{asset\_desc}))\) -
        • + \(\mathsf{AssetDigest}\) + from the issuance validating key + \(\mathsf{ik}\) + and + \(\mathsf{asset\_desc}\) + as decribed in the Asset Identifier section.
        • compute - \(\mathsf{AssetBase^{Protocol}} := \mathsf{ZSAValueBase^{Protocol}}(\mathsf{AssetDigest})\) -
        • + \(\mathsf{AssetBase^{Protocol}}\) + from + \(\mathsf{AssetDigest}\) + as decribed in the Asset Identifier section.
        • set the finalize boolean as desired (if more more issuance actions are to be created for this Asset Identifier, set finalize = 0, otherwise set finalize = 1)
        • For each recipient \(i\) diff --git a/zip-0227.rst b/zip-0227.rst index 31928bd0c..0d3a333cf 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -70,7 +70,7 @@ As explained, the issuance protocol allows for a single issuance action to be se Overview -------- -This specification enables only *transparent* issuance, since as a first step, transparency is important to properly test the applications that will be most used in the Zcash ecosystem, while enabling tracking of supply of Assets. Any user of the block chain can issue new Asset Identifiers, yet only a single issuer (a set of keys) can issue that specific Asset Identifer, as the Asset Identifiers are tied to the issuer keys. +This specification enables only *transparent* issuance, since as a first step, transparency is important to properly test the applications that will be most used in the Zcash ecosystem, while enabling tracking of supply of Assets. Any user of the block chain can issue new Asset Identifiers, yet only a single issuer (a set of keys) can issue that specific Asset Identifier, as the Asset Identifiers are tied to the issuer keys. The protocol was designed with three main properties in mind: @@ -132,7 +132,7 @@ Asset Identifier For every new Asset, there must be a new and unique Asset Identifier. We define this to be a globally unique pair :math:`(\mathsf{ik}, \mathsf{asset\_desc})`, where :math:`\mathsf{ik}` is the issuance key and :math:`\mathsf{asset\_desc}` is a byte string. -A given Asset Identifier is used across all Zcash protocols that support ZSAs -- that is, the Orchard-based ZSA protocol and potentially future Zcash shielded protocols. For this Asset Identifier, we derive an Asset Digest, :math:`\mathsf{AssetDigest}`, which is simply is a :math:`\mathsf{BLAKE2b-256}` hash of the Asset Identifier. +A given Asset Identifier is used across all Zcash protocols that support ZSAs -- that is, the Orchard-based ZSA protocol and potentially future Zcash shielded protocols. For this Asset Identifier, we derive an Asset Digest, :math:`\mathsf{AssetDigest}`, which is simply is a :math:`\textsf{BLAKE2b-512}` hash of the Asset Identifier. From the Asset Digest, we derive a specific Asset Base within each such shielded protocol (for example :math:`\mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}}` for the Orchard-based ZSA protocol), using the applicable hash-to-curve algorithm. This Asset Base is included in shielded notes. Let @@ -140,7 +140,7 @@ Let - :math:`\mathsf{asset\_desc}` be the asset description, a UTF-8 encoded string of up to 512 bytes, which includes any information pertaining to the issuance. - :math:`\mathsf{ik}` be the issuance validating key of the issuer, a public key used to verify the signature on the issuance transaction's SIGHASH. -Define :math:`\mathsf{AssetDigest_{\mathsf{AssetId}}} := \mathsf{BLAKE2b\text{-}256}(\mathsf{EncodeAssetId}(\mathsf{AssetId}))`, +Define :math:`\mathsf{AssetDigest_{\mathsf{AssetId}}} := \textsf{BLAKE2b-512}(\mathtt{''ZZSA-AssetDigest''},\; \mathsf{EncodeAssetId}(\mathsf{AssetId}))`, where - :math:`\mathsf{EncodeAssetId}(\mathsf{AssetId}) = \mathsf{EncodeAssetId}(\mathsf{ik}, \mathsf{asset\_desc}) := \mathsf{repr}_{\mathbb{P}}(\mathsf{ik}) || \mathsf{asset\_desc}\!`. @@ -158,7 +158,7 @@ The relations between the Asset Identifier, Asset Digest, and Asset Base are sho :align: center :figclass: align-center - Diagram relating the Asset Identifer, Asset Digest, and Asset Base in the ZSA Protocol + Diagram relating the Asset Identifier, Asset Digest, and Asset Base in the ZSA Protocol Global Issuance State @@ -216,9 +216,9 @@ The issuer program performs the following operations For all actions `IssueAction`: -- encode :math:`\mathsf{asset\_desc}` as 512 byte-string. -- compute :math:`\mathsf{AssetDigest} := \mathsf{BLAKE2b\text{-}256}(\mathsf{EncodeAssetId}(\mathsf{ik}, \mathsf{asset\_desc}))` -- compute :math:`\mathsf{AssetBase^{Protocol}} := \mathsf{ZSAValueBase^{Protocol}}(\mathsf{AssetDigest})` +- encode :math:`\mathsf{asset\_desc}` as a UTF-8 byte string of size up to 512. +- compute :math:`\mathsf{AssetDigest}` from the issuance validating key :math:`\mathsf{ik}` and :math:`\mathsf{asset\_desc}` as decribed in the `Asset Identifier`_ section. +- compute :math:`\mathsf{AssetBase^{Protocol}}` from :math:`\mathsf{AssetDigest}` as decribed in the `Asset Identifier`_ section. - set the ``finalize`` boolean as desired (if more more issuance actions are to be created for this Asset Identifier, set ``finalize = 0``, otherwise set ``finalize = 1``) - For each recipient :math:`i`: From 2c519ffcd772bb481c41f8608b386b97304e183e Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Tue, 21 Feb 2023 14:03:16 +0530 Subject: [PATCH 080/101] adding cross reference for note commitment function definition --- zip-0227.html | 74 +++++++++++++++++++++++++++++++-------------------- zip-0227.rst | 7 ++--- 2 files changed, 49 insertions(+), 32 deletions(-) diff --git a/zip-0227.html b/zip-0227.html index af6100915..c554798a8 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -32,7 +32,7 @@

        Abstract

        -

        ZIP 226 4 and ZIP 227 5 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 5. 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.

        +

        ZIP 226 4 and ZIP 227 6 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 6. 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.

        Motivation

        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.

        @@ -69,12 +69,12 @@

        The issuance mechanism 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. In fact, the protocol described below enables what we hope will be a useful set of applications. The design decision is not to have a chosen name to describe the custom Asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”.

        Issuance Authorization Signature Scheme

        -

        The requirement of cryptographic authorization in order to issue new Assets or change attributes of existing Assets is met by using a signature to prove knowledge of the issuance key used to authorize the issuance of the Asset, similar to what is done with the Spend Authorization Signature 12.

        +

        The requirement of cryptographic authorization in order to issue new Assets or change attributes of existing Assets is met by using a signature to prove knowledge of the issuance key used to authorize the issuance of the Asset, similar to what is done with the Spend Authorization Signature 13.

        We define the issuance authorization signature scheme \(\mathsf{IssueAuthSig}\) similar to the Orchard spend authorization signature scheme, \(\mathsf{SpendAuthSig}^{\mathsf{Orchard}}\) - 13. Specifically, we instantiate + 14. Specifically, we instantiate \(\mathsf{IssueAuthSig}\) as \(\mathsf{RedPallas}\) @@ -82,10 +82,10 @@ \(\mathcal{P}_{\mathbb{G}} = \mathcal{G}^{\mathsf{Issuance}} := \mathsf{GroupHash}^\mathbb{P}(\texttt{"z.cash:ZSA"}, \texttt{"Issuance"})\) where \(\mathsf{GroupHash}^\mathbb{P}\) - is defined as in 10.

        + is defined as in 11.

        Issuance Keys

        -

        The ZSA Protocol adds the following three keys to the key components 9:

        +

        The ZSA Protocol adds the following three keys to the key components 10:

        1. The issuance master key, denoted as \(\mathsf{sk}_{\mathsf{iss}}\) @@ -99,9 +99,9 @@

        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 11. In + , like the Orchard spending key 12. In \(\mathsf{zcashd}\) - , this key is derived in a manner similar to the generation of the Orchard master key in ZIP 32 7, as detailed below:

        + , this key is derived in a manner similar to the generation of the Orchard master key in ZIP 32 8, as detailed below:

        • Let \(S\) @@ -109,7 +109,7 @@ \(\mathsf{sk}_{\mathsf{iss}} := \mathsf{BLAKE2b\text{-}256}(\mathtt{''ZcashIP32Issuance''}, S)\) .
        -

        The issuance authorizing key and issuance validating key are derived from the issuance master key in an analogous manner to the derivation of the Orchard spend authorizing key and Orchard spend validating key from the Orchard spending key 11, as described below.

        +

        The issuance authorizing key and issuance validating key are derived from the issuance master key in an analogous manner to the derivation of the Orchard spend authorizing key and Orchard spend validating key from the Orchard spending key 12, as described below.

        • The issuance authorizing key is derived from the issuance master key, \(\mathsf{sk}_{\mathsf{iss}}\) @@ -122,7 +122,7 @@ , as a public verification key:
        \(\mathsf{ik} := \mathsf{IssueAuthSig}.\mathsf{DerivePublic}(\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 7. 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.

        +

        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 8. 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.

        The derivation of these keys are shown in the following diagram:

        @@ -168,7 +168,7 @@ \(\mathsf{ZSAValueBase^{Orchard}}(\mathsf{asset\_id}) := \mathsf{GroupHash}^\mathbb{P}(\texttt{"z.cash:OrchardZSA"}, \mathsf{asset\_id})\) where \(\mathsf{GroupHash}^\mathbb{P}\) - is defined as in 10.

        + is defined as in 11.

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

        @@ -248,7 +248,7 @@ \(\mathsf{isk}\) , that validates the issuance .
      -

      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 14.

      +

      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 15.

    2224 ZIP 317: Proportional Transfer Fee Mechanism - Pull Request #667 for ZSA Protocol ZIPs
    @@ -387,9 +387,11 @@

    If all of the above checks pass, do the following:

    • For each note, compute the note commitment as - \(cm = \mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, AssetId)}\) - and
    • -
    • add cm to the Merkle tree of note commitments, NoteCommitmentTree.
    • + \(\mathsf{cm} = \mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, AssetId)}\) + as defined in the Note Structure and Commitment section of ZIP 226 5 and +
    • add + \(\mathsf{cm}\) + to the Merkle tree of note commitments, NoteCommitmentTree.
    • If finalize = 1, add \(\mathsf{AssetId}\) to the previously_finalized set in the global state.
    • @@ -414,9 +416,9 @@

      TxId Digest

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

      -
      -

      issuance_txid_digest ├── issueActions └── issuerVerificationKey

      -
      +
      issuance_txid_digest
      +├── issueActions
      +└── issuerVerificationKey

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

      issuance_txid_digest

      A BLAKE2b-256 hash of the following values

      @@ -472,7 +474,7 @@ \(\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 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.

    +

    Bridging Assets 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.

    Other Considerations

    Implementing Zcash Nodes

    @@ -483,7 +485,7 @@ 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 317b 6.

    +

    The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317b 7.

    Future Work

    In future versions of this ZIP, the protocol may also include a "key rotation" mechanism. This would allow an issuer to change the underlying @@ -538,10 +540,24 @@

    - +
    + + + +
    5 +
    +

    System Message: WARNING/2 (zip-0227.rst line 414) zip-226-transfer-and-burn-of-zcash-shielded-assets-1

    +

    Duplicate explicit target name: "zip 226: transfer and burn of zcash shielded assets".

    +
    +

    ZIP 226: Transfer and Burn of Zcash Shielded Assets

    +
    + + + + @@ -549,7 +565,7 @@
    6 ZIP 227: Issuance of Zcash Shielded Assets
    - + @@ -557,7 +573,7 @@
    67 ZIP 317b: ZSA Extension Proportional Fee Mechanism
    - + @@ -565,7 +581,7 @@
    78 ZIP 32: Shielded Hierarchical Deterministic Wallets
    - + @@ -573,7 +589,7 @@
    89 ZIP 316: Unified Addresses and Unified Viewing Keys
    - + @@ -581,7 +597,7 @@
    910 Zcash Protocol Specification, Version 2022.3.8. Section 3.1: Payment Addresses and Keys
    - + @@ -589,7 +605,7 @@
    1011 Zcash Protocol Specification, Version 2022.3.8. Section 5.4.9.8: Group Hash into Pallas and Vesta
    - + @@ -597,7 +613,7 @@
    1112 Zcash Protocol Specification, Version 2022.3.8. Section 4.2.3: Orchard Key Components
    - + @@ -605,7 +621,7 @@
    1213 Zcash Protocol Specification, Version 2022.3.8. Section 4.15: Spend Authorization Signature (Sapling and Orchard)
    - + @@ -613,7 +629,7 @@
    1314 Zcash Protocol Specification, Version 2022.3.8. Section 5.4.7.1: Spend Authorization Signature (Sapling and Orchard)
    - + diff --git a/zip-0227.rst b/zip-0227.rst index 0d3a333cf..36033036f 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -272,8 +272,8 @@ For each `IssueAction` in `IssueBundle`: If all of the above checks pass, do the following: -- For each note, compute the note commitment as :math:`cm = \mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, AssetId)}` and -- add `cm` to the Merkle tree of note commitments, `NoteCommitmentTree`. +- For each note, compute the note commitment as :math:`\mathsf{cm} = \mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, AssetId)}` as defined in the Note Structure and Commitment section of ZIP 226 [#zip-0226-notestructure]_ and +- add :math:`\mathsf{cm}` to the Merkle tree of note commitments, `NoteCommitmentTree`. - If ``finalize = 1``, add :math:`\mathsf{AssetId}` to the ``previously_finalized`` set in the global state. @@ -291,7 +291,7 @@ The following is a list of rationale for different decisions made in the proposa TxId Digest =========== -A new issuance transaction digest algorithm is defined that constructs the identifier for an issuance transaction. Each branch of the tree of hashes will correspond to a specific subset of transaction data. The overall structure of the hash is as follows; each name referenced here will be described in detail below: +A new issuance transaction digest algorithm is defined that constructs the identifier for an issuance transaction. Each branch of the tree of hashes will correspond to a specific subset of transaction data. The overall structure of the hash is as follows; each name referenced here will be described in detail below:: issuance_txid_digest ├── issueActions @@ -417,6 +417,7 @@ References .. [#zip-0200] `ZIP 200: Network Upgrade Mechanism `_ .. [#zip-0224] `ZIP 224: Orchard `_ .. [#zip-0226] `ZIP 226: Transfer and Burn of Zcash Shielded Assets `_ +.. [#zip-0226-notestructure] `ZIP 226: Transfer and Burn of Zcash Shielded Assets `_ .. [#zip-0227] `ZIP 227: Issuance of Zcash Shielded Assets `_ .. [#zip-0317b] `ZIP 317b: ZSA Extension Proportional Fee Mechanism `_ .. [#zip-0032] `ZIP 32: Shielded Hierarchical Deterministic Wallets `_ From 672e7f4661fd0c9afed1c265945ccdeadc94b87f Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Thu, 23 Feb 2023 08:18:19 +0530 Subject: [PATCH 081/101] IssueAuthSig fix to remove key rerendomization --- zip-0227.html | 2 +- zip-0227.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/zip-0227.html b/zip-0227.html index c554798a8..a3a8a34ba 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -78,7 +78,7 @@ \(\mathsf{IssueAuthSig}\) as \(\mathsf{RedPallas}\) - with key re-randomization and with generator + without key re-randomization using generator \(\mathcal{P}_{\mathbb{G}} = \mathcal{G}^{\mathsf{Issuance}} := \mathsf{GroupHash}^\mathbb{P}(\texttt{"z.cash:ZSA"}, \texttt{"Issuance"})\) where \(\mathsf{GroupHash}^\mathbb{P}\) diff --git a/zip-0227.rst b/zip-0227.rst index 36033036f..ccf9328ac 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -86,7 +86,7 @@ Issuance Authorization Signature Scheme The requirement of cryptographic authorization in order to issue new Assets or change attributes of existing Assets is met by using a signature to prove knowledge of the issuance key used to authorize the issuance of the Asset, similar to what is done with the Spend Authorization Signature [#protocol-spendauthsig]_. We define the issuance authorization signature scheme :math:`\mathsf{IssueAuthSig}` similar to the Orchard spend authorization signature scheme, :math:`\mathsf{SpendAuthSig}^{\mathsf{Orchard}}` [#protocol-concretespendauthsig]_. -Specifically, we instantiate :math:`\mathsf{IssueAuthSig}` as :math:`\mathsf{RedPallas}` with key re-randomization and with generator :math:`\mathcal{P}_{\mathbb{G}} = \mathcal{G}^{\mathsf{Issuance}} := \mathsf{GroupHash}^\mathbb{P}(\texttt{"z.cash:ZSA"}, \texttt{"Issuance"})` where :math:`\mathsf{GroupHash}^\mathbb{P}` is defined as in [#protocol-concretegrouphashpallasandvesta]_. +Specifically, we instantiate :math:`\mathsf{IssueAuthSig}` as :math:`\mathsf{RedPallas}` without key re-randomization using generator :math:`\mathcal{P}_{\mathbb{G}} = \mathcal{G}^{\mathsf{Issuance}} := \mathsf{GroupHash}^\mathbb{P}(\texttt{"z.cash:ZSA"}, \texttt{"Issuance"})` where :math:`\mathsf{GroupHash}^\mathbb{P}` is defined as in [#protocol-concretegrouphashpallasandvesta]_. Issuance Keys From d0a75f11d25b1df0a2837c6d03ee75f9943450d1 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Thu, 23 Feb 2023 10:25:40 +0530 Subject: [PATCH 082/101] adding back the leading 0x00 for EncodeAssetId --- zip-0227.html | 2 +- zip-0227.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/zip-0227.html b/zip-0227.html index a3a8a34ba..66262f961 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -158,7 +158,7 @@ , where

    • - \(\mathsf{EncodeAssetId}(\mathsf{AssetId}) = \mathsf{EncodeAssetId}(\mathsf{ik}, \mathsf{asset\_desc}) := \mathsf{repr}_{\mathbb{P}}(\mathsf{ik}) || \mathsf{asset\_desc}\!\) + \(\mathsf{EncodeAssetId}(\mathsf{AssetId}) = \mathsf{EncodeAssetId}(\mathsf{ik}, \mathsf{asset\_desc}) := \mathsf{0x00} || \mathsf{repr}_{\mathbb{P}}(\mathsf{ik}) || \mathsf{asset\_desc}\!\) .

    Define diff --git a/zip-0227.rst b/zip-0227.rst index ccf9328ac..b3c975c2f 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -143,7 +143,7 @@ Let Define :math:`\mathsf{AssetDigest_{\mathsf{AssetId}}} := \textsf{BLAKE2b-512}(\mathtt{''ZZSA-AssetDigest''},\; \mathsf{EncodeAssetId}(\mathsf{AssetId}))`, where -- :math:`\mathsf{EncodeAssetId}(\mathsf{AssetId}) = \mathsf{EncodeAssetId}(\mathsf{ik}, \mathsf{asset\_desc}) := \mathsf{repr}_{\mathbb{P}}(\mathsf{ik}) || \mathsf{asset\_desc}\!`. +- :math:`\mathsf{EncodeAssetId}(\mathsf{AssetId}) = \mathsf{EncodeAssetId}(\mathsf{ik}, \mathsf{asset\_desc}) := \mathsf{0x00} || \mathsf{repr}_{\mathbb{P}}(\mathsf{ik}) || \mathsf{asset\_desc}\!`. Define :math:`\mathsf{AssetBase^{Protocol}_{\mathsf{AssetId}}} := \mathsf{ZSAValueBase^{Protocol}}(\mathsf{AssetDigest}_{\mathsf{AssetId}})`, where From 661565deaef66f93207405887077881b95c00775 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Sun, 26 Feb 2023 10:41:19 +0530 Subject: [PATCH 083/101] minor edits, rearranging for value commitment rationale --- zip-0226.html | 287 +++++++++++++++++++++++++------------------------- zip-0226.rst | 16 ++- 2 files changed, 156 insertions(+), 147 deletions(-) diff --git a/zip-0226.html b/zip-0226.html index bb37cefe9..62efe699f 100644 --- a/zip-0226.html +++ b/zip-0226.html @@ -56,7 +56,7 @@ . This Asset Identifier maps to an Asset Base \(\mathsf{AssetBase}^{\mathsf{Orchard}}\) that is stored in Orchard-based ZSA notes. These terms are formally defined in ZIP 227 5.

    -

    The Asset Identifier (via means of theAsset Digest and Asset Base) will be used to enforce that the balance of an Action Description 8 is preserved across Assets (see the Orchard Binding Signature 10), and by extension the balance of an Orchard transaction. That is, the sum of all the +

    The Asset Identifier (via means of the Asset Digest and Asset Base) will be used to enforce that the balance of an Action Description 8 is preserved across Assets (see the Orchard Binding Signature 10), and by extension the balance of an Orchard transaction. That is, the sum of all the \(\mathsf{value^{net}}\) from each Action Description, computed as \(\mathsf{value^{old}-value^{new}}\) @@ -164,12 +164,7 @@

    Value Commitment

    -

    The Orchard Protocol uses a Homomorphic Pedersen Commitment 18 to perform the value commitment, with fixed base points - \(\mathcal{V}^{\mathsf{Orchard}}\) - and - \(\mathcal{R}^{\mathsf{Orchard}}\) - as the values represent the amount of ZEC being transferred.

    -

    In the case of the ZSA protocol, the value of different Asset Identifiers in a given transaction will be committed using a different value base point. This enables the final balance of the transaction to be securely computed, such that each Asset Identifier is balanced independently, as different Assets are not meant to be mutually fungible. The value commitment then becomes

    +

    In the case of the ZSA protocol, the value of different Asset Identifiers in a given transaction will be committed using a different value base point. The value commitment becomes:

    \(\mathsf{cv^{net}:=ValueCommit^{OrchardZSA}_{rcv}(v^{net}_{AssetId}, \mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}})}:= \mathsf{[v^{net}_{AssetId}]}\mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}} + [\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}}\)

    where \(\mathsf{v^{net}_{AssetId}} = \mathsf{v^{old}_{AssetId} - v^{new}_{AssetId}}\) @@ -182,13 +177,21 @@ respectively,

    \(\mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}}\) - is defined in ZIP 227 5, and

    + is defined in ZIP 227 5, and

    \(\mathcal{R}^{\mathsf{Orchard}}:=\mathsf{GroupHash^{\mathbb{P}}}\texttt{("z.cash:Orchard-cv", "r")}\) , as in the Orchard protocol.

    We define \(\mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{ZEC}} :=\mathcal{V}^{\mathsf{Orchard}}\) - so that the value commitment for ZEC notes is computed identically to the Orchard protocol deployed in NU5 3.

    + so that the value commitment for ZEC notes is computed identically to the Orchard protocol deployed in NU5 3.

    +

    Rationale for Value Commitment

    +

    The Orchard Protocol uses a Homomorphic Pedersen Commitment 18 to perform the value commitment, with fixed base points + \(\mathcal{V}^{\mathsf{Orchard}}\) + and + \(\mathcal{R}^{\mathsf{Orchard}}\) + as the values represent the amount of ZEC being transferred.

    +

    The use of different value base points for different Assets enables the final balance of the transaction to be securely computed, such that each Asset Identifier is balanced independently, which is required as different Assets are not meant to be mutually fungible.

    +

    Value Balance Verification

    In order to verify the balance of the different Assets, the verifier MUST perform exactly the same process as for the Orchard protocol 10.

    @@ -223,139 +226,139 @@

    The specific circuit changes are presented below.

    - -

    Circuit Statement

    -

    The advantage of the design described above, with respect to the circuit statement, is that every ZSA Action statement is kept closely similar to the Orchard Action statement 20, except for a few additions that ensure the security of the Asset Identifier system.

    -

    Asset Identifier Equality: the following constraints must be added to ensure that the input and output note are of the same - \(\mathsf{AssetId}\) - :

    -
      -
    • The Asset Base, - \(\mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}}\) - , for the note is witnessed once, as an auxiliary input.
    • -
    • In the Old note commitment integrity constraint in the Orchard Action statement 20, - \(\mathsf{NoteCommit^{Orchard}_{rcm^{old}}(repr_{\mathbb{P}}(g_d^{old}), repr_{\mathbb{P}}(pk_d^{old}), v^{old}, \rho^{old}, \psi^{old})}\) - is replaced with - \(\mathsf{NoteCommit^{OrchardZSA}_{rcm^{old}}(repr_{\mathbb{P}}(g_d^{old}), repr_{\mathbb{P}}(pk_d^{old}), v^{old}, \rho^{old}, \psi^{old}, \mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}})}\) - .
    • -
    • In the New note commitment integrity constraint in the Orchard Action statement 20, - \(\mathsf{NoteCommit^{Orchard}_{rcm^{new}}(repr_{\mathbb{P}}(g_d^{new}), repr_{\mathbb{P}}(pk_d^{new}), v^{new}, \rho^{new}, \psi^{new})}\) - is replaced with - \(\mathsf{NoteCommit^{OrchardZSA}_{rcm^{new}}(repr_{\mathbb{P}}(g_d^{new}), repr_{\mathbb{P}}(pk_d^{new}), v^{new}, \rho^{new}, \psi^{new}, \mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}})}\) - .
    • -
    -

    Correct Value Commitment: the following constraints must be added to ensure that the value commitment is computed using the witnessed Asset Base, as represented in the notes:

    -
      -
    • The fixed-base multiplication constraints between the value and the value base point of the value commitment, - \(\mathsf{cv}\) - , is replaced with a variable-base multiplication between the two.
    • -
    • The witness to the value base point, as defined in the value base equation is the auxiliary input - \(\mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}}\) - .
    • -
    -

    Enforce Secure Identifier for Split Actions: the following constraints must be added to prevent senders from changing the Asset Base for the output note in a Split Action:

    -
      -
    • -
      -
      The Value Commitment Integrity should be changed
      -
      -
        -
      • Replace the input note value by a generic value, - \(\mathsf{v}'\) - , as - \(\mathsf{cv^{net}} = \mathsf{ValueCommit_rcv^{OrchardZSA}(v’ - v^new, \mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}})}\) -
      • -
      -
      -
      -
    • -
    • -
      -
      Add a boolean split variable as an auxiliary witness. This variable is to be activated split = 1 if the Action in question is a split and split = 0 if the Action is actually spending an input note:
      -
      -
        -
      • If split = 1 then set - \(\mathsf{v}' = 0\) - otherwise - \(\mathsf{v}'=\mathsf{v^{old}}\) - from the auxiliary input.
      • -
      -
      -
      -
    • -
    • -
      -
      The Merkle Path Validity should check the existence of the note commitment as usual (and not like with dummy notes):
      -
      -
        -
      • Check that (path, pos) is a valid Merkle path of depth - \(\mathsf{MerkleDepth^Orchard}\) - , from - \(\mathsf{cm^old}\) - to the anchor - \(\mathsf{rt^Orchard}\) - .
      • -
      -
      -
      -
    • -
    • -
      -
      The Nullifier Integrity will be changed to prevent the identification of notes
      -
      -
        -
      • Replace the - \(\psi_{old}\) - value with a generic - \(\psi'\) - as - \(\mathsf{nf_old = DeriveNullifier_nk}(\rho^\mathsf{old}, \psi', \mathsf{cm^old})\) -
      • -
      • if - \(\mathtt{split} = 0\) - then constrain - \(\psi' = \psi^{old}\) - . (Otherwise - \(\psi'\) - should be sampled randomly.)
      • -
      -
      -
      -
    • -
    -

    Enabling Backwards Compatibility with ZEC Notes: the following constraints must be added to enable backwards compatibility with Orchard ZEC notes.

    -

    The old note commitment is computed using a “rolling-aggregate” Sinsemilla commitment. This means that the commitment is computed by adding new chunks or windows to the accumulated value. This method will be used in order to maintain a single commitment instance for the old note commitment, that will be used both for Orchard ZEC notes and for ZSA notes. The original Orchard ZEC notes will be conserved and not actually be converted into ZSA notes, as we will always need to compute them. However, new notes will always be ZSA notes with an Asset Base.

    -

    The input note in the old note commitment integrity check must either include an Asset Base (ZSA note) or not (ZEC-Orchard note). If the note is an old note, from before the upgrade, the commitment is computed in the original Orchard fashion. If the note is a new ZSA note, there are two cases:

    -
      -
    • -
      -
      If the Asset Base auxiliary input present but set to - \(\mathsf{AssetBase}^{\mathsf{Orchard}}\) - = - \(\mathcal{V}^\mathsf{Orchard}\) -
      -
      -
        -
      • NoteCommitment has a “compatibility” path that computes the note commitment as in plain Orchard (i.e.: without including the Asset Base)
      • -
      • This path also uses the original domain separator for ZEC note commitment
      • -
      -
      -
      -
    • -
    • -
      -
      Else,
      -
      -
        -
      • The note commitment adds the identfier, - \(\mathsf{AssetId}\) - , as a final “chunk” of the Sinsemilla commitment
      • -
      • The note commitment uses a different domain separator for ZSA note commitment
      • -
      -
      -
      -
    • -
    +

    Circuit Statement

    +

    The advantage of the design described above, with respect to the circuit statement, is that every ZSA Action statement is kept closely similar to the Orchard Action statement 20, except for a few additions that ensure the security of the Asset Identifier system.

    +

    Asset Identifier Equality: the following constraints must be added to ensure that the input and output note are of the same + \(\mathsf{AssetId}\) + :

    +
      +
    • The Asset Base, + \(\mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}}\) + , for the note is witnessed once, as an auxiliary input.
    • +
    • In the Old note commitment integrity constraint in the Orchard Action statement 20, + \(\mathsf{NoteCommit^{Orchard}_{rcm^{old}}(repr_{\mathbb{P}}(g_d^{old}), repr_{\mathbb{P}}(pk_d^{old}), v^{old}, \rho^{old}, \psi^{old})}\) + is replaced with + \(\mathsf{NoteCommit^{OrchardZSA}_{rcm^{old}}(repr_{\mathbb{P}}(g_d^{old}), repr_{\mathbb{P}}(pk_d^{old}), v^{old}, \rho^{old}, \psi^{old}, \mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}})}\) + .
    • +
    • In the New note commitment integrity constraint in the Orchard Action statement 20, + \(\mathsf{NoteCommit^{Orchard}_{rcm^{new}}(repr_{\mathbb{P}}(g_d^{new}), repr_{\mathbb{P}}(pk_d^{new}), v^{new}, \rho^{new}, \psi^{new})}\) + is replaced with + \(\mathsf{NoteCommit^{OrchardZSA}_{rcm^{new}}(repr_{\mathbb{P}}(g_d^{new}), repr_{\mathbb{P}}(pk_d^{new}), v^{new}, \rho^{new}, \psi^{new}, \mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}})}\) + .
    • +
    +

    Correct Value Commitment: the following constraints must be added to ensure that the value commitment is computed using the witnessed Asset Base, as represented in the notes:

    +
      +
    • The fixed-base multiplication constraints between the value and the value base point of the value commitment, + \(\mathsf{cv}\) + , is replaced with a variable-base multiplication between the two.
    • +
    • The witness to the value base point, as defined in the value base equation is the auxiliary input + \(\mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}}\) + .
    • +
    +

    Enforce Secure Identifier for Split Actions: the following constraints must be added to prevent senders from changing the Asset Base for the output note in a Split Action:

    +
      +
    • +
      +
      The Value Commitment Integrity should be changed
      +
      +
        +
      • Replace the input note value by a generic value, + \(\mathsf{v}'\) + , as + \(\mathsf{cv^{net}} = \mathsf{ValueCommit_rcv^{OrchardZSA}(v’ - v^new, \mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}})}\) +
      • +
      +
      +
      +
    • +
    • +
      +
      Add a boolean split variable as an auxiliary witness. This variable is to be activated split = 1 if the Action in question is a split and split = 0 if the Action is actually spending an input note:
      +
      +
        +
      • If split = 1 then set + \(\mathsf{v}' = 0\) + otherwise + \(\mathsf{v}'=\mathsf{v^{old}}\) + from the auxiliary input.
      • +
      +
      +
      +
    • +
    • +
      +
      The Merkle Path Validity should check the existence of the note commitment as usual (and not like with dummy notes):
      +
      +
        +
      • Check that (path, pos) is a valid Merkle path of depth + \(\mathsf{MerkleDepth^Orchard}\) + , from + \(\mathsf{cm^old}\) + to the anchor + \(\mathsf{rt^Orchard}\) + .
      • +
      +
      +
      +
    • +
    • +
      +
      The Nullifier Integrity will be changed to prevent the identification of notes
      +
      +
        +
      • Replace the + \(\psi_{old}\) + value with a generic + \(\psi'\) + as + \(\mathsf{nf_old = DeriveNullifier_nk}(\rho^\mathsf{old}, \psi', \mathsf{cm^old})\) +
      • +
      • if + \(\mathtt{split} = 0\) + then constrain + \(\psi' = \psi^{old}\) + . (Otherwise + \(\psi'\) + should be sampled randomly.)
      • +
      +
      +
      +
    • +
    +

    Enabling Backwards Compatibility with ZEC Notes: the following constraints must be added to enable backwards compatibility with Orchard ZEC notes.

    +

    The old note commitment is computed using a “rolling-aggregate” Sinsemilla commitment. This means that the commitment is computed by adding new chunks or windows to the accumulated value. This method will be used in order to maintain a single commitment instance for the old note commitment, that will be used both for Orchard ZEC notes and for ZSA notes. The original Orchard ZEC notes will be conserved and not actually be converted into ZSA notes, as we will always need to compute them. However, new notes will always be ZSA notes with an Asset Base.

    +

    The input note in the old note commitment integrity check must either include an Asset Base (ZSA note) or not (ZEC-Orchard note). If the note is an old note, from before the upgrade, the commitment is computed in the original Orchard fashion. If the note is a new ZSA note, there are two cases:

    +
      +
    • +
      +
      If the Asset Base auxiliary input present but set to + \(\mathsf{AssetBase}^{\mathsf{Orchard}}\) + = + \(\mathcal{V}^\mathsf{Orchard}\) +
      +
      +
        +
      • NoteCommitment has a “compatibility” path that computes the note commitment as in plain Orchard (i.e.: without including the Asset Base)
      • +
      • This path also uses the original domain separator for ZEC note commitment
      • +
      +
      +
      +
    • +
    • +
      +
      Else,
      +
      +
        +
      • The note commitment adds the identfier, + \(\mathsf{AssetId}\) + , as a final “chunk” of the Sinsemilla commitment
      • +
      • The note commitment uses a different domain separator for ZSA note commitment
      • +
      +
      +
      +
    • +
    +

    Backward Compatibility

    In order to have a "clean" backwards compatibility with the ZEC notes, we have designed the circuit to support both ZEC and ZSA notes. As we specify above, there are three main reasons we can do this: - The input notes with an Asset Base denote the Custom Assets, generating a note commitment that includes the Asset Identifier; whereas the notes without an Asset Base denote the ZEC notes from before the protocol upgrade, and generate a note commitment that does not include the Asset Base, in order to maintain the referencability to the Merkle tree - The value commitment is abstracted to allow for the value base-point as a variable private input to the proof - The ZEC-based Actions will still include dummy input notes, whereas the ZSA-based Actions will include split input notes.

    diff --git a/zip-0226.rst b/zip-0226.rst index 3002b231b..e9b36beeb 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -61,7 +61,7 @@ In order to be able to represent different Assets, we need to define a data fiel This Asset Identifier maps to an Asset Base :math:`\mathsf{AssetBase}^{\mathsf{Orchard}}` that is stored in Orchard-based ZSA notes. These terms are formally defined in ZIP 227 [#zip-0227]_. -The Asset Identifier (via means of theAsset Digest and Asset Base) will be used to enforce that the balance of an Action Description [#protocol-actions]_ is preserved across Assets (see the Orchard Binding Signature [#protocol-binding]_), and by extension the balance of an Orchard transaction. That is, the sum of all the :math:`\mathsf{value^{net}}` from each Action Description, computed as :math:`\mathsf{value^{old}-value^{new}}`, must be balanced **only with respect to the same Asset Identifier**. This is specially important since we will allow different Action Descriptions to transfer notes of different Asset Identifiers, where the overall balance is checked without revealing which (or how many distinct) Assets are being transferred. +The Asset Identifier (via means of the Asset Digest and Asset Base) will be used to enforce that the balance of an Action Description [#protocol-actions]_ is preserved across Assets (see the Orchard Binding Signature [#protocol-binding]_), and by extension the balance of an Orchard transaction. That is, the sum of all the :math:`\mathsf{value^{net}}` from each Action Description, computed as :math:`\mathsf{value^{old}-value^{new}}`, must be balanced **only with respect to the same Asset Identifier**. This is specially important since we will allow different Action Descriptions to transfer notes of different Asset Identifiers, where the overall balance is checked without revealing which (or how many distinct) Assets are being transferred. As was initially proposed by Jack Grigg and Daira Hopwood [#initial-zsa-issue]_ [#generalized-value-commitments]_, we propose to make this happen by changing the value base point, :math:`\mathcal{V}^{\mathsf{Orchard}}`, in the Homomorphic Pedersen Commitment that derives the value commitment, :math:`\mathsf{cv^{net}}`, of the *net value* in an Orchard Action. @@ -142,9 +142,7 @@ The note commitment output is still indistinguishable from the original Orchard Value Commitment ---------------- -The Orchard Protocol uses a Homomorphic Pedersen Commitment [#protocol-concretevaluecommit]_ to perform the value commitment, with fixed base points :math:`\mathcal{V}^{\mathsf{Orchard}}` and :math:`\mathcal{R}^{\mathsf{Orchard}}` as the values represent the amount of ZEC being transferred. - -In the case of the ZSA protocol, the value of different Asset Identifiers in a given transaction will be committed using a **different value base point**. This enables the final balance of the transaction to be securely computed, such that each Asset Identifier is balanced independently, as different Assets are not meant to be mutually fungible. The value commitment then becomes +In the case of the ZSA protocol, the value of different Asset Identifiers in a given transaction will be committed using a **different value base point**. The value commitment becomes: .. math:: \mathsf{cv^{net}:=ValueCommit^{OrchardZSA}_{rcv}(v^{net}_{AssetId}, \mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}})}:= \mathsf{[v^{net}_{AssetId}]}\mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{AssetId}} + [\mathsf{rcv}]\mathcal{R}^{\mathsf{Orchard}} @@ -158,6 +156,14 @@ where :math:`\mathsf{v^{net}_{AssetId}} = \mathsf{v^{old}_{AssetId} - v^{new}_{A We define :math:`\mathsf{AssetBase}^{\mathsf{Orchard}}_{\mathsf{ZEC}} :=\mathcal{V}^{\mathsf{Orchard}}` so that the value commitment for ZEC notes is computed identically to the Orchard protocol deployed in NU5 [#zip-0224]_. +Rationale for Value Commitment +'''''''''''''''''''''''''''''' + +The Orchard Protocol uses a Homomorphic Pedersen Commitment [#protocol-concretevaluecommit]_ to perform the value commitment, with fixed base points :math:`\mathcal{V}^{\mathsf{Orchard}}` and :math:`\mathcal{R}^{\mathsf{Orchard}}` as the values represent the amount of ZEC being transferred. + +The use of different value base points for different Assets enables the final balance of the transaction to be securely computed, such that each Asset Identifier is balanced independently, which is required as different Assets are not meant to be mutually fungible. + + Value Balance Verification -------------------------- @@ -203,7 +209,7 @@ Wallets and other clients have a choice to make to ensure the Asset Base is pres The specific circuit changes are presented below. Circuit Statement -================= +----------------- The advantage of the design described above, with respect to the circuit statement, is that every *ZSA Action statement* is kept closely similar to the Orchard Action statement [#protocol-actionstatement]_, except for a few additions that ensure the security of the Asset Identifier system. From ef0f8dff0c2ab222a54eff0a7dd000012124541d Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Tue, 28 Feb 2023 10:31:43 +0530 Subject: [PATCH 084/101] updating ZIP owners --- zip-0226.html | 13 +++++++------ zip-0226.rst | 13 +++++++------ zip-0227.html | 21 ++++++++------------- zip-0227.rst | 15 ++++++++------- 4 files changed, 30 insertions(+), 32 deletions(-) diff --git a/zip-0226.html b/zip-0226.html index 62efe699f..132425350 100644 --- a/zip-0226.html +++ b/zip-0226.html @@ -9,12 +9,13 @@
    ZIP: 226
     Title: Transfer and Burn of Zcash Shielded Assets
    -Owners: Daniel Benarroch <daniel@qed-it.com>
    -        Pablo Kogan <pablo@qed-it.com>
    -        Aurelien Nicolas <aurel@qed-it.com>
    -Credits: Daira Hopwood
    -         Jack Grigg
    -         Vivek Arte
    +Owners: Pablo Kogan <pablo@qed-it.com>
    +        Vivek Arte <vivek@qed-it.com>
    +        Daira Hopwood <daira@electriccoin.co>
    +        Jack Grigg <str4d@electriccoin.co>
    +        Deidre Connolly <deirdre@zfnd.org>
    +Credits: Daniel Benarroch
    +         Aurelien Nicolas
     Status: Draft
     Category: Consensus
     Created: 2022-05-01
    diff --git a/zip-0226.rst b/zip-0226.rst
    index e9b36beeb..b74756a43 100644
    --- a/zip-0226.rst
    +++ b/zip-0226.rst
    @@ -2,12 +2,13 @@
     
       ZIP: 226
       Title: Transfer and Burn of Zcash Shielded Assets
    -  Owners: Daniel Benarroch 
    -          Pablo Kogan 
    -          Aurelien Nicolas 
    -  Credits: Daira Hopwood
    -           Jack Grigg
    -           Vivek Arte
    +  Owners: Pablo Kogan 
    +          Vivek Arte 
    +          Daira Hopwood 
    +          Jack Grigg 
    +          Deidre Connolly 
    +  Credits: Daniel Benarroch
    +           Aurelien Nicolas
       Status: Draft
       Category: Consensus
       Created: 2022-05-01
    diff --git a/zip-0227.html b/zip-0227.html
    index 66262f961..f7566f1e4 100644
    --- a/zip-0227.html
    +++ b/zip-0227.html
    @@ -9,12 +9,13 @@
         
    ZIP: 227
     Title: Issuance of Zcash Shielded Assets
    -Owners: Daniel Benarroch <daniel@qed-it.com>
    -        Pablo Kogan <pablo@qed-it.com>
    -        Aurelien Nicolas <aurel@qed-it.com>
    -Credits: Daira Hopwood
    -         Jack Grigg
    -         Vivek Arte
    +Owners: Pablo Kogan <pablo@qed-it.com>
    +        Vivek Arte <vivek@qed-it.com>
    +        Daira Hopwood <daira@electriccoin.co>
    +        Jack Grigg <str4d@electriccoin.co>
    +        Deidre Connolly <deirdre@zfnd.org>
    +Credits: Daniel Benarroch
    +         Aurelien Nicolas
     Status: Draft
     Category: Consensus
     Created: 2022-05-01
    @@ -544,13 +545,7 @@
                     
    - +
    1415 Zcash Protocol Specification, Version 2022.3.8. Section 7.1: Transaction Encoding and Consensus (Transaction Version 5)
    5 -
    -

    System Message: WARNING/2 (zip-0227.rst line 414) zip-226-transfer-and-burn-of-zcash-shielded-assets-1

    -

    Duplicate explicit target name: "zip 226: transfer and burn of zcash shielded assets".

    -
    -

    ZIP 226: Transfer and Burn of Zcash Shielded Assets

    -
    ZIP 226: Transfer and Burn of Zcash Shielded Assets - Note Structure & Commitment
    diff --git a/zip-0227.rst b/zip-0227.rst index b3c975c2f..c17df1f95 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -2,12 +2,13 @@ ZIP: 227 Title: Issuance of Zcash Shielded Assets - Owners: Daniel Benarroch - Pablo Kogan - Aurelien Nicolas - Credits: Daira Hopwood - Jack Grigg - Vivek Arte + Owners: Pablo Kogan + Vivek Arte + Daira Hopwood + Jack Grigg + Deidre Connolly + Credits: Daniel Benarroch + Aurelien Nicolas Status: Draft Category: Consensus Created: 2022-05-01 @@ -417,7 +418,7 @@ References .. [#zip-0200] `ZIP 200: Network Upgrade Mechanism `_ .. [#zip-0224] `ZIP 224: Orchard `_ .. [#zip-0226] `ZIP 226: Transfer and Burn of Zcash Shielded Assets `_ -.. [#zip-0226-notestructure] `ZIP 226: Transfer and Burn of Zcash Shielded Assets `_ +.. [#zip-0226-notestructure] `ZIP 226: Transfer and Burn of Zcash Shielded Assets - Note Structure & Commitment `_ .. [#zip-0227] `ZIP 227: Issuance of Zcash Shielded Assets `_ .. [#zip-0317b] `ZIP 317b: ZSA Extension Proportional Fee Mechanism `_ .. [#zip-0032] `ZIP 32: Shielded Hierarchical Deterministic Wallets `_ From 5b9d42457e9313338c8d1fd0f7b9916a37b2aba2 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Tue, 28 Feb 2023 11:21:55 +0530 Subject: [PATCH 085/101] editing issuance key section --- zip-0227.html | 129 ++++++++++++++++++++++++++------------------------ zip-0227.rst | 26 +++++----- 2 files changed, 81 insertions(+), 74 deletions(-) diff --git a/zip-0227.html b/zip-0227.html index f7566f1e4..a6bda3cfe 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -69,24 +69,8 @@

    The issuance mechanism 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. In fact, the protocol described below enables what we hope will be a useful set of applications. The design decision is not to have a chosen name to describe the custom Asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”.

    -

    Issuance Authorization Signature Scheme

    -

    The requirement of cryptographic authorization in order to issue new Assets or change attributes of existing Assets is met by using a signature to prove knowledge of the issuance key used to authorize the issuance of the Asset, similar to what is done with the Spend Authorization Signature 13.

    -

    We define the issuance authorization signature scheme - \(\mathsf{IssueAuthSig}\) - similar to the Orchard spend authorization signature scheme, - \(\mathsf{SpendAuthSig}^{\mathsf{Orchard}}\) - 14. Specifically, we instantiate - \(\mathsf{IssueAuthSig}\) - as - \(\mathsf{RedPallas}\) - without key re-randomization using generator - \(\mathcal{P}_{\mathbb{G}} = \mathcal{G}^{\mathsf{Issuance}} := \mathsf{GroupHash}^\mathbb{P}(\texttt{"z.cash:ZSA"}, \texttt{"Issuance"})\) - where - \(\mathsf{GroupHash}^\mathbb{P}\) - is defined as in 11.

    -
    -

    Issuance Keys

    -

    The ZSA Protocol adds the following three keys to the key components 10:

    +

    Issuance Keys & Issuance Authorization Signature Scheme

    +

    The ZSA Protocol adds the following three keys to the key components 11:

    1. The issuance master key, denoted as \(\mathsf{sk}_{\mathsf{iss}}\) @@ -98,37 +82,50 @@ \(\mathsf{ik}\) , is the key that is used to validate the issuance transaction. This key is used to validate the issuance of a specific Asset Identifier, and is used by all block chain users (specifically the Asset owners and consensus validators) to associate the Asset in question with the issuer.
    -

    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 12. In - \(\mathsf{zcashd}\) - , this key is derived in a manner similar to the generation of the Orchard master key in ZIP 32 8, as detailed below:

    -
      -
    • Let - \(S\) - be a seed byte sequence of a chosen length, which MUST be at least 32 bytes and at most 252 bytes. Compute the issuance master key - \(\mathsf{sk}_{\mathsf{iss}} := \mathsf{BLAKE2b\text{-}256}(\mathtt{''ZcashIP32Issuance''}, S)\) - .
    • -
    -

    The issuance authorizing key and issuance validating key are derived from the issuance master key in an analogous manner to the derivation of the Orchard spend authorizing key and Orchard spend validating key from the Orchard spending key 12, as described below.

    -
      -
    • The issuance authorizing key is derived from the issuance master key, - \(\mathsf{sk}_{\mathsf{iss}}\) - , as a private signature key:
    • -
    -
    \(\mathsf{isk} := \mathsf{ToScalar}^{\mathsf{Orchard}}(︀ \mathsf{sk}_{\mathsf{iss}} )\)
    -
      -
    • The issuance validating key is derived from the issuance authorizing key, - \(\mathsf{isk}\) - , as a public verification key:
    • -
    -
    \(\mathsf{ik} := \mathsf{IssueAuthSig}.\mathsf{DerivePublic}(\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 8. 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.

    -

    The derivation of these keys are shown in the following diagram:

    -
    - -
    Diagram of Issuance Key Components for the ZSA Protocol
    -
    +

    Issuance Authorization Signature Scheme

    +

    We define the issuance authorization signature scheme + \(\mathsf{IssueAuthSig}\) + similar to + \(\mathsf{SpendAuthSig}^{\mathsf{Orchard}}\) + , the Orchard spend authorization signature scheme 15. Specifically, we instantiate + \(\mathsf{IssueAuthSig}\) + as + \(\mathsf{RedPallas}\) + without key re-randomization using generator + \(\mathcal{P}_{\mathbb{G}} = \mathcal{G}^{\mathsf{Issuance}} := \mathsf{GroupHash}^\mathbb{P}(\texttt{"z.cash:ZSA"}, \texttt{"Issuance"})\) + where + \(\mathsf{GroupHash}^\mathbb{P}\) + is defined as in the Zcash protocol specification 12.

    +
    +

    Issuance Key Derivation

    +

    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 13. In + \(\mathsf{zcashd}\) + , this key is derived in a manner similar to the generation of the Orchard master key in ZIP 32 9, as detailed below:

    +
      +
    • Details TBD
    • +
    +

    The issuance authorizing key and issuance validating key are derived from the issuance master key in an analogous manner to the derivation of the Orchard spend authorizing key and Orchard spend validating key from the Orchard spending key 13, as described below.

    +
      +
    • The issuance authorizing key is derived from the issuance master key, + \(\mathsf{sk}_{\mathsf{iss}}\) + , as a private signature key:
    • +
    +
    \(\mathsf{isk} := \mathsf{ToScalar}^{\mathsf{Orchard}}(︀ \mathsf{sk}_{\mathsf{iss}} )\)
    +
      +
    • The issuance validating key is derived from the issuance authorizing key, + \(\mathsf{isk}\) + , as a public verification key:
    • +
    +
    \(\mathsf{ik} := \mathsf{IssueAuthSig}.\mathsf{DerivePublic}(\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 8. 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.

    +

    The derivation of these keys are shown in the following diagram:

    +
    + +
    Diagram of Issuance Key Components for the ZSA Protocol
    +
    +

    Asset Identifier

    For every new Asset, there must be a new and unique Asset Identifier. We define this to be a globally unique pair @@ -169,7 +166,7 @@ \(\mathsf{ZSAValueBase^{Orchard}}(\mathsf{asset\_id}) := \mathsf{GroupHash}^\mathbb{P}(\texttt{"z.cash:OrchardZSA"}, \mathsf{asset\_id})\) where \(\mathsf{GroupHash}^\mathbb{P}\) - is defined as in 11.

    + is defined as in 12.

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

    @@ -249,7 +246,7 @@ \(\mathsf{isk}\) , that validates the issuance . -

    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 15.

    +

    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 16.

    @@ -341,7 +338,7 @@

    Asset Features

      -
    • By using the 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, +
    • By using the 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,
      • by setting 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.
      @@ -389,7 +386,7 @@
      • For each note, compute the note commitment as \(\mathsf{cm} = \mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, AssetId)}\) - as defined in the Note Structure and Commitment section of ZIP 226 5 and
      • + as defined in the Note Structure and Commitment section of ZIP 226 5 and
      • add \(\mathsf{cm}\) to the Merkle tree of note commitments, NoteCommitmentTree.
      • @@ -475,7 +472,7 @@ \(\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 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.

      +

      Bridging Assets 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.

      Other Considerations

      Implementing Zcash Nodes

      @@ -486,7 +483,7 @@ 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 317b 7.

      +

      The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317b 7.

      Future Work

      In future versions of this ZIP, the protocol may also include a "key rotation" mechanism. This would allow an issuer to change the underlying @@ -573,10 +570,18 @@

    - +
    + + + +
    9ZIP 32: Shielded Hierarchical Deterministic Wallets - Orchard master key generation
    + + + + @@ -584,7 +589,7 @@
    10 ZIP 316: Unified Addresses and Unified Viewing Keys
    - + @@ -592,7 +597,7 @@
    1011 Zcash Protocol Specification, Version 2022.3.8. Section 3.1: Payment Addresses and Keys
    - + @@ -600,7 +605,7 @@
    1112 Zcash Protocol Specification, Version 2022.3.8. Section 5.4.9.8: Group Hash into Pallas and Vesta
    - + @@ -608,7 +613,7 @@
    1213 Zcash Protocol Specification, Version 2022.3.8. Section 4.2.3: Orchard Key Components
    - + @@ -616,7 +621,7 @@
    1314 Zcash Protocol Specification, Version 2022.3.8. Section 4.15: Spend Authorization Signature (Sapling and Orchard)
    - + @@ -624,7 +629,7 @@
    1415 Zcash Protocol Specification, Version 2022.3.8. Section 5.4.7.1: Spend Authorization Signature (Sapling and Orchard)
    - + diff --git a/zip-0227.rst b/zip-0227.rst index c17df1f95..a83bb15fc 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -81,17 +81,9 @@ The protocol was designed with three main properties in mind: The issuance mechanism 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. In fact, the protocol described below enables what we hope will be a useful set of applications. The design decision is not to have a chosen name to describe the custom Asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”. -Issuance Authorization Signature Scheme ---------------------------------------- - -The requirement of cryptographic authorization in order to issue new Assets or change attributes of existing Assets is met by using a signature to prove knowledge of the issuance key used to authorize the issuance of the Asset, similar to what is done with the Spend Authorization Signature [#protocol-spendauthsig]_. - -We define the issuance authorization signature scheme :math:`\mathsf{IssueAuthSig}` similar to the Orchard spend authorization signature scheme, :math:`\mathsf{SpendAuthSig}^{\mathsf{Orchard}}` [#protocol-concretespendauthsig]_. -Specifically, we instantiate :math:`\mathsf{IssueAuthSig}` as :math:`\mathsf{RedPallas}` without key re-randomization using generator :math:`\mathcal{P}_{\mathbb{G}} = \mathcal{G}^{\mathsf{Issuance}} := \mathsf{GroupHash}^\mathbb{P}(\texttt{"z.cash:ZSA"}, \texttt{"Issuance"})` where :math:`\mathsf{GroupHash}^\mathbb{P}` is defined as in [#protocol-concretegrouphashpallasandvesta]_. - -Issuance Keys -------------- +Issuance Keys & Issuance Authorization Signature Scheme +------------------------------------------------------- The ZSA Protocol adds the following three keys to the key components [#protocol-addressesandkeys]_: @@ -101,10 +93,19 @@ The ZSA Protocol adds the following three keys to the key components [#protocol- 3. The issuance validating key, denoted as :math:`\mathsf{ik}`, is the key that is used to validate the issuance transaction. This key is used to validate the issuance of a specific Asset Identifier, and is used by all block chain users (specifically the Asset owners and consensus validators) to associate the Asset in question with the issuer. +Issuance Authorization Signature Scheme +``````````````````````````````````````` + +We define the issuance authorization signature scheme :math:`\mathsf{IssueAuthSig}` similar to :math:`\mathsf{SpendAuthSig}^{\mathsf{Orchard}}`, the Orchard spend authorization signature scheme [#protocol-concretespendauthsig]_. +Specifically, we instantiate :math:`\mathsf{IssueAuthSig}` as :math:`\mathsf{RedPallas}` without key re-randomization using generator :math:`\mathcal{P}_{\mathbb{G}} = \mathcal{G}^{\mathsf{Issuance}} := \mathsf{GroupHash}^\mathbb{P}(\texttt{"z.cash:ZSA"}, \texttt{"Issuance"})` where :math:`\mathsf{GroupHash}^\mathbb{P}` is defined as in the Zcash protocol specification [#protocol-concretegrouphashpallasandvesta]_. + +Issuance Key Derivation +``````````````````````` + The issuance master key is generated by choosing a bit sequence uniformly at random from :math:`\mathbb{B}^{\mathbb{Y}[32]}`, like the Orchard spending key [#protocol-orchardkeycomponents]_. -In :math:`\mathsf{zcashd}`, this key is derived in a manner similar to the generation of the Orchard master key in ZIP 32 [#zip-0032]_, as detailed below: +In :math:`\mathsf{zcashd}`, this key is derived in a manner similar to the generation of the Orchard master key in ZIP 32 [#zip-0032-orchard-master]_, as detailed below: -- Let :math:`S` be a seed byte sequence of a chosen length, which MUST be at least 32 bytes and at most 252 bytes. Compute the issuance master key :math:`\mathsf{sk}_{\mathsf{iss}} := \mathsf{BLAKE2b\text{-}256}(\mathtt{''ZcashIP32Issuance''}, S)`. +- Details TBD The issuance authorizing key and issuance validating key are derived from the issuance master key in an analogous manner to the derivation of the Orchard spend authorizing key and Orchard spend validating key from the Orchard spending key [#protocol-orchardkeycomponents]_, as described below. @@ -422,6 +423,7 @@ References .. [#zip-0227] `ZIP 227: Issuance of Zcash Shielded Assets `_ .. [#zip-0317b] `ZIP 317b: ZSA Extension Proportional Fee Mechanism `_ .. [#zip-0032] `ZIP 32: Shielded Hierarchical Deterministic Wallets `_ +.. [#zip-0032-orchard-master] `ZIP 32: Shielded Hierarchical Deterministic Wallets - Orchard master key generation `_ .. [#zip-0316] `ZIP 316: Unified Addresses and Unified Viewing Keys `_ .. [#protocol-addressesandkeys] `Zcash Protocol Specification, Version 2022.3.8. Section 3.1: Payment Addresses and Keys `_ .. [#protocol-concretegrouphashpallasandvesta] `Zcash Protocol Specification, Version 2022.3.8. Section 5.4.9.8: Group Hash into Pallas and Vesta `_ From b265a018f8321bd328188f52483b4b31ff0920f2 Mon Sep 17 00:00:00 2001 From: Vivek Arte <46618816+vivek-arte@users.noreply.github.com> Date: Tue, 28 Feb 2023 14:44:09 +0530 Subject: [PATCH 086/101] Editing the "previously_finalized" definitions to only deal with finalize setting at each block Co-authored-by: Daira Hopwood --- zip-0227.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zip-0227.rst b/zip-0227.rst index a83bb15fc..594b74d98 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -166,9 +166,9 @@ The relations between the Asset Identifier, Asset Digest, and Asset Base are sho Global Issuance State --------------------- -Issuance requires the following additions to the global state: +Issuance requires the following additions to the global state defined at block boundaries: -- ``previously_finalized``, a set of :math:`\mathsf{AssetId}` that have been finalized (i.e.: the ``finalize`` flag has been set to ``1``). +- :math:`\mathsf{previously\_finalized}`, a set of :math:`\mathsf{AssetId}` that have been finalized (i.e.: the ``finalize`` flag has been set to ``1`` in some issuance transaction preceding the block boundary). Issuance Action Description --------------------------- @@ -179,7 +179,7 @@ An issuance action, `IssueAction`, is the instance of issuing a specific custom - `notes`: an array containing the unencrypted output notes of the recipients of the Asset, of type `Note` - ``finalize``: a boolean that defines whether the issuance of that specific custom Asset is finalized or not -Once ``finalize`` is set to 1, it cannot be unset. For Assets whose ``finalize = 1``, no further tokens can be issued, so as seen below, the validators will reject the transaction. For Assets whose ``finalize = 0``, new issuance actions can be issued in future transactions. These must use the same Asset description, :math:`\mathsf{asset\_desc}`, and can either maintain ``finalize = 0`` or change it to ``finalize = 1``, denoting the last transaction containing issuance of such custom Asset. +An asset's :math:`\mathsf{AssetId}` is added to the :math:`\mathsf{previously\_finalized}` set after a block that contains any issuance transaction for that asset with ``finalize = 1``. It then cannot be removed from this set. For Assets with :math:`\mathsf{AssetId} \in \mathsf{previously\_finalized}`, no further tokens can be issued, so as seen below, the validators will reject the transaction. For Assets with :math:`\mathsf{AssetId} \not\in \mathsf{previously\_finalized}`, new issuance actions can be issued in future transactions. These must use the same Asset description, :math:`\mathsf{asset\_desc}`, and can either maintain ``finalize = 0`` or change it to ``finalize = 1``, denoting that this custom Asset cannot be issued after the containing block. ================= =============================== ========================== ======================================================================== Size Name Data Type Description From e8d879667e09a5e0f99f8c707d6cb8d0161c63ab Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Tue, 28 Feb 2023 14:48:36 +0530 Subject: [PATCH 087/101] editing the asset digest section --- zip-0227.html | 4 ++-- zip-0227.rst | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/zip-0227.html b/zip-0227.html index a6bda3cfe..b91c977f2 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -152,7 +152,7 @@ be the issuance validating key of the issuer, a public key used to verify the signature on the issuance transaction's SIGHASH.

    Define - \(\mathsf{AssetDigest_{\mathsf{AssetId}}} := \textsf{BLAKE2b-512}(\mathtt{''ZZSA-AssetDigest''},\; \mathsf{EncodeAssetId}(\mathsf{AssetId}))\) + \(\mathsf{AssetDigest_{\mathsf{AssetId}}} := \textsf{BLAKE2b-512}(\texttt{"ZSA-Asset-Digest"},\; \mathsf{EncodeAssetId}(\mathsf{AssetId}))\) , where

    • @@ -163,7 +163,7 @@ \(\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\_id}) := \mathsf{GroupHash}^\mathbb{P}(\texttt{"z.cash:OrchardZSA"}, \mathsf{asset\_id})\) + \(\mathsf{ZSAValueBase^{Orchard}}(\mathsf{asset\_digest}) := \mathsf{GroupHash}^\mathbb{P}(\texttt{"z.cash:OrchardZSA"}, \mathsf{asset\_digest})\) where \(\mathsf{GroupHash}^\mathbb{P}\) is defined as in 12.

      diff --git a/zip-0227.rst b/zip-0227.rst index 594b74d98..35d8ac6e1 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -142,7 +142,7 @@ Let - :math:`\mathsf{asset\_desc}` be the asset description, a UTF-8 encoded string of up to 512 bytes, which includes any information pertaining to the issuance. - :math:`\mathsf{ik}` be the issuance validating key of the issuer, a public key used to verify the signature on the issuance transaction's SIGHASH. -Define :math:`\mathsf{AssetDigest_{\mathsf{AssetId}}} := \textsf{BLAKE2b-512}(\mathtt{''ZZSA-AssetDigest''},\; \mathsf{EncodeAssetId}(\mathsf{AssetId}))`, +Define :math:`\mathsf{AssetDigest_{\mathsf{AssetId}}} := \textsf{BLAKE2b-512}(\texttt{"ZSA-Asset-Digest"},\; \mathsf{EncodeAssetId}(\mathsf{AssetId}))`, where - :math:`\mathsf{EncodeAssetId}(\mathsf{AssetId}) = \mathsf{EncodeAssetId}(\mathsf{ik}, \mathsf{asset\_desc}) := \mathsf{0x00} || \mathsf{repr}_{\mathbb{P}}(\mathsf{ik}) || \mathsf{asset\_desc}\!`. @@ -150,7 +150,7 @@ where Define :math:`\mathsf{AssetBase^{Protocol}_{\mathsf{AssetId}}} := \mathsf{ZSAValueBase^{Protocol}}(\mathsf{AssetDigest}_{\mathsf{AssetId}})`, where -In the case of Orchard, we define :math:`\mathsf{ZSAValueBase^{Orchard}}(\mathsf{asset\_id}) := \mathsf{GroupHash}^\mathbb{P}(\texttt{"z.cash:OrchardZSA"}, \mathsf{asset\_id})` +In the case of Orchard, we define :math:`\mathsf{ZSAValueBase^{Orchard}}(\mathsf{asset\_digest}) := \mathsf{GroupHash}^\mathbb{P}(\texttt{"z.cash:OrchardZSA"}, \mathsf{asset\_digest})` where :math:`\mathsf{GroupHash}^\mathbb{P}` is defined as in [#protocol-concretegrouphashpallasandvesta]_. The relations between the Asset Identifier, Asset Digest, and Asset Base are shown in the following diagram: From 40f1a6c6579e15bd043258f64c21e99e27df70ba Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Tue, 28 Feb 2023 14:55:00 +0530 Subject: [PATCH 088/101] adding rationale for the finalize happening at block boundaries --- zip-0227.html | 21 ++++++++++++++++----- zip-0227.rst | 3 +++ 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/zip-0227.html b/zip-0227.html index b91c977f2..68cfef5d2 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -174,11 +174,13 @@

      Global Issuance State

      -

      Issuance requires the following additions to the global state:

      +

      Issuance requires the following additions to the global state defined at block boundaries:

        -
      • previously_finalized, a set of +
      • + \(\mathsf{previously\_finalized}\) + , a set of \(\mathsf{AssetId}\) - that have been finalized (i.e.: the finalize flag has been set to 1).
      • + that have been finalized (i.e.: the finalize flag has been set to 1 in some issuance transaction preceding the block boundary).

      Issuance Action Description

      @@ -190,9 +192,17 @@
    • notes: an array containing the unencrypted output notes of the recipients of the Asset, of type Note
    • finalize: a boolean that defines whether the issuance of that specific custom Asset is finalized or not
    -

    Once finalize is set to 1, it cannot be unset. For Assets whose finalize = 1, no further tokens can be issued, so as seen below, the validators will reject the transaction. For Assets whose finalize = 0, new issuance actions can be issued in future transactions. These must use the same Asset description, +

    An asset's + \(\mathsf{AssetId}\) + is added to the + \(\mathsf{previously\_finalized}\) + set after a block that contains any issuance transaction for that asset with finalize = 1. It then cannot be removed from this set. For Assets with + \(\mathsf{AssetId} \in \mathsf{previously\_finalized}\) + , no further tokens can be issued, so as seen below, the validators will reject the transaction. For Assets with + \(\mathsf{AssetId} \not\in \mathsf{previously\_finalized}\) + , new issuance actions can be issued in future transactions. These must use the same Asset description, \(\mathsf{asset\_desc}\) - , and can either maintain finalize = 0 or change it to finalize = 1, denoting the last transaction containing issuance of such custom Asset.

    + , and can either maintain finalize = 0 or change it to finalize = 1, denoting that this custom Asset cannot be issued after the containing block.

    1516 Zcash Protocol Specification, Version 2022.3.8. Section 7.1: Transaction Encoding and Consensus (Transaction Version 5)
    @@ -410,6 +420,7 @@
  • information to be committed by the issuer, though not enforceable by the protocol.
  • +
  • We require a check whether the finalize flag only has been set in a previous block rather than a previous transaction in the same block. In other words, we only update the previously_finalized set at the block boundary. This is in keeping with the current property which allows for a miner to reorder transactions in a block without changing the meaning, which we aim to preserve.
  • TxId Digest

    diff --git a/zip-0227.rst b/zip-0227.rst index 35d8ac6e1..641380186 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -291,6 +291,9 @@ The following is a list of rationale for different decisions made in the proposa - bridging information for Wrapped Assets (chain of origin, issuer name, etc) - information to be committed by the issuer, though not enforceable by the protocol. +- We require a check whether the ``finalize`` flag only has been set in a previous block rather than a previous transaction in the same block. In other words, we only update the ``previously_finalized`` set at the block boundary. This is in keeping with the current property which allows for a miner to reorder transactions in a block without changing the meaning, which we aim to preserve. + + TxId Digest =========== A new issuance transaction digest algorithm is defined that constructs the identifier for an issuance transaction. Each branch of the tree of hashes will correspond to a specific subset of transaction data. The overall structure of the hash is as follows; each name referenced here will be described in detail below:: From b2b92aa9bf23740004fcd437401488030f125469 Mon Sep 17 00:00:00 2001 From: Vivek Arte <46618816+vivek-arte@users.noreply.github.com> Date: Thu, 2 Mar 2023 11:42:10 +0530 Subject: [PATCH 089/101] Fixing typos in owner details Co-authored-by: Deirdre Connolly --- zip-0226.rst | 4 ++-- zip-0227.rst | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/zip-0226.rst b/zip-0226.rst index b74756a43..c3cc5cf6e 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -4,9 +4,9 @@ Title: Transfer and Burn of Zcash Shielded Assets Owners: Pablo Kogan Vivek Arte - Daira Hopwood + Daira Emma Hopwood Jack Grigg - Deidre Connolly + Deirdre Connolly Credits: Daniel Benarroch Aurelien Nicolas Status: Draft diff --git a/zip-0227.rst b/zip-0227.rst index 641380186..faa78cc98 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -4,9 +4,9 @@ Title: Issuance of Zcash Shielded Assets Owners: Pablo Kogan Vivek Arte - Daira Hopwood + Daira Emma Hopwood Jack Grigg - Deidre Connolly + Deirdre Connolly Credits: Daniel Benarroch Aurelien Nicolas Status: Draft From 2d2643fa6be69147a5420701db2562b378191c1e Mon Sep 17 00:00:00 2001 From: Vivek Arte <46618816+vivek-arte@users.noreply.github.com> Date: Thu, 2 Mar 2023 11:44:21 +0530 Subject: [PATCH 090/101] Applying suggestions from ZIP review Co-authored-by: Deirdre Connolly --- zip-0227.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zip-0227.rst b/zip-0227.rst index faa78cc98..201efc97f 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -82,8 +82,8 @@ The protocol was designed with three main properties in mind: The issuance mechanism 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. In fact, the protocol described below enables what we hope will be a useful set of applications. The design decision is not to have a chosen name to describe the custom Asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”. -Issuance Keys & Issuance Authorization Signature Scheme -------------------------------------------------------- +Issuance Keys and Issuance Authorization Signature Scheme +--------------------------------------------------------- The ZSA Protocol adds the following three keys to the key components [#protocol-addressesandkeys]_: @@ -276,7 +276,7 @@ If all of the above checks pass, do the following: - For each note, compute the note commitment as :math:`\mathsf{cm} = \mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, AssetId)}` as defined in the Note Structure and Commitment section of ZIP 226 [#zip-0226-notestructure]_ and - add :math:`\mathsf{cm}` to the Merkle tree of note commitments, `NoteCommitmentTree`. -- If ``finalize = 1``, add :math:`\mathsf{AssetId}` to the ``previously_finalized`` set in the global state. +- If ``finalize = 1``, add :math:`\mathsf{AssetId}` to the ``previously_finalized`` set immediately after the block in which this transaction occurs. Rationale From 1ef4663a638d1ab80ad961751d05004a073f62ae Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Sat, 4 Mar 2023 21:19:40 +0530 Subject: [PATCH 091/101] updating html files to reflect rst changes --- zip-0226.html | 4 ++-- zip-0227.html | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/zip-0226.html b/zip-0226.html index 132425350..15f69f6e9 100644 --- a/zip-0226.html +++ b/zip-0226.html @@ -11,9 +11,9 @@ Title: Transfer and Burn of Zcash Shielded Assets Owners: Pablo Kogan <pablo@qed-it.com> Vivek Arte <vivek@qed-it.com> - Daira Hopwood <daira@electriccoin.co> + Daira Emma Hopwood <daira@electriccoin.co> Jack Grigg <str4d@electriccoin.co> - Deidre Connolly <deirdre@zfnd.org> + Deirdre Connolly <deirdre@zfnd.org> Credits: Daniel Benarroch Aurelien Nicolas Status: Draft diff --git a/zip-0227.html b/zip-0227.html index 68cfef5d2..10cbae1c8 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -11,9 +11,9 @@ Title: Issuance of Zcash Shielded Assets Owners: Pablo Kogan <pablo@qed-it.com> Vivek Arte <vivek@qed-it.com> - Daira Hopwood <daira@electriccoin.co> + Daira Emma Hopwood <daira@electriccoin.co> Jack Grigg <str4d@electriccoin.co> - Deidre Connolly <deirdre@zfnd.org> + Deirdre Connolly <deirdre@zfnd.org> Credits: Daniel Benarroch Aurelien Nicolas Status: Draft @@ -69,7 +69,7 @@

    The issuance mechanism 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. In fact, the protocol described below enables what we hope will be a useful set of applications. The design decision is not to have a chosen name to describe the custom Asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”.

    -

    Issuance Keys & Issuance Authorization Signature Scheme

    +

    Issuance Keys and Issuance Authorization Signature Scheme

    The ZSA Protocol adds the following three keys to the key components 11:

    1. The issuance master key, denoted as @@ -402,7 +402,7 @@ to the Merkle tree of note commitments, NoteCommitmentTree.
    2. If finalize = 1, add \(\mathsf{AssetId}\) - to the previously_finalized set in the global state.
    3. + to the previously_finalized set immediately after the block in which this transaction occurs.
    From 881959b2b386b63e0031b25ed9a1ee5debfb9f58 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Sat, 4 Mar 2023 23:45:25 +0530 Subject: [PATCH 092/101] rearrangement of ZIP 227 motivation and requirements --- zip-0227.html | 19 +++++++------------ zip-0227.rst | 26 ++++++++++---------------- 2 files changed, 17 insertions(+), 28 deletions(-) diff --git a/zip-0227.html b/zip-0227.html index 10cbae1c8..381da3c8d 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -37,6 +37,8 @@

    Motivation

    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.

    Use Cases

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

    @@ -52,23 +54,15 @@
    • Any user of the Zcash block chain can issue custom Assets on chain.
    • The issuance mechanism should enable public tracking of the supply of the Assets on the Zcash block chain.
    • +
    • At the time of issuance, the issuer should be able to allocate all the Assets to the corresponding owners by creating the corresponding (shielded) output notes to the respective addresses. This allows for allocation to be totally private even though the issuance mechanism is itself transparent.
    • Issuing or changing the attributes of a specific Asset should require cryptographic authorization.
    • The Asset identification should be unique (among all shielded pools) and different issuer public keys should not be able to generate the same Asset Identifier.
    • -
    • An issuer should be able to issue different Assets in the same transaction.
    • +
    • An issuer should be able to issue different Assets in the same transaction. In other words, in a single "issuance bundle", the issuer should be able publish many "issuance actions", potentially creating multiple Custom Assets.
    • +
    • Every "issuance action" should contain a finalize boolean that defines whether the specific Custom Asset can have further tokens issued or not.

    Specification

    As explained, the issuance protocol allows for a single issuance action to be sent to many receivers, by generating as many output notes as distinct recipients. Furthermore, every bundle can contain many issuance actions.

    -

    Overview

    -

    This specification enables only transparent issuance, since as a first step, transparency is important to properly test the applications that will be most used in the Zcash ecosystem, while enabling tracking of supply of Assets. Any user of the block chain can issue new Asset Identifiers, yet only a single issuer (a set of keys) can issue that specific Asset Identifier, as the Asset Identifiers are tied to the issuer keys.

    -

    The protocol was designed with three main properties in mind:

    -
      -
    • At the time of issuance, the issuer can already allocate all the tokens to the corresponding owners by creating the corresponding (shielded) output notes to the respective addresses. As is implied, the issuance mechanism is itself transparent, but the allocation is totally private.
    • -
    • In a single issuance bundle, the issuer can publish many issuance actions, or in other words, create multiple Custom Assets.
    • -
    • Every issuance action contains the finalize boolean that defines whether that specific Custom Asset can have further tokens issued or not.
    • -
    -

    The issuance mechanism 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. In fact, the protocol described below enables what we hope will be a useful set of applications. The design decision is not to have a chosen name to describe the custom Asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”.

    -

    Issuance Keys and Issuance Authorization Signature Scheme

    The ZSA Protocol adds the following three keys to the key components 11:

      @@ -409,7 +403,8 @@

      Rationale

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

        -
      • The issuance key structure was kept aligned to the original key tree in order to ease issuance integration with wallets and to prevent users from having to manage multiple keys and secrets.
      • +
      • The issuance key structure is independent of the original key tree, but derived in an analogous manner (via ZIP 32). This is in order to keep the issuance details and the Asset Identifiers consistent across multiple shielded pools.
      • +
      • The design decision is not to have a chosen name to describe the Custom Asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”.
      • The \(\mathsf{asset\_desc}\) is a general byte string in order to allow for a wide range of information type to be included that may be associated with the Assets. Some are: diff --git a/zip-0227.rst b/zip-0227.rst index 201efc97f..edfc10e1d 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -41,6 +41,11 @@ Motivation This ZIP is a supporting ZIP for ZIP 226 [#zip-0226]_, 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. + + Use Cases ========= @@ -58,9 +63,11 @@ Requirements - Any user of the Zcash block chain can issue custom Assets on chain. - The issuance mechanism should enable public tracking of the supply of the Assets on the Zcash block chain. +- At the time of issuance, the issuer should be able to allocate all the Assets to the corresponding owners by creating the corresponding (shielded) output notes to the respective addresses. This allows for allocation to be totally private even though the issuance mechanism is itself transparent. - Issuing or changing the attributes of a specific Asset should require cryptographic authorization. - The Asset identification should be unique (among all shielded pools) and different issuer public keys should not be able to generate the same Asset Identifier. -- An issuer should be able to issue different Assets in the same transaction. +- An issuer should be able to issue different Assets in the same transaction. In other words, in a single "issuance bundle", the issuer should be able publish many "issuance actions", potentially creating multiple Custom Assets. +- Every "issuance action" should contain a ``finalize`` boolean that defines whether the specific Custom Asset can have further tokens issued or not. Specification @@ -68,20 +75,6 @@ Specification As explained, the issuance protocol allows for a single issuance action to be sent to many receivers, by generating as many output notes as distinct recipients. Furthermore, every bundle can contain many issuance actions. -Overview --------- - -This specification enables only *transparent* issuance, since as a first step, transparency is important to properly test the applications that will be most used in the Zcash ecosystem, while enabling tracking of supply of Assets. Any user of the block chain can issue new Asset Identifiers, yet only a single issuer (a set of keys) can issue that specific Asset Identifier, as the Asset Identifiers are tied to the issuer keys. - -The protocol was designed with three main properties in mind: - -- At the time of issuance, the issuer can already allocate all the tokens to the corresponding owners by creating the corresponding (shielded) output notes to the respective addresses. As is implied, the issuance mechanism is itself transparent, but the allocation is totally private. -- In a single issuance bundle, the issuer can publish many issuance actions, or in other words, create multiple Custom Assets. -- Every issuance action contains the ``finalize`` boolean that defines whether that specific Custom Asset can have further tokens issued or not. - -The issuance mechanism 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. In fact, the protocol described below enables what we hope will be a useful set of applications. The design decision is not to have a chosen name to describe the custom Asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”. - - Issuance Keys and Issuance Authorization Signature Scheme --------------------------------------------------------- @@ -283,7 +276,8 @@ Rationale ========= The following is a list of rationale for different decisions made in the proposal: -- The issuance key structure was kept aligned to the original key tree in order to ease issuance integration with wallets and to prevent users from having to manage multiple keys and secrets. +- The issuance key structure is independent of the original key tree, but derived in an analogous manner (via ZIP 32). This is in order to keep the issuance details and the Asset Identifiers consistent across multiple shielded pools. +- The design decision is not to have a chosen name to describe the Custom Asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”. - The :math:`\mathsf{asset\_desc}` is a general byte string in order to allow for a wide range of information type to be included that may be associated with the Assets. Some are: - links for storage such as for NFTs. From 00e6c7bd61ab2711b09141cedd35316ff26084c7 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Tue, 7 Mar 2023 12:33:12 +0530 Subject: [PATCH 093/101] link to QEDIT deploy of ZIP 317 --- zip-0227.html | 2 +- zip-0227.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/zip-0227.html b/zip-0227.html index 381da3c8d..ca1af0b3e 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -564,7 +564,7 @@
    - +
    7ZIP 317b: ZSA Extension Proportional Fee MechanismZIP 317: Proportional Fee Mechanism
    diff --git a/zip-0227.rst b/zip-0227.rst index edfc10e1d..0c603cfae 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -418,7 +418,7 @@ References .. [#zip-0226] `ZIP 226: Transfer and Burn of Zcash Shielded Assets `_ .. [#zip-0226-notestructure] `ZIP 226: Transfer and Burn of Zcash Shielded Assets - Note Structure & Commitment `_ .. [#zip-0227] `ZIP 227: Issuance of Zcash Shielded Assets `_ -.. [#zip-0317b] `ZIP 317b: ZSA Extension Proportional Fee Mechanism `_ +.. [#zip-0317b] `ZIP 317: Proportional Fee Mechanism `_ .. [#zip-0032] `ZIP 32: Shielded Hierarchical Deterministic Wallets `_ .. [#zip-0032-orchard-master] `ZIP 32: Shielded Hierarchical Deterministic Wallets - Orchard master key generation `_ .. [#zip-0316] `ZIP 316: Unified Addresses and Unified Viewing Keys `_ From c84e4f42e8e30732fdc236131fddfb59a5cb5a32 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Tue, 7 Mar 2023 12:38:59 +0530 Subject: [PATCH 094/101] moving concrete applications to top level heading --- zip-0227.html | 56 +++++++++++++++++++++++++-------------------------- zip-0227.rst | 41 +++++++++++++++++++------------------ 2 files changed, 49 insertions(+), 48 deletions(-) diff --git a/zip-0227.html b/zip-0227.html index ca1af0b3e..2c42ecc04 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -335,33 +335,6 @@

    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.

    -

    Concrete Applications

    -

    Bridging Assets Issuers can wrap Assets defined in other chains and issue them at once in a single transaction. The specifics of the bridge are not implemented in the protocol, but there are several ways we conceive issuers can build these bridges (at least centralized bridges):

    -
      -
    • First, the issuance and burn mechanism can be used in conjunction to determine the
    • -
    -

    Asset Features

    -
      -
    • By using the 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, -
        -
      • by setting 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}\) - , during which 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 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).
      • -
      -
    • -
    • Furthermore, NFT issuance is enabled by issuing in a single bundle several issuance actions, where each - \(\mathsf{AssetId}\) - corresponds to value = 1 at the fundamental unit level. Issuers and users should make sure that finalize = 1 for each of the actions in this scenario.
    • -
    -

    Consensus Rule Changes

    For the IssueBundle:

      @@ -390,7 +363,7 @@
      • For each note, compute the note commitment as \(\mathsf{cm} = \mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, AssetId)}\) - as defined in the Note Structure and Commitment section of ZIP 226 5 and
      • + as defined in the Note Structure and Commitment section of ZIP 226 5 and
      • add \(\mathsf{cm}\) to the Merkle tree of note commitments, NoteCommitmentTree.
      • @@ -400,6 +373,33 @@
    +

    Concrete Applications

    +

    Bridging Assets Issuers can wrap Assets defined in other chains and issue them at once in a single transaction. The specifics of the bridge are not implemented in the protocol, but there are several ways we conceive issuers can build these bridges (at least centralized bridges):

    +
      +
    • First, the issuance and burn mechanism can be used in conjunction to determine the
    • +
    +

    Asset Features

    +
      +
    • By using the 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, +
        +
      • by setting 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}\) + , during which 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 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).
      • +
      +
    • +
    • Furthermore, NFT issuance is enabled by issuing in a single bundle several issuance actions, where each + \(\mathsf{AssetId}\) + corresponds to value = 1 at the fundamental unit level. Issuers and users should make sure that finalize = 1 for each of the actions in this scenario.
    • +
    +

    Rationale

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

      diff --git a/zip-0227.rst b/zip-0227.rst index 0c603cfae..f68f953b5 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -230,26 +230,6 @@ For the `IssueBundle`: 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`. -Concrete Applications ---------------------- - -**Bridging Assets** -Issuers can wrap Assets defined in other chains and issue them at once in a single transaction. The specifics of the bridge are not implemented in the protocol, but there are several ways we conceive issuers can build these bridges (at least centralized bridges): - -- First, the issuance and burn mechanism can be used in conjunction to determine the - -**Asset Features** - -- By using the ``finalize`` boolean and the burning mechanism defined in [#zip-0226]_, issuers can control the supply production of any Asset associated to their issuer keys. For example, - - - by setting ``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 :math:`\mathsf{AssetId}`, during which ``finalize = 1``, or by - - issuing a transaction with a single note in the issuance action pertaining to that :math:`\mathsf{AssetId}`, where the note will contain a ``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). - -- Furthermore, NFT issuance is enabled by issuing in a single bundle several issuance actions, where each :math:`\mathsf{AssetId}` corresponds to ``value = 1`` at the fundamental unit level. Issuers and users should make sure that ``finalize = 1`` for each of the actions in this scenario. Consensus Rule Changes ---------------------- @@ -271,6 +251,27 @@ If all of the above checks pass, do the following: - add :math:`\mathsf{cm}` to the Merkle tree of note commitments, `NoteCommitmentTree`. - If ``finalize = 1``, add :math:`\mathsf{AssetId}` to the ``previously_finalized`` set immediately after the block in which this transaction occurs. +Concrete Applications +===================== + +**Bridging Assets** +Issuers can wrap Assets defined in other chains and issue them at once in a single transaction. The specifics of the bridge are not implemented in the protocol, but there are several ways we conceive issuers can build these bridges (at least centralized bridges): + +- First, the issuance and burn mechanism can be used in conjunction to determine the + +**Asset Features** + +- By using the ``finalize`` boolean and the burning mechanism defined in [#zip-0226]_, issuers can control the supply production of any Asset associated to their issuer keys. For example, + + - by setting ``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 :math:`\mathsf{AssetId}`, during which ``finalize = 1``, or by + - issuing a transaction with a single note in the issuance action pertaining to that :math:`\mathsf{AssetId}`, where the note will contain a ``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). + +- Furthermore, NFT issuance is enabled by issuing in a single bundle several issuance actions, where each :math:`\mathsf{AssetId}` corresponds to ``value = 1`` at the fundamental unit level. Issuers and users should make sure that ``finalize = 1`` for each of the actions in this scenario. + Rationale ========= From af4cf9e65d57c5b4bc9b5c24552c0f9699de1505 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Tue, 7 Mar 2023 14:48:21 +0530 Subject: [PATCH 095/101] moving Concrete Applications to within the Rationale --- zip-0227.html | 54 +++++++++++++++++++++++++-------------------------- zip-0227.rst | 33 ++++++++++++++++--------------- 2 files changed, 44 insertions(+), 43 deletions(-) diff --git a/zip-0227.html b/zip-0227.html index 2c42ecc04..089b9b5e2 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -373,33 +373,6 @@
    -

    Concrete Applications

    -

    Bridging Assets Issuers can wrap Assets defined in other chains and issue them at once in a single transaction. The specifics of the bridge are not implemented in the protocol, but there are several ways we conceive issuers can build these bridges (at least centralized bridges):

    -
      -
    • First, the issuance and burn mechanism can be used in conjunction to determine the
    • -
    -

    Asset Features

    -
      -
    • By using the 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, -
        -
      • by setting 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}\) - , during which 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 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).
      • -
      -
    • -
    • Furthermore, NFT issuance is enabled by issuing in a single bundle several issuance actions, where each - \(\mathsf{AssetId}\) - corresponds to value = 1 at the fundamental unit level. Issuers and users should make sure that finalize = 1 for each of the actions in this scenario.
    • -
    -

    Rationale

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

      @@ -417,6 +390,33 @@
    • We require a check whether the finalize flag only has been set in a previous block rather than a previous transaction in the same block. In other words, we only update the previously_finalized set at the block boundary. This is in keeping with the current property which allows for a miner to reorder transactions in a block without changing the meaning, which we aim to preserve.
    +

    Concrete Applications

    +

    Bridging Assets Issuers can wrap Assets defined in other chains and issue them at once in a single transaction. The specifics of the bridge are not implemented in the protocol, but there are several ways we conceive issuers can build these bridges (at least centralized bridges):

    +
      +
    • First, the issuance and burn mechanism can be used in conjunction to determine the
    • +
    +

    Asset Features

    +
      +
    • By using the 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, +
        +
      • by setting 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}\) + , during which 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 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).
      • +
      +
    • +
    • Furthermore, NFT issuance is enabled by issuing in a single bundle several issuance actions, where each + \(\mathsf{AssetId}\) + corresponds to value = 1 at the fundamental unit level. Issuers and users should make sure that finalize = 1 for each of the actions in this scenario.
    • +
    +

    TxId Digest

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

    diff --git a/zip-0227.rst b/zip-0227.rst index f68f953b5..33332b55b 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -251,8 +251,24 @@ If all of the above checks pass, do the following: - add :math:`\mathsf{cm}` to the Merkle tree of note commitments, `NoteCommitmentTree`. - If ``finalize = 1``, add :math:`\mathsf{AssetId}` to the ``previously_finalized`` set immediately after the block in which this transaction occurs. + +Rationale +========= +The following is a list of rationale for different decisions made in the proposal: + +- The issuance key structure is independent of the original key tree, but derived in an analogous manner (via ZIP 32). This is in order to keep the issuance details and the Asset Identifiers consistent across multiple shielded pools. +- The design decision is not to have a chosen name to describe the Custom Asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”. +- The :math:`\mathsf{asset\_desc}` is a general byte string in order to allow for a wide range of information type to be included that may be associated with the Assets. Some are: + + - links for storage such as for NFTs. + - metadata for Assets, encoded in any format. + - bridging information for Wrapped Assets (chain of origin, issuer name, etc) + - information to be committed by the issuer, though not enforceable by the protocol. + +- We require a check whether the ``finalize`` flag only has been set in a previous block rather than a previous transaction in the same block. In other words, we only update the ``previously_finalized`` set at the block boundary. This is in keeping with the current property which allows for a miner to reorder transactions in a block without changing the meaning, which we aim to preserve. + Concrete Applications -===================== +--------------------- **Bridging Assets** Issuers can wrap Assets defined in other chains and issue them at once in a single transaction. The specifics of the bridge are not implemented in the protocol, but there are several ways we conceive issuers can build these bridges (at least centralized bridges): @@ -273,21 +289,6 @@ Issuers can wrap Assets defined in other chains and issue them at once in a sing - Furthermore, NFT issuance is enabled by issuing in a single bundle several issuance actions, where each :math:`\mathsf{AssetId}` corresponds to ``value = 1`` at the fundamental unit level. Issuers and users should make sure that ``finalize = 1`` for each of the actions in this scenario. -Rationale -========= -The following is a list of rationale for different decisions made in the proposal: - -- The issuance key structure is independent of the original key tree, but derived in an analogous manner (via ZIP 32). This is in order to keep the issuance details and the Asset Identifiers consistent across multiple shielded pools. -- The design decision is not to have a chosen name to describe the Custom Asset, but to delegate it to an off-chain mapping, as this would imply a land-grab “war”. -- The :math:`\mathsf{asset\_desc}` is a general byte string in order to allow for a wide range of information type to be included that may be associated with the Assets. Some are: - - - links for storage such as for NFTs. - - metadata for Assets, encoded in any format. - - bridging information for Wrapped Assets (chain of origin, issuer name, etc) - - information to be committed by the issuer, though not enforceable by the protocol. - -- We require a check whether the ``finalize`` flag only has been set in a previous block rather than a previous transaction in the same block. In other words, we only update the ``previously_finalized`` set at the block boundary. This is in keeping with the current property which allows for a miner to reorder transactions in a block without changing the meaning, which we aim to preserve. - TxId Digest =========== From 2ef7c97488f3eeb8ac7462a9dc764a3e98048e98 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Tue, 14 Mar 2023 01:13:45 +0530 Subject: [PATCH 096/101] adding Teor to credits --- zip-0226.html | 1 + zip-0226.rst | 1 + zip-0227.html | 1 + zip-0227.rst | 1 + 4 files changed, 4 insertions(+) diff --git a/zip-0226.html b/zip-0226.html index 15f69f6e9..acda0ca62 100644 --- a/zip-0226.html +++ b/zip-0226.html @@ -16,6 +16,7 @@ Deirdre Connolly <deirdre@zfnd.org> Credits: Daniel Benarroch Aurelien Nicolas + Teor Status: Draft Category: Consensus Created: 2022-05-01 diff --git a/zip-0226.rst b/zip-0226.rst index c3cc5cf6e..517f63159 100644 --- a/zip-0226.rst +++ b/zip-0226.rst @@ -9,6 +9,7 @@ Deirdre Connolly Credits: Daniel Benarroch Aurelien Nicolas + Teor Status: Draft Category: Consensus Created: 2022-05-01 diff --git a/zip-0227.html b/zip-0227.html index 089b9b5e2..596f139cf 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -16,6 +16,7 @@ Deirdre Connolly <deirdre@zfnd.org> Credits: Daniel Benarroch Aurelien Nicolas + Teor Status: Draft Category: Consensus Created: 2022-05-01 diff --git a/zip-0227.rst b/zip-0227.rst index 33332b55b..086cec2ab 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -9,6 +9,7 @@ Deirdre Connolly Credits: Daniel Benarroch Aurelien Nicolas + Teor Status: Draft Category: Consensus Created: 2022-05-01 From 890df09f0d9a17b65f9cfc0087cfd7c2343bdf7e Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Tue, 14 Mar 2023 01:20:16 +0530 Subject: [PATCH 097/101] fixing inconsistency in ZIP 227 Consensus Rule Changes --- zip-0227.html | 16 ++++++++++------ zip-0227.rst | 6 +++--- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/zip-0227.html b/zip-0227.html index 596f139cf..befab468a 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -347,23 +347,27 @@ \(\mathsf{asset\_desc}\) is a string with 0 < byte size <= 512.
  • retrieve - \(\mathsf{AssetId}\) + \(\mathsf{AssetBase}\) from the first note in the sequence and check that - \(\mathsf{AssetId = GroupHash^{\mathbb{P}}(ik || asset\_desc)}\) - is properly derived.
  • + \(\mathsf{AssetBase}\) + is derived from the issuance validating key + \(\mathsf{ik}\) + and + \(\mathsf{asset\_desc}\) + as described in the Asset Identifier section.
  • check that the \(\mathsf{AssetId}\) does not exist in the previously_finalized set in the global state.
  • check that every note in the IssueAction contains the same - \(\mathsf{AssetId}\) + \(\mathsf{AssetBase}\) and is properly constructed as - \(note = (\mathsf{g_d, pk_d, v, \rho, \psi, AssetId})\) + \(note = (\mathsf{g_d, pk_d, v, \rho, \psi, AssetBase})\) .
  • If all of the above checks pass, do the following:

    • For each note, compute the note commitment as - \(\mathsf{cm} = \mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, AssetId)}\) + \(\mathsf{cm} = \mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, AssetBase)}\) as defined in the Note Structure and Commitment section of ZIP 226 5 and
    • add \(\mathsf{cm}\) diff --git a/zip-0227.rst b/zip-0227.rst index 086cec2ab..c07d918d8 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -242,13 +242,13 @@ For the IssueBundle: For each `IssueAction` in `IssueBundle`: - check that :math:`\mathsf{asset\_desc}` is a string with `0 < byte size <= 512`. -- retrieve :math:`\mathsf{AssetId}` from the first note in the sequence and check that :math:`\mathsf{AssetId = GroupHash^{\mathbb{P}}(ik || asset\_desc)}` is properly derived. +- retrieve :math:`\mathsf{AssetBase}` from the first note in the sequence and check that :math:`\mathsf{AssetBase}` is derived from the issuance validating key :math:`\mathsf{ik}` and :math:`\mathsf{asset\_desc}` as described in the `Asset Identifier`_ section. - check that the :math:`\mathsf{AssetId}` does not exist in the ``previously_finalized`` set in the global state. -- check that every note in the `IssueAction` contains the same :math:`\mathsf{AssetId}` and is properly constructed as :math:`note = (\mathsf{g_d, pk_d, v, \rho, \psi, AssetId})`. +- check that every note in the `IssueAction` contains the same :math:`\mathsf{AssetBase}` and is properly constructed as :math:`note = (\mathsf{g_d, pk_d, v, \rho, \psi, AssetBase})`. If all of the above checks pass, do the following: -- For each note, compute the note commitment as :math:`\mathsf{cm} = \mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, AssetId)}` as defined in the Note Structure and Commitment section of ZIP 226 [#zip-0226-notestructure]_ and +- For each note, compute the note commitment as :math:`\mathsf{cm} = \mathsf{NoteCommit^{OrchardZSA}_{rcm}(repr_{\mathbb{P}}(g_d), repr_{\mathbb{P}}(pk_d), v, \rho, \psi, AssetBase)}` as defined in the Note Structure and Commitment section of ZIP 226 [#zip-0226-notestructure]_ and - add :math:`\mathsf{cm}` to the Merkle tree of note commitments, `NoteCommitmentTree`. - If ``finalize = 1``, add :math:`\mathsf{AssetId}` to the ``previously_finalized`` set immediately after the block in which this transaction occurs. From 639f46bd3d07981bc41edc47b446dd2c1bf46d51 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Tue, 14 Mar 2023 10:30:38 +0530 Subject: [PATCH 098/101] fixing bridging text --- zip-0227.html | 5 +---- zip-0227.rst | 7 ++----- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/zip-0227.html b/zip-0227.html index befab468a..d862f352b 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -396,10 +396,6 @@
    • We require a check whether the finalize flag only has been set in a previous block rather than a previous transaction in the same block. In other words, we only update the previously_finalized set at the block boundary. This is in keeping with the current property which allows for a miner to reorder transactions in a block without changing the meaning, which we aim to preserve.

    Concrete Applications

    -

    Bridging Assets Issuers can wrap Assets defined in other chains and issue them at once in a single transaction. The specifics of the bridge are not implemented in the protocol, but there are several ways we conceive issuers can build these bridges (at least centralized bridges):

    -
      -
    • First, the issuance and burn mechanism can be used in conjunction to determine the
    • -

    Asset Features

    • By using the 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, @@ -417,6 +413,7 @@ , where the note will contain a 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 value = 1 at the fundamental unit level. Issuers and users should make sure that finalize = 1 for each of the actions in this scenario.
  • diff --git a/zip-0227.rst b/zip-0227.rst index c07d918d8..e0c29fcc5 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -271,11 +271,6 @@ The following is a list of rationale for different decisions made in the proposa Concrete Applications --------------------- -**Bridging Assets** -Issuers can wrap Assets defined in other chains and issue them at once in a single transaction. The specifics of the bridge are not implemented in the protocol, but there are several ways we conceive issuers can build these bridges (at least centralized bridges): - -- First, the issuance and burn mechanism can be used in conjunction to determine the - **Asset Features** - By using the ``finalize`` boolean and the burning mechanism defined in [#zip-0226]_, issuers can control the supply production of any Asset associated to their issuer keys. For example, @@ -287,6 +282,8 @@ Issuers can wrap Assets defined in other chains and issue them at once in a sing - issuing a last set of tokens of that specific :math:`\mathsf{AssetId}`, during which ``finalize = 1``, or by - issuing a transaction with a single note in the issuance action pertaining to that :math:`\mathsf{AssetId}`, where the note will contain a ``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 :math:`\mathsf{AssetId}` corresponds to ``value = 1`` at the fundamental unit level. Issuers and users should make sure that ``finalize = 1`` for each of the actions in this scenario. From 633a4406b7401b9dc71273b3f5a27b14b2e4266f Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Tue, 14 Mar 2023 11:21:10 +0530 Subject: [PATCH 099/101] additions based on review comments --- zip-0227.html | 3 ++- zip-0227.rst | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/zip-0227.html b/zip-0227.html index d862f352b..f0f8d267c 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -407,10 +407,11 @@
    • issuing a last set of tokens of that specific \(\mathsf{AssetId}\) - , during which finalize = 1, or by
    • + , for which 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 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).
    • +
    • Note in the above cases, that the setting of the finalize flag will take effect at the block boundary, that is, after all the transactions in the block.
  • 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.
  • diff --git a/zip-0227.rst b/zip-0227.rst index e0c29fcc5..0d4cfdc7b 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -279,8 +279,9 @@ Concrete Applications - 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 :math:`\mathsf{AssetId}`, during which ``finalize = 1``, or by + - issuing a last set of tokens of that specific :math:`\mathsf{AssetId}`, for which ``finalize = 1``, or by - issuing a transaction with a single note in the issuance action pertaining to that :math:`\mathsf{AssetId}`, where the note will contain a ``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). + - Note in the above cases, that the setting of the ``finalize`` flag will take effect at the block boundary, that is, after all the transactions in the block. - 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. From 7475f6cf0560928604f8d16551dcd4ea609181f2 Mon Sep 17 00:00:00 2001 From: Vivek Arte <46618816+vivek-arte@users.noreply.github.com> Date: Tue, 14 Mar 2023 13:53:09 +0530 Subject: [PATCH 100/101] Changes to issuance_txid_digest to align with ZIP 244 (#7) * changes to issuance_txid_digest to align with ZIP 244 * using flagsIssuance in place of a single bit boolean for the issue actions as well * fixing small typo --- zip-0227.html | 113 +++++++++++++++++++++++++++++++------------------- zip-0227.rst | 70 +++++++++++++++++++------------ 2 files changed, 114 insertions(+), 69 deletions(-) diff --git a/zip-0227.html b/zip-0227.html index f0f8d267c..2632424a4 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -65,7 +65,7 @@

    Specification

    As explained, the issuance protocol allows for a single issuance action to be sent to many receivers, by generating as many output notes as distinct recipients. Furthermore, every bundle can contain many issuance actions.

    Issuance Keys and Issuance Authorization Signature Scheme

    -

    The ZSA Protocol adds the following three keys to the key components 11:

    +

    The ZSA Protocol adds the following three keys to the key components 12:

    1. The issuance master key, denoted as \(\mathsf{sk}_{\mathsf{iss}}\) @@ -82,7 +82,7 @@ \(\mathsf{IssueAuthSig}\) similar to \(\mathsf{SpendAuthSig}^{\mathsf{Orchard}}\) - , the Orchard spend authorization signature scheme 15. Specifically, we instantiate + , the Orchard spend authorization signature scheme 16. Specifically, we instantiate \(\mathsf{IssueAuthSig}\) as \(\mathsf{RedPallas}\) @@ -90,18 +90,18 @@ \(\mathcal{P}_{\mathbb{G}} = \mathcal{G}^{\mathsf{Issuance}} := \mathsf{GroupHash}^\mathbb{P}(\texttt{"z.cash:ZSA"}, \texttt{"Issuance"})\) where \(\mathsf{GroupHash}^\mathbb{P}\) - is defined as in the Zcash protocol specification 12.

      + is defined as in the Zcash protocol specification 13.

    Issuance Key Derivation

    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 13. In + , like the Orchard spending key 14. In \(\mathsf{zcashd}\) - , this key is derived in a manner similar to the generation of the Orchard master key in ZIP 32 9, as detailed below:

    + , this key is derived in a manner similar to the generation of the Orchard master key in ZIP 32 10, as detailed below:

    • Details TBD
    -

    The issuance authorizing key and issuance validating key are derived from the issuance master key in an analogous manner to the derivation of the Orchard spend authorizing key and Orchard spend validating key from the Orchard spending key 13, as described below.

    +

    The issuance authorizing key and issuance validating key are derived from the issuance master key in an analogous manner to the derivation of the Orchard spend authorizing key and Orchard spend validating key from the Orchard spending key 14, as described below.

    • The issuance authorizing key is derived from the issuance master key, \(\mathsf{sk}_{\mathsf{iss}}\) @@ -114,7 +114,7 @@ , as a public verification key:
    \(\mathsf{ik} := \mathsf{IssueAuthSig}.\mathsf{DerivePublic}(\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 8. 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.

    +

    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 9. 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.

    The derivation of these keys are shown in the following diagram:

    @@ -161,7 +161,7 @@ \(\mathsf{ZSAValueBase^{Orchard}}(\mathsf{asset\_digest}) := \mathsf{GroupHash}^\mathbb{P}(\texttt{"z.cash:OrchardZSA"}, \mathsf{asset\_digest})\) where \(\mathsf{GroupHash}^\mathbb{P}\) - is defined as in 12.

    + is defined as in 13.

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

    @@ -229,10 +229,10 @@ A sequence of note descriptions within the issuance action - 1 bit - finalize - boolean - The boolean that determines the finality of the issuance of that Asset + 1 byte + flagsIssuance + byte + An 8-bit value with the finalize boolean value as the LSB, and the other bits set to 0. @@ -251,7 +251,7 @@ \(\mathsf{isk}\) , that validates the issuance . -

    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 16.

    +

    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 18.

    @@ -422,31 +422,38 @@

    TxId Digest

    -

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

    +

    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 identifier for an issuance transaction. Each branch of the tree of hashes 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_txid_digest
    -├── issueActions
    -└── issuerVerificationKey
    +├── issue_actions_digest +└── issuanceValidatingKey

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

    issuance_txid_digest

    A BLAKE2b-256 hash of the following values

    -
    T.1: issueActions            (field encoding bytes)
    -T.2: issuerVerificationKey   (field encoding bytes)
    +
    T.1: issue_actions_digest    (32-byte hash output)
    +T.2: issuanceValidatingKey   (32 bytes)

    The personalization field of this hash is set to:

    -
    "ZTxIdOrcZSAIssue"
    -

    T.1 issueActions

    -

    A byte encoding of Issue Action information for all Issue Actions belonging to the transaction. For each Action, the following elements are included in the hash:

    -
    T.1a: notes                   (field encoding bytes)
    +                
    "ZTxIdSAIssueHash"
    +

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

    +
    BLAKE2b-256("ZTxIdSAIssueHash", [])
    +

    T.1: 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.1a: notes_digest            (32-byte hash output)
     T.1b: assetDescription        (field encoding bytes)
    -T.1c: isFinalized             (1 bit)
    -
    T.1a: notes
    -

    A byte encoding of Note information for all Notes belonging to the Action. For each Note, the following elements are included in the hash:

    +T.1c: flagsIssuance (1 byte)
    +

    The personalization field of this hash is set to:

    +
    "ZTxIdIssActHash"
    +
    T.1a: 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.1a.1: recipient                    (field encoding bytes)
     T.1a.2: value                        (field encoding bytes)
     T.1a.3: asset                        (field encoding bytes)
     T.1a.4: rho                          (field encoding bytes)
     T.1a.5: rseed                        (field encoding bytes)
    +

    The personalization field of this hash is set to:

    +
    "ZTxIdIANoteHash"
    T.1a.1: recipient
    -

    Raw Address encoded as specified in [Zcash Protocol Spec § 5.6.4.2: Orchard Raw Payment Addresses].

    +

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

    T.1a.2: value

    Note value encoded as little-endian 8-byte representation of u64 raw value.

    @@ -464,12 +471,16 @@
    T.1b: assetDescription

    UTF-8 encoding of the Asset description string.

    -
    T.1c: isFinalized
    -

    1-bit representation of a boolean flag that is set to 'true' if the Asset Identifier was finalized in this action and 'false' otherwise. 'True' is represented as 1, 'false' as 0.

    +
    T.1c: flagsIssuance
    +

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

    +
      +
    • finalize
    • +
    • The remaining bits are set to 0.
    • +
    -

    T.2 issuerVerificationKey

    -

    A byte encoding of issuer validating key for the bundle as defined in [Zcash Protocol Spec § 4.2.3: Orchard Key Components].

    +

    T.2: issuanceValidatingKey

    +

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

    @@ -481,7 +492,7 @@ \(\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 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.

    +

    Bridging Assets 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.

    Other Considerations

    Implementing Zcash Nodes

    @@ -492,7 +503,7 @@ 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 317b 7.

    +

    The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317b 8.

    Future Work

    In future versions of this ZIP, the protocol may also include a "key rotation" mechanism. This would allow an issuer to change the underlying @@ -563,18 +574,26 @@

    - +
    - +
    7ZIP 317: Proportional Fee MechanismZIP 244: Transaction Identifier Non-Malleability
    - +
    + + + +
    8ZIP 317b: ZSA Extension Proportional Fee Mechanism
    + + + + @@ -582,7 +601,7 @@
    9 ZIP 32: Shielded Hierarchical Deterministic Wallets
    - + @@ -590,7 +609,7 @@
    910 ZIP 32: Shielded Hierarchical Deterministic Wallets - Orchard master key generation
    - + @@ -598,7 +617,7 @@
    1011 ZIP 316: Unified Addresses and Unified Viewing Keys
    - + @@ -606,7 +625,7 @@
    1112 Zcash Protocol Specification, Version 2022.3.8. Section 3.1: Payment Addresses and Keys
    - + @@ -614,7 +633,7 @@
    1213 Zcash Protocol Specification, Version 2022.3.8. Section 5.4.9.8: Group Hash into Pallas and Vesta
    - + @@ -622,7 +641,7 @@
    1314 Zcash Protocol Specification, Version 2022.3.8. Section 4.2.3: Orchard Key Components
    - + @@ -630,15 +649,23 @@
    1415 Zcash Protocol Specification, Version 2022.3.8. Section 4.15: Spend Authorization Signature (Sapling and Orchard)
    - +
    1516 Zcash Protocol Specification, Version 2022.3.8. Section 5.4.7.1: Spend Authorization Signature (Sapling and Orchard)
    + + + + + + + +
    17Zcash Protocol Specification, Version 2022.3.8. Section 5.6.4.2: Orchard Raw Payment Addresses
    - + diff --git a/zip-0227.rst b/zip-0227.rst index 0d4cfdc7b..31fe86cac 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -175,14 +175,14 @@ An issuance action, `IssueAction`, is the instance of issuing a specific custom An asset's :math:`\mathsf{AssetId}` is added to the :math:`\mathsf{previously\_finalized}` set after a block that contains any issuance transaction for that asset with ``finalize = 1``. It then cannot be removed from this set. For Assets with :math:`\mathsf{AssetId} \in \mathsf{previously\_finalized}`, no further tokens can be issued, so as seen below, the validators will reject the transaction. For Assets with :math:`\mathsf{AssetId} \not\in \mathsf{previously\_finalized}`, new issuance actions can be issued in future transactions. These must use the same Asset description, :math:`\mathsf{asset\_desc}`, and can either maintain ``finalize = 0`` or change it to ``finalize = 1``, denoting that this custom Asset cannot be issued after the containing block. -================= =============================== ========================== ======================================================================== +================= =============================== ========================== =========================================================================================== Size Name Data Type Description -================= =============================== ========================== ======================================================================== +================= =============================== ========================== =========================================================================================== Varies :math:`\mathsf{asset\_desc}` byte UTF-8 encoded string of varied size, up to 512 bytes Varies nNotes compactSize The number of notes in the issuance action noteSize * nNotes vNotes Note[nNotes] A sequence of note descriptions within the issuance action -1 bit ``finalize`` boolean The boolean that determines the finality of the issuance of that Asset -================= =============================== ========================== ======================================================================== +1 byte ``flagsIssuance`` byte An 8-bit value with the ``finalize`` boolean value as the LSB, and the other bits set to 0. +================= =============================== ========================== =========================================================================================== 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. @@ -291,11 +291,14 @@ Concrete Applications TxId Digest =========== -A new issuance transaction digest algorithm is defined that constructs the identifier for an issuance transaction. Each branch of the tree of hashes will correspond to a specific subset of transaction data. The overall structure of the hash is as follows; each name referenced here will be described in detail below:: + +As in ZIP 244 [#zip-0244]_, 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 identifier for an issuance transaction. Each branch of the tree of hashes 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_txid_digest - ├── issueActions - └── issuerVerificationKey + ├── issue_actions_digest + └── issuanceValidatingKey In the specification below, nodes of the tree are presented in depth-first order. @@ -303,25 +306,32 @@ issuance_txid_digest -------------------- A BLAKE2b-256 hash of the following values :: - T.1: issueActions (field encoding bytes) - T.2: issuerVerificationKey (field encoding bytes) + T.1: issue_actions_digest (32-byte hash output) + T.2: issuanceValidatingKey (32 bytes) The personalization field of this hash is set to:: - "ZTxIdOrcZSAIssue" + "ZTxIdSAIssueHash" -T.1 issueActions -```````````````` -A byte encoding of Issue Action information for all Issue Actions belonging to the transaction. For each Action, the following elements are included in the hash:: +In case the transaction has no issuance components, ''issue_actions_digest'' is:: + + BLAKE2b-256("ZTxIdSAIssueHash", []) - T.1a: notes (field encoding bytes) +T.1: 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.1a: notes_digest (32-byte hash output) T.1b: assetDescription (field encoding bytes) - T.1c: isFinalized (1 bit) + T.1c: flagsIssuance (1 byte) + +The personalization field of this hash is set to:: + "ZTxIdIssActHash" -T.1a: notes -''''''''''' -A byte encoding of Note information for all Notes belonging to the Action. For each Note, the following elements are included in the hash:: +T.1a: 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.1a.1: recipient (field encoding bytes) T.1a.2: value (field encoding bytes) @@ -329,10 +339,13 @@ A byte encoding of Note information for all Notes belonging to the Action. For e T.1a.4: rho (field encoding bytes) T.1a.5: rseed (field encoding bytes) +The personalization field of this hash is set to:: + + "ZTxIdIANoteHash" T.1a.1: recipient ................. -Raw Address encoded as specified in [Zcash Protocol Spec § 5.6.4.2: Orchard Raw Payment Addresses]. +This is the raw encoding of an Orchard shielded payment address as defined in the protocol specification [#protocol-orchardpaymentaddrencoding]_. T.1a.2: value ............. @@ -354,14 +367,17 @@ T.1b: assetDescription '''''''''''''''''''''' UTF-8 encoding of the Asset description string. -T.1c: isFinalized -''''''''''''''''' -1-bit representation of a boolean flag that is set to 'true' if the Asset Identifier was finalized in this action and 'false' otherwise. 'True' is represented as 1, 'false' as 0. +T.1c: flagsIssuance +''''''''''''''''''' +An 8-bit value representing a set of flags. Ordered from LSB to MSB: +- ``finalize`` +- The remaining bits are set to `0`. -T.2 issuerVerificationKey -````````````````````````` -A byte encoding of issuer validating key for the bundle as defined in [Zcash Protocol Spec § 4.2.3: Orchard Key Components]. + +T.2: issuanceValidatingKey +`````````````````````````` +A byte encoding of issuance validating key for the bundle as defined in the `Issuance Key Derivation`_ section. Security and Privacy Considerations @@ -419,7 +435,8 @@ References .. [#zip-0226] `ZIP 226: Transfer and Burn of Zcash Shielded Assets `_ .. [#zip-0226-notestructure] `ZIP 226: Transfer and Burn of Zcash Shielded Assets - Note Structure & Commitment `_ .. [#zip-0227] `ZIP 227: Issuance of Zcash Shielded Assets `_ -.. [#zip-0317b] `ZIP 317: Proportional Fee Mechanism `_ +.. [#zip-0244] `ZIP 244: Transaction Identifier Non-Malleability `_ +.. [#zip-0317b] `ZIP 317b: ZSA Extension Proportional Fee Mechanism `_ .. [#zip-0032] `ZIP 32: Shielded Hierarchical Deterministic Wallets `_ .. [#zip-0032-orchard-master] `ZIP 32: Shielded Hierarchical Deterministic Wallets - Orchard master key generation `_ .. [#zip-0316] `ZIP 316: Unified Addresses and Unified Viewing Keys `_ @@ -428,4 +445,5 @@ References .. [#protocol-orchardkeycomponents] `Zcash Protocol Specification, Version 2022.3.8. Section 4.2.3: Orchard Key Components `_ .. [#protocol-spendauthsig] `Zcash Protocol Specification, Version 2022.3.8. Section 4.15: Spend Authorization Signature (Sapling and Orchard) `_ .. [#protocol-concretespendauthsig] `Zcash Protocol Specification, Version 2022.3.8. Section 5.4.7.1: Spend Authorization Signature (Sapling and Orchard) `_ +.. [#protocol-orchardpaymentaddrencoding] `Zcash Protocol Specification, Version 2022.3.8. Section 5.6.4.2: Orchard Raw Payment Addresses `_ .. [#protocol-transactionstructure] `Zcash Protocol Specification, Version 2022.3.8. Section 7.1: Transaction Encoding and Consensus (Transaction Version 5) `_ \ No newline at end of file From 81b6a00126024acfded51584bc5c7ab39132a654 Mon Sep 17 00:00:00 2001 From: Vivek Arte <46618816+vivek-arte@users.noreply.github.com> Date: Tue, 14 Mar 2023 14:32:31 +0530 Subject: [PATCH 101/101] Addition of length prefix to Asset description in issuance action (#9) * changes to issuance_txid_digest to align with ZIP 244 * using flagsIssuance in place of a single bit boolean for the issue actions as well * adding assetDescSize field to IssueAction, and corresponding changes to the consensus rule changes section * rename authorization to issueAuthSig --- zip-0227.html | 34 +++++++++++++++++++++++++++++----- zip-0227.rst | 13 ++++++++----- 2 files changed, 37 insertions(+), 10 deletions(-) diff --git a/zip-0227.html b/zip-0227.html index 2632424a4..d0c39c846 100644 --- a/zip-0227.html +++ b/zip-0227.html @@ -181,6 +181,13 @@

    Issuance Action Description

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

      +
    • + \(\mathsf{assetDescSize}\) + : the size of the Asset description, a number between + \(0\) + and + \(512\) + , stored in two bytes.
    • \(\mathsf{asset\_desc}\) : the Asset description, a UTF-8 encoded string of up to 512 bytes
    • @@ -208,13 +215,25 @@
    + + + + + + - + @@ -247,7 +266,7 @@ \(\mathsf{AssetId}\) is properly associated with the issuer.
  • actions: an array of issuance actions, of type IssueAction.
  • -
  • authorization: the signature of the transaction SIGHASH, signed by the issuance authorizing key, +
  • issueAuthSig: the signature of the transaction SIGHASH, signed by the issuance authorizing key, \(\mathsf{isk}\) , that validates the issuance .
  • @@ -284,7 +303,7 @@ - + @@ -339,13 +358,18 @@

    Consensus Rule Changes

    For the IssueBundle:

      -
    • Verify the RedPallas-based issuance authorization signature on SIGHASH, authorization, is verified by invoking authorization.VerifySig(ik, SIGHASH)
    • +
    • Verify the RedPallas-based issuance authorization signature on SIGHASH, issueAuthSig, is verified by invoking issueAuthSig.VerifySig(ik, SIGHASH)

    For each IssueAction in IssueBundle:

      +
    • check that + \(0 < \mathsf{assetDescSize} <= 512\) + .
    • check that \(\mathsf{asset\_desc}\) - is a string with 0 < byte size <= 512.
    • + is a string of length + \(\mathsf{assetDescSize}\) + bytes.
    • retrieve \(\mathsf{AssetBase}\) from the first note in the sequence and check that diff --git a/zip-0227.rst b/zip-0227.rst index 31fe86cac..06ec10528 100644 --- a/zip-0227.rst +++ b/zip-0227.rst @@ -169,6 +169,7 @@ Issuance Action Description An issuance action, `IssueAction`, is the instance of issuing a specific custom Asset, and contains the following fields: +- :math:`\mathsf{assetDescSize}`: the size of the Asset description, a number between :math:`0` and :math:`512`, stored in two bytes. - :math:`\mathsf{asset\_desc}`: the Asset description, a UTF-8 encoded string of up to 512 bytes - `notes`: an array containing the unencrypted output notes of the recipients of the Asset, of type `Note` - ``finalize``: a boolean that defines whether the issuance of that specific custom Asset is finalized or not @@ -178,7 +179,8 @@ An asset's :math:`\mathsf{AssetId}` is added to the :math:`\mathsf{previously\_f ================= =============================== ========================== =========================================================================================== Size Name Data Type Description ================= =============================== ========================== =========================================================================================== -Varies :math:`\mathsf{asset\_desc}` byte UTF-8 encoded string of varied size, up to 512 bytes +2 bytes :math:`\mathsf{assetDescSize}` byte The length of the :math:`\mathsf{asset\_desc}` string in bytes +Varies :math:`\mathsf{asset\_desc}` byte UTF-8 encoded string, of size :math:`\mathsf{assetDescSize}` bytes Varies nNotes compactSize The number of notes in the issuance action noteSize * nNotes vNotes Note[nNotes] A sequence of note descriptions within the issuance action 1 byte ``flagsIssuance`` byte An 8-bit value with the ``finalize`` boolean value as the LSB, and the other bits set to 0. @@ -193,7 +195,7 @@ An issuance bundle, `IssueBundle`, is the aggregate of all the issuance-related - :math:`\mathsf{ik}`: the issuance validating key, that allows the validators to verify that the :math:`\mathsf{AssetId}` is properly associated with the issuer. - `actions`: an array of issuance actions, of type `IssueAction`. -- `authorization`: the signature of the transaction SIGHASH, signed by the issuance authorizing key, :math:`\mathsf{isk}`, that validates the issuance . +- `issueAuthSig`: the signature of the transaction SIGHASH, signed by the issuance authorizing key, :math:`\mathsf{isk}`, that validates the issuance . 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 [#protocol-transactionstructure]_. @@ -203,7 +205,7 @@ Bytes Name Data Type Description Varies nIssueActions compactSize The number of issuance actions in the bundle Varies vIssueActions IssueAction[nIssueActions] A sequence of issuance actions descriptions 32 :math:`\mathsf{ik}` byte[32] The issuance validating key of the issuer, used to validate the signature -64 authorization byte[64] The signature of the transaction SIGHASH, signed by the issuer +64 issueAuthSig byte[64] The signature of the transaction SIGHASH, signed by the issuer ======= ==================== ========================== ========================================================================= Issuance Protocol @@ -237,11 +239,12 @@ Consensus Rule Changes For the IssueBundle: -- Verify the RedPallas-based issuance authorization signature on `SIGHASH`, `authorization`, is verified by invoking `authorization.VerifySig(ik, SIGHASH)` +- Verify the RedPallas-based issuance authorization signature on `SIGHASH`, `issueAuthSig`, is verified by invoking `issueAuthSig.VerifySig(ik, SIGHASH)` For each `IssueAction` in `IssueBundle`: -- check that :math:`\mathsf{asset\_desc}` is a string with `0 < byte size <= 512`. +- check that :math:`0 < \mathsf{assetDescSize} <= 512`. +- check that :math:`\mathsf{asset\_desc}` is a string of length :math:`\mathsf{assetDescSize}` bytes. - retrieve :math:`\mathsf{AssetBase}` from the first note in the sequence and check that :math:`\mathsf{AssetBase}` is derived from the issuance validating key :math:`\mathsf{ik}` and :math:`\mathsf{asset\_desc}` as described in the `Asset Identifier`_ section. - check that the :math:`\mathsf{AssetId}` does not exist in the ``previously_finalized`` set in the global state. - check that every note in the `IssueAction` contains the same :math:`\mathsf{AssetBase}` and is properly constructed as :math:`note = (\mathsf{g_d, pk_d, v, \rho, \psi, AssetBase})`.
    1618 Zcash Protocol Specification, Version 2022.3.8. Section 7.1: Transaction Encoding and Consensus (Transaction Version 5)
    2 bytes + \(\mathsf{assetDescSize}\) + byteThe length of the + \(\mathsf{asset\_desc}\) + string in bytes
    Varies \(\mathsf{asset\_desc}\) byteUTF-8 encoded string of varied size, up to 512 bytesUTF-8 encoded string, of size + \(\mathsf{assetDescSize}\) + bytes
    Varies
    64authorizationissueAuthSig byte[64] The signature of the transaction SIGHASH, signed by the issuer