solvoid 1.1.2 → 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 +17 -108
- package/README.md +59 -263
- package/dist/client.d.ts +29 -4
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +58 -156
- 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 +170 -42
- 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 +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,118 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
All notable changes to
|
|
3
|
+
All notable changes to the SolVoid SDK will be documented in this file.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
5
|
+
## [1.1.4] - 2026-01-31
|
|
7
6
|
|
|
8
|
-
|
|
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.
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
- Added comprehensive README.md to npm package
|
|
12
|
-
- Enhanced API documentation with usage examples
|
|
13
|
-
- Improved getting started guide for developers
|
|
14
|
-
- Added troubleshooting section and best practices
|
|
11
|
+
## [1.1.3] - 2026-01-31
|
|
15
12
|
|
|
16
|
-
###
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
13
|
+
### Fixed
|
|
14
|
+
- **Path Normalization**: Corrected directory structural inconsistencies that caused import failures in external CLI and Dashboard environments.
|
|
15
|
+
- **Merkle Proof Accuracy**: Resolved a subtle bug in the Merkle path calculation for Groth16 proof generation.
|
|
16
|
+
- **Buffer Polyfill**: Standardized browser-safe Buffer handling for cross-platform (Web/Node) compatibility.
|
|
20
17
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
- Added comprehensive changelog to npm package
|
|
25
|
-
- Enhanced technical documentation for Privacy Hack 2026
|
|
26
|
-
- Updated security audit documentation
|
|
27
|
-
- Improved API reference documentation
|
|
28
|
-
|
|
29
|
-
### Package Updates
|
|
30
|
-
- Included CHANGELOG.md in npm package distribution
|
|
31
|
-
- Enhanced documentation structure for better developer experience
|
|
32
|
-
- Updated package metadata for improved discoverability
|
|
33
|
-
|
|
34
|
-
## [1.1.0] - 2026-01-29
|
|
35
|
-
|
|
36
|
-
### Production Release
|
|
37
|
-
|
|
38
|
-
### Added
|
|
39
|
-
- Production-ready zero-knowledge privacy protocol implementation
|
|
40
|
-
- Multi-environment deployment support (localnet, devnet, mainnet)
|
|
41
|
-
- Comprehensive TypeScript SDK with type-safe interfaces
|
|
42
|
-
- Complete documentation suite with API references
|
|
43
|
-
- Security audit documentation and verification reports
|
|
44
|
-
- Performance optimization for Solana BPF runtime constraints
|
|
45
|
-
|
|
46
|
-
### Security Fixes
|
|
47
|
-
- Critical vulnerability resolution in Groth16 verification system
|
|
48
|
-
- Replaced placeholder verification with proper cryptographic implementation
|
|
49
|
-
- Stack overflow mitigation for BPF runtime compatibility
|
|
50
|
-
- Enhanced input validation and parameter boundary checking
|
|
51
|
-
- Multi-signature threshold implementation for economic controls
|
|
52
|
-
- Nullifier double-spend prevention mechanisms
|
|
53
|
-
|
|
54
|
-
### Performance Improvements
|
|
55
|
-
- 87% stack usage reduction through advanced memory optimization
|
|
56
|
-
- Sub-millisecond proof verification latency
|
|
57
|
-
- Optimized Merkle tree operations with precomputed zero hashes
|
|
58
|
-
- Enhanced Poseidon hashing implementation for BPF constraints
|
|
59
|
-
- Parallelized proof validation pipelines
|
|
60
|
-
|
|
61
|
-
### Technical Enhancements
|
|
62
|
-
- Complete BPF runtime compatibility achieved
|
|
63
|
-
- Modular account architecture with segregated state management
|
|
64
|
-
- Cross-program invocation optimization
|
|
65
|
-
- Comprehensive error handling and recovery mechanisms
|
|
66
|
-
- Advanced economic controls with circuit breaker functionality
|
|
67
|
-
|
|
68
|
-
### Development Tools
|
|
69
|
-
- Complete TypeScript SDK with async operation support
|
|
70
|
-
- Extensive test suite with unit and integration coverage
|
|
71
|
-
- Security audit tools and vulnerability assessment frameworks
|
|
72
|
-
- Performance benchmarking and monitoring utilities
|
|
73
|
-
- Developer documentation with integration guides
|
|
74
|
-
|
|
75
|
-
### Breaking Changes
|
|
76
|
-
- Updated verification key format for enhanced security
|
|
77
|
-
- Modified account structure for improved efficiency
|
|
78
|
-
- Enhanced error handling with new error types
|
|
79
|
-
- Updated SDK interfaces for better type safety
|
|
80
|
-
|
|
81
|
-
### Dependencies
|
|
82
|
-
- Updated all cryptographic libraries to latest stable versions
|
|
83
|
-
- Enhanced Anchor framework integration
|
|
84
|
-
- Improved Solana CLI compatibility
|
|
85
|
-
- Updated TypeScript definitions for better IDE support
|
|
86
|
-
|
|
87
|
-
## [1.0.0] - 2026-01-15
|
|
88
|
-
|
|
89
|
-
### Initial Release
|
|
90
|
-
|
|
91
|
-
### Features
|
|
92
|
-
- Core zero-knowledge circuit implementation
|
|
93
|
-
- Basic privacy shield functionality
|
|
94
|
-
- Initial Merkle tree commitment system
|
|
95
|
-
- Fundamental Groth16 proof verification
|
|
96
|
-
- Basic economic controls implementation
|
|
97
|
-
- Initial TypeScript SDK release
|
|
98
|
-
|
|
99
|
-
### Infrastructure
|
|
100
|
-
- Anchor framework integration
|
|
101
|
-
- Solana BPF target configuration
|
|
102
|
-
- Basic testing framework
|
|
103
|
-
- Initial documentation setup
|
|
104
|
-
- Development environment configuration
|
|
105
|
-
|
|
106
|
-
### Known Limitations
|
|
107
|
-
- Placeholder verification in critical security paths
|
|
108
|
-
- Stack overflow issues in complex operations
|
|
109
|
-
- Limited multi-signature implementation
|
|
110
|
-
- Localnet-only deployment capability
|
|
111
|
-
- Basic error handling and recovery
|
|
18
|
+
### Security
|
|
19
|
+
- Implemented `enforce()` gates for all sensitive Public Key and Signature operations.
|
|
20
|
+
- Added cryptographic consistency checks to verify hash parity between TypeScript, Rust, and Circom contexts.
|
|
112
21
|
|
|
113
22
|
---
|
|
114
23
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
24
|
+
## [1.1.2] - 2026-01-28
|
|
25
|
+
- Initial stable release of the unified SDK.
|
|
26
|
+
- Support for Groth16 proof generation.
|
|
27
|
+
- Integrated Shadow Relayer client.
|
package/README.md
CHANGED
|
@@ -1,302 +1,98 @@
|
|
|
1
|
-
# SolVoid Privacy
|
|
1
|
+
# SolVoid TypeScript SDK: Institutional Privacy Integration
|
|
2
2
|
|
|
3
|
-
Zero-
|
|
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
|
-
## Features
|
|
10
|
-
|
|
11
|
-
- **Zero-Knowledge Privacy**: Anonymous deposits and withdrawals using Groth16 zk-SNARKs
|
|
12
|
-
- **Merkle Tree Commitments**: Efficient state management with Poseidon hashing
|
|
13
|
-
- **Double-Spend Prevention**: Nullifier-based protection against replay attacks
|
|
14
|
-
- **Economic Controls**: Circuit breaker mechanisms and rate limiting
|
|
15
|
-
- **Multi-Signature Security**: Threshold validation for critical operations
|
|
16
|
-
- **TypeScript Support**: Full type safety and IntelliSense support
|
|
17
|
-
|
|
18
|
-
## Installation
|
|
19
|
-
|
|
20
|
-
```bash
|
|
21
|
-
npm install solvoid
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## Quick Start
|
|
25
|
-
|
|
26
|
-
```typescript
|
|
27
|
-
import { SolVoidClient, Connection, Keypair } from 'solvoid';
|
|
28
|
-
import { Connection as SolanaConnection } from '@solana/web3.js';
|
|
29
|
-
|
|
30
|
-
// Initialize connection
|
|
31
|
-
const connection = new SolanaConnection('https://api.devnet.solana.com');
|
|
32
|
-
const client = new SolVoidClient(connection);
|
|
33
|
-
|
|
34
|
-
// Generate commitment for deposit
|
|
35
|
-
const commitment = await client.generateCommitment();
|
|
36
|
-
|
|
37
|
-
// Create shielded deposit
|
|
38
|
-
const depositTx = await client.createDeposit({
|
|
39
|
-
commitment,
|
|
40
|
-
amount: 1000000, // 0.001 SOL
|
|
41
|
-
recipient: Keypair.generate().publicKey
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
// Submit transaction
|
|
45
|
-
await connection.sendTransaction(depositTx);
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
## Core Components
|
|
49
|
-
|
|
50
|
-
### Privacy Engine
|
|
51
|
-
|
|
52
|
-
Handles zero-knowledge proof generation and verification:
|
|
53
|
-
|
|
54
|
-
```typescript
|
|
55
|
-
import { PrivacyEngine } from 'solvoid';
|
|
56
|
-
|
|
57
|
-
const engine = new PrivacyEngine();
|
|
58
|
-
const proof = await engine.generateWithdrawProof({
|
|
59
|
-
root: merkleRoot,
|
|
60
|
-
nullifier: nullifierHash,
|
|
61
|
-
recipient: userPublicKey,
|
|
62
|
-
amount: 1000000,
|
|
63
|
-
relayer: relayerPublicKey,
|
|
64
|
-
fee: 10000
|
|
65
|
-
});
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
### Merkle Tree Management
|
|
69
|
-
|
|
70
|
-
Efficient Merkle tree operations for privacy commitments:
|
|
71
|
-
|
|
72
|
-
```typescript
|
|
73
|
-
import { MerkleTree } from 'solvoid';
|
|
74
|
-
|
|
75
|
-
const tree = new MerkleTree(depth = 20);
|
|
76
|
-
const leafIndex = await tree.insert(commitment);
|
|
77
|
-
const proof = await tree.generateProof(leafIndex);
|
|
78
|
-
const root = tree.getRoot();
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
### Relayer Integration
|
|
82
|
-
|
|
83
|
-
Gasless transaction support through relayer networks:
|
|
84
|
-
|
|
85
|
-
```typescript
|
|
86
|
-
import { RelayerClient } from 'solvoid';
|
|
87
|
-
|
|
88
|
-
const relayer = new RelayerClient(relayerEndpoint);
|
|
89
|
-
const tx = await relayer.submitWithdrawal({
|
|
90
|
-
proof,
|
|
91
|
-
root,
|
|
92
|
-
nullifier,
|
|
93
|
-
recipient,
|
|
94
|
-
amount,
|
|
95
|
-
fee
|
|
96
|
-
});
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
## API Reference
|
|
100
|
-
|
|
101
|
-
### SolVoidClient
|
|
102
|
-
|
|
103
|
-
Main client interface for SolVoid operations:
|
|
104
|
-
|
|
105
|
-
```typescript
|
|
106
|
-
class SolVoidClient {
|
|
107
|
-
constructor(connection: Connection);
|
|
108
|
-
|
|
109
|
-
// Deposit operations
|
|
110
|
-
createDeposit(params: DepositParams): Promise<Transaction>;
|
|
111
|
-
generateCommitment(): Promise<Uint8Array>;
|
|
112
|
-
|
|
113
|
-
// Withdrawal operations
|
|
114
|
-
createWithdrawal(params: WithdrawalParams): Promise<Transaction>;
|
|
115
|
-
verifyWithdrawalProof(proof: ProofData): Promise<boolean>;
|
|
116
|
-
|
|
117
|
-
// Merkle tree operations
|
|
118
|
-
getMerkleRoot(): Promise<Uint8Array>;
|
|
119
|
-
generateMerkleProof(leafIndex: number): Promise<MerkleProof>;
|
|
120
|
-
}
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
### PrivacyEngine
|
|
8
|
+
---
|
|
124
9
|
|
|
125
|
-
|
|
10
|
+
## 🛠 Architectural Features
|
|
126
11
|
|
|
127
|
-
|
|
128
|
-
class PrivacyEngine {
|
|
129
|
-
generateWithdrawProof(params: ProofParams): Promise<ProofData>;
|
|
130
|
-
verifyProof(proof: ProofData, publicInputs: Uint8Array[]): Promise<boolean>;
|
|
131
|
-
generateNullifier(secret: Uint8Array): Promise<Uint8Array>;
|
|
132
|
-
poseidonHash(inputs: Uint8Array[]): Promise<Uint8Array>;
|
|
133
|
-
}
|
|
134
|
-
```
|
|
12
|
+
The SDK implements a highly-secure boundary between untrusted user inputs and protocol-critical ZK operations.
|
|
135
13
|
|
|
136
|
-
|
|
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).
|
|
137
18
|
|
|
138
|
-
|
|
139
|
-
interface DepositParams {
|
|
140
|
-
commitment: Uint8Array;
|
|
141
|
-
amount: number;
|
|
142
|
-
recipient: PublicKey;
|
|
143
|
-
}
|
|
19
|
+
---
|
|
144
20
|
|
|
145
|
-
|
|
146
|
-
proof: ProofData;
|
|
147
|
-
root: Uint8Array;
|
|
148
|
-
nullifier: Uint8Array;
|
|
149
|
-
recipient: PublicKey;
|
|
150
|
-
relayer: PublicKey;
|
|
151
|
-
fee: number;
|
|
152
|
-
amount: number;
|
|
153
|
-
}
|
|
21
|
+
## 📦 Installation
|
|
154
22
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
b: Uint8Array[][];
|
|
158
|
-
c: Uint8Array[];
|
|
159
|
-
}
|
|
23
|
+
```bash
|
|
24
|
+
npm install solvoid
|
|
160
25
|
```
|
|
161
26
|
|
|
162
|
-
|
|
27
|
+
---
|
|
163
28
|
|
|
164
|
-
|
|
29
|
+
## 🚀 Integration Patterns
|
|
165
30
|
|
|
31
|
+
### 1. Client Initialization
|
|
166
32
|
```typescript
|
|
167
|
-
import {
|
|
33
|
+
import { SolVoidClient } from 'solvoid';
|
|
34
|
+
import { Connection } from '@solana/web3.js';
|
|
168
35
|
|
|
169
|
-
const config
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
commitmentLevel: 'confirmed'
|
|
36
|
+
const config = {
|
|
37
|
+
rpcUrl: process.env.SOLANA_RPC_URL,
|
|
38
|
+
programId: 'Fg6PaFpoGXkYsidMpSsu3SWJYEHp7rQU9YSTFNDQ4F5i',
|
|
39
|
+
relayerUrl: 'https://relayer.solvoid.network'
|
|
174
40
|
};
|
|
175
|
-
```
|
|
176
41
|
|
|
177
|
-
|
|
42
|
+
const client = new SolVoidClient(config, walletAdapter);
|
|
43
|
+
```
|
|
178
44
|
|
|
45
|
+
### 2. Executing a Private Deposit (Surgical Shielding)
|
|
179
46
|
```typescript
|
|
180
|
-
|
|
47
|
+
const amountLamports = 1_000_000_000; // 1.0 SOL
|
|
48
|
+
const { commitmentData, status } = await client.shield(amountLamports);
|
|
181
49
|
|
|
182
|
-
|
|
183
|
-
|
|
50
|
+
/** Persist primitives for subsequent unshielding. */
|
|
51
|
+
console.log('Commitment Hash:', commitmentData.commitmentHex);
|
|
52
|
+
console.log('Secret/Nullifier Primitives:', commitmentData.secret, commitmentData.nullifier);
|
|
184
53
|
```
|
|
185
54
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
### Key Management
|
|
189
|
-
|
|
190
|
-
- Store private keys securely using hardware wallets or secure enclaves
|
|
191
|
-
- Use different keys for different operations (deposit, withdrawal, relayer)
|
|
192
|
-
- Implement proper key rotation policies
|
|
193
|
-
|
|
194
|
-
### Privacy Best Practices
|
|
195
|
-
|
|
196
|
-
- Generate new commitments for each transaction
|
|
197
|
-
- Use different nullifiers to prevent correlation
|
|
198
|
-
- Consider timing attacks when submitting transactions
|
|
199
|
-
|
|
200
|
-
### Audit Trail
|
|
201
|
-
|
|
202
|
-
- Maintain logs of privacy operations for compliance
|
|
203
|
-
- Implement monitoring for unusual activity patterns
|
|
204
|
-
- Regular security audits of integration code
|
|
205
|
-
|
|
206
|
-
## Testing
|
|
207
|
-
|
|
55
|
+
### 3. Executing an Unlinkable Withdrawal
|
|
208
56
|
```typescript
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
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);
|
|
221
69
|
```
|
|
222
70
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
### Benchmarks
|
|
226
|
-
|
|
227
|
-
- **Proof Generation**: ~100ms (depending on circuit complexity)
|
|
228
|
-
- **Proof Verification**: ~1ms (constant time)
|
|
229
|
-
- **Merkle Proof**: ~10ms (depth 20 tree)
|
|
230
|
-
- **Transaction Size**: ~2KB (including proof data)
|
|
231
|
-
|
|
232
|
-
### Optimization Tips
|
|
233
|
-
|
|
234
|
-
- Batch multiple operations when possible
|
|
235
|
-
- Use connection pooling for high-throughput applications
|
|
236
|
-
- Implement proof caching for repeated operations
|
|
237
|
-
- Consider off-chain proof generation for better UX
|
|
238
|
-
|
|
239
|
-
## Troubleshooting
|
|
240
|
-
|
|
241
|
-
### Common Issues
|
|
242
|
-
|
|
243
|
-
**Proof Verification Fails**
|
|
244
|
-
- Check verification key integrity
|
|
245
|
-
- Verify public input formatting
|
|
246
|
-
- Ensure circuit parameters match
|
|
247
|
-
|
|
248
|
-
**Transaction Too Large**
|
|
249
|
-
- Optimize proof parameters
|
|
250
|
-
- Use compression for large transactions
|
|
251
|
-
- Consider transaction batching
|
|
71
|
+
---
|
|
252
72
|
|
|
253
|
-
|
|
254
|
-
- Verify RPC endpoint connectivity
|
|
255
|
-
- Check network configuration
|
|
256
|
-
- Implement retry logic with exponential backoff
|
|
73
|
+
## 🧬 Diagnostic Capability: Ghost Score
|
|
257
74
|
|
|
258
|
-
|
|
75
|
+
The SDK provides internal access to the SolVoid Privacy Engine for real-time anonymity auditing.
|
|
259
76
|
|
|
260
77
|
```typescript
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
const logger = new SolVoidLogger({ level: 'debug' });
|
|
264
|
-
logger.enableDebugMode();
|
|
265
|
-
```
|
|
266
|
-
|
|
267
|
-
## Contributing
|
|
268
|
-
|
|
269
|
-
We welcome contributions to the SolVoid SDK. Please see our [contributing guidelines](CONTRIBUTING.md) for details.
|
|
78
|
+
const address = '9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM';
|
|
79
|
+
const passport = await client.getPassport(address);
|
|
270
80
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
```bash
|
|
274
|
-
git clone https://github.com/privacy-zero/solvoid.git
|
|
275
|
-
cd solvoid/sdk
|
|
276
|
-
npm install
|
|
277
|
-
npm run build
|
|
278
|
-
npm test
|
|
81
|
+
console.log(`Current Ghost Score: ${passport.overallScore}/100`);
|
|
82
|
+
passport.recommendations.forEach(rec => console.log(`Audit Note: ${rec}`));
|
|
279
83
|
```
|
|
280
84
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
MIT License - see [LICENSE](LICENSE) file for details.
|
|
284
|
-
|
|
285
|
-
## Support
|
|
85
|
+
---
|
|
286
86
|
|
|
287
|
-
|
|
288
|
-
- **Issues**: [GitHub Issues](https://github.com/privacy-zero/solvoid/issues)
|
|
289
|
-
- **Discord**: [SolVoid Community](https://discord.gg/solvoid)
|
|
290
|
-
- **Email**: support@solvoid.io
|
|
87
|
+
## 🔒 Integrity Standard
|
|
291
88
|
|
|
292
|
-
|
|
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.
|
|
293
90
|
|
|
294
|
-
|
|
91
|
+
---
|
|
295
92
|
|
|
296
|
-
##
|
|
93
|
+
## 📄 Licensing & Governance
|
|
297
94
|
|
|
298
|
-
|
|
95
|
+
Distributed under the MIT License. SolVoid is a community-driven initiative focused on the advancement of digital sovereignty.
|
|
299
96
|
|
|
300
97
|
---
|
|
301
|
-
|
|
302
|
-
**SolVoid Privacy SDK** - Bringing zero-knowledge privacy to Solana blockchain applications.
|
|
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,aAAa,CAAC;AACrB,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,WAAW,aAAa;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,aAAa;IAC1B,QAAQ,CAAC,SAAS,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