@smithii_io/mixoor 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -0
- package/circuits/build/transaction_js/transaction.wasm +0 -0
- package/circuits/transaction_0001.zkey +0 -0
- package/circuits/verification_key.json +124 -0
- package/dist/src/index.js +8 -11
- package/dist/src/index.js.map +1 -1
- package/dist/src/index.mjs +8 -11
- package/dist/src/index.mjs.map +1 -1
- package/dist/test/_setup.js.map +1 -1
- package/dist/types/src/utils/circuit.d.ts.map +1 -1
- package/dist/types/test/_setup.d.ts +2 -2
- package/dist/types/test/_setup.d.ts.map +1 -1
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -36,3 +36,23 @@ pnpm lint:fix
|
|
|
36
36
|
pnpm format
|
|
37
37
|
pnpm format:fix
|
|
38
38
|
```
|
|
39
|
+
|
|
40
|
+
## Development
|
|
41
|
+
|
|
42
|
+
### Circuit Files
|
|
43
|
+
|
|
44
|
+
This package includes zero-knowledge proof circuit files required for generating privacy-preserving transaction proofs. These files are bundled with the package during publishing.
|
|
45
|
+
|
|
46
|
+
If you're developing locally and need to update the circuit files:
|
|
47
|
+
|
|
48
|
+
```sh
|
|
49
|
+
# After building circuits in the main circuits directory
|
|
50
|
+
pnpm copy-circuits
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
The circuit files are located in:
|
|
54
|
+
- `circuits/build/transaction_js/transaction.wasm` - WASM circuit
|
|
55
|
+
- `circuits/transaction_0001.zkey` - ZKey file
|
|
56
|
+
- `circuits/verification_key.json` - Verification key
|
|
57
|
+
|
|
58
|
+
These paths are resolved at runtime relative to the package root, ensuring the library works both during development and when installed as an npm dependency.
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
{
|
|
2
|
+
"protocol": "groth16",
|
|
3
|
+
"curve": "bn128",
|
|
4
|
+
"nPublic": 7,
|
|
5
|
+
"vk_alpha_1": [
|
|
6
|
+
"5546433345559129444237190777830761250332113749146486872468235040665291734547",
|
|
7
|
+
"13963905734702601515485862894046335164180959786365513804837155437966338284436",
|
|
8
|
+
"1"
|
|
9
|
+
],
|
|
10
|
+
"vk_beta_2": [
|
|
11
|
+
[
|
|
12
|
+
"21412145793220292067859405918112107716359293542119378539352891116432217911143",
|
|
13
|
+
"2611966564152221085363047640833318876719586724975105066179882056173108088903"
|
|
14
|
+
],
|
|
15
|
+
[
|
|
16
|
+
"5683913335783624892102444117130791035155207942152776919376767806572080471466",
|
|
17
|
+
"20424418561484727324565184652251513974075649083989440164478053411013464042109"
|
|
18
|
+
],
|
|
19
|
+
[
|
|
20
|
+
"1",
|
|
21
|
+
"0"
|
|
22
|
+
]
|
|
23
|
+
],
|
|
24
|
+
"vk_gamma_2": [
|
|
25
|
+
[
|
|
26
|
+
"10857046999023057135944570762232829481370756359578518086990519993285655852781",
|
|
27
|
+
"11559732032986387107991004021392285783925812861821192530917403151452391805634"
|
|
28
|
+
],
|
|
29
|
+
[
|
|
30
|
+
"8495653923123431417604973247489272438418190587263600148770280649306958101930",
|
|
31
|
+
"4082367875863433681332203403145435568316851327593401208105741076214120093531"
|
|
32
|
+
],
|
|
33
|
+
[
|
|
34
|
+
"1",
|
|
35
|
+
"0"
|
|
36
|
+
]
|
|
37
|
+
],
|
|
38
|
+
"vk_delta_2": [
|
|
39
|
+
[
|
|
40
|
+
"14990800869627850257893476139502138886842300073782552416527527220211999051021",
|
|
41
|
+
"12019227350316302784523778352691865318953394316697895104204947035916007498199"
|
|
42
|
+
],
|
|
43
|
+
[
|
|
44
|
+
"4782487834358741961569897821318547231280402135966285712520334657603277542574",
|
|
45
|
+
"2749538355489199106712219902886462447683742227659308580079039377096586499583"
|
|
46
|
+
],
|
|
47
|
+
[
|
|
48
|
+
"1",
|
|
49
|
+
"0"
|
|
50
|
+
]
|
|
51
|
+
],
|
|
52
|
+
"vk_alphabeta_12": [
|
|
53
|
+
[
|
|
54
|
+
[
|
|
55
|
+
"16004604140728965578138661638211594037063293277199793332563710415107506403520",
|
|
56
|
+
"11147560166332981252925195150980455467875144655505899867249798224526410047168"
|
|
57
|
+
],
|
|
58
|
+
[
|
|
59
|
+
"6885248949178366070388253878092568893637466600168081265843685606931844530240",
|
|
60
|
+
"16338979583697105458788164829930805615704040650316790143822770401021791453011"
|
|
61
|
+
],
|
|
62
|
+
[
|
|
63
|
+
"16999255288466657357929768473293392136087902628034586995869476993675858607964",
|
|
64
|
+
"17319716874845868217639405801798359751259784577964908873054359885398726572212"
|
|
65
|
+
]
|
|
66
|
+
],
|
|
67
|
+
[
|
|
68
|
+
[
|
|
69
|
+
"16065932114393349213400212155432985804364119886372730654401480458147339753454",
|
|
70
|
+
"19492410405735392736025405612326078134005714512479382795304779697851446975052"
|
|
71
|
+
],
|
|
72
|
+
[
|
|
73
|
+
"19316995995129947188171619844923027852024324073427133485549527394782130881463",
|
|
74
|
+
"15152158843247135514589563238821772760234127722300614674014602048664122417314"
|
|
75
|
+
],
|
|
76
|
+
[
|
|
77
|
+
"4413911027750469686293381147712195016200499995285328063918209101558201901380",
|
|
78
|
+
"13756379472300325575468067886046279096717793365882446758762570308974885229873"
|
|
79
|
+
]
|
|
80
|
+
]
|
|
81
|
+
],
|
|
82
|
+
"IC": [
|
|
83
|
+
[
|
|
84
|
+
"3949268453856671477837944156738550879784344849318952569404254752776571543558",
|
|
85
|
+
"18880214408650637025151652959348151451776787379955660714374817103157848430447",
|
|
86
|
+
"1"
|
|
87
|
+
],
|
|
88
|
+
[
|
|
89
|
+
"7595383299465162355762836247608390932868047357866691105205992865750052290945",
|
|
90
|
+
"20433437015153212901089547709024839459004759345208190123539659491221344306189",
|
|
91
|
+
"1"
|
|
92
|
+
],
|
|
93
|
+
[
|
|
94
|
+
"13374632508151173855086275271447357852814774320197819996760809172154184804557",
|
|
95
|
+
"16243978781153453546157051308457933764757039947655668837125687410464695287676",
|
|
96
|
+
"1"
|
|
97
|
+
],
|
|
98
|
+
[
|
|
99
|
+
"5100006802904210985453765707472395269225543487583823550337192150736970528292",
|
|
100
|
+
"11422826625115544450768095068673594582668285010128785727772989005420123848364",
|
|
101
|
+
"1"
|
|
102
|
+
],
|
|
103
|
+
[
|
|
104
|
+
"6372192181718433266625543056882793633891933831629698322649596298241635548389",
|
|
105
|
+
"1709100153456215113738425147889192593829068042544692876702518987995366013294",
|
|
106
|
+
"1"
|
|
107
|
+
],
|
|
108
|
+
[
|
|
109
|
+
"19023554220556579593405142750585200583727431288001850956526899901383498587894",
|
|
110
|
+
"18297669907692343833002904807534260395539852692277207966597076894953025600140",
|
|
111
|
+
"1"
|
|
112
|
+
],
|
|
113
|
+
[
|
|
114
|
+
"8941916294769993668611112875396217591149851648038239397926633496081198913978",
|
|
115
|
+
"9988646368972541886335809760033327451475524812702990285260789674301170666927",
|
|
116
|
+
"1"
|
|
117
|
+
],
|
|
118
|
+
[
|
|
119
|
+
"1442460910073871138127576487044360633238044344422191659635689177249834998473",
|
|
120
|
+
"14346911267655939600069210937090128179049312695187836316371484475583295682383",
|
|
121
|
+
"1"
|
|
122
|
+
]
|
|
123
|
+
]
|
|
124
|
+
}
|
package/dist/src/index.js
CHANGED
|
@@ -1189,23 +1189,20 @@ async function generateProof(input) {
|
|
|
1189
1189
|
pathIndices: input.pathIndices,
|
|
1190
1190
|
amount: BigInt(input.amount).toString()
|
|
1191
1191
|
};
|
|
1192
|
+
const packageRoot = path__namespace.join(__dirname, "../..");
|
|
1192
1193
|
const wasmPath = path__namespace.join(
|
|
1193
|
-
|
|
1194
|
-
"
|
|
1195
|
-
);
|
|
1196
|
-
const zkeyPath = path__namespace.join(
|
|
1197
|
-
__dirname,
|
|
1198
|
-
"../../../../circuits/transaction_0001.zkey"
|
|
1194
|
+
packageRoot,
|
|
1195
|
+
"circuits/build/transaction_js/transaction.wasm"
|
|
1199
1196
|
);
|
|
1197
|
+
const zkeyPath = path__namespace.join(packageRoot, "circuits/transaction_0001.zkey");
|
|
1200
1198
|
const { proof, publicSignals } = await snarkjs.groth16.fullProve(
|
|
1201
1199
|
circuitInputs,
|
|
1202
1200
|
wasmPath,
|
|
1203
|
-
zkeyPath
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
__dirname,
|
|
1207
|
-
"../../../../circuits/verification_key.json"
|
|
1201
|
+
zkeyPath,
|
|
1202
|
+
true
|
|
1203
|
+
// ! use single thread for proving
|
|
1208
1204
|
);
|
|
1205
|
+
const vKeyPath = path__namespace.join(packageRoot, "circuits/verification_key.json");
|
|
1209
1206
|
const isValid = await snarkjs.groth16.verify(
|
|
1210
1207
|
JSON.parse(fs__namespace.readFileSync(vKeyPath, "utf8")),
|
|
1211
1208
|
publicSignals,
|