diff --git a/zip-0320.html b/zip-0320.html
index ac846081..f8e4891e 100644
--- a/zip-0320.html
+++ b/zip-0320.html
@@ -14,44 +14,63 @@ Owners: Daira Emma Hopwood <daira@electriccoin.co>
Credits: Hanh
Status: Draft
Category: Standards / Wallet
-Discussions-To: <https://github.com/zcash/zips/issues/757>
+Created: 2024-01-12
+License: MIT
+Discussions-To: <https://github.com/zcash/zips/issues/757>
+Pull-Request: <https://github.com/zcash/zips/pull/760>
The key words "MUST", "MUST NOT", "SHOULD", and "MAY" in this document are to be interpreted as described in BCP 14 1 when, and only when, they appear in all capitals. The terms below are to be interpreted as follows: This ZIP defines a new encoding for transparent Zcash addresses. Wallets must ensure that no shielded notes are spent in transactions that send to a transparent address encoded in the specified fashion. This ZIP is presently in Draft status, and defines two alternate encodings This ZIP is presently in Draft status, and defines two alternate encodings for consideration. Analysis of the benefits and drawbacks of each of the proposed alternatives is presented at the end of this document. In November of 2023, the Zcash community received notice from the Binance cryptocurrency exchange that Zcash was at risk of being delisted from the exchange unless the community could provide a mechanism by which Binance could refuse deposits from shielded addresses and return them to the depositor. This issue was raised and discussed at length in the Zcash Community forum 2. In the course of that discussion thread, wallet developer and community member @hanh 3 suggested a wallet-oriented approach 4 that involved defining a new encoding for Zcash transparent P2PKH addresses. A Consumer of such an address, whether it be a wallet or an exchange, could recognize this encoding as a directive that the wallet should only spend transparent funds when creating an output to that address. The Binance cryptocurrency exchange requires that funds sent to their deposit addresses come from source addresses that are readily identifiable using on-chain information, such that if necessary funds may be rejected by sending them back to the source address(es). This ZIP is intended to standardize a transparent address encoding that is only usable by wallets that understand and will respect this constraint. The Binance cryptocurrency exchange requires that funds sent to their deposit addresses come from source addresses that are readily identifiable using on-chain information, such that if necessary funds may be rejected by sending them back to the source address(es). This ZIP is intended to standardize a transparent address encoding that is not yet understood by preexisting Consumers, in order to prevent inadvertent shielded spends when sending to such addresses. Then, Consumers that upgrade to support the new encoding will do so with the understanding that they must respect the restrictions on sources of funds described in this ZIP. This alternative was suggested by @hanh in 4. A TEX Address is a A TEX Address is a The TEX Address is the simplest-possible approach to creating a new address type that indicates that only transparent sources of funds should be used. The TEX Address is the simplest possible approach to creating a new address type that indicates that only transparent sources of funds should be used. A TEX address may be produced from a mainnet Zcash P2PKH Address by executing the following steps: A TEX address is produced from a mainnet Zcash P2PKH Address by executing the following steps: For testnet addresses, the lead bytes of a P2PKH address are
+ For testnet addresses, the required lead bytes of a P2PKH address in step 2 are
\(\mathtt{[0x1C, 0xB8]}\)
- and the Terminology
+
Abstract
Background
+ Motivation
- Requirements
-
Specification (Alternative 1)
+ Alternative 1
+ TEX Addresses
- bech32m
reencoding of a transparent Zcash P2PKH address 5bech32m
reencoding of a transparent Zcash P2PKH address 8.Motivations for Alternative 1
- Detailed Specification (Alternative 1)
- Specification (Alternative 1)
+
-
- base58check
decoding algorithm.bech32m
encoding as defined in 6 with the human-readable prefix (HRP) 'tex'
."tex"
.'textest'
HRP should be used when reencoding."textest"
HRP is used when reencoding in step 3.
Wallets and other Senders sending to a TEX address MUST ensure that only transparent UTXOs are spent in the creation of a transaction.
A Traceable Unified Address is a reencoding of a transparent Zcash address into a Unified Address 2.
+A Traceable Unified Address is a reencoding of a transparent Zcash address into a Unified Address 5.
Traceable Unified Addresses fit into the existing Zcash Unified Address ecosystem. As such, wallets that support Unified Addresses will be able to parse (but not necessarily send to) a Traceable Unified Address. Even in the case that Traceable Receivers are not understood by the sending wallet, a Unified Address-supporting wallet will be able to automatically provide good error messages for their users to indicate that the wallet needs to be updated to understand these addresses.
-In addition, by integrating with the Unified Address framework, it becomes possible for the addresses being generated to include extra metadata, in particular, metadata items such as an Address Expiry Height or Address Expiry Date 4 may be included. For exchange use cases such as Binance's, it is useful to ensure that an address provided to a user has a limited utility life, such that after expiration the user must obtain a new address in order to be able to continue to send funds.
+Traceable Unified Addresses fit into the existing Zcash Unified Address ecosystem. Existing Consumers that support Unified Addresses will automatically be able to recognize a Traceable Unified Address as a valid Zcash address, but will not be able to send to that address unless they update their code to understand the new Receiver Typecode defined in this ZIP. Even in the case that Traceable Receivers are not understood by the sending wallet, a Unified Address-supporting wallet will be able to automatically provide good error messages for their users to indicate that the wallet needs to be updated to understand and send to these addresses.
+In addition, by integrating with the Unified Address framework, it becomes possible for the addresses being generated to include extra metadata, in particular, metadata items such as an Address Expiry Height or Address Expiry Date 7 may be included. For exchange use cases such as Binance's, it is useful to ensure that an address provided to a user has a limited utility life, such that after expiration the user must obtain a new address in order to be able to continue to send funds 9.
Upon activation of this ZIP, the section Encoding of Unified Addresses of ZIP 316 2 will be modified to define a new Traceable Receiver Type having typecode
+ Upon activation of this ZIP, the section Encoding of Unified Addresses of ZIP 316 5 will be modified to define a new Traceable Receiver Type having typecode
\(\mathtt{0x04}\)
- , the value of which must be the 20-byte validating key hash of a Zcash P2PKH Address as defined in 5. The "Requirements for both Unified Addresses and Unified Viewing Keys" section of ZIP 316 3 will be modified as follows:Specification (Alternative 2)
+
The "Requirements for both Unified Addresses and Unified Viewing Keys" section of ZIP 316 6 will be modified as follows — the text:
A Unified Address or Unified Viewing Key MUST contain at least one shielded Item (Typecodes :math:`\mathtt{0x02}` and :math:`\mathtt{0x03}`). The rationale is that the existing P2SH and P2PKH transparent-only @@ -91,7 +112,7 @@ address formats, and the existing P2PKH extended public key format, suffice for representing transparent Items and are already supported by the existing ecosystem.
will be replaced by:
-A Unified Address MUST contain at least one Receiver, plus any number +A Unified Address MUST contain at least one Receiver and any number of Metadata Items. The selection of Receivers is further restricted such that a Unified Address MUST **either** contain at least one shielded Receiver (Typecodes :math:`\mathtt{0x02}` and :math:`\mathtt{0x03}`), OR @@ -102,20 +123,24 @@ A Unified Viewing Key MUST contain at least one shielded Item (Typecodes :math:`\mathtt{0x02}` and :math:`\mathtt{0x03}`).A Traceable Unified Address is produced from a mainnet Zcash P2PKH address by executing the following steps:
-
+- Decode the address to a byte array using the
-base58check
decoding algorithm.- Remove the two-byte address prefix from the resulting byte array. These bytes should be equal to +
- Decode the address to a byte array using the Base58Check decoding algorithm 10.
+- If the length of the resulting byte sequence is not 22 bytes or if its two-byte address prefix is not \(\mathtt{[0x1C, 0xB8]}\) - . The remainder of the byte array (the validating key hash) should have a length of 20 bytes.
+ , return an error. Otherwise, let the validating key hash be the remaining 20 bytes of the array after removing the two-byte address prefix.- Construct a new Unified Address using a single Traceable Receiver \(\mathtt{0x04}\) - with the 20-byte validating_key_hash as its value. In addition, metadata items such as an Address Expiry Height or Address Expiry Date 4 may be included.
+ with the 20-byte validating_key_hash as its value. In addition, metadata items such as an Address Expiry Height or Address Expiry Date 7 MAY be included.Wallets and other Senders sending to a Traceable Unified Address MUST ensure that only transparent UTXOs are spent in the creation of a transaction.
Javascript library zcash_address_wasm:
+// Create a deposit address that is valid for 30 days +var expiry_time = new Date(); +expiry_time.setDate(expiry_time.getDate() + 30); +var traceable_addr = to_traceable_address('t1VmmGiyjVNeCjxDZzg7vZmd99WyzVby9yC', expiry_time.getTime() / 1000) -->Rust:
+2 | +Zcash Community Forum thread "Important: Potential Binance Delisting" | +
---|
3 | +'Zcash Community Forum user @hanh <https://forum.zcashcommunity.com/u/hanh/summary>'_ | +
---|
4 | +'Ywallet developer @hanh's proposal <https://forum.zcashcommunity.com/t/important-potential-binance-delisting/45954/112>'_ | +
---|
5 | ZIP 316: Unified Addresses |
---|
3 | +6 | ZIP 316: Requirements for both Unified Addresses and Unified Viewing Keys |
---|
4 | +7 | ZIP 316: |
---|
5 | +8 | Zcash Protocol Specification, Version 2023.4.0. Section 5.6.1.1 Transparent Addresses |
---|
9 | +Zcash Community Forum post describing motivations for address expiry | +
---|
10 | +Base58Check encoding — Bitcoin Wiki | +
---|
11 | +ZIP 316: F4Jumble encoding | +
---|
6 | +12 | BIP 350: Bech32m format for v1+ witness addresses |
---|