Can only be used for payment scenarios with no programmability
2. Main Concepts
Note: Zcash has undergone several protocol upgrades and we only focus on the latest version. This article mainly introduces the core concepts of Zcash.
Note is the basic unit of the Zcash protocol, similar to the UTXO of BTC; in Zcash, the inputs and outputs of all transactions are notes. Of course, Zcash also supports non-anonymous transactions, identical to Bitcoin's transaction model. Therefore, in order to further understand Zcash, you must know the data structure of note first:
rcm : being used to compute the random number of the note commitment
In the Zcash protocol, the note cannot be made public due to the requirement of privacy. Therefore, the corresponding commitment needs to be computed to represent the note. The computation method is as follows:
A transaction may contain multiple action transfers, and each action transfer will spend the old note and generate a new note. The data structure is as follows:
The entire transaction structure consists of four parts:
Public info (1 - 5)
Transparent transactions info (6 - 9)
Sapling transactions info (10 - 16)
Orchard transaction info (17 - 25)
2.5.2 From transparent to shield
The Orchard protocol includes two types of addresses, transparent address (TA) and shield address (SA). Generally, in order to execute a private transaction, it is necessary to transfer from TA to SA first. The corresponding transaction structure should be:
Public info (1 - 5)
Transparent transactions info (6 - 9)
tx_in _* : actual value
tx_out _* : default value
Sapling transactions info (10 - 16)
All : default value
Orchard transaction info (17 - 25)
All: actual value
2.5.3 From shield to shield
The Orchard protocol includes two types of addresses, transparent address (TA) and shield address (SA). Generally, in order to execute a private transaction, it is necessary to transfer from TA to SA first. The corresponding transaction structure should be:
Public info (1 - 5)
Transparent transactions info (6 - 9)
All : default value
Sapling transactions info (10 - 16)
All : default value
Orchard transaction info (17 - 25)
All: actual value
2.5.4 From shield to transparent
The Orchard protocol includes two types of addresses, transparent address (TA) and shield address (SA). Generally, in order to execute a private transaction, it is necessary to transfer from TA to SA first. The corresponding transaction structure should be:
Public info (1 - 5)
Transparent transactions info (6 - 9)
tx_in _* : default value
tx_out _* : actual value
Sapling transactions info (10 - 16)
All : default value
Orchard transaction info (17 - 25)
All: actual value
2.6 How is privacy achieved?
Unlinkable The generated note is represented by cm, and the spent note is represented by nf. There is no connection between nf and cm. Therefore, no one can know in which transaction any generated note was spent.
Private
Sender address: The transaction information does not contain the sender address and the spendAuthSig is a one-time signature (it is different every time, so the public key is different, rk)
Receiver address: The transaction does not contain the receiver's address and the new note plaint is encrypted by the receiver's public key (the receiver's private address is also one-time)
Value: Hide the note in the form of pedersen commitment, and ensure the balance attribute of the transaction by bindsig
Aleo
1. The similarities and differences with Zcash
Zcash can only execute private transactions based on the OUTX model and have no programmability; therefore, the main difference between Aleo and Zcash is privacy programmability; and the similarity is that they both support privacy attributes (transaction privacy is not only limited to assets).
2. Aleo vs Zcash
2.1 Unit
Unlike the note of Zcash, the basic operation unit of Aleo is record (UTXO in BTC). Find the main differences between the two below:
Although the names of the specific parameters are different, there is a corresponding relationship between the two from the functional point of view: corresponding to the address information of the note owner, commitment-related information, nf/sn-related information, and value-related information, respectively. Therefore, the structures of the two are quite similar; the main differences exist in the birth predicate and death predicate of the record, which are two Boolean-type functions, representing the conditions that need to be met when a record is in the birth(generate) and death(spend) stages. This part supports user-defined, so it’s programmable.
The old record legitimacy (have the right to spend the record)
The new record validity
The birth/death predicate validity (similar to the balance check in Zcash)
3. More
3.1 Technologies not mentioned
From the perspective of the paper, the privacy design of Aleo 's programmable privacy design is more similar to the earlier Zcash white paper (zerocash), the similar key structure, the similar note structure and the similar name (nf is called sn in zerocash, serial number). This article makes a comparison based on the latest paper of Zcash and the ZEXE of Aleo. Although there are differences in specific details, such as the key structure and the specific cryptographic methods used, the high-level design is generally the same. In addition to the technical details described above, there are still some other technical details that have not been mentioned yet, such as the delegate prover scheme, zero-knowledge proof algorithm, recursion/aggregation scheme, and so on. People interested in them can study further.
3.2 Why are they all UTXO -based, not account-based?