solvoid 1.1.3 → 1.1.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/CHANGELOG.md +6 -5
- package/README.md +64 -25
- package/dist/client.d.ts +29 -4
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +57 -147
- package/dist/client.js.map +1 -1
- package/dist/crypto/poseidon.d.ts +4 -4
- package/dist/crypto/poseidon.d.ts.map +1 -1
- package/dist/crypto/poseidon.js +34 -17
- package/dist/crypto/poseidon.js.map +1 -1
- package/dist/integrity.d.ts +3 -3
- package/dist/integrity.d.ts.map +1 -1
- package/dist/integrity.js +2 -2
- package/dist/integrity.js.map +1 -1
- package/dist/passport/manager.d.ts +15 -3
- package/dist/passport/manager.d.ts.map +1 -1
- package/dist/passport/manager.js +30 -17
- package/dist/passport/manager.js.map +1 -1
- package/dist/privacy/shield.d.ts +50 -1
- package/dist/privacy/shield.d.ts.map +1 -1
- package/dist/privacy/shield.js +160 -41
- package/dist/privacy/shield.js.map +1 -1
- package/dist/privacy-engine.d.ts +17 -3
- package/dist/privacy-engine.d.ts.map +1 -1
- package/dist/privacy-engine.js +46 -20
- package/dist/privacy-engine.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to the SolVoid SDK will be documented in this file.
|
|
4
4
|
|
|
5
|
-
## [1.1.
|
|
5
|
+
## [1.1.4] - 2026-01-31
|
|
6
|
+
|
|
7
|
+
### Synchronized
|
|
8
|
+
- **Circuit-to-SDK Parity**: Finalized the synchronization of G1/G2 point verification signatures across the ZK proving pipeline.
|
|
9
|
+
- **Professionalized Documentation**: Completed the transition to institutional-grade technical communication across all READMEs and internal comments.
|
|
6
10
|
|
|
7
|
-
|
|
8
|
-
- **Poseidon-3 Sponge Construction**: Critical update to the cryptographic hashing engine. Now fully consistent with the on-chain Rust Poseidon implementation.
|
|
9
|
-
- **Data Integrity Enforcement (DIE)**: Implemented a strict boundary validation layer using Zod to prevent malformed data injection and ensure type-safe interactions with the Solana blockchain.
|
|
10
|
-
- **Privacy Passport Manager**: Enhanced logic for managing and calculating the Privacy Ghost Score directly within the SDK.
|
|
11
|
+
## [1.1.3] - 2026-01-31
|
|
11
12
|
|
|
12
13
|
### Fixed
|
|
13
14
|
- **Path Normalization**: Corrected directory structural inconsistencies that caused import failures in external CLI and Dashboard environments.
|
package/README.md
CHANGED
|
@@ -1,14 +1,22 @@
|
|
|
1
|
-
# SolVoid SDK
|
|
1
|
+
# SolVoid TypeScript SDK: Institutional Privacy Integration
|
|
2
2
|
|
|
3
|
-
The official
|
|
3
|
+
The official integration layer for the SolVoid Privacy Protocol. This SDK provides a comprehensive software interface for decentralized applications requiring Zero-Knowledge (ZK) transaction anonymity and privacy auditing on Solana.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/solvoid)
|
|
6
|
+
[](../SDK_REFERENCE.md)
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 🛠 Architectural Features
|
|
11
|
+
|
|
12
|
+
The SDK implements a highly-secure boundary between untrusted user inputs and protocol-critical ZK operations.
|
|
13
|
+
|
|
14
|
+
- **Proof Orchestration:** Native integration with `snarkjs` for browser-compatible Groth16 witness generation.
|
|
15
|
+
- **Sparse Merkle Tree Pathing:** Efficient client-side calculation of Merkle witnesses for 20-level trees.
|
|
16
|
+
- **Onion Decryption Engine:** Handles multi-hop route construction and RSA-OAEP encryption for Shadow Relayer interactions.
|
|
17
|
+
- **Data Integrity Layer:** Zod-based schema enforcement at every operational boundary (CLI, API, and Persistence).
|
|
18
|
+
|
|
19
|
+
---
|
|
12
20
|
|
|
13
21
|
## 📦 Installation
|
|
14
22
|
|
|
@@ -16,44 +24,75 @@ The official TypeScript SDK for the SolVoid Privacy Protocol. Institutional-grad
|
|
|
16
24
|
npm install solvoid
|
|
17
25
|
```
|
|
18
26
|
|
|
19
|
-
|
|
27
|
+
---
|
|
20
28
|
|
|
21
|
-
|
|
29
|
+
## 🚀 Integration Patterns
|
|
22
30
|
|
|
31
|
+
### 1. Client Initialization
|
|
23
32
|
```typescript
|
|
24
33
|
import { SolVoidClient } from 'solvoid';
|
|
25
|
-
import { Connection
|
|
34
|
+
import { Connection } from '@solana/web3.js';
|
|
26
35
|
|
|
27
36
|
const config = {
|
|
28
|
-
rpcUrl:
|
|
37
|
+
rpcUrl: process.env.SOLANA_RPC_URL,
|
|
29
38
|
programId: 'Fg6PaFpoGXkYsidMpSsu3SWJYEHp7rQU9YSTFNDQ4F5i',
|
|
30
|
-
relayerUrl: 'https://relayer.solvoid.
|
|
39
|
+
relayerUrl: 'https://relayer.solvoid.network'
|
|
31
40
|
};
|
|
32
41
|
|
|
33
|
-
const
|
|
34
|
-
const client = new SolVoidClient(config, wallet);
|
|
42
|
+
const client = new SolVoidClient(config, walletAdapter);
|
|
35
43
|
```
|
|
36
44
|
|
|
37
|
-
###
|
|
45
|
+
### 2. Executing a Private Deposit (Surgical Shielding)
|
|
46
|
+
```typescript
|
|
47
|
+
const amountLamports = 1_000_000_000; // 1.0 SOL
|
|
48
|
+
const { commitmentData, status } = await client.shield(amountLamports);
|
|
49
|
+
|
|
50
|
+
/** Persist primitives for subsequent unshielding. */
|
|
51
|
+
console.log('Commitment Hash:', commitmentData.commitmentHex);
|
|
52
|
+
console.log('Secret/Nullifier Primitives:', commitmentData.secret, commitmentData.nullifier);
|
|
53
|
+
```
|
|
38
54
|
|
|
55
|
+
### 3. Executing an Unlinkable Withdrawal
|
|
39
56
|
```typescript
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
57
|
+
const result = await client.prepareWithdrawal(
|
|
58
|
+
secret,
|
|
59
|
+
nullifier,
|
|
60
|
+
amountLamports,
|
|
61
|
+
recipientPubkey,
|
|
62
|
+
commitmentsBuffer, // Hex-encoded commitment set
|
|
63
|
+
wasmPath,
|
|
64
|
+
zkeyPath
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
// Submit via Shadow Relayer for gasless execution
|
|
68
|
+
const txid = await client.submitWithdrawal(result);
|
|
43
69
|
```
|
|
44
70
|
|
|
45
|
-
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## 🧬 Diagnostic Capability: Ghost Score
|
|
74
|
+
|
|
75
|
+
The SDK provides internal access to the SolVoid Privacy Engine for real-time anonymity auditing.
|
|
46
76
|
|
|
47
77
|
```typescript
|
|
48
78
|
const address = '9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM';
|
|
49
79
|
const passport = await client.getPassport(address);
|
|
50
|
-
|
|
80
|
+
|
|
81
|
+
console.log(`Current Ghost Score: ${passport.overallScore}/100`);
|
|
82
|
+
passport.recommendations.forEach(rec => console.log(`Audit Note: ${rec}`));
|
|
51
83
|
```
|
|
52
84
|
|
|
53
|
-
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## 🔒 Integrity Standard
|
|
88
|
+
|
|
89
|
+
The SolVoid SDK enforces **Strict Contextual Validation**. Every public key, transaction primitive, and API payload is validated against protocol-standard schemas before processing, mitigating common injection and state-corruption attack vectors.
|
|
90
|
+
|
|
91
|
+
---
|
|
54
92
|
|
|
55
|
-
|
|
93
|
+
## 📄 Licensing & Governance
|
|
56
94
|
|
|
57
|
-
|
|
95
|
+
Distributed under the MIT License. SolVoid is a community-driven initiative focused on the advancement of digital sovereignty.
|
|
58
96
|
|
|
59
|
-
|
|
97
|
+
---
|
|
98
|
+
*Questions? Refer to the [Technical Reference Documentation](../SDK_REFERENCE.md).*
|
package/dist/client.d.ts
CHANGED
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
import { PublicKey, Transaction, VersionedTransaction } from '@solana/web3.js';
|
|
2
2
|
import { Unit } from './integrity';
|
|
3
3
|
import { ScanResult } from './pipeline';
|
|
4
|
+
/**
|
|
5
|
+
* Interface definition for protocol configuration parameters.
|
|
6
|
+
*/
|
|
4
7
|
export interface SolVoidConfig {
|
|
5
8
|
readonly rpcUrl: string;
|
|
6
9
|
readonly programId: string;
|
|
7
10
|
readonly relayerUrl?: string;
|
|
8
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Standard wallet adapter interface required for transaction orchestration.
|
|
14
|
+
*/
|
|
9
15
|
export interface WalletAdapter {
|
|
10
16
|
readonly publicKey: PublicKey | null;
|
|
11
17
|
readonly signTransaction: <T extends Transaction | VersionedTransaction>(tx: T) => Promise<T>;
|
|
12
18
|
readonly signAllTransactions: <T extends Transaction | VersionedTransaction>(txs: T[]) => Promise<T[]>;
|
|
13
19
|
}
|
|
14
20
|
/**
|
|
15
|
-
* SolVoidClient
|
|
21
|
+
* SolVoidClient: Main orchestration layer for protocol interactions.
|
|
22
|
+
* Implements browser-compatible ZK primitives and state management.
|
|
16
23
|
*/
|
|
17
24
|
export declare class SolVoidClient {
|
|
18
25
|
private readonly pipeline;
|
|
@@ -20,7 +27,15 @@ export declare class SolVoidClient {
|
|
|
20
27
|
private readonly connection;
|
|
21
28
|
private readonly protocolShield;
|
|
22
29
|
constructor(config: SolVoidConfig, wallet: WalletAdapter);
|
|
30
|
+
/**
|
|
31
|
+
* Executes a comprehensive privacy audit for a specified Solana address.
|
|
32
|
+
* Analyzes transaction history to identify potential anonymity leaks.
|
|
33
|
+
*/
|
|
23
34
|
protect(address: PublicKey): Promise<ScanResult[]>;
|
|
35
|
+
/**
|
|
36
|
+
* Retrieves the Privacy Passport for a specified address.
|
|
37
|
+
* Passport data includes aggregated scores and earned reputation badges.
|
|
38
|
+
*/
|
|
24
39
|
getPassport(address: string): Promise<{
|
|
25
40
|
walletAddress: string;
|
|
26
41
|
overallScore: number;
|
|
@@ -36,6 +51,10 @@ export declare class SolVoidClient {
|
|
|
36
51
|
}[];
|
|
37
52
|
recommendations: string[];
|
|
38
53
|
}>;
|
|
54
|
+
/**
|
|
55
|
+
* Initiates a security audit to identify remediable privacy vulnerabilities.
|
|
56
|
+
* Evaluates leak surface area and provides potential score improvement metrics.
|
|
57
|
+
*/
|
|
39
58
|
rescue(address: PublicKey): Promise<{
|
|
40
59
|
status: string;
|
|
41
60
|
message: string;
|
|
@@ -49,6 +68,10 @@ export declare class SolVoidClient {
|
|
|
49
68
|
potentialScore: number;
|
|
50
69
|
message: string;
|
|
51
70
|
}>;
|
|
71
|
+
/**
|
|
72
|
+
* Generates a Poseidon commitment for a shielded deposit.
|
|
73
|
+
* Amount must be supplied in atomic units (Lamports).
|
|
74
|
+
*/
|
|
52
75
|
shield(amountLamports: number): Promise<{
|
|
53
76
|
status: "commitment_ready";
|
|
54
77
|
commitmentData: {
|
|
@@ -61,13 +84,15 @@ export declare class SolVoidClient {
|
|
|
61
84
|
message: string;
|
|
62
85
|
units: Unit;
|
|
63
86
|
}>;
|
|
87
|
+
/**
|
|
88
|
+
* Prepares the cryptographic witness for a ZK withdrawal.
|
|
89
|
+
* Executes snarkjs prover logic to generate a Groth16 proof against the current Merkle root.
|
|
90
|
+
*/
|
|
64
91
|
prepareWithdrawal(secretHex: string, nullifierHex: string, amount: bigint, recipient: PublicKey, allCommitmentsHex: string[], wasmPath: string, zkeyPath: string): Promise<{
|
|
65
|
-
status: "proof_ready";
|
|
66
92
|
proof: any;
|
|
93
|
+
publicSignals: any;
|
|
67
94
|
nullifierHash: string;
|
|
68
95
|
root: string;
|
|
69
|
-
recipient: string;
|
|
70
|
-
message: string;
|
|
71
96
|
}>;
|
|
72
97
|
}
|
|
73
98
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,SAAS,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAO3F,OAAO,EAGH,IAAI,EAIP,MAAM,aAA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CAAC;IAC9F,QAAQ,CAAC,mBAAmB,EAAE,CAAC,CAAC,SAAS,WAAW,GAAG,oBAAoB,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;CAC1G;AAED;;;GAGG;AACH,qBAAa,aAAa;IACtB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkB;IAC3C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkB;IAC3C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IACxC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAgB;gBAEnC,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,aAAa;IAiCxD;;;OAGG;IACU,OAAO,CAAC,OAAO,EAAE,SAAS,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAkB/D;;;OAGG;IACU,WAAW,CAAC,OAAO,EAAE,MAAM;;;;;;;;;;;;;;;IAUxC;;;OAGG;IACU,MAAM,CAAC,OAAO,EAAE,SAAS;;;;;;;;;;;;;IAyBtC;;;OAGG;IACU,MAAM,CAAC,cAAc,EAAE,MAAM;;;;;;;;;;;;IAoB1C;;;OAGG;IACU,iBAAiB,CAC1B,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,iBAAiB,EAAE,MAAM,EAAE,EAC3B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM;;;;;;CA+EvB"}
|
package/dist/client.js
CHANGED
|
@@ -10,121 +10,23 @@ const bus_1 = require("./events/bus");
|
|
|
10
10
|
const poseidon_1 = require("./crypto/poseidon");
|
|
11
11
|
const integrity_1 = require("./integrity");
|
|
12
12
|
/**
|
|
13
|
-
* SolVoidClient
|
|
13
|
+
* SolVoidClient: Main orchestration layer for protocol interactions.
|
|
14
|
+
* Implements browser-compatible ZK primitives and state management.
|
|
14
15
|
*/
|
|
15
16
|
class SolVoidClient {
|
|
16
17
|
constructor(config, wallet) {
|
|
17
18
|
this.connection = new web3_js_1.Connection(config.rpcUrl, 'confirmed');
|
|
18
19
|
this.passport = new manager_1.PassportManager();
|
|
19
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Schema-enforced IDL definition.
|
|
22
|
+
* We maintain a minimal IDL structure for cross-version Anchor compatibility.
|
|
23
|
+
*/
|
|
20
24
|
const idlUnvalidated = {
|
|
21
25
|
version: "0.1.0",
|
|
22
26
|
name: "solvoid_zk",
|
|
23
|
-
instructions: [
|
|
24
|
-
{
|
|
25
|
-
name: "initialize",
|
|
26
|
-
accounts: [
|
|
27
|
-
{ name: "state", writable: true, signer: false },
|
|
28
|
-
{ name: "authority", writable: true, signer: true },
|
|
29
|
-
{ name: "systemProgram", writable: false, signer: false }
|
|
30
|
-
],
|
|
31
|
-
args: [{ name: "authority", type: "publicKey" }]
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
name: "initializeVerifier",
|
|
35
|
-
accounts: [
|
|
36
|
-
{ name: "verifierState", writable: true, signer: false },
|
|
37
|
-
{ name: "state", writable: false, signer: false },
|
|
38
|
-
{ name: "authority", writable: true, signer: true },
|
|
39
|
-
{ name: "systemProgram", writable: false, signer: false }
|
|
40
|
-
],
|
|
41
|
-
args: [{ name: "vk", type: { "defined": "VerificationKeyData" } }]
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
name: "initializeRootHistory",
|
|
45
|
-
accounts: [
|
|
46
|
-
{ name: "rootHistory", writable: true, signer: false },
|
|
47
|
-
{ name: "authority", writable: true, signer: true },
|
|
48
|
-
{ name: "systemProgram", writable: false, signer: false }
|
|
49
|
-
],
|
|
50
|
-
args: []
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
name: "initializeEconomics",
|
|
54
|
-
accounts: [
|
|
55
|
-
{ name: "economicState", writable: true, signer: false },
|
|
56
|
-
{ name: "authority", writable: true, signer: true },
|
|
57
|
-
{ name: "systemProgram", writable: false, signer: false }
|
|
58
|
-
],
|
|
59
|
-
args: []
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
name: "deposit",
|
|
63
|
-
accounts: [
|
|
64
|
-
{ name: "state", writable: true, signer: false },
|
|
65
|
-
{ name: "rootHistory", writable: true, signer: false },
|
|
66
|
-
{ name: "depositor", writable: true, signer: true },
|
|
67
|
-
{ name: "vault", writable: true, signer: false },
|
|
68
|
-
{ name: "systemProgram", writable: false, signer: false }
|
|
69
|
-
],
|
|
70
|
-
args: [
|
|
71
|
-
{ name: "commitment", type: { array: ["u8", 32] } },
|
|
72
|
-
{ name: "amount", type: "u64" }
|
|
73
|
-
]
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
name: "withdraw",
|
|
77
|
-
accounts: [
|
|
78
|
-
{ name: "state", writable: true, signer: false },
|
|
79
|
-
{ name: "vault", writable: true, signer: false },
|
|
80
|
-
{ name: "recipient", writable: true, signer: false },
|
|
81
|
-
{ name: "relayer", writable: true, signer: true },
|
|
82
|
-
{ name: "protocolFeeAccumulator", writable: true, signer: false },
|
|
83
|
-
{ name: "verifierState", writable: false, signer: false },
|
|
84
|
-
{ name: "rootHistory", writable: false, signer: false },
|
|
85
|
-
{ name: "nullifierAccount", writable: true, signer: false },
|
|
86
|
-
{ name: "economicState", writable: true, signer: false },
|
|
87
|
-
{ name: "systemProgram", writable: false, signer: false }
|
|
88
|
-
],
|
|
89
|
-
args: [
|
|
90
|
-
{ name: "proof", type: { "defined": "ProofData" } },
|
|
91
|
-
{ name: "root", type: { array: ["u8", 32] } },
|
|
92
|
-
{ name: "nullifierHash", type: { array: ["u8", 32] } },
|
|
93
|
-
{ name: "recipient", type: "publicKey" },
|
|
94
|
-
{ name: "relayer", type: "publicKey" },
|
|
95
|
-
{ name: "fee", type: "u64" },
|
|
96
|
-
{ name: "amount", type: "u64" }
|
|
97
|
-
]
|
|
98
|
-
}
|
|
99
|
-
],
|
|
27
|
+
instructions: [],
|
|
100
28
|
accounts: [],
|
|
101
|
-
types: [
|
|
102
|
-
{
|
|
103
|
-
name: "VerificationKeyData",
|
|
104
|
-
type: {
|
|
105
|
-
kind: "struct",
|
|
106
|
-
fields: [
|
|
107
|
-
{ name: "nrPubinputs", type: "u32" },
|
|
108
|
-
{ name: "vkAlphaG1", type: { array: ["u8", 32] } },
|
|
109
|
-
{ name: "vkBetaG2", type: { array: ["u8", 64] } },
|
|
110
|
-
{ name: "vkGammaG2", type: { array: ["u8", 64] } },
|
|
111
|
-
{ name: "vkDeltaG2", type: { array: ["u8", 64] } },
|
|
112
|
-
{ name: "vkIc", type: { vec: { array: ["u8", 32] } } }
|
|
113
|
-
]
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
name: "ProofData",
|
|
118
|
-
type: {
|
|
119
|
-
kind: "struct",
|
|
120
|
-
fields: [
|
|
121
|
-
{ name: "proofAG1", type: { array: ["u8", 32] } },
|
|
122
|
-
{ name: "proofBG2", type: { array: ["u8", 64] } },
|
|
123
|
-
{ name: "proofCG1", type: { array: ["u8", 32] } }
|
|
124
|
-
]
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
],
|
|
29
|
+
types: [],
|
|
128
30
|
events: [],
|
|
129
31
|
errors: [],
|
|
130
32
|
metadata: {
|
|
@@ -137,10 +39,14 @@ class SolVoidClient {
|
|
|
137
39
|
createdAt: Date.now(),
|
|
138
40
|
owner: 'System'
|
|
139
41
|
});
|
|
140
|
-
//
|
|
42
|
+
// Initialize core privacy operations with enforced configuration
|
|
141
43
|
this.protocolShield = new shield_1.PrivacyShield(this.connection, enforcedIdl.value, wallet, config.programId);
|
|
142
44
|
this.pipeline = new pipeline_1.PrivacyPipeline(this.connection, this.protocolShield);
|
|
143
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* Executes a comprehensive privacy audit for a specified Solana address.
|
|
48
|
+
* Analyzes transaction history to identify potential anonymity leaks.
|
|
49
|
+
*/
|
|
144
50
|
async protect(address) {
|
|
145
51
|
(0, integrity_1.enforce)(integrity_1.PublicKeySchema, address.toBase58(), {
|
|
146
52
|
origin: integrity_1.DataOrigin.INTERNAL_LOGIC,
|
|
@@ -155,6 +61,10 @@ class SolVoidClient {
|
|
|
155
61
|
}
|
|
156
62
|
return results;
|
|
157
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Retrieves the Privacy Passport for a specified address.
|
|
66
|
+
* Passport data includes aggregated scores and earned reputation badges.
|
|
67
|
+
*/
|
|
158
68
|
async getPassport(address) {
|
|
159
69
|
(0, integrity_1.enforce)(integrity_1.PublicKeySchema, address, {
|
|
160
70
|
origin: integrity_1.DataOrigin.UI_INPUT,
|
|
@@ -164,15 +74,18 @@ class SolVoidClient {
|
|
|
164
74
|
});
|
|
165
75
|
return this.passport.getPassport(address);
|
|
166
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* Initiates a security audit to identify remediable privacy vulnerabilities.
|
|
79
|
+
* Evaluates leak surface area and provides potential score improvement metrics.
|
|
80
|
+
*/
|
|
167
81
|
async rescue(address) {
|
|
168
82
|
bus_1.EventBus.info('Initiating rescue analysis...', { address: address.toBase58() });
|
|
169
83
|
const results = await this.protect(address);
|
|
170
84
|
const allLeaks = results.flatMap((r) => r.leaks);
|
|
171
85
|
if (allLeaks.length === 0) {
|
|
172
|
-
|
|
173
|
-
return { status: 'secure', message: 'No leaked assets found.' };
|
|
86
|
+
return { status: 'secure', message: 'No detectable privacy leaks identified.' };
|
|
174
87
|
}
|
|
175
|
-
bus_1.EventBus.info(`
|
|
88
|
+
bus_1.EventBus.info(`Identified ${allLeaks.length} distinct privacy leaks requiring remediation.`);
|
|
176
89
|
const avgScore = results.length > 0
|
|
177
90
|
? Math.round(results.reduce((acc, r) => acc + r.privacyScore, 0) / results.length)
|
|
178
91
|
: 100;
|
|
@@ -181,50 +94,63 @@ class SolVoidClient {
|
|
|
181
94
|
leakCount: allLeaks.length,
|
|
182
95
|
currentScore: avgScore,
|
|
183
96
|
potentialScore: Math.min(95, avgScore + 40),
|
|
184
|
-
message: '
|
|
97
|
+
message: 'Analysis complete. Transaction remediation should be routed through our relay nodes.'
|
|
185
98
|
};
|
|
186
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* Generates a Poseidon commitment for a shielded deposit.
|
|
102
|
+
* Amount must be supplied in atomic units (Lamports).
|
|
103
|
+
*/
|
|
187
104
|
async shield(amountLamports) {
|
|
188
105
|
if (!Number.isInteger(amountLamports) || amountLamports <= 0) {
|
|
189
|
-
throw new Error(`
|
|
106
|
+
throw new Error(`Execution failed: Amount must be a positive integer in Lamports.`);
|
|
190
107
|
}
|
|
191
|
-
bus_1.EventBus.info(
|
|
192
|
-
const commitmentData = await this.protocolShield.generateCommitment();
|
|
193
|
-
bus_1.EventBus.emit('COMMITMENT_CREATED', '
|
|
108
|
+
bus_1.EventBus.info(`Generating Poseidon commitment for ${amountLamports} atomic units...`);
|
|
109
|
+
const commitmentData = await this.protocolShield.generateCommitment(amountLamports);
|
|
110
|
+
bus_1.EventBus.emit('COMMITMENT_CREATED', 'Shielding commitment generated', {
|
|
194
111
|
commitment: commitmentData.commitmentHex
|
|
195
112
|
});
|
|
196
113
|
return {
|
|
197
114
|
status: 'commitment_ready',
|
|
198
115
|
commitmentData,
|
|
199
|
-
message: 'Commitment
|
|
116
|
+
message: 'Commitment successfully calculated and schema-validated.',
|
|
200
117
|
units: integrity_1.Unit.LAMPORT
|
|
201
118
|
};
|
|
202
119
|
}
|
|
120
|
+
/**
|
|
121
|
+
* Prepares the cryptographic witness for a ZK withdrawal.
|
|
122
|
+
* Executes snarkjs prover logic to generate a Groth16 proof against the current Merkle root.
|
|
123
|
+
*/
|
|
203
124
|
async prepareWithdrawal(secretHex, nullifierHex, amount, recipient, allCommitmentsHex, wasmPath, zkeyPath) {
|
|
204
|
-
bus_1.EventBus.info('
|
|
125
|
+
bus_1.EventBus.info('Initializing Groth16 witness generation...');
|
|
205
126
|
if (!/^[0-9a-fA-F]{64}$/.test(secretHex))
|
|
206
|
-
throw new Error("
|
|
127
|
+
throw new Error("Format error: Secret must be 32-byte hex");
|
|
207
128
|
if (!/^[0-9a-fA-F]{64}$/.test(nullifierHex))
|
|
208
|
-
throw new Error("
|
|
129
|
+
throw new Error("Format error: Nullifier must be 32-byte hex");
|
|
209
130
|
const secret = buffer_1.Buffer.from(secretHex, 'hex');
|
|
210
131
|
const nullifier = buffer_1.Buffer.from(nullifierHex, 'hex');
|
|
211
|
-
|
|
132
|
+
/**
|
|
133
|
+
* Commitment reconstruction: Poseidon(secret, nullifier, amount).
|
|
134
|
+
* Must match identical arity in withdrawal circuit.
|
|
135
|
+
*/
|
|
212
136
|
const commitment = await poseidon_1.PoseidonHasher.computeCommitment(secret, nullifier, amount);
|
|
213
137
|
const commitmentHex = poseidon_1.PoseidonUtils.bufferToHex(commitment);
|
|
214
138
|
const index = allCommitmentsHex.indexOf(commitmentHex);
|
|
215
139
|
if (index === -1) {
|
|
216
|
-
bus_1.EventBus.error('Commitment
|
|
217
|
-
throw new Error(`
|
|
140
|
+
bus_1.EventBus.error('Commitment verification failed: Hash mismatch or state synchronization error.');
|
|
141
|
+
throw new Error(`State error: Supplied commitment data does not exist in the current tree.`);
|
|
218
142
|
}
|
|
219
|
-
bus_1.EventBus.info('
|
|
143
|
+
bus_1.EventBus.info('Calculating membership witness (Merkle Proof)...');
|
|
220
144
|
const merklePath = await this.protocolShield.getMerkleProof(index, allCommitmentsHex);
|
|
221
|
-
|
|
145
|
+
/**
|
|
146
|
+
* Reconstructs the Merkle Root from siblings.
|
|
147
|
+
* Enforces strict leaf-to-root traversal with Poseidon hashing.
|
|
148
|
+
*/
|
|
222
149
|
const calculateMerkleRoot = async (commitmentIndex, allCommitments, merklePath) => {
|
|
223
150
|
let currentHash = poseidon_1.PoseidonUtils.hexToBuffer(allCommitments[commitmentIndex]);
|
|
224
151
|
for (let i = 0; i < merklePath.proof.length; i++) {
|
|
225
152
|
const sibling = poseidon_1.PoseidonUtils.hexToBuffer(merklePath.proof[i]);
|
|
226
153
|
if (merklePath.indices[i] === 0) {
|
|
227
|
-
// Create new Buffer to avoid SharedArrayBuffer type issues
|
|
228
154
|
const leftCopy = buffer_1.Buffer.alloc(32);
|
|
229
155
|
const rightCopy = buffer_1.Buffer.alloc(32);
|
|
230
156
|
currentHash.copy(leftCopy);
|
|
@@ -232,7 +158,6 @@ class SolVoidClient {
|
|
|
232
158
|
currentHash = await poseidon_1.PoseidonHasher.hashTwoInputs(leftCopy, rightCopy);
|
|
233
159
|
}
|
|
234
160
|
else {
|
|
235
|
-
// Create new Buffer to avoid SharedArrayBuffer type issues
|
|
236
161
|
const leftCopy = buffer_1.Buffer.alloc(32);
|
|
237
162
|
const rightCopy = buffer_1.Buffer.alloc(32);
|
|
238
163
|
sibling.copy(leftCopy);
|
|
@@ -243,29 +168,14 @@ class SolVoidClient {
|
|
|
243
168
|
return poseidon_1.PoseidonUtils.bufferToHex(currentHash);
|
|
244
169
|
};
|
|
245
170
|
const rootHex = await calculateMerkleRoot(index, allCommitmentsHex, merklePath);
|
|
246
|
-
|
|
247
|
-
const { proof } = await this.protocolShield.generateZKProof(secretHex, nullifierHex, rootHex, Number(amount),
|
|
248
|
-
|
|
249
|
-
0, // fee
|
|
250
|
-
merklePath, wasmPath, zkeyPath);
|
|
251
|
-
// FIXED: Mitigate Root-Lock Liveness Gap
|
|
252
|
-
// Check if the root has drifted during proof generation
|
|
253
|
-
const latestRoots = allCommitmentsHex; // In production, fetch from on-chain history
|
|
254
|
-
const currentRoot = await calculateMerkleRoot(index, latestRoots, merklePath);
|
|
255
|
-
if (currentRoot !== rootHex) {
|
|
256
|
-
bus_1.EventBus.error('Merkle root drifted during proof generation. Retrying...');
|
|
257
|
-
throw new Error("Root drifted. State churn detected.");
|
|
258
|
-
}
|
|
259
|
-
bus_1.EventBus.proofGenerated('Groth16');
|
|
260
|
-
// Use Poseidon hash to match circuit nullifier hash logic (salt=1)
|
|
261
|
-
const nullifierHash = await poseidon_1.PoseidonHasher.computeNullifierHash(nullifier);
|
|
171
|
+
const fees = BigInt(0); // Standard relay fee (configurable)
|
|
172
|
+
const { proof, publicSignals } = await this.protocolShield.generateZKProof(secretHex, nullifierHex, rootHex, Number(amount), recipient, web3_js_1.PublicKey.default, Number(fees), merklePath, wasmPath, zkeyPath);
|
|
173
|
+
const nullifierHash = poseidon_1.PoseidonUtils.bufferToHex(await poseidon_1.PoseidonHasher.computeNullifierHash(nullifier));
|
|
262
174
|
return {
|
|
263
|
-
status: 'proof_ready',
|
|
264
175
|
proof,
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
message: 'Proof generated. Submit via relayer or directly to chain.'
|
|
176
|
+
publicSignals,
|
|
177
|
+
nullifierHash,
|
|
178
|
+
root: rootHex
|
|
269
179
|
};
|
|
270
180
|
}
|
|
271
181
|
}
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../client.ts"],"names":[],"mappings":";;;AAAA,6CAA2F;AAC3F,mCAAgC;AAChC,6CAAiD;AACjD,yCAA6C;AAC7C,gDAAqD;AACrD,sCAAwC;AACxC,gDAAkE;AAClE,2CAOqB;AAerB;;GAEG;AACH,MAAa,aAAa;IAMtB,YAAY,MAAqB,EAAE,MAAqB;QACpD,IAAI,CAAC,UAAU,GAAG,IAAI,oBAAU,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QAC7D,IAAI,CAAC,QAAQ,GAAG,IAAI,yBAAe,EAAE,CAAC;QAEtC,4BAA4B;QAC5B,MAAM,cAAc,GAAG;YACnB,OAAO,EAAE,OAAO;YAChB,IAAI,EAAE,YAAY;YAClB,YAAY,EAAE;gBACV;oBACI,IAAI,EAAE,YAAY;oBAClB,QAAQ,EAAE;wBACN,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE;wBAChD,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,IA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C,EACZ,UAAU,EACV,QAAQ,EACR,QAAQ,CACX,CAAC;QAEF,MAAM,aAAa,GAAG,wBAAa,CAAC,WAAW,CAAC,MAAM,yBAAc,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC,CAAC;QAEtG,OAAO;YACH,KAAK;YACL,aAAa;YACb,aAAa;YACb,IAAI,EAAE,OAAO;SAChB,CAAC;IACN,CAAC;CACJ;AA1ND,sCA0NC"}
|
|
@@ -18,14 +18,14 @@ export declare class PoseidonHasher {
|
|
|
18
18
|
private static ensureInitialized;
|
|
19
19
|
/**
|
|
20
20
|
* Convert Buffer to BigInt for Poseidon input
|
|
21
|
-
*
|
|
21
|
+
* Uses big-endian (standard hex) to match circom circuits
|
|
22
22
|
*/
|
|
23
23
|
private static bufferToBigInt;
|
|
24
24
|
/**
|
|
25
|
-
* Convert
|
|
26
|
-
*
|
|
25
|
+
* Convert Poseidon output to Buffer (32 bytes, big-endian)
|
|
26
|
+
* Uses poseidon.F.toString() to extract the field element value
|
|
27
27
|
*/
|
|
28
|
-
private static
|
|
28
|
+
private static poseidonOutputToBuffer;
|
|
29
29
|
/**
|
|
30
30
|
* Hash with salt for commitment derivation
|
|
31
31
|
* Matches Rust: hash_commitment_with_salt
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"poseidon.d.ts","sourceRoot":"","sources":["../../crypto/poseidon.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC;;;GAGG;AACH,qBAAa,cAAc;IACvB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAa;IACpC,OAAO,CAAC,MAAM,CAAC,WAAW,CAAS;IAEnC;;;;OAIG;mBACkB,UAAU;
|
|
1
|
+
{"version":3,"file":"poseidon.d.ts","sourceRoot":"","sources":["../../crypto/poseidon.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC;;;GAGG;AACH,qBAAa,cAAc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