liqproof 0.0.0-stage → 0.1.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.
Files changed (143) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +536 -2
  3. package/bugs/README.md +144 -0
  4. package/bugs/coin-gecko-liquidity-report.md +283 -0
  5. package/bugs/collect-ds-aggregate.mjs +213 -0
  6. package/bugs/collect-evidence.mjs +458 -0
  7. package/bugs/collect-gt-aggregate.mjs +215 -0
  8. package/bugs/collect-raw-rpc.mjs +165 -0
  9. package/bugs/collect-sweep-context.mjs +162 -0
  10. package/bugs/dexscreener-fake-liquidity-report.md +310 -0
  11. package/bugs/evidence/aggregator-liquidity-claims.json +648 -0
  12. package/bugs/evidence/aggregator-liquidity-claims.md +103 -0
  13. package/bugs/evidence/bat-native-pool-drained.json +136 -0
  14. package/bugs/evidence/bat-native-pool-drained.md +51 -0
  15. package/bugs/evidence/chz-impersonator-pool-drained.json +136 -0
  16. package/bugs/evidence/chz-impersonator-pool-drained.md +51 -0
  17. package/bugs/evidence/gt-stale-reserve-after-drain.json +141 -0
  18. package/bugs/evidence/gt-stale-reserve-after-drain.md +31 -0
  19. package/bugs/evidence/raw-rpc-transcript.json +683 -0
  20. package/bugs/evidence/raw-rpc-transcript.md +308 -0
  21. package/bugs/evidence/sweep-context.json +325 -0
  22. package/bugs/evidence/sweep-context.md +55 -0
  23. package/bugs/evidence/verified-aggregate.json +526 -0
  24. package/bugs/evidence/verified-aggregate.md +24 -0
  25. package/bugs/evidence/verified-ds-liquidity-usd.json +1197 -0
  26. package/bugs/evidence/verified-ds-liquidity-usd.md +250 -0
  27. package/bugs/evidence/verified-gt-reserve-in-usd.json +1002 -0
  28. package/bugs/evidence/verified-gt-reserve-in-usd.md +218 -0
  29. package/bugs/fix-bundle-titles.mjs +72 -0
  30. package/bugs/geckoterminal-stale-reserve-after-drain.md +137 -0
  31. package/data/dataset-summary.md +103 -0
  32. package/data/impersonators.json +12888 -0
  33. package/data/verified-impersonators.json +725 -0
  34. package/data/wallets.json +23 -0
  35. package/dist/base58.js +70 -0
  36. package/dist/base58.js.map +1 -0
  37. package/dist/canonical.js +372 -0
  38. package/dist/canonical.js.map +1 -0
  39. package/dist/cli.js +830 -0
  40. package/dist/cli.js.map +1 -0
  41. package/dist/curve.js +255 -0
  42. package/dist/curve.js.map +1 -0
  43. package/dist/dashboard.js +485 -0
  44. package/dist/dashboard.js.map +1 -0
  45. package/dist/keccak.js +197 -0
  46. package/dist/keccak.js.map +1 -0
  47. package/dist/mcp.js +604 -0
  48. package/dist/mcp.js.map +1 -0
  49. package/dist/operator.js +180 -0
  50. package/dist/operator.js.map +1 -0
  51. package/dist/pda.js +86 -0
  52. package/dist/pda.js.map +1 -0
  53. package/dist/receipt.js +897 -0
  54. package/dist/receipt.js.map +1 -0
  55. package/dist/render.js +335 -0
  56. package/dist/render.js.map +1 -0
  57. package/dist/rpc.js +377 -0
  58. package/dist/rpc.js.map +1 -0
  59. package/dist/sources.js +599 -0
  60. package/dist/sources.js.map +1 -0
  61. package/dist/store.js +330 -0
  62. package/dist/store.js.map +1 -0
  63. package/dist/tokenmeta.js +424 -0
  64. package/dist/tokenmeta.js.map +1 -0
  65. package/dist/util.js +273 -0
  66. package/dist/util.js.map +1 -0
  67. package/dist/vaults.js +510 -0
  68. package/dist/vaults.js.map +1 -0
  69. package/dist/wallet.js +404 -0
  70. package/dist/wallet.js.map +1 -0
  71. package/dist/warnings.js +41 -0
  72. package/dist/warnings.js.map +1 -0
  73. package/dist/worker.js +857 -0
  74. package/dist/worker.js.map +1 -0
  75. package/dist/x402.js +549 -0
  76. package/dist/x402.js.map +1 -0
  77. package/docs/HACKATHON-SUBMISSION.md +264 -0
  78. package/docs/liqproof-plan.md +221 -0
  79. package/docs/llms.txt +32 -0
  80. package/docs/mcp-registry.md +165 -0
  81. package/docs/screenshots/01-dashboard.png +0 -0
  82. package/docs/screenshots/02-receipt-drained.png +0 -0
  83. package/docs/screenshots/03-receipt-impersonator.png +0 -0
  84. package/docs/screenshots/04-receipt-canonical.png +0 -0
  85. package/docs/x402-pricing.md +171 -0
  86. package/docs/zero-xyz.md +250 -0
  87. package/out/6eftxVbSAunVEoxUWdGhPdxg5UdsJ8Wkwy5w5YFuxouw.json +1171 -0
  88. package/out/6eftxVbSAunVEoxUWdGhPdxg5UdsJ8Wkwy5w5YFuxouw.md +52 -0
  89. package/out/6eftxVbSAunVEoxUWdGhPdxg5UdsJ8Wkwy5w5YFuxouw.svg +25 -0
  90. package/out/BTNiaZb6HaEFWeEtND4SXtZ7T6mgtDwSryHTAj6PuPyp.json +3975 -0
  91. package/out/BTNiaZb6HaEFWeEtND4SXtZ7T6mgtDwSryHTAj6PuPyp.md +90 -0
  92. package/out/BTNiaZb6HaEFWeEtND4SXtZ7T6mgtDwSryHTAj6PuPyp.svg +25 -0
  93. package/out/ENGkoidj2jNs73A7GZuseVmnkRg6EVF9tDtViwPz8o85.json +1446 -0
  94. package/out/ENGkoidj2jNs73A7GZuseVmnkRg6EVF9tDtViwPz8o85.md +66 -0
  95. package/out/ENGkoidj2jNs73A7GZuseVmnkRg6EVF9tDtViwPz8o85.svg +25 -0
  96. package/out/dataset.csv +67 -0
  97. package/out/impersonation-table.md +156 -0
  98. package/out/index.html +1179 -0
  99. package/package.json +78 -4
  100. package/scripts/assert-no-canonical-accusations.mjs +193 -0
  101. package/scripts/backfill.mjs +1063 -0
  102. package/scripts/bundle-evidence.mjs +237 -0
  103. package/scripts/bundle-stale-claim.mjs +417 -0
  104. package/scripts/capture-bch-evidence.mjs +58 -0
  105. package/scripts/check-orientation-fix.mjs +40 -0
  106. package/scripts/check-wallet.mjs +54 -0
  107. package/scripts/daily-refresh.mjs +451 -0
  108. package/scripts/decode-clmm-vaults.mjs +180 -0
  109. package/scripts/falsifiability.mjs +263 -0
  110. package/scripts/impersonator-mining.mjs +156 -0
  111. package/scripts/inspect-matches.mjs +73 -0
  112. package/scripts/operator-sweep.mjs +252 -0
  113. package/scripts/publish-release.mjs +248 -0
  114. package/scripts/refresh-store.mjs +78 -0
  115. package/scripts/survival-miner.mjs +951 -0
  116. package/scripts/test-keccak.mjs +103 -0
  117. package/scripts/verify-bch-1p95b.mjs +124 -0
  118. package/scripts/verify-clmm-1p95b.mjs +127 -0
  119. package/scripts/verify-clmm-control.mjs +84 -0
  120. package/scripts/verify-impersonators.mjs +138 -0
  121. package/scripts/verify-raw.mjs +110 -0
  122. package/scripts/verify-raw2.mjs +99 -0
  123. package/server.json +34 -0
  124. package/src/base58.ts +68 -0
  125. package/src/canonical.ts +447 -0
  126. package/src/cli.ts +941 -0
  127. package/src/curve.ts +349 -0
  128. package/src/dashboard.ts +504 -0
  129. package/src/keccak.ts +228 -0
  130. package/src/mcp.ts +735 -0
  131. package/src/operator.ts +219 -0
  132. package/src/receipt.ts +1219 -0
  133. package/src/render.ts +396 -0
  134. package/src/rpc.ts +435 -0
  135. package/src/sources.ts +714 -0
  136. package/src/store.ts +428 -0
  137. package/src/tokenmeta.ts +460 -0
  138. package/src/util.ts +276 -0
  139. package/src/vaults.ts +574 -0
  140. package/src/wallet.ts +459 -0
  141. package/src/warnings.ts +40 -0
  142. package/src/worker.ts +1086 -0
  143. package/src/x402.ts +717 -0
