You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

489 lines
25 KiB

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