arnaucube
arnaucube/circomPublic Self-hosted repository
circom/doc/r1cs_bin_format.md
doc/r1cs_bin_format.mdRaw
  1# Binary format for R1CS
  2
  3---
  4eip:
  5title: r1cs binary format
  6author:  Jordi Baylina <jordi@baylina.cat>
  7discussions-to:
  8status: draft
  9type: Standards Track
 10category: ERC
 11created: 2019-09-24
 12requires:
 13---
 14
 15## Simple Summary
 16
 17This standard defines a standard format for a binery representation of a r1cs constraint system.
 18
 19## Abstract
 20
 21
 22## Motivation
 23
 24The zero knowledge primitives, requires the definition of a statment that wants to be proved. This statment can be expressed as a deterministric program or an algebraic circuit. Lots of primitives like zkSnarks, bulletProofs or aurora, requires to convert this statment to a rank-one constraint system.
 25
 26This standard specifies a format for a r1cs and allows the to connect a set of tools that compiles a program or a circuit to r1cs that can be used for the zksnarks or bulletproofs primitives.
 27
 28## Specification
 29
 30### General considerations
 31
 32All integers are represented in Little Endian Fix size format
 33
 34The standard extension is `.r1cs`
 35
 36The constraint is in the form
 37
 38$$
 39\left\{  \begin{array}{rclclcl}
 40(a_{0,0}s_0 + a_{0,1}s_1 + ... + a_{0,n-1}s_{n-1}) &\cdot& (b_{0,0} s_0 + b_{0,1} s_1 + ... + b_{0,n-1} s_{n-1}) &-& (c_{0,0} s_0 + c_{0,1} s_1 + ... + c_{0,n-1}s_{n-1}) &=& 0 \\
 41(a_{1,0}s_0 + a_{1,1}s_1 + ... + a_{1,n-1}s_{n-1}) &\cdot& (b_{1,0} s_0 + b_{1,1} s_1 + ... + b_{1,n-1} s_{n-1}) &-& (c_{1,0} s_0 + c_{1,1}s_1 + ... + c_{1,n-1}s_{n-1}) &=& 0 \\
 42...\\
 43(a_{m-1,0}s_0 + a_{m-1,1}s_1 + ... + a_{m-1,n-1}s_{n-1}) &\cdot& (b_{m-1,0} s_0 + b_{m-1,1} s_1 + ... + b_{m-1,n-1} s_{n-1}) &-& (c_{m-1,0} s_0 + c_{m-1,1}s_1 + ... + c_{m-1,n-1}s_{n-1}) &=& 0
 44 \end{array} \right.
 45$$
 46
 47
 48### Format
 49
 50````
 51
 52     ┏━━━━┳━━━━━━━━━━━━━━━━━┓
 53     ┃ 4  │   72 31 63 73   ┃     Magic  "r1cs"
 54     ┗━━━━┻━━━━━━━━━━━━━━━━━┛
 55     ┏━━━━┳━━━━━━━━━━━━━━━━━┓
 56     ┃ 4  │   01 00 00 00   ┃       Version 1
 57     ┗━━━━┻━━━━━━━━━━━━━━━━━┛
 58
 59     ┏━━━━┳━━━━━━━━━━━━━━━━━┓
 60     ┃ 4  │       nW        ┃
 61     ┗━━━━┻━━━━━━━━━━━━━━━━━┛
 62
 63     ┏━━━━┳━━━━━━━━━━━━━━━━━┓
 64     ┃ nW │   01 00 00 00   ┃        nWires
 65     ┗━━━━┻━━━━━━━━━━━━━━━━━┛
 66     ┏━━━━┳━━━━━━━━━━━━━━━━━┓
 67     ┃ nW │   01 00 00 00   ┃        nPubOut
 68     ┗━━━━┻━━━━━━━━━━━━━━━━━┛
 69     ┏━━━━┳━━━━━━━━━━━━━━━━━┓
 70     ┃ nW │   01 00 00 00   ┃        nPubIn
 71     ┗━━━━┻━━━━━━━━━━━━━━━━━┛
 72     ┏━━━━┳━━━━━━━━━━━━━━━━━┓
 73     ┃ nW │   01 00 00 00   ┃        nPrvIn
 74     ┗━━━━┻━━━━━━━━━━━━━━━━━┛
 75
 76     ┏━━━━┳━━━━━━━━━━━━━━━━━┓
 77     ┃ nW │m := NConstraints┃
 78     ┗━━━━┻━━━━━━━━━━━━━━━━━┛
 79
 80     ┏━━━━┳━━━━━━━━━━━━━━━━━┓                                     ╲
 81     ┃ nW │       nA        ┃                                      ╲
 82     ┣━━━━╋━━━━━━━━━━━━━━━━━╋━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┓        ╲
 83     ┃ nW │     idx_1       ┃  V  │     a_{0,idx_1}        ┃         │
 84     ┣━━━━╋━━━━━━━━━━━━━━━━━╋━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━┫         │
 85     ┃ nW │     idx_2       ┃  V  │     a_{0,idx_2}        ┃         │
 86     ┗━━━━┻━━━━━━━━━━━━━━━━━┻━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━┛         │
 87                ...                          ...                     │
 88     ┏━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┓         │
 89     ┃ nW │     idx_nA      ┃  V  │     a_{0,idx_nA}       ┃         │
 90     ┗━━━━┻━━━━━━━━━━━━━━━━━┻━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━┛         │
 91     ┏━━━━┳━━━━━━━━━━━━━━━━━┓                                        │
 92     ┃ nW │       nB        ┃                                        │
 93     ┣━━━━╋━━━━━━━━━━━━━━━━━╋━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┓         │
 94     ┃ nW │     idx_1       ┃  V  │     b_{0,idx_1}        ┃         │
 95     ┣━━━━╋━━━━━━━━━━━━━━━━━╋━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━┫         ╲
 96     ┃ nW │     idx_2       ┃  V  │     b_{0,idx_2}        ┃          ╲
 97     ┗━━━━┻━━━━━━━━━━━━━━━━━┻━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━┛          ╱  Constraint_0
 98                ...                          ...                     ╱
 99     ┏━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┓         │
100     ┃ nW │     idx_nB      ┃  V  │     b_{0,idx_nB}       ┃         │
101     ┗━━━━┻━━━━━━━━━━━━━━━━━┻━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━┛         │
102     ┏━━━━┳━━━━━━━━━━━━━━━━━┓                                        │
103     ┃ nW │       nC        ┃                                        │
104     ┣━━━━╋━━━━━━━━━━━━━━━━━╋━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┓         │
105     ┃ nW │     idx_1       ┃  V  │     c_{0,idx_1}        ┃         │
106     ┣━━━━╋━━━━━━━━━━━━━━━━━╋━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━┫         │
107     ┃ nW │     idx_2       ┃  V  │     c_{0,idx_2}        ┃         │
108     ┗━━━━┻━━━━━━━━━━━━━━━━━┻━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━┛         │
109                ...                          ...                     │
110     ┏━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┓         │
111     ┃ nW │     idx_nB      ┃  V  │     c_{0,idx_nC}       ┃        ╱
112     ┗━━━━┻━━━━━━━━━━━━━━━━━┻━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━┛       ╱
113                                                                  ╱
114
115
116     ┏━━━━┳━━━━━━━━━━━━━━━━━┓                                     ╲
117     ┃ nW │       nA        ┃                                      ╲
118     ┣━━━━╋━━━━━━━━━━━━━━━━━╋━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┓        ╲
119     ┃ nW │     idx_1       ┃  V  │     a_{1,idx_1}        ┃         │
120     ┣━━━━╋━━━━━━━━━━━━━━━━━╋━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━┫         │
121     ┃ nW │     idx_2       ┃  V  │     a_{1,idx_2}        ┃         │
122     ┗━━━━┻━━━━━━━━━━━━━━━━━┻━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━┛         │
123                ...                          ...                     │
124     ┏━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┓         │
125     ┃ nW │     idx_nA      ┃  V  │     a_{1,idx_nA}       ┃         │
126     ┗━━━━┻━━━━━━━━━━━━━━━━━┻━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━┛         │
127     ┏━━━━┳━━━━━━━━━━━━━━━━━┓                                        │
128     ┃ nW │       nB        ┃                                        │
129     ┣━━━━╋━━━━━━━━━━━━━━━━━╋━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┓         │
130     ┃ nW │     idx_1       ┃  V  │     b_{1,idx_1}        ┃         │
131     ┣━━━━╋━━━━━━━━━━━━━━━━━╋━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━┫         ╲
132     ┃ nW │     idx_2       ┃  V  │     b_{1,idx_2}        ┃          ╲
133     ┗━━━━┻━━━━━━━━━━━━━━━━━┻━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━┛          ╱  Constraint_1
134                ...                          ...                     ╱
135     ┏━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┓         │
136     ┃ nW │     idx_nB      ┃  V  │     b_{1,idx_nB}       ┃         │
137     ┗━━━━┻━━━━━━━━━━━━━━━━━┻━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━┛         │
138     ┏━━━━┳━━━━━━━━━━━━━━━━━┓                                        │
139     ┃ nW │       nC        ┃                                        │
140     ┣━━━━╋━━━━━━━━━━━━━━━━━╋━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┓         │
141     ┃ nW │     idx_1       ┃  V  │     c_{1,idx_1}        ┃         │
142     ┣━━━━╋━━━━━━━━━━━━━━━━━╋━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━┫         │
143     ┃ nW │     idx_2       ┃  V  │     c_{1,idx_2}        ┃         │
144     ┗━━━━┻━━━━━━━━━━━━━━━━━┻━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━┛         │
145                ...                          ...                     │
146     ┏━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┓         │
147     ┃ nW │     idx_nB      ┃  V  │     c_{1,idx_nC}       ┃        ╱
148     ┗━━━━┻━━━━━━━━━━━━━━━━━┻━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━┛       ╱
149                                                                  ╱
150
151                         ...
152                         ...
153                         ...
154
155     ┏━━━━┳━━━━━━━━━━━━━━━━━┓                                     ╲
156     ┃ nW │       nA        ┃                                      ╲
157     ┣━━━━╋━━━━━━━━━━━━━━━━━╋━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┓        ╲
158     ┃ nW │     idx_1       ┃  V  │    a_{m-1,idx_1}       ┃         │
159     ┣━━━━╋━━━━━━━━━━━━━━━━━╋━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━┫         │
160     ┃ nW │     idx_2       ┃  V  │    a_{m-1,idx_2}       ┃         │
161     ┗━━━━┻━━━━━━━━━━━━━━━━━┻━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━┛         │
162                ...                          ...                     │
163     ┏━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┓         │
164     ┃ nW │     idx_nA      ┃  V  │    a_{m-1,idx_nA}      ┃         │
165     ┗━━━━┻━━━━━━━━━━━━━━━━━┻━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━┛         │
166     ┏━━━━┳━━━━━━━━━━━━━━━━━┓                                        │
167     ┃ nW │       nB        ┃                                        │
168     ┣━━━━╋━━━━━━━━━━━━━━━━━╋━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┓         │
169     ┃ nW │     idx_1       ┃  V  │    b_{m-1,idx_1}       ┃         │
170     ┣━━━━╋━━━━━━━━━━━━━━━━━╋━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━┫         ╲
171     ┃ nW │     idx_2       ┃  V  │    b_{m-1,idx_2}       ┃          ╲
172     ┗━━━━┻━━━━━━━━━━━━━━━━━┻━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━┛          ╱  Constraint_{m-1}
173                ...                          ...                     ╱
174     ┏━━━━━━━━━━━━━━━━━━━━━━┳━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┓         │
175     ┃ nW       idx_nB      ┃  V  │    b_{m-1,idx_nB}      ┃         │
176     ┗━━━━━━━━━━━━━━━━━━━━━━┻━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━┛         │
177     ┏━━━━┳━━━━━━━━━━━━━━━━━┓                                        │
178     ┃ nW │       nC        ┃                                        │
179     ┣━━━━╋━━━━━━━━━━━━━━━━━╋━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┓         │
180     ┃ nW │     idx_1       ┃  V  │    c_{m-1,idx_1}       ┃         │
181     ┣━━━━╋━━━━━━━━━━━━━━━━━╋━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━┫         │
182     ┃ nW │     idx_2       ┃  V  │    c_{m-1,idx_2}       ┃         │
183     ┗━━━━┻━━━━━━━━━━━━━━━━━┻━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━┛         │
184                ...                          ...                     │
185     ┏━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┓         │
186     ┃ nW │     idx_nB      ┃  V  │    c_{m-1,idx_nC}      ┃        ╱
187     ┗━━━━┻━━━━━━━━━━━━━━━━━┻━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━┛       ╱
188                                                                  ╱                                                                  ╱
189````
190
191
192### Magic Number
193
194Size: 4 bytes
195The file start with a constant 4 byts (magic number) "r1cs"
196
197```
1980x72 0x31 0x63 0x73
199```
200
201### Version
202
203Size: 4 bytes
204Format: Little-Endian
205
206For this standard it's fixed to
207
208```
2090x01 0x00 0x00 0x00
210```
211
212### Word With (nW)
213
214Size: 4 bytes
215Format: Little-Endian
216
217This is the standard word size in bytes used to specify lenghts and indexes in the file.
218
219The format of this field is little endian.
220
221In most of the cases this will be 4 (32bit values)
222
223Example:
224```
2250x04 0x00 0x00 0x00
226```
227
228### Number of wires
229
230Size: nW bytes
231Format: Little-Endian
232
233Total Number of wires including ONE signal (Index 0).
234
235### Number of public outputs
236
237Size: nW bytes
238Format: Little-Endian
239
240Total Number of wires public output wires. They should be starting at idx 1
241
242### Number of public inputs
243
244Size: nW bytes
245Format: Little-Endian
246
247Total Number of wires public input wires. They should be starting just after the public output
248
249### Number of private inputs
250
251Size: nW bytes
252Format: Little-Endian
253
254Total Number of wires private input wires. They should be starting just after the public inputs
255
256### Number of constraints
257
258Size: nW bytes
259Format: Little-Endian
260
261Total Number of constraints
262
263### Constraints
264
265Each constraint contains 3 linear combinations A, B, C.
266
267The constraint is such that:
268```
269A*B-C = 0
270```
271
272### Linear combination
273
274Each linear combination is of the form:
275
276$$
277a_{0,0}s_0 + a_{0,1}s_1 + ... + a_{0,n-1}s_{n-1}
278$$
279
280### Number of nonZero Factors
281
282Size: nW bytes
283Format: Little-Endian
284
285Total number of non Zero factors in the linear compination.
286
287The factors MUST be sorted in ascending order.
288
289### Factor
290
291For each factor we have the index of the factor and the value of the factor.
292
293### Index of the factor
294
295
296Size: nW bytes
297Format: Little-Endian
298
299Index of the nonZero Factor
300
301### Value of the factor
302
303The first byte indicate the length N in bytes of the number in the upcoming bytes.
304
305The next N bytes represent the value in Little Endian format.
306
307For example, to represent the linear combination:
308
309$$
3105s_4 +8s_5 + 260s_886
311$$
312
313The linear combination would be represented as:
314
315````
316    ┏━━━━━━━━━━━━━━━━━┓
317    ┃   03 00 00 00   ┃
318    ┣━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━┓
319    ┃   04 00 00 00   ┃      01 05      ┃
320    ┣━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━┫
321    ┃   05 00 00 00   ┃      01 08      ┃
322    ┣━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━┫
323    ┃   76 03 00 00   ┃    02 04 01     ┃
324    ┗━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━┛
325````
326## Rationale
327
328Variable size for field elements allows to shrink the size of the file and allows to work with any field.
329
330Version allows to update the format.
331
332Have a very good comprasion ratio for sparse r1cs as it's the normal case.
333
334
335## Backward Compatibility
336
337N.A.
338
339## Test Cases
340### Example
341
342Given this r1cs in a 256 bit Field:
343
344
345$$
346\left\{  \begin{array}{rclclcl}
347(3s_5 + 8s_6) &\cdot& (2s_0 + 20s_2 + 12s_3) &-& (5s_0 + 7s_9) &=& 0 \\
348(4s_1 + 8s_5 + 3s_9) &\cdot& (6s_6 + 44s_3) &&  &=& 0 \\
349(4s_6) &\cdot& (6s_0 + 5s_3 + 11s_9) &-& (600s_700) &=& 0
350\end{array} \right.
351$$
352
353The format will be:
354
355````
356
357        ┏━━━━━━━━━━━━━━┓
358        ┃ 72 31 63 77  ┃        Magic
359        ┣━━━━━━━━━━━━━━┫
360        ┃ 01 00 00 00  ┃       Version
361        ┣━━━━━━━━━━━━━━┫
362        ┃ 04 00 00 00  ┃          nW
363        ┣━━━━━━━━━━━━━━┫
364        ┃ 04 23 45 00  ┃      # of wires
365        ┣━━━━━━━━━━━━━━┫
366        ┃ 01 00 00 00  ┃    # Public Outs
367        ┣━━━━━━━━━━━━━━┫
368        ┃ 02 00 00 00  ┃     # Public Ins
369        ┣━━━━━━━━━━━━━━┫
370        ┃ 05 00 00 00  ┃    # Private Ins
371        ┗━━━━━━━━━━━━━━┛
372
373        ┏━━━━━━━━━━━━━━┓
374        ┃ 03 00 00 00  ┃   # of constraints
375        ┗━━━━━━━━━━━━━━┛
376
377        ┏━━━━━━━━━━━━━━┓   Constraint 0: (3s_5 + 8s_6) * (2s_0 + 20s_2 + 12s_3) - (5s_0 + 7s_9) = 0
378        ┃ 02 00 00 00  ┃
379        ┣━━━━━━━━━━━━━━╋━━━━━━━━┓
380        ┃ 05 00 00 00  ┃ 01 03  ┃
381        ┣━━━━━━━━━━━━━━╋━━━━━━━━┫
382        ┃ 06 00 00 00  ┃ 01 08  ┃
383        ┗━━━━━━━━━━━━━━┻━━━━━━━━┛
384        ┏━━━━━━━━━━━━━━┓
385        ┃ 03 00 00 00  ┃
386        ┣━━━━━━━━━━━━━━╋━━━━━━━━┓
387        ┃ 00 00 00 00  ┃ 01 02  ┃
388        ┣━━━━━━━━━━━━━━╋━━━━━━━━┫
389        ┃ 02 00 00 00  ┃ 01 14  ┃
390        ┣━━━━━━━━━━━━━━╋━━━━━━━━┫
391        ┃ 03 00 00 00  ┃ 01 0C  ┃
392        ┗━━━━━━━━━━━━━━┻━━━━━━━━┛
393        ┏━━━━━━━━━━━━━━┓
394        ┃ 02 00 00 00  ┃
395        ┣━━━━━━━━━━━━━━╋━━━━━━━━┓
396        ┃ 00 00 00 00  ┃ 01 05  ┃
397        ┣━━━━━━━━━━━━━━╋━━━━━━━━┫
398        ┃ 09 00 00 00  ┃ 01 07  ┃
399        ┗━━━━━━━━━━━━━━┻━━━━━━━━┛
400
401
402        ┏━━━━━━━━━━━━━━┓   Constraint 1: (4s_1 + 8s_5 + 3s_9) * (6s_6 + 44s_3) = 0
403        ┃ 03 00 00 00  ┃
404        ┣━━━━━━━━━━━━━━╋━━━━━━━━━┓
405        ┃ 01 00 00 00  ┃  01 04  ┃
406        ┣━━━━━━━━━━━━━━╋━━━━━━━━━┫
407        ┃ 05 00 00 00  ┃  01 08  ┃
408        ┣━━━━━━━━━━━━━━╋━━━━━━━━━┫
409        ┃ 09 00 00 00  ┃  01 03  ┃
410        ┗━━━━━━━━━━━━━━┻━━━━━━━━━┛
411        ┏━━━━━━━━━━━━━━┓
412        ┃ 02 00 00 00  ┃
413        ┣━━━━━━━━━━━━━━╋━━━━━━━━━┓
414        ┃ 03 00 00 00  ┃  01 2C  ┃
415        ┣━━━━━━━━━━━━━━╋━━━━━━━━━┫
416        ┃ 06 00 00 00  ┃  01 06  ┃
417        ┗━━━━━━━━━━━━━━┻━━━━━━━━━┛
418        ┏━━━━━━━━━━━━━━┓
419        ┃ 00 00 00 00  ┃
420        ┗━━━━━━━━━━━━━━┛
421
422
423        ┏━━━━━━━━━━━━━━┓   Constraint 2: (4s_6) * (6s_0 + 5s_3 + 11s_9) - (600s_700) = 0
424        ┃ 01 00 00 00  ┃
425        ┣━━━━━━━━━━━━━━╋━━━━━━━━━┓
426        ┃ 06 00 00 00  ┃  01 04  ┃
427        ┗━━━━━━━━━━━━━━┻━━━━━━━━━┛
428        ┏━━━━━━━━━━━━━━┓
429        ┃ 03 00 00 00  ┃
430        ┣━━━━━━━━━━━━━━╋━━━━━━━━━┓
431        ┃ 00 00 00 00  ┃  01 06  ┃
432        ┣━━━━━━━━━━━━━━╋━━━━━━━━━┫
433        ┃ 03 00 00 00  ┃  01 05  ┃
434        ┣━━━━━━━━━━━━━━╋━━━━━━━━━┫
435        ┃ 09 00 00 00  ┃  01 0B  ┃
436        ┗━━━━━━━━━━━━━━┻━━━━━━━━━┛
437        ┏━━━━━━━━━━━━━━┓
438        ┃ 01 00 00 00  ┃
439        ┣━━━━━━━━━━━━━━╋━━━━━━━━━━━━━┓
440        ┃ BC 02 00 00  ┃  02 58 02   ┃
441        ┗━━━━━━━━━━━━━━┻━━━━━━━━━━━━━┛
442````
443
444And the binary representation in Hex:
445
446````
44772 31 63 77
44801 00 00 00
44904 00 00 00
45004 23 45 00
45101 00 00 00
45202 00 00 00
45305 00 00 00
45403 00 00 00
45502 00 00 00
45605 00 00 00 01 03
45706 00 00 00 01 08
45803 00 00 00
45900 00 00 00 01 02
46002 00 00 00 01 14
46103 00 00 00 01 0C
46202 00 00 00
46300 00 00 00 01 05
46409 00 00 00 01 07
46503 00 00 00
46601 00 00 00 01 04
46705 00 00 00 01 08
46809 00 00 00 01 03
46902 00 00 00
47003 00 00 00 01 2C
47106 00 00 00 01 06
47200 00 00 00
47301 00 00 00
47406 00 00 00 01 04
47503 00 00 00
47600 00 00 00 01 06
47703 00 00 00 01 05
47809 00 00 00 01 0B
47901 00 00 00
480BC 02 00 00 02 58 02
481````
482
483## Implementation
484
485circom will output this format.
486
487## Copyright
488
489Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).