Skip to content

Update encodings for ik and issueAuthSig#31

Merged
vivek-arte merged 15 commits intozsa1from
update_ik_issueauthsig_encoding
Sep 1, 2025
Merged

Update encodings for ik and issueAuthSig#31
vivek-arte merged 15 commits intozsa1from
update_ik_issueauthsig_encoding

Conversation

@vivek-arte
Copy link
Copy Markdown

@vivek-arte vivek-arte commented Jul 12, 2025

This is a companion PR to QED-it/orchard#182. It makes the changes to the specification made in zcash/zips#1042, namely the addition of a 0x00 byte to the start of the issuance validating key and the issuance authorization signature.

Copy link
Copy Markdown

@PaulLaux PaulLaux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added minor comments

Comment thread zcash_test_vectors/orchard_zsa/issuance_auth_sig.py Outdated
Comment thread zcash_test_vectors/orchard_zsa/issuance_auth_sig.py Outdated
Comment thread zcash_test_vectors/orchard_zsa/issuance_auth_sig.py Outdated
Comment thread zcash_test_vectors/orchard_zsa/key_components.py Outdated
Copy link
Copy Markdown

@PaulLaux PaulLaux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still, the intent of https://github.com/zcash/zips/pull/1053/files is not fully reflected from these changes.

We need an "encoding" step (a function to encode) to add the
$\mathtt{ZSA-BIP340-SIG-SCHEME} = \mathtt{0x00}$ to
$\mathtt{issueAuthSig_encoding} = \mathtt{ZSA-BIP340-SIG-SCHEME}||\ ...$

$\mathtt{ZSA-BIP340-SIG-SCHEME} = \mathtt{0x00}$ to
and $\mathsf{issuer} = \mathsf{ik_encoding} = \mathtt{ZSA-BIP340-SIG-SCHEME} ||\ \mathsf{ik}$

the constant name should be
ZSA_BIP340_SIG_SCHEME = b'\0'

Also, The issuer should be properly represented here.

In addition, these changes also should be reflected in the code:


math:: \mathsf{AssetId} := (\mathsf{issuer}, \mathsf{assetDescHash})

and define their canonical encoding as

.. math:: \mathsf{EncodeAssetId}(\mathsf{AssetId}) = \mathsf{EncodeAssetId}((\mathsf{issuer}, \mathsf{assetDescHash})) := \mathtt{0x00} \,||\, \mathsf{issuer}\,||\,\mathsf{assetDescHash}

see https://github.com/zcash/zips/pull/1053/files#diff-c6949a94266d29a04e537001e58384261262c4c490334776ae26ff28b3437d00R255

The associated constant name for this should be
ZSA_ASSETID_VERSION_BYTE = b'\0'

The Orchard implementation should mimic those changes

Comment thread test-vectors/rust/orchard_zsa_digests.rs Outdated
PaulLaux
PaulLaux previously approved these changes Aug 28, 2025
Copy link
Copy Markdown

@PaulLaux PaulLaux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good,

In this PR:

    allowed_choices = [
        [False, False, False],
        [False, False, True],
        [True, False, False],
        [True, False, True],
        [True, True, False],
        [True, True, True]
    ]

drop [False, False, True] - issuance without OrchardZSA bundle is not allowed.
Merge after fixing the in body comment.

For a subsequent PR we need:

  • Burns: Are we testing burns? I see orchard_zsa_burn_field_bytes() but it is always empty, isn't it. Also, must enforce no duplicates and no zero value burn.

  • We should create Reference note for first issuance of an Asset. Curently there is no referance to it.

  • We need ρ for IssueNotes: rho = DeriveIssuedRho(nf0,0, indexAction, indexNote)
    If unclear, let's discuss in our meeting.

Comment thread zcash_test_vectors/orchard_zsa/asset_base.py Outdated
@ConstanceBeguier
Copy link
Copy Markdown

I think orchard_zsa_issuance_auth_sig.rs should be also updated (ik and sig must begin with 0x00)

@vivek-arte
Copy link
Copy Markdown
Author

Implemented the suggestions in #31 (review) and also updated the issueAuthSig to be generated from the signature digest rather than the txid_digest (which differs in the case where transparent inputs are present).

Burns: Are we testing burns? I see orchard_zsa_burn_field_bytes() but it is always empty, isn't it. Also, must enforce no duplicates and no zero value burn.

  • We are testing burns, yes. The function is defined and is not empty.
  • We are not enforcing no duplicates and no zero-value burns though, noted.

@vivek-arte vivek-arte requested a review from PaulLaux August 29, 2025 13:10
PaulLaux
PaulLaux previously approved these changes Aug 31, 2025
Copy link
Copy Markdown

@PaulLaux PaulLaux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With minor comments

Comment thread zcash_test_vectors/transaction_v6.py Outdated
Comment thread zcash_test_vectors/transaction_v6.py Outdated
Comment thread zcash_test_vectors/transaction_v6.py Outdated
Comment thread zcash_test_vectors/transaction_v6.py Outdated
ConstanceBeguier added a commit to QED-it/orchard that referenced this pull request Sep 1, 2025
…es (#182)

This PR makes the updates to the encoding of the issuance validating key
and the issuance authorization signature, as done in the specification
in zcash/zips#1042, along with the further updates in zcash/zips#1048
and zcash/zips#1053.

The test vectors are updated in QED-it/zcash-test-vectors#31.

---------

Co-authored-by: Constance Beguier <constance@qed-it.com>
@vivek-arte vivek-arte merged commit 5976b22 into zsa1 Sep 1, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants