@orbinum/circuits 0.4.2 → 0.4.4

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 CHANGED
@@ -13,14 +13,15 @@ npm install @orbinum/circuits
13
13
 
14
14
  ## 📦 Package Contents
15
15
 
16
- This package includes **12 files** for 3 circuits (disclosure, transfer, unshield):
16
+ This package includes **20 files** for 4 circuits (disclosure, transfer, unshield, private_link):
17
17
 
18
- ### For Each Circuit (disclosure, transfer, unshield):
18
+ ### For Each Circuit (disclosure, transfer, unshield, private_link):
19
19
 
20
- 1. **`{circuit}.wasm`** - Witness calculator (3 files)
21
- 2. **`{circuit}_pk.zkey`** - Proving key for snarkjs (3 files)
22
- 3. **`{circuit}_pk.ark`** - Proving key for arkworks/Rust (3 files)
23
- 4. **`verification_key_{circuit}.json`** - Verification key for on-chain verification (3 files)
20
+ 1. **`{circuit}.wasm`** - Witness calculator (4 files)
21
+ 2. **`{circuit}.r1cs`** - R1CS constraint system — for custom provers / verification (4 files)
22
+ 3. **`{circuit}_pk.zkey`** - Proving key for snarkjs (4 files)
23
+ 4. **`{circuit}_pk.ark`** - Proving key for arkworks/Rust (4 files)
24
+ 5. **`verification_key_{circuit}.json`** - Verification key for on-chain verification (4 files)
24
25
 
25
26
  ## 🔧 Usage
26
27
 
@@ -29,17 +30,19 @@ This package includes **12 files** for 3 circuits (disclosure, transfer, unshiel
29
30
  ```typescript
30
31
  import { join } from "path";
31
32
  import { readFileSync } from "fs";
33
+ import { getCircuitPaths } from "@orbinum/circuits";
32
34
 
33
- // Get circuit artifacts
34
- const circuitsPath = require.resolve("@orbinum/circuits/package.json").replace("package.json", "");
35
+ // Get all paths for a circuit
36
+ const paths = getCircuitPaths("transfer"); // 'disclosure' | 'transfer' | 'unshield' | 'private_link'
35
37
 
36
38
  // Load WASM witness calculator
37
- const wasmPath = join(circuitsPath, "transfer.wasm");
38
- const wasmBuffer = readFileSync(wasmPath);
39
+ const wasmBuffer = readFileSync(paths.wasm);
39
40
 
40
41
  // Load proving key (.zkey)
41
- const zkeyPath = join(circuitsPath, "transfer_pk.zkey");
42
- const zkeyBuffer = readFileSync(zkeyPath);
42
+ const zkeyBuffer = readFileSync(paths.zkey);
43
+
44
+ // Load R1CS (e.g. for custom prover or constraint inspection)
45
+ const r1csBuffer = readFileSync(paths.r1cs);
43
46
 
44
47
  // Use with snarkjs for proof generation
45
48
  // ... snarkjs proof generation code ...
@@ -82,6 +85,10 @@ Private token transfer circuit with 2 inputs and 2 outputs.
82
85
 
83
86
  Withdrawal circuit from private pool to public account.
84
87
 
88
+ ### 4. **Private Link** (`private_link_*`)
89
+
90
+ Proves linkage between two commitments without revealing their values.
91
+
85
92
  ## 🔗 Related Packages
86
93
 
87
94
  - [@orbinum/proof-generator](https://www.npmjs.com/package/@orbinum/proof-generator) - High-level proof orchestrator
@@ -101,12 +108,13 @@ console.log("Public signals:", result.publicSignals);
101
108
 
102
109
  ## 📄 File Sizes
103
110
 
104
- - **WASM files**: ~1-2 MB each (witness calculators)
105
- - **`.zkey` files**: ~7-9 MB each (snarkjs proving keys)
106
- - **`.ark` files**: ~7-9 MB each (arkworks proving keys)
111
+ - **WASM files**: ~1-3 MB each (witness calculators)
112
+ - **R1CS files**: ~1-5 MB each (constraint systems)
113
+ - **`.zkey` files**: ~0.5-20 MB each (snarkjs proving keys)
114
+ - **`.ark` files**: ~0.2-9 MB each (arkworks proving keys)
107
115
  - **Verification keys**: ~3-4 KB each (JSON)
108
116
 
109
- **Total package size**: ~50-60 MB
117
+ **Total package size**: ~80-90 MB
110
118
 
111
119
  ## 🔒 Security Notice
112
120
 
Binary file
package/disclosure_pk.ark CHANGED
Binary file
Binary file
package/index.d.ts CHANGED
@@ -6,6 +6,7 @@
6
6
 
7
7
  export interface CircuitPaths {
8
8
  wasm: string;
9
+ r1cs: string;
9
10
  zkey: string;
10
11
  ark: string;
11
12
  verificationKey: string;
@@ -14,11 +15,13 @@ export interface CircuitPaths {
14
15
  /**
15
16
  * Get paths to all files for a specific circuit
16
17
  */
17
- export function getCircuitPaths(circuit: "disclosure" | "transfer" | "unshield"): CircuitPaths;
18
+ export function getCircuitPaths(
19
+ circuit: "disclosure" | "transfer" | "unshield" | "private_link"
20
+ ): CircuitPaths;
18
21
 
19
22
  /**
20
23
  * Available circuits
21
24
  */
22
- export type CircuitType = "disclosure" | "transfer" | "unshield";
25
+ export type CircuitType = "disclosure" | "transfer" | "unshield" | "private_link";
23
26
 
24
27
  export const CIRCUITS: CircuitType[];
package/index.js CHANGED
@@ -6,11 +6,11 @@
6
6
 
7
7
  const { join } = require("path");
8
8
 
9
- const CIRCUITS = ["disclosure", "transfer", "unshield"];
9
+ const CIRCUITS = ["disclosure", "transfer", "unshield", "private_link"];
10
10
 
11
11
  /**
12
12
  * Get paths to all files for a specific circuit
13
- * @param {string} circuit - Circuit name: 'disclosure', 'transfer', or 'unshield'
13
+ * @param {string} circuit - Circuit name: 'disclosure', 'transfer', 'unshield', or 'private_link'
14
14
  * @returns {Object} Paths to circuit files
15
15
  */
16
16
  function getCircuitPaths(circuit) {
@@ -22,6 +22,7 @@ function getCircuitPaths(circuit) {
22
22
 
23
23
  return {
24
24
  wasm: join(basePath, `${circuit}.wasm`),
25
+ r1cs: join(basePath, `${circuit}.r1cs`),
25
26
  zkey: join(basePath, `${circuit}_pk.zkey`),
26
27
  ark: join(basePath, `${circuit}_pk.ark`),
27
28
  verificationKey: join(basePath, `verification_key_${circuit}.json`),
package/manifest.json ADDED
@@ -0,0 +1,160 @@
1
+ {
2
+ "schema_version": "1.0.0",
3
+ "package_name": "orbinum-circuits",
4
+ "package_version": "0.4.4",
5
+ "generated_at": "2026-03-19T14:10:04.861Z",
6
+ "circuits": {
7
+ "disclosure": {
8
+ "active_version": 1,
9
+ "supported_versions": [
10
+ 1
11
+ ],
12
+ "versions": {
13
+ "1": {
14
+ "version": 1,
15
+ "vk_hash": "0xc27372bfd4aaf3b14b47af119d38c42e1aee8be4051bfbc1a0e27c767a13d9cf",
16
+ "artifacts": {
17
+ "wasm": {
18
+ "file": "disclosure.wasm",
19
+ "localPath": "build/disclosure_js/disclosure.wasm",
20
+ "bytes": 2220560,
21
+ "sha256": "db42d0d4941c7d7265717fe44e43048c0800f962a2ea7251353ea2f645aa9f31"
22
+ },
23
+ "zkey": {
24
+ "file": "disclosure_pk.zkey",
25
+ "localPath": "keys/disclosure_pk.zkey",
26
+ "bytes": 554204,
27
+ "sha256": "dbc292073cf2b8c9dc304b8e7de6cd206277f5b9e7ed4c67efe4b7fa27137efb"
28
+ },
29
+ "vk_json": {
30
+ "file": "verification_key_disclosure.json",
31
+ "localPath": "build/verification_key_disclosure.json",
32
+ "bytes": 3471,
33
+ "sha256": "c27372bfd4aaf3b14b47af119d38c42e1aee8be4051bfbc1a0e27c767a13d9cf"
34
+ },
35
+ "r1cs": {
36
+ "file": "disclosure.r1cs",
37
+ "localPath": "build/disclosure.r1cs",
38
+ "bytes": 159840,
39
+ "sha256": "c8dc1ba76e133ebd39db020ce52b1d8587103209d83dbf02d7eb7545557042f0"
40
+ }
41
+ }
42
+ }
43
+ }
44
+ },
45
+ "transfer": {
46
+ "active_version": 1,
47
+ "supported_versions": [
48
+ 1
49
+ ],
50
+ "versions": {
51
+ "1": {
52
+ "version": 1,
53
+ "vk_hash": "0x2ab60d1597eacb9bdc80e8ceedcf678fff2349d40c350af9192c98fdda0990c0",
54
+ "artifacts": {
55
+ "wasm": {
56
+ "file": "transfer.wasm",
57
+ "localPath": "build/transfer_js/transfer.wasm",
58
+ "bytes": 3359868,
59
+ "sha256": "97cae6deed6c526ed0a287da3d3ab4b8f2cc71ccc956278d262f850ec435b7e5"
60
+ },
61
+ "zkey": {
62
+ "file": "transfer_pk.zkey",
63
+ "localPath": "keys/transfer_pk.zkey",
64
+ "bytes": 20484784,
65
+ "sha256": "c5d6dfb9dba43687a5cdada1f5a244807971a2ae596125568e736ae7d85313ac"
66
+ },
67
+ "vk_json": {
68
+ "file": "verification_key_transfer.json",
69
+ "localPath": "build/verification_key_transfer.json",
70
+ "bytes": 3658,
71
+ "sha256": "2ab60d1597eacb9bdc80e8ceedcf678fff2349d40c350af9192c98fdda0990c0"
72
+ },
73
+ "r1cs": {
74
+ "file": "transfer.r1cs",
75
+ "localPath": "build/transfer.r1cs",
76
+ "bytes": 6629624,
77
+ "sha256": "96757770bbd03e7cff1a313a58d76296823774328966e7ebf088cabe90655592"
78
+ }
79
+ }
80
+ }
81
+ }
82
+ },
83
+ "unshield": {
84
+ "active_version": 1,
85
+ "supported_versions": [
86
+ 1
87
+ ],
88
+ "versions": {
89
+ "1": {
90
+ "version": 1,
91
+ "vk_hash": "0x73401aa0b77bb475478d0be2005a20fcd60196a68ee4abea6cecb6f77124050d",
92
+ "artifacts": {
93
+ "wasm": {
94
+ "file": "unshield.wasm",
95
+ "localPath": "build/unshield_js/unshield.wasm",
96
+ "bytes": 2396830,
97
+ "sha256": "aebf93eb6d7544742eb8bffdbedc82101ff524efdfb649839e3f5b3960c3f06e"
98
+ },
99
+ "zkey": {
100
+ "file": "unshield_pk.zkey",
101
+ "localPath": "keys/unshield_pk.zkey",
102
+ "bytes": 5326768,
103
+ "sha256": "a19e057e669e28df35c231b10d90824493a969f896f6f865448db981d77491e0"
104
+ },
105
+ "vk_json": {
106
+ "file": "verification_key_unshield.json",
107
+ "localPath": "build/verification_key_unshield.json",
108
+ "bytes": 3657,
109
+ "sha256": "73401aa0b77bb475478d0be2005a20fcd60196a68ee4abea6cecb6f77124050d"
110
+ },
111
+ "r1cs": {
112
+ "file": "unshield.r1cs",
113
+ "localPath": "build/unshield.r1cs",
114
+ "bytes": 1584412,
115
+ "sha256": "bebc3fe2a0e9eae6128fb402225ca18276e127daac0df15bad2da7b14e123428"
116
+ }
117
+ }
118
+ }
119
+ }
120
+ },
121
+ "private_link": {
122
+ "active_version": 1,
123
+ "supported_versions": [
124
+ 1
125
+ ],
126
+ "versions": {
127
+ "1": {
128
+ "version": 1,
129
+ "vk_hash": "0x5370006e31d603618b2487d6f61077d86160f2de5cb188c517036be8ce63d9e6",
130
+ "artifacts": {
131
+ "wasm": {
132
+ "file": "private_link.wasm",
133
+ "localPath": "build/private_link_js/private_link.wasm",
134
+ "bytes": 1750902,
135
+ "sha256": "3190bb18260b294c2dccad6f509867a2fdd756707a3c1d10a483551e18796e08"
136
+ },
137
+ "zkey": {
138
+ "file": "private_link_pk.zkey",
139
+ "localPath": "keys/private_link_pk.zkey",
140
+ "bytes": 508588,
141
+ "sha256": "0fbb22eb4917d36d1664bf5a7435bda83fb91543c02fe36548900a0354be5ffb"
142
+ },
143
+ "vk_json": {
144
+ "file": "verification_key_private_link.json",
145
+ "localPath": "build/verification_key_private_link.json",
146
+ "bytes": 3108,
147
+ "sha256": "5370006e31d603618b2487d6f61077d86160f2de5cb188c517036be8ce63d9e6"
148
+ },
149
+ "r1cs": {
150
+ "file": "private_link.r1cs",
151
+ "localPath": "build/private_link.r1cs",
152
+ "bytes": 138248,
153
+ "sha256": "62b38b485b501d0423580c5f217f5cc088d46ead3956097cd893358df7b3fa8c"
154
+ }
155
+ }
156
+ }
157
+ }
158
+ }
159
+ }
160
+ }
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@orbinum/circuits",
3
- "version": "0.4.2",
3
+ "version": "0.4.4",
4
4
  "description": "Zero-Knowledge circuits for Orbinum privacy blockchain",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
7
7
  "files": [
8
8
  "*.wasm",
9
+ "*.r1cs",
9
10
  "*.zkey",
10
11
  "*.ark",
11
12
  "*.json",
Binary file
Binary file
Binary file
package/transfer.r1cs ADDED
Binary file
package/transfer_pk.ark CHANGED
Binary file
package/transfer_pk.zkey CHANGED
Binary file
package/unshield.r1cs ADDED
Binary file
package/unshield_pk.ark CHANGED
Binary file
package/unshield_pk.zkey CHANGED
Binary file
@@ -37,12 +37,12 @@
37
37
  ],
38
38
  "vk_delta_2": [
39
39
  [
40
- "15891488507266392457506126879904299590646143497545573658070845046860313168900",
41
- "17932936512660402537945596421514282776231371752944152874563145263497597450760"
40
+ "17217040771673193595057726921783631627855097326348120963208522878512499029330",
41
+ "13885070462915928008454037293608534517313451468269061002600563284403343119679"
42
42
  ],
43
43
  [
44
- "3499547373407916183334246733416920057398428467450155425825370305197257091551",
45
- "19552021655696733860272339514203367725306524797267373214782737566735379534814"
44
+ "3294658414414120993425471992804336667610262589234319138843342065557453098560",
45
+ "17737015192861348799337032595899967396123214324126230194042205099833539151635"
46
46
  ],
47
47
  [
48
48
  "1",
@@ -37,12 +37,12 @@
37
37
  ],
38
38
  "vk_delta_2": [
39
39
  [
40
- "10017835699183705898959917136102492144834257686815545884930858162381601990409",
41
- "931443350602532557937041795504460956825516039268595684065058096905709951092"
40
+ "18708088501824770155642880639406132276019586927975426545919843091107665711136",
41
+ "7281146943269352647233370615143721749052948920156705386694100248139135409054"
42
42
  ],
43
43
  [
44
- "5422627372590078623437693585780294233708885223015825213203251737533870277450",
45
- "283187716635581259790955746698071893681197794322898971002784670258068039290"
44
+ "561349355935335715726998988887632818489251333881052239604755799880817608689",
45
+ "19376843534964904315969326338320223321824520867819696102836942219623770579841"
46
46
  ],
47
47
  [
48
48
  "1",
@@ -37,12 +37,12 @@
37
37
  ],
38
38
  "vk_delta_2": [
39
39
  [
40
- "13592358905892806894609749704924498653340310428666562825012485043168406251517",
41
- "3211692905624887612709603909359343249636321946591964015653041273643645227074"
40
+ "16534541960038203730922153431011952520231502248102204627778677469454764257863",
41
+ "612718894073470502899294133376956338400130590801671068885296033589842631143"
42
42
  ],
43
43
  [
44
- "13578083370589112277533348698319334184076656186483533721611127475200402183319",
45
- "1108626797718921918393637882276842818263529189049174090035812773418872629637"
44
+ "13344470759550869768113821122007863796610274203571333884277796728461553136702",
45
+ "17939730979332296194637439421341086527627400250626716559950805216086863237071"
46
46
  ],
47
47
  [
48
48
  "1",
@@ -37,12 +37,12 @@
37
37
  ],
38
38
  "vk_delta_2": [
39
39
  [
40
- "14018664169821405030103251176282245231130962942915865206666085788024510483344",
41
- "18071845854913103053394274596987694171637401535194883546405614579067243429300"
40
+ "13485340673905960649139915426847429419411563348595946927397116672747480831694",
41
+ "1095836256349972235647488149588381659699652235902169087555248652538356328950"
42
42
  ],
43
43
  [
44
- "15299874059012859661606442170730830993341770196170954699235150146401785745498",
45
- "5987421919169714599301773144652260474271539718465406299442363505585632972816"
44
+ "1002081672113001348839112824395978772012000343800109361341868255356781827876",
45
+ "10671240843878105133627292009960428867606819728877311425314008749951591965216"
46
46
  ],
47
47
  [
48
48
  "1",