This page is the Simplified Technical English version of ZIP 210. The source ZIP is the normative text. Read the writing rules to understand the marked words.
ZIP 210: Sapling Anchor Deduplication within Transactions
ZIP: 210 Title: Sapling Anchor Deduplication within Transactions Owners: Jack Grigg <thestr4d@gmail.com> Status: Withdrawn Category: Consensus Created: 2019-03-27 License: MIT
Status
This ZIP is withdrawn, because the ZIP 225 proposal for a version 5 transaction format includes a similar change [zip-0225].
Terminology
On this page, STE words are in the place of the BCP 14 key words of the source. Refer to the key word table.
In this document, the term "network upgrade" has the meaning in ZIP 200 [zip-0200].
In this document, the term "Sapling" has the meaning in ZIP 205 [zip-0205].
Abstract
This ZIP contains a change to the transaction format. With this change, one Sapling anchor is used for all Sapling spends. As a result, a potential implementation fingerprint is removed. The size of Sapling transactions in the block chain also decreases.
Motivation
The Sapling network upgrade [zip-0205] has new shielded inputs (spends) and outputs. For each spend, the spender proves that the spent note exists. To do this, the spender includes the anchor of a Merkle tree that contains the commitment of the note. The spender also proves in zero knowledge that a path exists from the commitment to the anchor. This path is a witness.
The valid anchors correspond to the state of the Sapling commitment tree after each block in the chain.
A spender who selects an anchor leaks information about the note that the spender spends. That is, the note was created at or before the block height of the anchor. This leak is an unavoidable outcome of the Zcash design. It is also the least information that it is possible to leak about a spent note.
But the Sapling v4 transaction format [protocol-txnencoding] includes a separate anchor for each Sapling spend. Thus it is possible to leak more information by the use of different anchors for different notes. The anchor selection choices can also be used as a fingerprint to identify transactions that particular wallet implementations create. As a result, the privacy set decreases.
In the new transaction format version, there is one Sapling anchor field instead of one field for each Sapling spend. Thus, in that version, it is not possible to create transactions with this fingerprint. The size of the transaction also decreases. The cost is 32 bytes for each transaction, instead of 32 bytes for each spend.
Specification
A new transaction format is defined. It is identical to the Sapling v4 transaction format except for two changes:
- The
anchorfield inSpendDescriptionis removed. - A new field
saplingAnchoris placed betweenvShieldedOutputandvJoinSplit, if and only ifvShieldedSpendis not empty.
Consensus rules that applied to individual anchor entries before this change must be applied to saplingAnchor.
TODO: If this is the only ZIP that has a change to the transaction format in a network upgrade, specify the full transaction format here. Otherwise, refer to the new transaction format when it is specified.
Implementations that support older transaction formats can copy saplingAnchor into the in-memory representation of each spend during parsing, to reduce code duplication. These implementations must make sure that these in-memory anchors, one for each spend, are all identical before serialization.
Rationale
The saplingAnchor field is after vShieldedOutput. This placement has two effects. A transaction can include the field conditionally. Thus space is saved when there are no Sapling spends. A parser can still parse the transaction unambiguously.
When all Sapling spends must use the same anchor, a possible performance optimisation is removed. This optimisation is for some classes of wallets, particularly light wallets. In this optimisation, a wallet updates witnesses for older notes only periodically, instead of at each block. This optimisation is exactly the kind of behaviour that can be used as a fingerprint in the v4 transaction format. Our decision is to prevent this kind of behaviour with this ZIP.
Security and Privacy Considerations
With this ZIP, a possible way to distinguish transactions by the implementation that created them is removed.
Reference Implementation
TBD
References
- [BCP14]
- Information on BCP 14 — "RFC 2119: Key words for use in RFCs to Indicate Requirement Levels" and "RFC 8174: Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words"
- [protocol-txnencoding]
- Zcash Protocol Specification, Version 2021.2.16. Section 7.1: Transaction Encoding and Consensus
- [zip-0200]
- ZIP 200: Network Upgrade Mechanism
- [zip-0205]
- ZIP 205: Deployment of the Sapling Network Upgrade
- [zip-0225]
- ZIP 225: Version 5 Transaction Format