-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ZIPs 226 & 227 - ZSA Protocol: Transfer, Issuance and Burn #680
Conversation
zip-0226.rst
Outdated
+-----------------+-------------+-----------------------------------+-------------------------+ | ||
| 40*nAssetBurn | vAssetBurn | bytes[40][nAssetBurn] | 32 bytes Asset type_t, | | ||
| | | | 8 bytes of valueBalance | | ||
+-----------------+-------------+-----------------------------------+-------------------------+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might want to limit nAssetBurn
to some maximum, so that it's clear the scalar field can't overflow, see the calculations in section 4.14 of the protocol spec. It's not really necessary because transactions are limited to 2MB anyway.
How would pool migrations work with shielded assets? I'm guessing that AssetIDs could be shared across pools and the consensus rules could be extended to allow burns in the Orchard pool to create coins of the same AssetID in the new pool automatically. We might want to have that spec'd out in case there's ever an urgent need to switch pools (e.g. security vulnerability) even if we don't implement it now. One difficulty with this is that some asset issuers might want their assets to remain in one pool, so they'd want to sign some kind of approval before the consensus rules start allowing transfers. But other asset issuers might lose their private key, and then get unintentionally stuck in an old pool. |
zip-0226.rst
Outdated
|
||
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. | ||
.. math:: \mathsf{bvk = (\sum cv_i^{net})} - \mathsf{ ValueCommit_0^{Orchard}(v^{balanceOrchard})} - \sum_{\mathsf{assetBurn}} \mathsf{ValueCommit_0^{OrchardZSA}(AssetBase, v^{AssetBase}) } = \sum \mathsf{rcv_{i,j}^{net}}\mathcal{R}^{\mathsf{Orchard}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The \sum
s here should technically be the large diamond addition operator used in the spec. I know this is difficult to represent in Markdown; don't worry about it for now and I will include it as an image later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As explained in § 4.14 Balance and Binding Signature (Orchard), the validators compute
We started a full top-to-bottom consistency check for both ZIPS by our new team member @AntoineRondelet, tracked here: QED-it#18. We all can expect a much more consistent documents once it is done. |
Summary of today's meeting: We discussed the circuit constraints for split notes, specifically the constraints on the nullifier and The old note commitment has to correspond to an existing note in order to confirm that the value base input to the commitment is correct for some issued asset (i.e. an output of the hash-to-curve). But the nullifier has to be something other than the nullifier for that note, so that the transaction will not be rejected as a double-spend. The old note commitment fixes Suppose that we keep the derived nullifier computation the same and still check that the derived nullifier corresponds to the public Qedit proposes (🇦) that the check that the derived I think either of these can work. Constance said that 🇦 is simpler in terms of circuit changes. I said that I'd ask @str4d and @ebfull for their opinions. While analysing both alternatives, I noticed that the current proposed circuit does not check that the split note flag is only set for non-native assets. I'm not sure this it's strictly necessary to check that, but I argued that it makes the analysis simpler because it cuts down the number of cases that must be considered. (Without this constraint, you'd have to consider both native and non-native cases for split notes.) We also talked about whether it was necessary to prove knowledge of the There was also an issue of whether adding another check to the Orchard gate would require referencing the previous as well as next row. I wasn't sure whether that actually made any difference to performance, given that we reference the previous row in other gates. I said I would ask @ebfull about that. |
@ebfull and I looked at this in detail, and found that 🇧 is insecure against a roadblock attack. (See section 8.4 of the protocol spec or slide 24 of my Zcash security presentation at Zcon3, with video here, for discussion of roadblocks and other attacks against spendability.) The reason is that it would be possible for an adversary, who sees some transaction spending a victim note and then front-runs that transaction, to choose the same nullifier for a split note and block the victim note from ever being spent. Unfortunately, approach 🇦 also falls to a more subtle roadblock attack that I just found. Let's try to prove it secure to see where the proof falls down. The reason why the existing protocol without ZSAs resists roadblock attacks, is that the nullifier can be viewed as being computed as a Pedersen hash that has independent bases for the scalar that an adversary could potentially control (that is, Without loss of generality we can assume that the attack targets a specific victim note; a similar argument applies even if it is targeting any of multiple notes. There are two cases for a roadblock using a split note:
However, nothing prevents the attacker from choosing the same A solution would be to ensure that the adversary proves they would be authorized to spend the split note, checking Then, to prevent the roadblock attack while still allowing the ZSA Action statement to be satisfied, we must have a different derivation for a split note's nullifier that still ensures collision resistance. The best way to do this I think (call this approach 🇨), is to compute the nullifier for a split note as It would also have been possible to add [Edit on 2023-07-05: |
Co-authored-by: Daira Emma Hopwood <daira@jacaranda.org>
This performs a rename of the Issuance keys as follows: - `imk : Issuance master key` is renamed to `isk: Issuance authorizing key`
This adds some details to the ZIP 226 Security and Privacy Considerations section to address this [comment](zcash#680 (comment))
Signed-off-by: Daira Emma Hopwood <daira@jacaranda.org>
For all actions ``IssueAction``: | ||
|
||
- 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 `Specification: Asset Identifier`_ section. | ||
- compute :math:`\mathsf{AssetBase}` from :math:`\mathsf{AssetDigest}` as decribed in the `Specification: Asset Identifier`_ section. | ||
- set the :math:`\mathsf{finalize}` boolean as desired (if more issuance actions are to be created for this :math:`\mathsf{AssetBase}`, set :math:`\mathsf{finalize} = 0`, otherwise set :math:`\mathsf{finalize} = 1`). | ||
- for each recipient :math:`i`: | ||
|
||
- generate a ZSA output note that includes the Asset Base. For an Orchard-ZSA note this is :math:`\mathsf{note}_i = (\mathsf{d}_i, \mathsf{pk}_{\mathsf{d}_i}, \mathsf{v}_i, \rho_i, \mathsf{rseed}_i, \mathsf{AssetBase}, \mathsf{rcm}_i)\!`. | ||
|
||
- encode the ``IssueAction`` into the vector ``vIssueActions`` of the bundle. | ||
|
||
For the ``IssueBundle``: | ||
|
||
- encode the ``vIssueActions`` vector. | ||
- encode the :math:`\mathsf{ik}` as 32 byte-string. | ||
- sign the SIGHASH transaction hash with the issuance authorizing key, :math:`\mathsf{isk}`, using the :math:`\mathsf{IssueAuthSig}` signature scheme. The signature is then added to the issuance bundle. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@daira note to self: check whether explicit type declarations or consensus rules are needed here.
This fixes a typo in the ZSA-Orchard Action Description table, wherein one table entry was not updated from 580 to 612 bytes.
This updates the ZSA ZIPs based on the comments made on PR#680.
Thanks for the comments and suggestions @daira! We have addressed them in our latest updates, and believe the PR is ready for merging. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK modulo the merge conflict. I will do a follow-up PR to change some formatting and other editorial issues.
) This adds to the specification to provide wallets instructions on displaying Asset information to users in an unambiguous way. This addresses [this comment](zcash#680 (comment)).
zcash#33) This addresses [this comment](zcash#680 (comment)).
This adds some details to the ZIP 226 Security and Privacy Considerations section to address this [comment](zcash#680 (comment))
Superceded by #778. |
As mentioned, closed in favor of #778. |
This PR continues the discussion from the outdated #649.
Content:
The updated table of contents: https://qed-it.github.io/zips/
ZIP 226: Transfer and Burn of Zcash Shielded Assets
ZIP 227: Issuance of Zcash Shielded Assets
ZIP 230: Version 6 Transaction Format