{"_id":"@edycutjong/lethe-sdk","_rev":"3-a461c369229bb367c2e17d2a059050a1","name":"@edycutjong/lethe-sdk","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.2":{"name":"@edycutjong/lethe-sdk","version":"1.0.2","_id":"@edycutjong/lethe-sdk@1.0.2","maintainers":[{"name":"edycutjong","email":"edy.cu@live.com"}],"dist":{"shasum":"49543e737bf48a8f790d0a92b3732e710603ad22","tarball":"https://registry.npmjs.org/@edycutjong/lethe-sdk/-/lethe-sdk-1.0.2.tgz","fileCount":10,"integrity":"sha512-ZntzmZmA3detQl9WZfV7v3NC+sgVe+iPemV6ujGlu5AbaNaBo1MZ2H/hgmTCN2YbSm3u/SOFfcGlMNGvsLmrQg==","signatures":[{"sig":"MEYCIQCCCEGnToItzAJc/cwkin+fFC6HXrshrACrufpE+O+AsAIhAP8+p7Z3Ec9Wa/SSnsX+mp6wnmINm6mxn7ZqczrDwcu/","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":28741},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"0750056dc4dda827d7be386099f60af4fed55a91","scripts":{"test":"jest --coverage","build":"tsc"},"_npmUser":{"name":"edycutjong","email":"edy.cu@live.com"},"_npmVersion":"10.8.2","description":"Lethe Client SDK for secure right-to-erasure blinding, ECIES envelopes, and ZK proof generation","directories":{},"_nodeVersion":"20.20.2","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.1.2","typescript":"^5.0.0","@types/jest":"^29.5.12","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/lethe-sdk_1.0.2_1781942750449_0.015618172486179471","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@edycutjong/lethe-sdk","version":"1.0.3","_id":"@edycutjong/lethe-sdk@1.0.3","maintainers":[{"name":"edycutjong","email":"edy.cu@live.com"}],"dist":{"shasum":"6d7a9d5d16a3c70421e04e6bc1a52e132e3b023f","tarball":"https://registry.npmjs.org/@edycutjong/lethe-sdk/-/lethe-sdk-1.0.3.tgz","fileCount":10,"integrity":"sha512-OupVIeu4v5+ZizQ57iOxAlbrDT996wvf0rHHrnhZBZcJFPEEQsddGCrieeXZZIdefqytvjh2mdcBip7Sx6Deqg==","signatures":[{"sig":"MEQCIGnkaY34emCc03LUTluKIvHx8vI5upx33GnI8d7x3QmVAiA5SHlbIYjgPtFU0kw096G+TnEWiyn/O6l0gVtVBD4y6Q==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":28741},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"0dc7b5bf2c7de5a678a6ad763afc2df49e77fec4","scripts":{"test":"jest --coverage","build":"tsc"},"_npmUser":{"name":"edycutjong","email":"edy.cu@live.com"},"_npmVersion":"10.8.2","description":"Lethe Client SDK for secure right-to-erasure blinding, ECIES envelopes, and ZK proof generation","directories":{},"_nodeVersion":"20.20.2","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.1.2","typescript":"^5.0.0","@types/jest":"^29.5.12","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/lethe-sdk_1.0.3_1781969594644_0.27062918075666076","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@edycutjong/lethe-sdk","version":"1.0.4","description":"Lethe Client SDK for secure right-to-erasure blinding, ECIES envelopes, and ZK proof generation","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","test":"jest --coverage"},"dependencies":{},"repository":{"type":"git","url":"git+https://github.com/edycutjong/lethe.git"},"bugs":{"url":"https://github.com/edycutjong/lethe/issues"},"homepage":"https://github.com/edycutjong/lethe#readme","publishConfig":{"access":"public"},"devDependencies":{"typescript":"^5.0.0","@types/node":"^20.0.0","jest":"^29.7.0","ts-jest":"^29.1.2","@types/jest":"^29.5.12"},"_id":"@edycutjong/lethe-sdk@1.0.4","gitHead":"b9fed8c3cc0a5bfbaa60a30d2dbc9fc588afc393","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-mAtPO4WQyiWbDMGRa2XzRRdOapLCIDtrThhom2//QrXbCvwIyzw9cQfbSCtLkilNbufAOaoHzmuJ/fRglbrCUA==","shasum":"564718057bbb3dd584aa369dad364e9ee56e5d01","tarball":"https://registry.npmjs.org/@edycutjong/lethe-sdk/-/lethe-sdk-1.0.4.tgz","fileCount":10,"unpackedSize":29880,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@edycutjong%2flethe-sdk@1.0.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDAh9Y+6VK7XHjyfd89t9ag8f2o6hNx9i8p/dKLEcws7AiEAsfwh+D/2H4OyzN5Tx/Tu2+hdy7yQfrRFNyMbwA9NtfE="}]},"_npmUser":{"name":"edycutjong","email":"edy.cu@live.com"},"directories":{},"maintainers":[{"name":"edycutjong","email":"edy.cu@live.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/lethe-sdk_1.0.4_1782045519728_0.9620580348232668"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-20T08:05:50.146Z","modified":"2026-06-21T12:38:40.171Z","1.0.2":"2026-06-20T08:05:50.591Z","1.0.3":"2026-06-20T15:33:14.761Z","1.0.4":"2026-06-21T12:38:39.890Z"},"description":"Lethe Client SDK for secure right-to-erasure blinding, ECIES envelopes, and ZK proof generation","maintainers":[{"name":"edycutjong","email":"edy.cu@live.com"}],"readme":"# Lethe SDK (`@edycutjong/lethe-sdk`)\n\nTypeScript client SDK for interacting with the Lethe erasure agent. Handles all client-side cryptographic operations: ECIES envelope encryption, ZK proof generation, campaign enqueuing, VC receipt verification, and self-destruct triggering.\n\n> **Security Model:** PII is encrypted locally in the client's environment using the enclave's public key before any network transmission. The coordinator agent only handles ciphertext.\n\n## Exports\n\n### `LetheClient` Class\n\n```typescript\nimport { LetheClient } from '@edycutjong/lethe-sdk';\n\nconst client = new LetheClient({\n  rpcUrl: 'https://rpc.bot-chain.sandbox.test',\n  enclaveUrl: 'http://localhost:8080'\n});\n```\n\n#### Methods\n\n| Method | Description |\n|---|---|\n| `encryptPayload(pii, enclavePubKey)` | Encrypts a PII object using ECIES (secp256k1 ECDH + HKDF-SHA256 + AES-256-GCM). Returns an `EciesEnvelope`. |\n| `generateZkProof(email, salt)` | Generates a mock Groth16 ZK proof with SHA-256 public signal commitment. |\n| `enqueueErasure(params)` | Submits an erasure campaign to the coordinator agent gateway. |\n| `verifyReceipt(vc)` | Validates a W3C Verifiable Credential deletion receipt structure. |\n| `selfDestruct(userDid)` | Triggers the TEE cryptographic purge and profile self-destruct. |\n\n### Interfaces\n\n| Interface | Description |\n|---|---|\n| `EciesEnvelope` | `{ ephemeralPublicKey, iv, ciphertext, authTag }` — ECIES encrypted payload |\n| `ZkProof` | `{ pi_a, pi_b, pi_c, publicSignals }` — Groth16 proof structure |\n\n## Cryptographic Details\n\nThe `encryptPayload` method implements real ECIES encryption:\n\n1. **Ephemeral keypair** — `crypto.createECDH('secp256k1')` generates a fresh keypair per encryption\n2. **ECDH shared secret** — Diffie-Hellman against the enclave's public key\n3. **HKDF-SHA256** — Derives 44 bytes: 32-byte AES key + 12-byte GCM IV\n4. **AES-256-GCM** — Encrypts JSON-serialized PII with authenticated encryption\n\nThe `generateZkProof` method currently produces a **simulated** Groth16 proof with hardcoded curve points. The `publicSignals[0]` field contains a real SHA-256 hash of `email + salt`.\n\n## Development\n\n```bash\n# Install dependencies\nnpm install\n\n# Build TypeScript\nnpm run build\n\n# Run unit tests (Jest)\nnpm test\n```\n\n## Testing\n\nThe SDK has 9 test cases in `src/index.test.ts` covering:\n\n- Constructor initialization\n- ZK proof structure validation\n- ECIES encryption output format (65-byte uncompressed pubkey, hex fields)\n- VC receipt verification (valid + 5 invalid shapes)\n- Enqueue success/failure/network-error paths\n- Self-destruct success/failure/network-error paths\n","readmeFilename":"README.md","homepage":"https://github.com/edycutjong/lethe#readme","repository":{"type":"git","url":"git+https://github.com/edycutjong/lethe.git"},"bugs":{"url":"https://github.com/edycutjong/lethe/issues"}}