diff --git a/rendered/zip-0227.html b/rendered/zip-0227.html index d8171df05..d98cd8d05 100644 --- a/rendered/zip-0227.html +++ b/rendered/zip-0227.html @@ -268,47 +268,17 @@

Specification: Asset Identifier, Asset Digest, and Asset Base

-

For every new Asset, there MUST be a new and unique Asset Identifier, denoted +

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

-

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

-

Let

- -

Define

+ . A given Asset Identifier is used across all Zcash protocols that support ZSAs -- that is, the OrchardZSA protocol and potentially future Zcash shielded protocols.

+

From the Asset Identifier, we derive an Asset Digest

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

where

- -

Define

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

In the case of the OrchardZSA protocol, we define

-
\(\mathsf{ZSAValueBase}(\mathsf{AssetDigest_{AssetId}}) := \mathsf{GroupHash}^\mathbb{P}(\texttt{"z.cash:OrchardZSA"}, \mathsf{AssetDigest_{AssetId}})\)

where - \(\mathsf{GroupHash}^\mathbb{P}\) - is defined as in 31.

+ \(\mathsf{EncodeAssetId}(\mathsf{AssetId})\) + is a canonical encoding scheme for the Asset Identifier.

+

From the Asset Digest, we derive a specific Asset Base that represents the Custom Asset within each shielded protocol:

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

This Asset Base is included in shielded notes within the shielded protocol.

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

@@ -319,13 +289,38 @@ (resp. \(\mathsf{Protocol}\!\) ) in the subscript (resp. superscript) when the Asset Identifier (resp. Protocol) is clear from the context.

-

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

- +

ZIP 227 Asset Identifiers

+

Assets issued using the protocol specified in this ZIP are scoped to the + \(\mathsf{ik}\) + that issued them. Within that scope, Asset Identifier uniqueness is obtained by way of an asset description, + \(\mathsf{asset\_desc}\!\) + , which includes any information pertaining to the issuance. + \(\mathsf{asset\_desc}\) + is a non-empty byte sequence which SHOULD be a well-formed UTF-8 code unit sequence according to Unicode 15.0.0 or later.

+

Define

+
\(\mathsf{AssetDescHash} := \textsf{BLAKE2b-256}(\texttt{“ZSA-AssetDescCRH”},\; \mathsf{asset\_desc}),\)
+

We define Asset Identifiers for assets issued under this ZIP as

+
\(\mathsf{AssetId} := (\mathsf{ik}, \mathsf{AssetDescHash})\)
+

and define their canonical encoding as

+
\(\mathsf{EncodeAssetId}(\mathsf{AssetId}) = \mathsf{EncodeAssetId}((\mathsf{ik}, \mathsf{AssetDescHash})) := \mathtt{0x00} || \mathsf{ik} || \mathsf{AssetDescHash}\)
+

Note that the initial + \(\mathtt{0x00}\) + byte is a version byte, enabling future ZIPs to specify alternative issuance protocols and Asset Identifiers.

+

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

+
    +
  • Wallets could allow clients to provide an additional configuration file that stores a one-to-one mapping of names to Asset Identifiers via a petname system. 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.
  • +
  • The Asset Digest could be used as a more compact bytestring to uniquely determine an Asset, and wallets could support clients scanning QR codes to load Asset information into their wallets.
  • +
+
+

OrchardZSA Custom Assets

+

In the case of the OrchardZSA protocol, we define

+
\(\mathsf{ZSAValueBase}(\mathsf{AssetDigest_{AssetId}}) := \mathsf{GroupHash}^\mathbb{P}(\texttt{"z.cash:OrchardZSA"}, \mathsf{AssetDigest_{AssetId}})\)
+

where + \(\mathsf{GroupHash}^\mathbb{P}\) + is defined as in 31.

+

Specification: Issue Note, Issuance Action, Issuance Bundle and Issuance Protocol

Issue Note

@@ -426,13 +421,16 @@