You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`input`, `spend_authority_signature` , and `output` are variable length arrays. The length of a single `input` is 320 bytes, it includes:
108
+
109
+
```
110
+
[32 bytes for nullifier][32 bytes for anchor][32 bytes for value_commitment][32 bytes for epk][32 bytes for rk][192 bytes for zkproof]
111
+
```
112
+
113
+
The length of a single `spend_authority_signature` is 64 bytes, it includes:
114
+
115
+
```
116
+
[64 bytes for spend_authority_signature]
117
+
```
118
+
119
+
The length of a single `output` is 288 bytes, it includes:
120
+
121
+
```
122
+
[32 bytes for note_commitment][32 bytes for value_commitment][32 bytes for epk][192 bytes for zkproof]
104
123
```
105
124
106
-
The parameters are specified as above.
125
+
The other parameters are:
107
126
108
127
```
109
-
[32 bytes for nullifier][32 bytes for anchor][32 bytes for value_commitment][32 bytes for epk][32 bytes for rk][192 bytes for zkproof][32 bytes for note_commitment][32 bytes for epk][192 bytes for zkproof][64 bytes for bindingSignature][32 bytes for signHash][1056 bytes for frontier][32 bytes for leafCount]
128
+
[64 bytes for bindingSignature][32 bytes for signHash][1056 bytes for frontier][32 bytes for leafCount]
110
129
```
111
130
112
-
The total input length of `verifyTransferProof` is variable. According to the input and output number in a `transfer` transaction, there are four scenarios:
131
+
The total input length of `verifyTransferProof` is also variable. According to the input and output number in a `transfer` transaction, there are four scenarios:
113
132
114
133
- one input and one output
115
134
116
135
```
117
-
[320 bytes for input][288 bytes for output][64 bytes for spend_authority_signature]
136
+
[320 bytes for input][64 bytes for spend_authority_signature][288 bytes for output]
118
137
```
119
138
120
-
The total input length of `verifyTransferProof` is 1856 bytes.
139
+
The original total input length is 1856 bytes. Since the special encoding rule of `abi.encode(...)` for variable arrays, the total input length of `verifyTransferProof` is 2048 bytes.
121
140
122
141
- one input and two output
123
142
124
143
```
125
-
[320 bytes for input][576 bytes for output][64 bytes for spend_authority_signature]
144
+
[320 bytes for input][64 bytes for spend_authority_signature][576 bytes for output]
126
145
```
127
-
The total input length of `verifyTransferProof` is 2144 bytes.
146
+
The original total input length is 2144 bytes. Since the special encoding rule of `abi.encode(...)` for variable arrays, the total input length of `verifyTransferProof` is 2336 bytes.
128
147
129
148
- two input and one output
130
149
131
150
```
132
-
[640 bytes for input][288 bytes for output][128 bytes for spend_authority_signature]
151
+
[640 bytes for input][128 bytes for spend_authority_signature][288 bytes for output]
133
152
```
134
153
135
-
The total input length of `verifyTransferProof` is 2240 bytes.
154
+
The original total input length is 2240 bytes. Since the special encoding rule of `abi.encode(...)` for variable arrays, the total input length of `verifyTransferProof` is 2432 bytes.
136
155
137
156
- Two input and two output
138
157
139
158
```
140
-
[640 bytes for input][576 bytes for output][128 bytes for spend_authority_signature]
159
+
[640 bytes for input][128 bytes for spend_authority_signature][576 bytes for output]
141
160
```
142
161
143
-
The total input length of `verifyTransferProof` is 2528 bytes.
162
+
The original total input length is 2528 bytes. Since the special encoding rule of `abi.encode(...)` for variable arrays, the total input length of `verifyTransferProof` is 2720 bytes.
144
163
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.
164
+
For the output, `result` is a bool value to indicate whether the proof verification succeeds. The length of `msg` is 33 ~ 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.
0 commit comments