solvoid 1.0.0
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/LICENSE +21 -0
- package/README.md +123 -0
- package/SECURITY.md +174 -0
- package/bin/solvoid-scan +2 -0
- package/dist/cli/privacy-scan.d.ts +11 -0
- package/dist/cli/privacy-scan.d.ts.map +1 -0
- package/dist/cli/privacy-scan.js +112 -0
- package/dist/cli/privacy-scan.js.map +1 -0
- package/dist/cli/solvoid-scan.d.ts +13 -0
- package/dist/cli/solvoid-scan.d.ts.map +1 -0
- package/dist/cli/solvoid-scan.js +174 -0
- package/dist/cli/solvoid-scan.js.map +1 -0
- package/dist/cli/test-forensics.d.ts +2 -0
- package/dist/cli/test-forensics.d.ts.map +1 -0
- package/dist/cli/test-forensics.js +90 -0
- package/dist/cli/test-forensics.js.map +1 -0
- package/dist/cli/test-scenarios.d.ts +2 -0
- package/dist/cli/test-scenarios.d.ts.map +1 -0
- package/dist/cli/test-scenarios.js +96 -0
- package/dist/cli/test-scenarios.js.map +1 -0
- package/dist/examples/enterprise-demo.js +65 -0
- package/dist/sdk/client.d.ts +77 -0
- package/dist/sdk/client.d.ts.map +1 -0
- package/dist/sdk/client.js +180 -0
- package/dist/sdk/client.js.map +1 -0
- package/dist/sdk/compliance/identity.d.ts +34 -0
- package/dist/sdk/compliance/identity.d.ts.map +1 -0
- package/dist/sdk/compliance/identity.js +55 -0
- package/dist/sdk/compliance/identity.js.map +1 -0
- package/dist/sdk/compliance/threat-model.d.ts +14 -0
- package/dist/sdk/compliance/threat-model.d.ts.map +1 -0
- package/dist/sdk/compliance/threat-model.js +101 -0
- package/dist/sdk/compliance/threat-model.js.map +1 -0
- package/dist/sdk/forensics/mev.js +50 -0
- package/dist/sdk/forensics/order-flow.d.ts +20 -0
- package/dist/sdk/forensics/order-flow.d.ts.map +1 -0
- package/dist/sdk/forensics/order-flow.js +104 -0
- package/dist/sdk/forensics/order-flow.js.map +1 -0
- package/dist/sdk/forensics/simulation.d.ts +14 -0
- package/dist/sdk/forensics/simulation.d.ts.map +1 -0
- package/dist/sdk/forensics/simulation.js +45 -0
- package/dist/sdk/forensics/simulation.js.map +1 -0
- package/dist/sdk/index.d.ts +10 -0
- package/dist/sdk/index.d.ts.map +1 -0
- package/dist/sdk/index.js +43 -0
- package/dist/sdk/index.js.map +1 -0
- package/dist/sdk/network/shadow-rpc.d.ts +18 -0
- package/dist/sdk/network/shadow-rpc.d.ts.map +1 -0
- package/dist/sdk/network/shadow-rpc.js +32 -0
- package/dist/sdk/network/shadow-rpc.js.map +1 -0
- package/dist/sdk/obfuscator.d.ts +36 -0
- package/dist/sdk/obfuscator.d.ts.map +1 -0
- package/dist/sdk/obfuscator.js +77 -0
- package/dist/sdk/obfuscator.js.map +1 -0
- package/dist/sdk/passport/manager.d.ts +36 -0
- package/dist/sdk/passport/manager.d.ts.map +1 -0
- package/dist/sdk/passport/manager.js +107 -0
- package/dist/sdk/passport/manager.js.map +1 -0
- package/dist/sdk/pipeline.d.ts +34 -0
- package/dist/sdk/pipeline.d.ts.map +1 -0
- package/dist/sdk/pipeline.js +81 -0
- package/dist/sdk/pipeline.js.map +1 -0
- package/dist/sdk/privacy/confidential-transfer.d.ts +81 -0
- package/dist/sdk/privacy/confidential-transfer.d.ts.map +1 -0
- package/dist/sdk/privacy/confidential-transfer.js +158 -0
- package/dist/sdk/privacy/confidential-transfer.js.map +1 -0
- package/dist/sdk/privacy/history.d.ts +11 -0
- package/dist/sdk/privacy/history.d.ts.map +1 -0
- package/dist/sdk/privacy/history.js +110 -0
- package/dist/sdk/privacy/history.js.map +1 -0
- package/dist/sdk/privacy/light-protocol.d.ts +42 -0
- package/dist/sdk/privacy/light-protocol.d.ts.map +1 -0
- package/dist/sdk/privacy/light-protocol.js +83 -0
- package/dist/sdk/privacy/light-protocol.js.map +1 -0
- package/dist/sdk/privacy/relayer.d.ts +12 -0
- package/dist/sdk/privacy/relayer.d.ts.map +1 -0
- package/dist/sdk/privacy/relayer.js +55 -0
- package/dist/sdk/privacy/relayer.js.map +1 -0
- package/dist/sdk/privacy/safe-obfuscator.d.ts +38 -0
- package/dist/sdk/privacy/safe-obfuscator.d.ts.map +1 -0
- package/dist/sdk/privacy/safe-obfuscator.js +101 -0
- package/dist/sdk/privacy/safe-obfuscator.js.map +1 -0
- package/dist/sdk/privacy/shield.d.ts +34 -0
- package/dist/sdk/privacy/shield.d.ts.map +1 -0
- package/dist/sdk/privacy/shield.js +174 -0
- package/dist/sdk/privacy/shield.js.map +1 -0
- package/dist/sdk/privacy/zk.js +43 -0
- package/dist/sdk/privacy-engine.d.ts +11 -0
- package/dist/sdk/privacy-engine.d.ts.map +1 -0
- package/dist/sdk/privacy-engine.js +165 -0
- package/dist/sdk/privacy-engine.js.map +1 -0
- package/dist/sdk/registry/idl-fetcher.d.ts +17 -0
- package/dist/sdk/registry/idl-fetcher.d.ts.map +1 -0
- package/dist/sdk/registry/idl-fetcher.js +98 -0
- package/dist/sdk/registry/idl-fetcher.js.map +1 -0
- package/dist/sdk/registry/programs.d.ts +18 -0
- package/dist/sdk/registry/programs.d.ts.map +1 -0
- package/dist/sdk/registry/programs.js +45 -0
- package/dist/sdk/registry/programs.js.map +1 -0
- package/dist/sdk/rescue/analyzer.d.ts +22 -0
- package/dist/sdk/rescue/analyzer.d.ts.map +1 -0
- package/dist/sdk/rescue/analyzer.js +46 -0
- package/dist/sdk/rescue/analyzer.js.map +1 -0
- package/dist/sdk/rescue/builder.d.ts +16 -0
- package/dist/sdk/rescue/builder.d.ts.map +1 -0
- package/dist/sdk/rescue/builder.js +33 -0
- package/dist/sdk/rescue/builder.js.map +1 -0
- package/dist/sdk/semantics/analyzer.d.ts +1 -0
- package/dist/sdk/semantics/analyzer.d.ts.map +1 -0
- package/dist/sdk/semantics/analyzer.js +2 -0
- package/dist/sdk/semantics/analyzer.js.map +1 -0
- package/dist/sdk/semantics/decoder.d.ts +7 -0
- package/dist/sdk/semantics/decoder.d.ts.map +1 -0
- package/dist/sdk/semantics/decoder.js +30 -0
- package/dist/sdk/semantics/decoder.js.map +1 -0
- package/dist/sdk/semantics/graph.d.ts +1 -0
- package/dist/sdk/semantics/graph.d.ts.map +1 -0
- package/dist/sdk/semantics/graph.js +2 -0
- package/dist/sdk/semantics/graph.js.map +1 -0
- package/dist/sdk/semantics/idl-registry.d.ts +7 -0
- package/dist/sdk/semantics/idl-registry.d.ts.map +1 -0
- package/dist/sdk/semantics/idl-registry.js +95 -0
- package/dist/sdk/semantics/idl-registry.js.map +1 -0
- package/dist/sdk/semantics/types.d.ts +44 -0
- package/dist/sdk/semantics/types.d.ts.map +1 -0
- package/dist/sdk/semantics/types.js +3 -0
- package/dist/sdk/semantics/types.js.map +1 -0
- package/dist/sdk/simulator.d.ts +15 -0
- package/dist/sdk/simulator.d.ts.map +1 -0
- package/dist/sdk/simulator.js +133 -0
- package/dist/sdk/simulator.js.map +1 -0
- package/dist/sdk/types.d.ts +53 -0
- package/dist/sdk/types.d.ts.map +1 -0
- package/dist/sdk/types.js +3 -0
- package/dist/sdk/types.js.map +1 -0
- package/dist/sdk/utils/config.d.ts +15 -0
- package/dist/sdk/utils/config.d.ts.map +1 -0
- package/dist/sdk/utils/config.js +40 -0
- package/dist/sdk/utils/config.js.map +1 -0
- package/dist/sdk/utils/logger.d.ts +3 -0
- package/dist/sdk/utils/logger.d.ts.map +1 -0
- package/dist/sdk/utils/logger.js +17 -0
- package/dist/sdk/utils/logger.js.map +1 -0
- package/dist/tests/unit/idl-registry.test.d.ts +2 -0
- package/dist/tests/unit/idl-registry.test.d.ts.map +1 -0
- package/dist/tests/unit/idl-registry.test.js +35 -0
- package/dist/tests/unit/idl-registry.test.js.map +1 -0
- package/dist/tools/exploit_demonstration.js +99 -0
- package/dist/tools/gen-tx.js +29 -0
- package/dist/tools/get-recent-tx.js +18 -0
- package/package.json +95 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export interface ScoreSnapshot {
|
|
2
|
+
timestamp: number;
|
|
3
|
+
score: number;
|
|
4
|
+
}
|
|
5
|
+
export interface PrivacyBadge {
|
|
6
|
+
name: string;
|
|
7
|
+
icon: string;
|
|
8
|
+
description: string;
|
|
9
|
+
dateEarned: number;
|
|
10
|
+
}
|
|
11
|
+
export interface PrivacyPassport {
|
|
12
|
+
walletAddress: string;
|
|
13
|
+
overallScore: number;
|
|
14
|
+
scoreHistory: ScoreSnapshot[];
|
|
15
|
+
badges: PrivacyBadge[];
|
|
16
|
+
recommendations: string[];
|
|
17
|
+
}
|
|
18
|
+
export declare class PassportManager {
|
|
19
|
+
private storagePath;
|
|
20
|
+
constructor(storagePath?: string);
|
|
21
|
+
/**
|
|
22
|
+
* Load or create a new privacy passport for the given wallet.
|
|
23
|
+
*/
|
|
24
|
+
getPassport(address: string): PrivacyPassport;
|
|
25
|
+
/**
|
|
26
|
+
* Update history and trigger badge checks based on latest audit.
|
|
27
|
+
*/
|
|
28
|
+
updateScore(address: string, newScore: number): void;
|
|
29
|
+
private initializePassport;
|
|
30
|
+
/**
|
|
31
|
+
* Milestone-based badge logic.
|
|
32
|
+
*/
|
|
33
|
+
private checkBadges;
|
|
34
|
+
private savePassport;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../../sdk/passport/manager.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,eAAe;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,aAAa,EAAE,CAAC;IAC9B,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,eAAe,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED,qBAAa,eAAe;IACxB,OAAO,CAAC,WAAW,CAAS;gBAEhB,WAAW,GAAE,MAAkC;IAI3D;;OAEG;IACI,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe;IAQpD;;OAEG;IACI,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAYpD,OAAO,CAAC,kBAAkB;IAU1B;;OAEG;IACH,OAAO,CAAC,WAAW;IAwBnB,OAAO,CAAC,YAAY;CAQvB"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.PassportManager = void 0;
|
|
37
|
+
const fs = __importStar(require("fs"));
|
|
38
|
+
class PassportManager {
|
|
39
|
+
constructor(storagePath = './privacy-passport.json') {
|
|
40
|
+
this.storagePath = storagePath;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Load or create a new privacy passport for the given wallet.
|
|
44
|
+
*/
|
|
45
|
+
getPassport(address) {
|
|
46
|
+
if (!fs.existsSync(this.storagePath)) {
|
|
47
|
+
return this.initializePassport(address);
|
|
48
|
+
}
|
|
49
|
+
const data = JSON.parse(fs.readFileSync(this.storagePath, 'utf8'));
|
|
50
|
+
return data[address] || this.initializePassport(address);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Update history and trigger badge checks based on latest audit.
|
|
54
|
+
*/
|
|
55
|
+
updateScore(address, newScore) {
|
|
56
|
+
const passport = this.getPassport(address);
|
|
57
|
+
passport.overallScore = newScore;
|
|
58
|
+
passport.scoreHistory.push({
|
|
59
|
+
timestamp: Date.now(),
|
|
60
|
+
score: newScore
|
|
61
|
+
});
|
|
62
|
+
this.checkBadges(passport);
|
|
63
|
+
this.savePassport(address, passport);
|
|
64
|
+
}
|
|
65
|
+
initializePassport(address) {
|
|
66
|
+
return {
|
|
67
|
+
walletAddress: address,
|
|
68
|
+
overallScore: 100,
|
|
69
|
+
scoreHistory: [],
|
|
70
|
+
badges: [],
|
|
71
|
+
recommendations: ["Perform your first privacy scan to earn the 'First Contact' badge."]
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Milestone-based badge logic.
|
|
76
|
+
*/
|
|
77
|
+
checkBadges(passport) {
|
|
78
|
+
const badgesToAdd = [];
|
|
79
|
+
if (passport.overallScore >= 95 && !passport.badges.some(b => b.name === "Zero-Trace Master")) {
|
|
80
|
+
badgesToAdd.push({
|
|
81
|
+
name: "Zero-Trace Master",
|
|
82
|
+
icon: "🛡️",
|
|
83
|
+
description: "Maintained a privacy score above 95.",
|
|
84
|
+
dateEarned: Date.now()
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
if (passport.scoreHistory.length > 5 && !passport.badges.some(b => b.name === "Consistent Ghost")) {
|
|
88
|
+
badgesToAdd.push({
|
|
89
|
+
name: "Consistent Ghost",
|
|
90
|
+
icon: "👻",
|
|
91
|
+
description: "Performed more than 5 successful privacy audits.",
|
|
92
|
+
dateEarned: Date.now()
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
passport.badges.push(...badgesToAdd);
|
|
96
|
+
}
|
|
97
|
+
savePassport(address, passport) {
|
|
98
|
+
let allData = {};
|
|
99
|
+
if (fs.existsSync(this.storagePath)) {
|
|
100
|
+
allData = JSON.parse(fs.readFileSync(this.storagePath, 'utf8'));
|
|
101
|
+
}
|
|
102
|
+
allData[address] = passport;
|
|
103
|
+
fs.writeFileSync(this.storagePath, JSON.stringify(allData, null, 2));
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
exports.PassportManager = PassportManager;
|
|
107
|
+
//# sourceMappingURL=manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manager.js","sourceRoot":"","sources":["../../../sdk/passport/manager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AAsBzB,MAAa,eAAe;IAGxB,YAAY,cAAsB,yBAAyB;QACvD,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;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'./privacy/shield';
|
|
3
|
+
export declare class PrivacyPipeline {
|
|
4
|
+
private connection;
|
|
5
|
+
private engine;
|
|
6
|
+
private shield;
|
|
7
|
+
constructor(connection: Connection, shield: PrivacyShield);
|
|
8
|
+
/**
|
|
9
|
+
* Map web3.js signatures to privacy results by analyzing the last 10 txs.
|
|
10
|
+
*/
|
|
11
|
+
processAddress(address: PublicKey): Promise<({
|
|
12
|
+
signature: string;
|
|
13
|
+
leaks: import("./types").Leak[];
|
|
14
|
+
remediation: {
|
|
15
|
+
action: string;
|
|
16
|
+
data: {
|
|
17
|
+
commitment: string;
|
|
18
|
+
nullifierHash: string;
|
|
19
|
+
};
|
|
20
|
+
description: string;
|
|
21
|
+
} | null;
|
|
22
|
+
privacyScore: number;
|
|
23
|
+
} | {
|
|
24
|
+
signature: string;
|
|
25
|
+
leaks: never[];
|
|
26
|
+
privacyScore: number;
|
|
27
|
+
remediation?: undefined;
|
|
28
|
+
})[]>;
|
|
29
|
+
/**
|
|
30
|
+
* Suggest specific fixes like shielding if we hit critical leak thresholds.
|
|
31
|
+
*/
|
|
32
|
+
private generateRemediation;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=pipeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../sdk/pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAExD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,qBAAa,eAAe;IACxB,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,MAAM,CAAgB;gBAElB,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa;IAMzD;;OAEG;IACU,cAAc,CAAC,OAAO,EAAE,SAAS;;;;;;;;;;;;;;;;;;IAoD9C;;OAEG;YACW,mBAAmB;CAkBpC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PrivacyPipeline = void 0;
|
|
4
|
+
const privacy_engine_1 = require("./privacy-engine");
|
|
5
|
+
class PrivacyPipeline {
|
|
6
|
+
constructor(connection, shield) {
|
|
7
|
+
this.connection = connection;
|
|
8
|
+
this.engine = new privacy_engine_1.PrivacyEngine();
|
|
9
|
+
this.shield = shield;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Map web3.js signatures to privacy results by analyzing the last 10 txs.
|
|
13
|
+
*/
|
|
14
|
+
async processAddress(address) {
|
|
15
|
+
const signatures = await this.connection.getSignaturesForAddress(address);
|
|
16
|
+
const results = [];
|
|
17
|
+
for (const sig of signatures.slice(0, 10)) {
|
|
18
|
+
const tx = await this.connection.getTransaction(sig.signature, {
|
|
19
|
+
maxSupportedTransactionVersion: 0,
|
|
20
|
+
});
|
|
21
|
+
if (tx) {
|
|
22
|
+
// Parse standard Solana tx structure into ours
|
|
23
|
+
const txData = {
|
|
24
|
+
message: {
|
|
25
|
+
accountKeys: tx.transaction.message.staticAccountKeys.map((k) => k.toBase58()),
|
|
26
|
+
header: tx.transaction.message.header,
|
|
27
|
+
instructions: tx.transaction.message.compiledInstructions.map((ix) => ({
|
|
28
|
+
programIdIndex: ix.programIdIndex,
|
|
29
|
+
accounts: ix.accountKeyIndexes,
|
|
30
|
+
data: Buffer.from(ix.data).toString('base64')
|
|
31
|
+
}))
|
|
32
|
+
},
|
|
33
|
+
meta: {
|
|
34
|
+
innerInstructions: tx.meta?.innerInstructions || [],
|
|
35
|
+
logMessages: tx.meta?.logMessages || []
|
|
36
|
+
},
|
|
37
|
+
signatures: [sig.signature]
|
|
38
|
+
};
|
|
39
|
+
const leaks = this.engine.analyzeTransaction(txData);
|
|
40
|
+
const privacyScore = this.engine.calculateScore(leaks);
|
|
41
|
+
if (leaks.length > 0) {
|
|
42
|
+
const remediation = await this.generateRemediation(address, leaks);
|
|
43
|
+
results.push({
|
|
44
|
+
signature: sig.signature,
|
|
45
|
+
leaks,
|
|
46
|
+
remediation,
|
|
47
|
+
privacyScore
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
results.push({
|
|
52
|
+
signature: sig.signature,
|
|
53
|
+
leaks: [],
|
|
54
|
+
privacyScore: 100
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return results;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Suggest specific fixes like shielding if we hit critical leak thresholds.
|
|
63
|
+
*/
|
|
64
|
+
async generateRemediation(_user, leaks) {
|
|
65
|
+
const criticalLeaks = leaks.filter(l => l.severity === 'CRITICAL' || l.severity === 'HIGH');
|
|
66
|
+
if (criticalLeaks.length > 0) {
|
|
67
|
+
const commitmentData = this.shield.generateCommitment();
|
|
68
|
+
return {
|
|
69
|
+
action: 'SHIELD_BALANCE',
|
|
70
|
+
data: {
|
|
71
|
+
commitment: commitmentData.commitmentHex,
|
|
72
|
+
nullifierHash: commitmentData.nullifierHash.toString('hex'),
|
|
73
|
+
},
|
|
74
|
+
description: `High risk leaks found. Shielding recommended to break clear identity links.`,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
exports.PrivacyPipeline = PrivacyPipeline;
|
|
81
|
+
//# sourceMappingURL=pipeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../../sdk/pipeline.ts"],"names":[],"mappings":";;;AACA,qDAAiD;AAGjD,MAAa,eAAe;IAKxB,YAAY,UAAsB,EAAE,MAAqB;QACrD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,MAAM,GAAG,IAAI,8BAAa,EAAE,CAAC;QAClC,I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EAAE,6EAA6E;aAC7F,CAAC;QACN,CAAC;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAvFD,0CAuFC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Token-2022 Confidential Transfers Manager
|
|
3
|
+
*
|
|
4
|
+
* IMPORTANT: This module provides interfaces for Token-2022's Confidential Transfer extension.
|
|
5
|
+
*
|
|
6
|
+
* CURRENT STATUS:
|
|
7
|
+
* - ✅ supportsConfidentiality(): Check if a mint supports confidential transfers
|
|
8
|
+
* - ⚠️ Other methods require the full @solana/spl-token-confidential package
|
|
9
|
+
*
|
|
10
|
+
* PRIVACY GUARANTEES:
|
|
11
|
+
* - Encrypted balances hide the AMOUNT from chain observers
|
|
12
|
+
* - Sender and receiver addresses are STILL VISIBLE
|
|
13
|
+
* - Transaction timing is STILL VISIBLE
|
|
14
|
+
* - This is AMOUNT privacy, not identity privacy
|
|
15
|
+
*
|
|
16
|
+
* FOR FULL PRIVACY: Use Light Protocol (LightProtocolManager) which provides
|
|
17
|
+
* identity privacy through ZK state compression.
|
|
18
|
+
*/
|
|
19
|
+
import { Connection, PublicKey, TransactionInstruction } from '@solana/web3.js';
|
|
20
|
+
/**
|
|
21
|
+
* Error thrown when ZK proof generation is required but not available
|
|
22
|
+
*/
|
|
23
|
+
export declare class ZkProofRequiredError extends Error {
|
|
24
|
+
constructor(operation: string);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Manager for Token2022 Confidential Transfers.
|
|
28
|
+
* Provides safe wrappers around encrypted balance operations.
|
|
29
|
+
*
|
|
30
|
+
* NOTE: This is a simplified interface. For full functionality,
|
|
31
|
+
* use @solana/spl-token-confidential which includes WASM modules
|
|
32
|
+
* for ZK proof generation.
|
|
33
|
+
*/
|
|
34
|
+
export declare class ConfidentialTokenManager {
|
|
35
|
+
private connection;
|
|
36
|
+
constructor(connection: Connection);
|
|
37
|
+
/**
|
|
38
|
+
* Checks if a Mint supports Confidential Transfers.
|
|
39
|
+
*
|
|
40
|
+
* @param mint - The mint public key to check
|
|
41
|
+
* @returns true if the mint has the ConfidentialTransferMint extension
|
|
42
|
+
*/
|
|
43
|
+
supportsConfidentiality(mint: PublicKey): Promise<boolean>;
|
|
44
|
+
/**
|
|
45
|
+
* Creates instructions to Initialize a User's Confidential Token Account.
|
|
46
|
+
*
|
|
47
|
+
* ⚠️ REQUIRES @solana/spl-token-confidential package
|
|
48
|
+
*
|
|
49
|
+
* This is a placeholder that throws an error with guidance.
|
|
50
|
+
*/
|
|
51
|
+
createEnableConfidentialAccountInstructions(mint: PublicKey, _owner: PublicKey, _tokenAccount: PublicKey): Promise<TransactionInstruction[]>;
|
|
52
|
+
/**
|
|
53
|
+
* Creates an instruction to DEPOSIT (Public -> Private).
|
|
54
|
+
*
|
|
55
|
+
* ⚠️ REQUIRES @solana/spl-token-confidential package
|
|
56
|
+
*/
|
|
57
|
+
createDepositPublicToPrivate(_mint: PublicKey, _tokenAccount: PublicKey, _owner: PublicKey, _amount: number | bigint, _decimals?: number): Promise<TransactionInstruction>;
|
|
58
|
+
/**
|
|
59
|
+
* Creates an ENCRYPTED TRANSFER instruction (Private -> Private).
|
|
60
|
+
*
|
|
61
|
+
* ⚠️ NOT IMPLEMENTED - REQUIRES ZK PROOF GENERATION ⚠️
|
|
62
|
+
*
|
|
63
|
+
* @throws ZkProofRequiredError Always - this operation requires external ZK tooling
|
|
64
|
+
*/
|
|
65
|
+
createEncryptedTransfer(_mint: PublicKey, _sourceTokenAccount: PublicKey, _destTokenAccount: PublicKey, _owner: PublicKey, _amount: number | bigint, _sourceElGamalKey: PublicKey): Promise<TransactionInstruction>;
|
|
66
|
+
/**
|
|
67
|
+
* Creates an instruction to WITHDRAW (Private -> Public).
|
|
68
|
+
*
|
|
69
|
+
* ⚠️ REQUIRES @solana/spl-token-confidential package
|
|
70
|
+
*/
|
|
71
|
+
createWithdrawPrivateToPublic(_mint: PublicKey, _tokenAccount: PublicKey, _owner: PublicKey, _amount: number | bigint, _decimals?: number): Promise<TransactionInstruction>;
|
|
72
|
+
/**
|
|
73
|
+
* Get privacy capabilities summary for this manager
|
|
74
|
+
*/
|
|
75
|
+
static getPrivacyCapabilities(): {
|
|
76
|
+
hides: string[];
|
|
77
|
+
exposes: string[];
|
|
78
|
+
recommendation: string;
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=confidential-transfer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"confidential-transfer.d.ts","sourceRoot":"","sources":["../../../sdk/privacy/confidential-transfer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EACH,UAAU,EACV,SAAS,EACT,sBAAsB,EACzB,MAAM,iBAAiB,CAAC;AAKzB;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;gBAC/B,SAAS,EAAE,MAAM;CAahC;AAED;;;;;;;GAOG;AACH,qBAAa,wBAAwB;IACjC,OAAO,CAAC,UAAU,CAAa;gBAEnB,UAAU,EAAE,UAAU;IAIlC;;;;;OAKG;IACU,uBAAuB,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC;IA4CvE;;;;;;OAMG;IACU,2CAA2C,CACpD,IAAI,EAAE,SAAS,EACf,MAAM,EAAE,SAAS,EACjB,aAAa,EAAE,SAAS,GACzB,OAAO,CAAC,sBAAsB,EAAE,CAAC;IAWpC;;;;OAIG;IACU,4BAA4B,CACrC,KAAK,EAAE,SAAS,EAChB,aAAa,EAAE,SAAS,EACxB,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,MAAM,GAAG,MAAM,EACxB,SAAS,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,sBAAsB,CAAC;IAIlC;;;;;;OAMG;IACU,uBAAuB,CAChC,KAAK,EAAE,SAAS,EAChB,mBAAmB,EAAE,SAAS,EAC9B,iBAAiB,EAAE,SAAS,EAC5B,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,MAAM,GAAG,MAAM,EACxB,iBAAiB,EAAE,SAAS,GAC7B,OAAO,CAAC,sBAAsB,CAAC;IAIlC;;;;OAIG;IACU,6BAA6B,CACtC,KAAK,EAAE,SAAS,EAChB,aAAa,EAAE,SAAS,EACxB,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,MAAM,GAAG,MAAM,EACxB,SAAS,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,sBAAsB,CAAC;IAIlC;;OAEG;WACW,sBAAsB,IAAI;QACpC,KAAK,EAAE,MAAM,EAAE,CAAC;QAChB,OAAO,EAAE,MAAM,EAAE,CAAC;QAClB,cAAc,EAAE,MAAM,CAAC;KAC1B;CAkBJ"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Token-2022 Confidential Transfers Manager
|
|
4
|
+
*
|
|
5
|
+
* IMPORTANT: This module provides interfaces for Token-2022's Confidential Transfer extension.
|
|
6
|
+
*
|
|
7
|
+
* CURRENT STATUS:
|
|
8
|
+
* - ✅ supportsConfidentiality(): Check if a mint supports confidential transfers
|
|
9
|
+
* - ⚠️ Other methods require the full @solana/spl-token-confidential package
|
|
10
|
+
*
|
|
11
|
+
* PRIVACY GUARANTEES:
|
|
12
|
+
* - Encrypted balances hide the AMOUNT from chain observers
|
|
13
|
+
* - Sender and receiver addresses are STILL VISIBLE
|
|
14
|
+
* - Transaction timing is STILL VISIBLE
|
|
15
|
+
* - This is AMOUNT privacy, not identity privacy
|
|
16
|
+
*
|
|
17
|
+
* FOR FULL PRIVACY: Use Light Protocol (LightProtocolManager) which provides
|
|
18
|
+
* identity privacy through ZK state compression.
|
|
19
|
+
*/
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.ConfidentialTokenManager = exports.ZkProofRequiredError = void 0;
|
|
22
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
23
|
+
// Token-2022 Program ID (not exported in older spl-token versions)
|
|
24
|
+
const TOKEN_2022_PROGRAM_ID = new web3_js_1.PublicKey('TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb');
|
|
25
|
+
/**
|
|
26
|
+
* Error thrown when ZK proof generation is required but not available
|
|
27
|
+
*/
|
|
28
|
+
class ZkProofRequiredError extends Error {
|
|
29
|
+
constructor(operation) {
|
|
30
|
+
super(`ZK Proof Generation Required for '${operation}'. ` +
|
|
31
|
+
`Token-2022 Confidential Transfers require client-side ElGamal encryption and ZK proofs. ` +
|
|
32
|
+
`You need to: ` +
|
|
33
|
+
`1. Generate an ElGamal keypair for the user ` +
|
|
34
|
+
`2. Encrypt the transfer amount using the recipient's ElGamal public key ` +
|
|
35
|
+
`3. Generate a range proof (proves amount is valid without revealing it) ` +
|
|
36
|
+
`4. Generate an equality proof (proves encrypted values match) ` +
|
|
37
|
+
`See: https://spl.solana.com/confidential-token/deep-dive/encryption`);
|
|
38
|
+
this.name = 'ZkProofRequiredError';
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.ZkProofRequiredError = ZkProofRequiredError;
|
|
42
|
+
/**
|
|
43
|
+
* Manager for Token2022 Confidential Transfers.
|
|
44
|
+
* Provides safe wrappers around encrypted balance operations.
|
|
45
|
+
*
|
|
46
|
+
* NOTE: This is a simplified interface. For full functionality,
|
|
47
|
+
* use @solana/spl-token-confidential which includes WASM modules
|
|
48
|
+
* for ZK proof generation.
|
|
49
|
+
*/
|
|
50
|
+
class ConfidentialTokenManager {
|
|
51
|
+
constructor(connection) {
|
|
52
|
+
this.connection = connection;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Checks if a Mint supports Confidential Transfers.
|
|
56
|
+
*
|
|
57
|
+
* @param mint - The mint public key to check
|
|
58
|
+
* @returns true if the mint has the ConfidentialTransferMint extension
|
|
59
|
+
*/
|
|
60
|
+
async supportsConfidentiality(mint) {
|
|
61
|
+
try {
|
|
62
|
+
// Fetch mint account info manually (getMint not available in older versions)
|
|
63
|
+
const accountInfo = await this.connection.getAccountInfo(mint);
|
|
64
|
+
if (!accountInfo || accountInfo.owner.toBase58() !== TOKEN_2022_PROGRAM_ID.toBase58()) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
// Token-2022 mints have TLV data after the base mint data (82 bytes)
|
|
68
|
+
const BASE_MINT_SIZE = 82;
|
|
69
|
+
if (accountInfo.data.length <= BASE_MINT_SIZE) {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
const tlvData = accountInfo.data.slice(BASE_MINT_SIZE);
|
|
73
|
+
if (tlvData.length === 0) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
// Parse TLV data to find ConfidentialTransferMint extension
|
|
77
|
+
// Extension type for ConfidentialTransferMint is 10
|
|
78
|
+
const CONFIDENTIAL_TRANSFER_MINT_EXTENSION = 10;
|
|
79
|
+
let offset = 0;
|
|
80
|
+
while (offset < tlvData.length) {
|
|
81
|
+
if (offset + 4 > tlvData.length)
|
|
82
|
+
break;
|
|
83
|
+
const extensionType = tlvData.readUInt16LE(offset);
|
|
84
|
+
const extensionLength = tlvData.readUInt16LE(offset + 2);
|
|
85
|
+
if (extensionType === CONFIDENTIAL_TRANSFER_MINT_EXTENSION) {
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
offset += 4 + extensionLength;
|
|
89
|
+
}
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Creates instructions to Initialize a User's Confidential Token Account.
|
|
98
|
+
*
|
|
99
|
+
* ⚠️ REQUIRES @solana/spl-token-confidential package
|
|
100
|
+
*
|
|
101
|
+
* This is a placeholder that throws an error with guidance.
|
|
102
|
+
*/
|
|
103
|
+
async createEnableConfidentialAccountInstructions(mint, _owner, _tokenAccount) {
|
|
104
|
+
const supported = await this.supportsConfidentiality(mint);
|
|
105
|
+
if (!supported) {
|
|
106
|
+
throw new Error(`Mint ${mint.toBase58()} does not support Confidential Transfers.`);
|
|
107
|
+
}
|
|
108
|
+
throw new ZkProofRequiredError('createEnableConfidentialAccountInstructions');
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Creates an instruction to DEPOSIT (Public -> Private).
|
|
112
|
+
*
|
|
113
|
+
* ⚠️ REQUIRES @solana/spl-token-confidential package
|
|
114
|
+
*/
|
|
115
|
+
async createDepositPublicToPrivate(_mint, _tokenAccount, _owner, _amount, _decimals) {
|
|
116
|
+
throw new ZkProofRequiredError('createDepositPublicToPrivate');
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Creates an ENCRYPTED TRANSFER instruction (Private -> Private).
|
|
120
|
+
*
|
|
121
|
+
* ⚠️ NOT IMPLEMENTED - REQUIRES ZK PROOF GENERATION ⚠️
|
|
122
|
+
*
|
|
123
|
+
* @throws ZkProofRequiredError Always - this operation requires external ZK tooling
|
|
124
|
+
*/
|
|
125
|
+
async createEncryptedTransfer(_mint, _sourceTokenAccount, _destTokenAccount, _owner, _amount, _sourceElGamalKey) {
|
|
126
|
+
throw new ZkProofRequiredError('createEncryptedTransfer');
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Creates an instruction to WITHDRAW (Private -> Public).
|
|
130
|
+
*
|
|
131
|
+
* ⚠️ REQUIRES @solana/spl-token-confidential package
|
|
132
|
+
*/
|
|
133
|
+
async createWithdrawPrivateToPublic(_mint, _tokenAccount, _owner, _amount, _decimals) {
|
|
134
|
+
throw new ZkProofRequiredError('createWithdrawPrivateToPublic');
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Get privacy capabilities summary for this manager
|
|
138
|
+
*/
|
|
139
|
+
static getPrivacyCapabilities() {
|
|
140
|
+
return {
|
|
141
|
+
hides: [
|
|
142
|
+
"Encrypted balance amounts (after deposit)",
|
|
143
|
+
"Transfer amounts between confidential accounts"
|
|
144
|
+
],
|
|
145
|
+
exposes: [
|
|
146
|
+
"Sender address (fully visible)",
|
|
147
|
+
"Receiver address (fully visible)",
|
|
148
|
+
"Transaction timing (block timestamp)",
|
|
149
|
+
"Deposit/withdrawal amounts (at boundaries)",
|
|
150
|
+
"Token mint being used"
|
|
151
|
+
],
|
|
152
|
+
recommendation: "Token-2022 Confidential Transfers provide AMOUNT privacy only. " +
|
|
153
|
+
"For full identity privacy, combine with Light Protocol or use a mixer."
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
exports.ConfidentialTokenManager = ConfidentialTokenManager;
|
|
158
|
+
//# sourceMappingURL=confidential-transfer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"confidential-transfer.js","sourceRoot":"","sources":["../../../sdk/privacy/confidential-transfer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;AAEH,6CAIyB;AAEzB,mEAAmE;AACnE,MAAM,qBAAqB,GAAG,IAAI,mBAAS,CAAC,6CAA6C,CAAC,CAAC;AAE3F;;GAEG;AACH,MAAa,oBAAqB,SAAQ,KAAK;IAC3C,YAAY,SAAiB;QACzB,KAAK,CACD,qCAAqC,SAAS,KAAK;YACnD,0FAA0F;YAC1F,eAAe;YACf,8CAA8C;YAC9C,0EAA0E;YAC1E,0EAA0E;YAC1E,gEAAgE;YAChE,qEAAqE,CACxE,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACvC,CAAC;CACJ;AAdD,oDAcC;AAED;;;;;;;GAOG;AACH,MAAa,wBAAwB;IAGjC,YAAY,UAAsB;QAC9B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IACjC,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,uBAAuB,CAAC,IAAe;QAChD,IAAI,CAAC;YACD,6EAA6E;YAC7E,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,UAAU,CAA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AAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC;QAC3D,IAAI,CAAC,SAAS,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CACX,QAAQ,IAAI,CAAC,QAAQ,EAAE,2CAA2C,CACrE,CAAC;QACN,CAAC;QAED,MAAM,IAAI,oBAAoB,CAAC,6CAA6C,CAAC,CAAC;IAClF,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,4BAA4B,CACrC,KAAgB,EAChB,aAAwB,EACxB,MAAiB,EACjB,OAAwB,EACxB,SAAkB;QAElB,MAAM,IAAI,oBAAoB,CAAC,8BAA8B,CAAC,CAAC;IACnE,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,uBAAuB,CAChC,KAAgB,EAChB,mBAA8B,EAC9B,iBAA4B,EAC5B,MAAiB,EACjB,OAAwB,EACxB,iBAA4B;QAE5B,MAAM,IAAI,oBAAoB,CAAC,yBAAyB,CAAC,CAAC;IAC9D,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,6BAA6B,CACtC,KAAgB,EAChB,aAAwB,EACxB,MAAiB,EACjB,OAAwB,EACxB,SAAkB;QAElB,MAAM,IAAI,oBAAoB,CAAC,+BAA+B,CAAC,CAAC;IACpE,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,sBAAsB;QAKhC,OAAO;YACH,KAAK,EAAE;gBACH,2CAA2C;gBAC3C,gDAAgD;aACnD;YACD,OAAO,EAAE;gBACL,gCAAgC;gBAChC,kCAAkC;gBAClC,sCAAsC;gBACtC,4CAA4C;gBAC5C,uBAAuB;aAC1B;YACD,cAAc,EACV,iEAAiE;gBACjE,wEAAwE;SAC/E,CAAC;IACN,CAAC;CACJ;AAxJD,4DAwJC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CumulativeHistory, Leak } from '../types';
|
|
2
|
+
export declare class HistoryManager {
|
|
3
|
+
private historyFile;
|
|
4
|
+
private cache;
|
|
5
|
+
constructor(baseDir?: string);
|
|
6
|
+
private load;
|
|
7
|
+
save(): void;
|
|
8
|
+
getHistory(address: string): CumulativeHistory;
|
|
9
|
+
updateHistory(address: string, leaks: Leak[], relatedAddresses: string[]): void;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=history.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../../sdk/privacy/history.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEnD,qBAAa,cAAc;IACvB,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,KAAK,CAA6C;gBAE9C,OAAO,CAAC,EAAE,MAAM;IAc5B,OAAO,CAAC,IAAI;IAcL,IAAI;IAKJ,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,iBAAiB;IAc9C,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,gBAAgB,EAAE,MAAM,EAAE;CAuBlF"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.HistoryManager = void 0;
|
|
37
|
+
const fs = __importStar(require("fs"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
class HistoryManager {
|
|
40
|
+
constructor(baseDir) {
|
|
41
|
+
this.cache = new Map();
|
|
42
|
+
// Use a hidden dot-folder in the implementation directory or user home
|
|
43
|
+
// For CLI simplicity, we'll use a local .privacy-zero/ folder
|
|
44
|
+
const root = baseDir || process.cwd();
|
|
45
|
+
const privacyDir = path.join(root, '.privacy-zero');
|
|
46
|
+
if (!fs.existsSync(privacyDir)) {
|
|
47
|
+
try {
|
|
48
|
+
fs.mkdirSync(privacyDir);
|
|
49
|
+
}
|
|
50
|
+
catch (e) { }
|
|
51
|
+
}
|
|
52
|
+
this.historyFile = path.join(privacyDir, 'history.json');
|
|
53
|
+
this.load();
|
|
54
|
+
}
|
|
55
|
+
load() {
|
|
56
|
+
if (fs.existsSync(this.historyFile)) {
|
|
57
|
+
try {
|
|
58
|
+
const data = JSON.parse(fs.readFileSync(this.historyFile, 'utf-8'));
|
|
59
|
+
// Migrate array to map
|
|
60
|
+
if (Array.isArray(data)) {
|
|
61
|
+
data.forEach((h) => this.cache.set(h.address, h));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
catch (e) {
|
|
65
|
+
console.warn("Failed to load history file, starting fresh.");
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
save() {
|
|
70
|
+
const data = Array.from(this.cache.values());
|
|
71
|
+
fs.writeFileSync(this.historyFile, JSON.stringify(data, null, 2));
|
|
72
|
+
}
|
|
73
|
+
getHistory(address) {
|
|
74
|
+
if (!this.cache.has(address)) {
|
|
75
|
+
this.cache.set(address, {
|
|
76
|
+
address,
|
|
77
|
+
firstSeen: Date.now(),
|
|
78
|
+
lastSeen: Date.now(),
|
|
79
|
+
transactionCount: 0,
|
|
80
|
+
knownAssociates: [],
|
|
81
|
+
privacyDebtScore: 0
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
return this.cache.get(address);
|
|
85
|
+
}
|
|
86
|
+
updateHistory(address, leaks, relatedAddresses) {
|
|
87
|
+
const record = this.getHistory(address);
|
|
88
|
+
record.lastSeen = Date.now();
|
|
89
|
+
record.transactionCount += 1;
|
|
90
|
+
// Add associates
|
|
91
|
+
relatedAddresses.forEach(a => {
|
|
92
|
+
if (!record.knownAssociates.includes(a) && a !== address) {
|
|
93
|
+
record.knownAssociates.push(a);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
// Add privacy debt
|
|
97
|
+
let debtImpact = 0;
|
|
98
|
+
leaks.forEach(l => {
|
|
99
|
+
if (l.severity === 'CRITICAL')
|
|
100
|
+
debtImpact += 10;
|
|
101
|
+
else if (l.severity === 'HIGH')
|
|
102
|
+
debtImpact += 5;
|
|
103
|
+
else
|
|
104
|
+
debtImpact += 1;
|
|
105
|
+
});
|
|
106
|
+
record.privacyDebtScore += debtImpact;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
exports.HistoryManager = HistoryManager;
|
|
110
|
+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