package/package.json CHANGED
@@ -1,6 +1,80 @@
1
1
  {
2
2
  "name": "liqproof",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "private": false,
5
+ "description": "On-chain liquidity receipts — prove fake liquidity with signed on-chain evidence. $0 budget, read-only.",
6
+ "type": "module",
7
+ "license": "MIT",
8
+ "author": "Ahmed Ibrahim Hassan <aih.business77@gmail.com>",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/aihbusiness77-pixel/liqproof.git"
12
+ },
13
+ "homepage": "https://github.com/aihbusiness77-pixel/liqproof#readme",
14
+ "bugs": {
15
+ "url": "https://github.com/aihbusiness77-pixel/liqproof/issues"
16
+ },
17
+ "keywords": [
18
+ "solana",
19
+ "liquidity",
20
+ "mev",
21
+ "rug-pull",
22
+ "on-chain",
23
+ "receipts",
24
+ "x402",
25
+ "mcp",
26
+ "audit",
27
+ "read-only"
28
+ ],
29
+ "mcpName": "io.github.aihbusiness77-pixel/liqproof",
30
+ "files": [
31
+ "dist/",
32
+ "src/",
33
+ "out/",
34
+ "scripts/",
35
+ "bugs/",
36
+ "data/impersonators.json",
37
+ "data/verified-impersonators.json",
38
+ "data/dataset-summary.md",
39
+ "data/wallets.json",
40
+ "docs/x402-pricing.md",
41
+ "docs/mcp-registry.md",
42
+ "docs/zero-xyz.md",
43
+ "docs/llms.txt",
44
+ "docs/liqproof-plan.md",
45
+ "docs/HACKATHON-SUBMISSION.md",
46
+ "docs/screenshots/",
47
+ "server.json",
48
+ "README.md",
49
+ "LICENSE"
50
+ ],
51
+ "engines": {
52
+ "node": ">=22.5.0"
53
+ },
54
+ "bin": {
55
+ "liqproof": "./dist/cli.js"
56
+ },
57
+ "scripts": {
58
+ "build": "tsc -p tsconfig.json",
59
+ "receipt": "node dist/cli.js receipt",
60
+ "scan": "node dist/cli.js scan",
61
+ "survival": "node dist/cli.js survival",
62
+ "timeline": "node dist/cli.js timeline",
63
+ "export": "node dist/cli.js export",
64
+ "mcp": "node dist/cli.js mcp",
65
+ "serve": "node dist/cli.js serve",
66
+ "x402": "node dist/cli.js x402",
67
+ "verify": "node dist/cli.js verify",
68
+ "wallet": "node dist/cli.js wallet",
69
+ "assert:safety": "node scripts/assert-no-canonical-accusations.mjs",
70
+ "test": "npm run build && node dist/cli.js verify && node scripts/test-keccak.mjs && node scripts/assert-no-canonical-accusations.mjs",
71
+ "miner": "node scripts/survival-miner.mjs",
72
+ "backfill": "node scripts/backfill.mjs",
73
+ "refresh": "node scripts/daily-refresh.mjs",
74
+ "dev": "tsc -p tsconfig.json --watch"
75
+ },
76
+ "devDependencies": {
77
+ "@types/node": "^22.10.2",
78
+ "typescript": "^5.7.2"
79
+ }
80
+ }
@@ -0,0 +1,193 @@
1
+ // LIQPROOF — safety assertion: a canonical token can never be accused.
2
+ //
3
+ // WHAT THIS CHECKS
4
+ //
5
+ // The published dataset (out/dataset.csv, and the dashboard built from it)
6
+ // may contain an ACCUSATORY verdict — FAKE_LIQUIDITY, DRAINED or
7
+ // NO_DEPTH — only for a mint that is NOT the canonical token.
8
+ //
9
+ // For every accusatory row, this script re-derives the canonical answer
10
+ // from scratch, the way an outside reviewer would:
11
+ //
12
+ // 1. read the mint's OWN Metaplex metadata account (the on-chain name);
13
+ // 2. load the canonical index (first-party documentation + CoinGecko's
14
+ // coin→Solana-mint map, both keyless);
15
+ // 3. ask the resolver whether this mint IS the canonical token.
16
+ //
17
+ // If the answer is "yes, it is canonical", the row is a false accusation
18
+ // and this script FAILS (exit 1). The check does not trust the dataset's
19
+ // own verdict, its flags, or the receipt that produced it — it re-reads
20
+ // the chain and the index.
21
+ //
22
+ // WHY IT EXISTS
23
+ //
24
+ // On 2026-12-04 the canonical USDB mint
25
+ // (9GV3oZL4p5uGFhtSxS4JsyP64Dqvw4ZuvzgX7FzJ7eTD) reached the published
26
+ // dataset as NO_DEPTH on a $500M claim, because the accusation gate in
27
+ // the receipt engine protected FAKE_LIQUIDITY only, and the canonical
28
+ // guard that did exist lived inside one mining script instead of at store
29
+ // time. Both are fixed. This script is the third line of defence: even if
30
+ // a future change opens the gate again, CI goes red before a reviewer can
31
+ // find the mistake.
32
+ //
33
+ // COST
34
+ //
35
+ // Zero. One CoinGecko request for the index (cached for 6h) and one RPC
36
+ // account read per accusatory row — six rows today.
37
+ //
38
+ // EXIT CODES
39
+ //
40
+ // 0 the published dataset is clean
41
+ // 1 a canonical mint carries an accusatory verdict (never ship this)
42
+
43
+ import { readFileSync } from 'node:fs';
44
+ import { fileURLToPath, pathToFileURL } from 'node:url';
45
+ import { dirname, join } from 'node:path';
46
+
47
+ const ROOT = join(dirname(fileURLToPath(import.meta.url)), '..');
48
+
49
+ const ACCUSATORY = new Set(['FAKE_LIQUIDITY', 'NO_DEPTH', 'DRAINED']);
50
+
51
+ // ── the published dataset ────────────────────────────────────────────────────
52
+
53
+ function readDataset() {
54
+ const raw = readFileSync(join(ROOT, 'out', 'dataset.csv'), 'utf8');
55
+ const lines = raw.split(/\r?\n/).filter((l) => l.length > 0);
56
+ const header = splitCsv(lines[0]);
57
+ return lines.slice(1).map((line) => {
58
+ const cells = splitCsv(line);
59
+ const row = {};
60
+ header.forEach((h, i) => {
61
+ row[h] = cells[i] ?? '';
62
+ });
63
+ return row;
64
+ });
65
+ }
66
+
67
+ /** Minimal RFC-4180 field splitter — the CSV is written by our own exporter. */
68
+ function splitCsv(line) {
69
+ const out = [];
70
+ let cur = '';
71
+ let quoted = false;
72
+ for (let i = 0; i < line.length; i++) {
73
+ const ch = line[i];
74
+ if (quoted) {
75
+ if (ch === '"') {
76
+ if (line[i + 1] === '"') {
77
+ cur += '"';
78
+ i++;
79
+ } else {
80
+ quoted = false;
81
+ }
82
+ } else {
83
+ cur += ch;
84
+ }
85
+ } else if (ch === '"') {
86
+ quoted = true;
87
+ } else if (ch === ',') {
88
+ out.push(cur);
89
+ cur = '';
90
+ } else {
91
+ cur += ch;
92
+ }
93
+ }
94
+ out.push(cur);
95
+ return out;
96
+ }
97
+
98
+ // ── the engine's own readers ─────────────────────────────────────────────────
99
+
100
+ // Windows note: an absolute path is NOT a valid ES module URL. Every import
101
+ // has to go through pathToFileURL, or the loader throws
102
+ // ERR_UNSUPPORTED_ESM_URL_SCHEME. (The project hit this exact trap before
103
+ // in scripts/check-wallet.mjs.)
104
+ const { RpcPool } = await import(pathToFileURL(join(ROOT, 'dist', 'rpc.js')).href);
105
+ const { loadCanonicalIndex, resolveCanonical } = await import(
106
+ pathToFileURL(join(ROOT, 'dist', 'canonical.js')).href
107
+ );
108
+ const { tokenMetadata } = await import(
109
+ pathToFileURL(join(ROOT, 'dist', 'tokenmeta.js')).href
110
+ );
111
+
112
+ const rows = readDataset();
113
+ const accusatory = rows.filter((r) => ACCUSATORY.has((r.verdict ?? '').trim()));
114
+
115
+ console.log('LIQPROOF SAFETY ASSERTION');
116
+ console.log('─'.repeat(64));
117
+ console.log(` published rows ${rows.length}`);
118
+ console.log(` accusatory rows ${accusatory.length}`);
119
+ console.log(` checked verdicts ${[...ACCUSATORY].join(', ')}`);
120
+ console.log('');
121
+
122
+ if (accusatory.length === 0) {
123
+ console.log(' nothing to accuse — the dataset makes no adverse claim.');
124
+ process.exit(0);
125
+ }
126
+
127
+ const rpc = new RpcPool({ verbose: false });
128
+ let index = null;
129
+ try {
130
+ index = await loadCanonicalIndex();
131
+ console.log(` canonical index ${index.entries.length} entries`);
132
+ } catch (err) {
133
+ console.error(` FAIL could not load the canonical index: ${err.message}`);
134
+ console.error(' Without the index this assertion cannot run, and a');
135
+ console.error(' dataset that accuses without one is not publishable.');
136
+ process.exit(1);
137
+ }
138
+
139
+ const violations = [];
140
+ const checked = [];
141
+
142
+ for (const row of accusatory) {
143
+ const mint = (row.mint ?? '').trim();
144
+ if (!mint) continue;
145
+
146
+ let name = '';
147
+ let symbol = (row.symbol ?? '').trim();
148
+ try {
149
+ const meta = await tokenMetadata(rpc, mint);
150
+ if (meta) {
151
+ name = meta.name ?? '';
152
+ symbol = meta.symbol || symbol;
153
+ }
154
+ } catch {
155
+ // A metadata read that fails does not make the row safe. We fall back to
156
+ // the symbol the dataset carries and let the resolver decide.
157
+ }
158
+
159
+ const resolution = resolveCanonical(mint, { name, symbol }, index);
160
+ checked.push({ mint, symbol, verdict: row.verdict, status: resolution.status });
161
+
162
+ if (resolution.status === 'canonical' || resolution.isCanonical) {
163
+ violations.push({ mint, symbol, verdict: row.verdict, name, method: resolution.method });
164
+ }
165
+ }
166
+
167
+ console.log('');
168
+ for (const c of checked) {
169
+ const mark = c.status === 'canonical' ? 'VIOLATION' : 'ok';
170
+ console.log(
171
+ ` ${mark.padEnd(10)} ${c.mint.slice(0, 44).padEnd(44)} ${c.verdict.padEnd(18)} canonical=${c.status}`,
172
+ );
173
+ }
174
+
175
+ console.log('');
176
+
177
+ if (violations.length > 0) {
178
+ console.error(' FAIL a canonical mint carries an accusatory verdict:');
179
+ for (const v of violations) {
180
+ console.error(
181
+ ` ${v.mint} (${v.symbol}) → ${v.verdict} · on-chain name "${v.name}" · ${v.method}`,
182
+ );
183
+ }
184
+ console.error('');
185
+ console.error(' A real project was published as fake. Fix the gate, rebuild the');
186
+ console.error(' dataset, and do not publish this until the assertion is green.');
187
+ process.exit(1);
188
+ }
189
+
190
+ console.log(` PASS ${checked.length} accusatory rows re-checked against the chain and the`);
191
+ console.log(' canonical index — none of them is a canonical token.');
192
+ console.log('');
193
+ process.exit(0);