Skip to content

Commit 4fdcc01

Browse files
authored
Merge pull request #144 from tronprotocol/feature/verify_proofs
TIP-137: add the link
2 parents c8906ea + 4178148 commit 4fdcc01

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

tip-137.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
```
33
tip: 137
4-
title: Zero-knowledeg Proof Verification functions
4+
title: Zero-knowledge Proof Verification functions
55
author: federico<federico.zhen@tron.network>
66
discussions-to: https://github.com/tronprotocol/tips/issues/137
77
status: draft
@@ -12,32 +12,32 @@ created: 2020-03-09
1212

1313
## Simple Summary
1414

15-
The TIP provides the zero-knowledge proof verification functions in shielded contract, which can be used in shielded token transactions.
15+
The TIP provides the zero-knowledge proof verification functions in the shielded contract ([TIP-135](https://github.com/tronprotocol/tips/blob/master/tip-135.md)), which can be used in shielded token transactions.
1616

1717
## Abstract
1818

19-
The TIP introduces three new functions: `verifyMintProof`, `verifyTransferProof`, and `verifyBurnProof`, which are implemented in the form of precompiled contract, and can accelerate the zero-knowledge verification for the `mint`, `transfer` and `burn` operations in shielded token contract.
19+
The TIP introduces three new functions: `verifyMintProof`, `verifyTransferProof`, and `verifyBurnProof`, which are implemented in the form of the precompiled contract, and can accelerate the zero-knowledge verification for the `mint`, `transfer` and `burn` operations in the shielded token contract.
2020

2121
## Motivation
2222

23-
In order to implement shielded transaction for [TRC-20](https://github.com/tronprotocol/TIPs/blob/master/tip-20.md) token, We have developed the shielded token contract. The contract has three core modules: `mint`, `transfer` and `burn`. `mint` is used to transform the public TRC-20 tokens into shielded tokens. `transfer` is used for shielded token transactions. `burn` is used to transform the shielded tokens back to public TRC-20 tokens. The shielded contract is implemented based on zero-knowledge proof, so it needs the complex zero-knowledge proof verification in `mint`, `transfer` and `burn` methods. In order to accelerate the speed, we will make use of the new functions in the contract to implement the verification process.
23+
To implement the shielded transactions for [TRC-20](https://github.com/tronprotocol/TIPs/blob/master/tip-20.md) token, We have developed the shielded token contract ([TIP-135](https://github.com/tronprotocol/tips/blob/master/tip-135.md)). The contract has three core modules: `mint`, `transfer` and `burn`. `mint` is used to transform the public TRC-20 tokens into shielded tokens. `transfer` is used for shielded token transactions. `burn` is used to transform the shielded tokens back to public TRC-20 tokens. The shielded contract is implemented based on zero-knowledge proof, so it needs the complex zero-knowledge proof verification in `mint`, `transfer` and `burn` methods. To accelerate the speed, we will make use of the new functions in the contract to implement the verification process.
2424

2525
## Specification
2626

27-
The following define the methods implementation for shielded token contract.
27+
The following defines the implementation of the methods for the shielded token contract.
2828

2929
### Preliminaries
3030
**NoteCommitment**
3131

32-
The TRC-20 token is tranformed into shielded token in the form of commitment by cryptographic method, which is defined as:
32+
The TRC-20 token is transformed into shielded token in the form of commitment by cryptographic method, which is defined as:
3333

3434
*note<sub>-</sub>commitment = NoteCommitment<sub>r</sub>(v)*
3535

36-
The `v` value is hided by `note_commitment` with the blinding factor `r`.
36+
The `v` value is hidden by `note_commitment` with the blinding factor `r`.
3737

3838
**SpendDescription**
3939

40-
The `SpendDescription` includes zk-SNARK proof related data, which is used as the input of shielded token transaction.
40+
The `SpendDescription` includes zk-SNARK proof related data, which is used as the input of the shielded token transaction.
4141

4242
```text
4343
message SpendDescription {
@@ -52,7 +52,7 @@ message SpendDescription {
5252

5353
**ReceiveDescription**
5454

55-
The `ReceiveDescrion` also includes zk-SNARK proof related data, which is used as the output of shielded token transaction.
55+
The `ReceiveDescrion` also includes zk-SNARK proof related data, which is used as the output of the shielded token transaction.
5656

5757
```text
5858
message ReceiveDescription {
@@ -117,32 +117,32 @@ The total input length of `verifyTransferProof` is variable. According to the in
117117
[320 bytes for input][288 bytes for output][64 bytes for spend_authority_signature]
118118
```
119119

120-
The total input lengh of `verifyTransferProof` is 1856 bytes.
120+
The total input length of `verifyTransferProof` is 1856 bytes.
121121

122122
- one input and two output
123123

124124
```
125125
[320 bytes for input][576 bytes for output][64 bytes for spend_authority_signature]
126126
```
127-
The total input lengh of `verifyTransferProof` is 2144 bytes.
127+
The total input length of `verifyTransferProof` is 2144 bytes.
128128

129129
- two input and one output
130130

131131
```
132132
[640 bytes for input][288 bytes for output][128 bytes for spend_authority_signature]
133133
```
134134

135-
The total input lengh of `verifyTransferProof` is 2240 bytes.
135+
The total input length of `verifyTransferProof` is 2240 bytes.
136136

137137
- Two input and two output
138138

139139
```
140140
[640 bytes for input][576 bytes for output][128 bytes for spend_authority_signature]
141141
```
142142

143-
The total input lengh of `verifyTransferProof` is 2528 bytes.
143+
The total input length of `verifyTransferProof` is 2528 bytes.
144144

145-
For the output, `result` is a bool value to indicate whether the proof verification succeeds. The length of `msg` is 66~1058 bytes. , and the other bytes return the node value to construct the Merkle tree. The time cost of `verifyTransferProof` function takes about 10~15ms in parallel mode.
145+
For the output, `result` is a bool value to indicate whether the proof verification succeeds. The length of `msg` is 66 ~ 1058 bytes, which returns the node value to construct the Merkle tree. The time cost of `verifyTransferProof` function takes about 10~15 ms in parallel mode.
146146

147147
(3)`verifyBurnProof`
148148

@@ -153,7 +153,7 @@ bytes32[10] input = abi.encode(nullifier, anchor, value_commitment, rk, zkproof)
153153
(bool result, bytes memory msg) = verifyBurnProof(abi.encode(input, spend_authority_signature, value, bindingSignature, signHash));
154154
```
155155

156-
- `value` - the amout of shielded tokens to be made public
156+
- `value` - the amount of shielded tokens to be made public
157157

158158
The other parameters are specified as above.
159159

@@ -276,4 +276,5 @@ Output:
276276
## Implementation
277277

278278
* https://github.com/tronprotocol/java-tron/blob/feature/shielded_TRC20_contract/actuator/src/main/java/org/tron/core/vm/PrecompiledContracts.java
279+
* https://github.com/tronprotocol/java-tron/blob/feature/shieldedUSDT/deploy/PrivateUSDT.sol
279280

0 commit comments

Comments
 (0)