-
Notifications
You must be signed in to change notification settings - Fork 0
/
final_circuit.json
123 lines (123 loc) · 33.3 KB
/
final_circuit.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
{
"noir_version": "0.23.0+5be9f9d7e2f39ca228df10e5a530474af0331704",
"hash": 10311687216356749624,
"abi": {
"parameters": [
{
"name": "signer_pub_x_key",
"type": {
"kind": "array",
"length": 32,
"type": { "kind": "integer", "sign": "unsigned", "width": 8 }
},
"visibility": "private"
},
{
"name": "signer_pub_y_key",
"type": {
"kind": "array",
"length": 32,
"type": { "kind": "integer", "sign": "unsigned", "width": 8 }
},
"visibility": "private"
},
{
"name": "signature",
"type": {
"kind": "array",
"length": 64,
"type": { "kind": "integer", "sign": "unsigned", "width": 8 }
},
"visibility": "private"
},
{
"name": "squad_player_ids",
"type": {
"kind": "array",
"length": 11,
"type": { "kind": "integer", "sign": "unsigned", "width": 8 }
},
"visibility": "private"
},
{
"name": "squad_points",
"type": {
"kind": "array",
"length": 11,
"type": { "kind": "integer", "sign": "unsigned", "width": 8 }
},
"visibility": "private"
},
{
"name": "player_points_merkle_paths",
"type": {
"kind": "array",
"length": 11,
"type": {
"kind": "array",
"length": 4,
"type": {
"kind": "array",
"length": 32,
"type": { "kind": "integer", "sign": "unsigned", "width": 8 }
}
}
},
"visibility": "private"
},
{
"name": "player_points_root",
"type": {
"kind": "array",
"length": 32,
"type": { "kind": "integer", "sign": "unsigned", "width": 8 }
},
"visibility": "public"
},
{
"name": "squad_hash",
"type": {
"kind": "array",
"length": 32,
"type": { "kind": "integer", "sign": "unsigned", "width": 8 }
},
"visibility": "public"
}
],
"param_witnesses": {
"player_points_merkle_paths": [{ "start": 150, "end": 1558 }],
"player_points_root": [{ "start": 1558, "end": 1590 }],
"signature": [{ "start": 64, "end": 128 }],
"signer_pub_x_key": [{ "start": 0, "end": 32 }],
"signer_pub_y_key": [{ "start": 32, "end": 64 }],
"squad_hash": [{ "start": 1590, "end": 1622 }],
"squad_player_ids": [{ "start": 128, "end": 139 }],
"squad_points": [{ "start": 139, "end": 150 }]
},
"return_type": {
"abi_type": { "kind": "integer", "sign": "unsigned", "width": 8 },
"visibility": "public"
},
"return_witnesses": [1825]
},
"bytecode": "H4sIAAAAAAAA/+3dBXRU2bquYYIEd3d3S6HB3d3d3d3d3a0Nd3d3d3d3d3e4b3VmnS6+w+7ddC/6UuOsjPHsn5ekq/6aJCGwSa0mgf35m+Dt7/cXL/j3+6G/IG7tJe1fOoB0QOlA0t7SgaWDSAeVDiYdXDqEdEjpUNKhpcNIh5UOJx1eOoJ0ROlI0pGlo0hHlY4mHV06hnRM6VjSsaXjSMeVjicdXzqBdELpRNKJpZNIJ5VOJp1cOoV0SulU0qmlfaQd0mmk00qnk04vnUE6o7SvdCbpzNJZpLNKZ5POLp1DOqd0Lunc0nmk80rnk84vXUC6oHQh6cLSRaSLSheTLi5dQrqkdCnp0tJlpMtKl5MuL11BuqJ0JenK0lWkq0pXk64uXUO6pnQt6drSdaTrSteTri/dQLqhdCPpxtJNpJtKN5NuLt1CuqV0K+nW0m2k20q3k24v3UG6o3Qn6c7SXaS7SneT7i7dQ7qndC/p3tJ9pPtK95PuLz1AeqD0IOnB0kOkh0oPkx4uPUJ6pPQo6dHSY6THSo+THi89Qfon6Z+lf5H+Vfo36YnSk6QnS0+Rnio9TXq69AzpmdKzpGdLz5GeKz1Per70AumF0oukF0svkV4qvUx6ufQK6ZXSq6RXS6+RXiu9Tnq99AbpjdKbpDdLb5HeKr1Nerv0Dumd0rukd0vvkd4rvU96v/QB6YPSh6QPSx+RPip9TPq49Anpk9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mceYeYyZx5h5jJnHmHmMmceYeYyZx5h5jJnHmHmMmceYeYyZx5h5jJnHmHmMmceYeYyZx5h5jJnHmHmMmceYeYyZx5h5jJnHmHmMmceYeYyZx5h5jJnHmHmMmceYeYyZx5h5jJnHmHmMmceYeYyZx5h5jJnHmHmMmceYeYyZx5h5jJnHmHmMmceYeYyZx5h5jJnHmHmMmceYeYyZx5h5jJnHmHmMmceYeYyZx5h5jJnHmHmMmceYeYyZx5h5jJnHmHmMmceYeYyZx5h5jJnHmHlMmMd37/4F",
"file_map": {
"39": {
"source": "use dep::std;\nuse dep::ecrecover;\n\nglobal MERKLE_DEPTH = 4;\nfn main(\n signer_pub_x_key: [u8; 32],\n signer_pub_y_key: [u8; 32],\n signature: [u8; 64],\n squad_player_ids: [u8; 11],\n squad_points: [u8; 11],\n player_points_merkle_paths: [[[u8; 32]; MERKLE_DEPTH]; 11],\n player_points_root: pub [u8; 32],\n squad_hash: pub [u8; 32]\n) -> pub u8 {\n // verify ECDSA signature\n let computedAddress: Field = ecrecover::secp256k1::PubKey::from_xy(signer_pub_x_key, signer_pub_y_key).to_eth_address(); // Compute address from public key\n let recoveredAddress = ecrecover::ecrecover(signer_pub_x_key, signer_pub_y_key, signature, squad_hash);\n assert(recoveredAddress == computedAddress);\n\n // verify the merkle path of the point to confirm that is actually the points of the player\n // for i in squad_player_ids {\n // let computed_root= compute_merkle_root(\n // squad_points[i], // leaf\n // squad_player_ids[i], // index\n // player_points_merkle_paths[i] // merkle proof\n // );\n // assert(computed_root == player_points_root);\n // }\n\n // sum all points and return it back to the contract\n let mut totalPoints: u8= 0;\n for point in squad_points {\n totalPoints+=point as u8;\n }\n\n totalPoints\n}\n\nfn concatenate_player_ids_with_salt(squad_player_ids: [u8; 11], player_ids_salt: [u8; 32]) -> [u8; 43] {\n let mut combined_array: [u8; 43] = [0; 43];\n for i in 0..11 {\n combined_array[i]=squad_player_ids[i];\n }\n for i in 0..32 {\n combined_array[i+11]=player_ids_salt[i];\n }\n combined_array\n}\n\nfn u8_to_u160(array: [u8]) -> Field {\n let mut conv: Field = 0;\n conv = (conv * 256) + (array[0] as Field);\n conv\n}\n\nfn compute_merkle_root(leaf: u8, leaf_index: u8, proof: [[u8; 32]; MERKLE_DEPTH]) -> [u8; 32] {\n let mut computed_hash: [u8; 32] = [0; 32];\n computed_hash[0]=leaf;\n for i in 0..MERKLE_DEPTH {\n if leaf_index % 2 == 0 {\n computed_hash = std::hash::keccak256(concatenate_leafs(computed_hash, proof[i]), 64);\n } else {\n computed_hash = std::hash::keccak256(concatenate_leafs(proof[i], computed_hash), 64);\n }\n }\n computed_hash\n}\n\nfn concatenate_leafs(leaf1: [u8; 32], leaf2: [u8; 32]) -> [u8; 64] {\n let mut arr: [u8; 64] = [0; 64];\n for i in 0..32 {\n arr[i] = leaf1[i];\n arr[i + 32] = leaf2[i];\n }\n arr\n}\n",
"path": "/Users/gabrielantonyxaviour/Developer/projects/luffy/circuits/src/main.nr"
},
"40": {
"source": "use dep::std;\n \nmod secp256k1;\n\nfn ecrecover(\n pub_key_x: [u8; 32],\n pub_key_y: [u8; 32],\n signature: [u8; 64], // clip v value\n hashed_message: [u8; 32]\n) -> Field {\n let key = secp256k1::PubKey::from_xy(pub_key_x, pub_key_y);\n\n assert(key.verify_sig(signature, hashed_message));\n let addr = key.to_eth_address();\n\n addr\n}\n\n#[test]\nfn test_ecrecover() {\n let pub_key_x = [131, 24, 83, 91, 84, 16, 93, 74, 122, 174, 96, 192, 143, 196, 95, 150, 135, 24, 27, 79, 223, 198, 37, 189, 26, 117, 63, 167, 57, 127, 237, 117];\n let pub_key_y = [53, 71, 241, 28, 168, 105, 102, 70, 242, 243, 172, 176, 142, 49, 1, 106, 250, 194, 62, 99, 12, 93, 17, 245, 159, 97, 254, 245, 123, 13, 42, 165];\n let signature = [57, 17, 112, 239, 241, 30, 64, 157, 170, 50, 85, 145, 156, 69, 226, 85, 147, 164, 10, 82, 71, 93, 42, 132, 200, 220, 161, 255, 95, 241, 211, 141, 81, 7, 150, 25, 25, 27, 162, 213, 80, 61, 12, 170, 50, 4, 154, 203, 252, 229, 119, 29, 202, 153, 50, 25, 126, 145, 245, 23, 136, 75, 29, 177];\n let hashed_message = [13, 82, 120, 60, 76, 186, 215, 235, 175, 126, 185, 67, 252, 100, 143, 82, 130, 165, 32, 112, 68, 47, 193, 141, 141, 209, 109, 219, 47, 203, 175, 102];\n\n let addr = ecrecover(pub_key_x, pub_key_y, signature, hashed_message);\n assert(addr == 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266);\n}\n",
"path": "/Users/gabrielantonyxaviour/nargo/github.com/colinnielsen/ecrecover-noirv0.19.0/src/lib.nr"
},
"41": {
"source": "use dep::std;\n\nuse dep::array_helpers;\n\nstruct PubKey {\n pub_x: [u8; 32],\n pub_y: [u8; 32],\n}\n\nunconstrained\nfn split_uncompressed_pub_key(\n pub_key: [u8; 65]\n) -> ([u8; 32], [u8; 32]) {\n let mut pub_key_x: [u8; 32] = [0; 32];\n let mut pub_key_y: [u8; 32] = [0; 32];\n\n for i in 0..32 {\n pub_key_x[i] = pub_key[i + 1];\n pub_key_y[i] = pub_key[i + 32 + 1];\n };\n\n (pub_key_x, pub_key_y)\n}\n\nimpl PubKey {\n fn from_xy(pub_x: [u8; 32], pub_y: [u8; 32]) -> PubKey {\n PubKey {\n pub_x,\n pub_y,\n }\n }\n\n fn from_unified(pub_key: [u8; 64]) -> PubKey {\n let (key_x, key_y) = array_helpers::split_u8_64_unconstrained(pub_key);\n\n PubKey {\n pub_x: key_x,\n pub_y: key_y,\n }\n }\n\n fn from_uncompressed(pub_key: [u8; 65]) -> PubKey {\n assert(pub_key[0] == 0x04);\n let (key_x, key_y) = split_uncompressed_pub_key(pub_key);\n\n PubKey {\n pub_x: key_x,\n pub_y: key_y,\n }\n }\n\n fn verify_sig(self, signature: [u8; 64], hashed_message: [u8; 32]) -> bool {\n std::ecdsa_secp256k1::verify_signature(self.pub_x, self.pub_y, signature, hashed_message)\n }\n\n fn to_eth_address(self) -> Field {\n let pub_key = array_helpers::u8_32_to_u8_64_unconstrained(self.pub_x, self.pub_y);\n let hashed_pub_key = std::hash::keccak256(pub_key, 64);\n\n let mut addr: Field = 0;\n for i in 0..20 {\n // shift left by 8 and add the new value\n addr = (addr * 256) + hashed_pub_key[i + 12] as Field;\n }\n\n addr\n }\n\n fn ecrecover(\n self,\n signature: [u8; 64],\n hashed_message: [u8; 32]\n ) -> Field {\n assert(self.verify_sig(signature, hashed_message));\n\n self.to_eth_address()\n }\n}\n\n\n#[test]\nfn test_ecrecover_via_key() {\n let pub_key_x = [131, 24, 83, 91, 84, 16, 93, 74, 122, 174, 96, 192, 143, 196, 95, 150, 135, 24, 27, 79, 223, 198, 37, 189, 26, 117, 63, 167, 57, 127, 237, 117];\n let pub_key_y = [53, 71, 241, 28, 168, 105, 102, 70, 242, 243, 172, 176, 142, 49, 1, 106, 250, 194, 62, 99, 12, 93, 17, 245, 159, 97, 254, 245, 123, 13, 42, 165];\n let signature = [57, 17, 112, 239, 241, 30, 64, 157, 170, 50, 85, 145, 156, 69, 226, 85, 147, 164, 10, 82, 71, 93, 42, 132, 200, 220, 161, 255, 95, 241, 211, 141, 81, 7, 150, 25, 25, 27, 162, 213, 80, 61, 12, 170, 50, 4, 154, 203, 252, 229, 119, 29, 202, 153, 50, 25, 126, 145, 245, 23, 136, 75, 29, 177];\n let hashed_message = [13, 82, 120, 60, 76, 186, 215, 235, 175, 126, 185, 67, 252, 100, 143, 82, 130, 165, 32, 112, 68, 47, 193, 141, 141, 209, 109, 219, 47, 203, 175, 102];\n\n let key = PubKey::from_xy(pub_key_x, pub_key_y);\n assert(key.ecrecover(signature, hashed_message) == 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266);\n}\n",
"path": "/Users/gabrielantonyxaviour/nargo/github.com/colinnielsen/ecrecover-noirv0.19.0/src/secp256k1.nr"
},
"42": {
"source": "use dep::std;\n\nfn u8_32s_to_u64_16(\n arr_a: [u8; 32],\n arr_b: [u8; 32],\n) -> [u64; 16] {\n let mut combined_u64: [u64; 16] = [0; 16];\n \n for i in 0..4 {\n let mut value: u64 = 0;\n for j in 0..8 {\n value |= (arr_a[i*8+j] as u64) << ((56 - j*8) as u64);\n }\n combined_u64[i] = value;\n }\n for i in 4..8 {\n let mut value: u64 = 0;\n for j in 0..8 {\n value |= (arr_b[(i-4)*8+j] as u64) << ((56 - j*8) as u64);\n }\n combined_u64[i] = value;\n }\n\n combined_u64\n}\n\nunconstrained\nfn u8_32s_to_u64_16_unconstrained(\n arr_a: [u8; 32],\n arr_b: [u8; 32],\n) -> [u64; 16] {\n let mut combined_u64: [u64; 16] = [0; 16];\n \n for i in 0..4 {\n let mut value: u64 = 0;\n for j in 0..8 {\n value |= (arr_a[i*8+j] as u64) << ((56 - j*8) as u64);\n }\n combined_u64[i] = value;\n }\n for i in 4..8 {\n let mut value: u64 = 0;\n for j in 0..8 {\n value |= (arr_b[(i-4)*8+j] as u64) << ((56 - j*8) as u64);\n }\n combined_u64[i] = value;\n }\n\n combined_u64\n}\n\n#[test]\nfn test_u8_32s_to_u64_16() {\n let arr_a: [u8; 32] = [\n 131,24,83,91,84,16,93,74,122,174,96,192,143,196,95,150,135,24,27,79,223,198,37,189,26,117,63,167,57,127,237,117\n ];\n let arr_b: [u8; 32] = [\n 53,71,241,28,168,105,102,70,242,243,172,176,142,49,1,106,250,194,62,99,12,93,17,245,159,97,254,245,123,13,42,165\n ];\n let out = u8_32s_to_u64_16(arr_a, arr_b);\n\n assert(out[0] == 9446391870127103306);\n assert(out[1] == 8840109498736861078);\n assert(out[2] == 9734560624431998397);\n assert(out[3] == 1906500004718046581);\n assert(out[4] == 3839302312743495238);\n assert(out[5] == 17506526050819047786);\n assert(out[6] == 18069073250093961717);\n assert(out[7] == 11484740855056378533);\n assert(out[8] == 0);\n assert(out[9] == 0);\n assert(out[10] == 0);\n assert(out[11] == 0);\n assert(out[12] == 0);\n assert(out[13] == 0);\n assert(out[14] == 0);\n assert(out[15] == 0);\n // the above output is the hex \"0x8318535b54105d4a7aae60c08fc45f9687181b4fdfc625bd1a753fa7397fed753547f11ca8696646f2f3acb08e31016afac23e630c5d11f59f61fef57b0d2aa5\"\n}\n\nfn u8_32_to_u8_64(\n arr_a: [u8; 32],\n arr_b: [u8; 32],\n) -> [u8; 64] {\n let mut combined: [u8; 64] = [0; 64];\n\n for i in 0..32 {\n combined[i] = arr_a[i];\n }\n for i in 0..32 {\n combined[i + 32] = arr_b[i];\n }\n\n combined\n}\n\nunconstrained\nfn u8_32_to_u8_64_unconstrained(\n arr_a: [u8; 32],\n arr_b: [u8; 32],\n) -> [u8; 64] {\n let mut combined: [u8; 64] = [0; 64];\n\n for i in 0..32 {\n combined[i] = arr_a[i];\n }\n for i in 0..32 {\n combined[i + 32] = arr_b[i];\n }\n\n combined\n}\n\n\nfn u64_4_to_u8_32(\n array: [u64; 4]\n) -> [u8; 32] {\n let mut output: [u8; 32] = [0; 32];\n let mut output_index = 0;\n\n for num_idx in 0..4 {\n for bit_pos in 0..8 {\n let shift_amount: u64 = 56 - (bit_pos * 8) as u64;\n output[output_index] = ((array[num_idx] >> shift_amount) & 255) as u8;\n output_index += 1;\n }\n }\n\n output\n}\n\nunconstrained\nfn u64_4_to_u8_32_unconstrained(\n array: [u64; 4]\n) -> [u8; 32] {\n let mut output: [u8; 32] = [0; 32];\n let mut output_index = 0;\n\n for num_idx in 0..4 {\n for bit_pos in 0..8 {\n let shift_amount: u64 = 56 - (bit_pos * 8) as u64;\n output[output_index] = ((array[num_idx] >> shift_amount) & 255) as u8;\n output_index += 1;\n }\n }\n\n output\n}\n\n#[test]\nfn test_u64_4_to_u8_32() {\n let hash: [u64; 4] = [\n 999647796417551690,\n 8840109498736861078,\n 9734560624431998397,\n 1906500004718046581\n ];\n \n let arr_out = u64_4_to_u8_32(hash);\n\n assert(arr_out[0] == 13);\n assert(arr_out[1] == 223);\n assert(arr_out[2] == 118);\n assert(arr_out[3] == 95);\n assert(arr_out[4] == 221);\n assert(arr_out[5] == 248);\n assert(arr_out[6] == 93);\n assert(arr_out[7] == 74);\n assert(arr_out[8] == 122);\n assert(arr_out[9] == 174);\n assert(arr_out[10] == 96);\n assert(arr_out[11] == 192);\n assert(arr_out[12] == 143);\n assert(arr_out[13] == 196);\n assert(arr_out[14] == 95);\n assert(arr_out[15] == 150);\n assert(arr_out[16] == 135);\n assert(arr_out[17] == 24);\n assert(arr_out[18] == 27);\n assert(arr_out[19] == 79);\n assert(arr_out[20] == 223);\n assert(arr_out[21] == 198);\n assert(arr_out[22] == 37);\n assert(arr_out[23] == 189);\n assert(arr_out[24] == 26);\n assert(arr_out[25] == 117);\n assert(arr_out[26] == 63);\n assert(arr_out[27] == 167);\n assert(arr_out[28] == 57);\n assert(arr_out[29] == 127);\n assert(arr_out[30] == 237);\n assert(arr_out[31] == 117);\n}\n\n/// @dev this method is used to convert a u8 array to a u160 (which is not supported by Noir, so it's represented as a Field)\n/// @dev will throw on Field overflow\nfn u8_to_u160(\n array: [u8]\n) -> Field {\n let mut addr: Field = 0;\n\n for i in 0..20 {\n // only take the last 20 bytes of the hash\n addr = (addr * 256) + (array[i] as Field);\n }\n\n addr\n}\n\nunconstrained\nfn u8_to_u160_unconstrained(\n array: [u8]\n) -> Field {\n let mut addr: Field = 0;\n\n for i in 0..20 {\n // only take the last 20 bytes of the hash\n addr = (addr * 256) + (array[i] as Field);\n }\n\n addr\n}\n\nfn u8_to_eth_address(\n array: [u8]\n) -> Field {\n u8_to_u160(array)\n}\n\nunconstrained\nfn u8_to_eth_address_unconstrained(\n array: [u8]\n) -> Field {\n u8_to_u160(array)\n}\n\n#[test]\nfn test_u8_32_to_u160() {\n // keccak hash of hardhat 0 address pub key (0xc1ffd3cfee2d9e5cd67643f8f39fd6e51aad88f6f4ce6ab8827279cfffb92266) as u8 array\n let hashed_pub_key = [\n 193,255,211,207,238,45,158,92,214,118,67,248,243,159,214,229,26,173,136,246,244,206,106,184,130,114,121,207,255,185,34,102\n ];\n\n let mut right_20_bytes: [u8] = [0; 20];\n for i in 0..20 {\n right_20_bytes[i] = hashed_pub_key[i + 12];\n }\n\n let addr = u8_to_u160(right_20_bytes);\n let addr_aliased = u8_to_eth_address(right_20_bytes);\n\n assert(addr == addr_aliased);\n assert(addr == 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266); // hardhat address 0\n}\n\nfn split_u8_64(\n arr: [u8; 64]\n) -> ([u8; 32], [u8; 32]) {\n let mut arr_a: [u8; 32] = [0; 32];\n let mut arr_b: [u8; 32] = [0; 32];\n\n for i in 0..32 {\n arr_a[i] = arr[i];\n arr_b[i] = arr[i + 32];\n };\n\n (arr_a, arr_b)\n}\n\nunconstrained\nfn split_u8_64_unconstrained(\n arr: [u8; 64]\n) -> ([u8; 32], [u8; 32]) {\n let mut arr_a: [u8; 32] = [0; 32];\n let mut arr_b: [u8; 32] = [0; 32];\n\n for i in 0..32 {\n arr_a[i] = arr[i];\n arr_b[i] = arr[i + 32];\n };\n\n (arr_a, arr_b)\n}\n\n#[test]\nfn test_split_u8_64() {\n let u8_64 = [\n 193,255,211,207,238,45,158,92,214,118,67,248,243,159,214,229,26,173,136,246,244,206,106,184,130,114,121,207,255,185,34,102,\n 193,255,211,207,238,45,158,92,214,118,67,248,243,159,214,229,26,173,136,246,244,206,106,184,130,114,121,207,255,185,34,102\n ];\n\n let (arr_a, arr_b) = split_u8_64(u8_64);\n\n for i in 0..32 {\n assert(arr_a[i] == u8_64[i]);\n assert(arr_b[i] == u8_64[i + 32]);\n }\n}\n",
"path": "/Users/gabrielantonyxaviour/nargo/github.com/colinnielsen/noir-array-helpersv0.19.0/src/lib.nr"
}
}
}