{"_id":"@cloakedxyz/clkd-stealth","_rev":"13-e577f1a9cee56802ab78d8453ef92806","name":"@cloakedxyz/clkd-stealth","dist-tags":{"latest":"1.1.1"},"versions":{"1.0.0":{"name":"@cloakedxyz/clkd-stealth","version":"1.0.0","keywords":[],"author":"","license":"MIT","_id":"@cloakedxyz/clkd-stealth@1.0.0","maintainers":[{"name":"oliviabarnett","email":"oliviabarnett@me.com"}],"dist":{"shasum":"5b10d8f56de1822964db1561905adcead008a289","tarball":"https://registry.npmjs.org/@cloakedxyz/clkd-stealth/-/clkd-stealth-1.0.0.tgz","fileCount":21,"integrity":"sha512-H2TzVdTwtZRptJg+4O28iRqSqdshbSgmweT2Xva9K+wOb2peJfg5a8u17qDYy7fVmk5RdEriGtAl4jIOkuxx1Q==","signatures":[{"sig":"MEYCIQDTfwC7t62ebK0VQJFK5ERCptovbujSw/57xSUrm59V8wIhAKGov/xLpNG1ws2EeHAgrBQh4vETVh9yiz4O7TAzSrVH","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":30566},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","gitHead":"f727523eb7d2a1baa43dd58a49522929c5a527fa","scripts":{"lint":"eslint .","test":"vitest","build":"tsc -p tsconfig.build.json","format":"prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"","test:ui":"vitest --ui","lint:fix":"eslint . --fix","test:run":"vitest run","format:check":"prettier --check \"**/*.{ts,tsx,js,jsx,json,md}\"","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"oliviabarnett","email":"oliviabarnett@me.com"},"deprecated":"This version has been deprecated. Please use 0.0.1 instead.","_npmVersion":"11.6.2","description":"Core stealth address tools for Cloaked","directories":{},"_nodeVersion":"25.1.0","dependencies":{"tsx":"^4.20.5","viem":"^2.39.2","ts-node":"^10.9.2","typescript":"^5","@noble/secp256k1":"^3.0.0"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.18.0","devDependencies":{"eslint":"^9.39.1","vitest":"^4.0.10","prettier":"^3.6.2","@eslint/js":"^9.39.1","@vitest/ui":"^4.0.10","typescript-eslint":"^8.47.0","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.4","@typescript-eslint/parser":"^8.47.0","@typescript-eslint/eslint-plugin":"^8.47.0"},"_npmOperationalInternal":{"tmp":"tmp/clkd-stealth_1.0.0_1763651473683_0.8838248342793524","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@cloakedxyz/clkd-stealth","version":"1.0.1","keywords":[],"author":"","license":"MIT","_id":"@cloakedxyz/clkd-stealth@1.0.1","maintainers":[{"name":"oliviabarnett","email":"oliviabarnett@me.com"}],"dist":{"shasum":"0cfe3bc45f6905ba10ff8f9178f7e32014329856","tarball":"https://registry.npmjs.org/@cloakedxyz/clkd-stealth/-/clkd-stealth-1.0.1.tgz","fileCount":23,"integrity":"sha512-sBhpcrA4F+eMmMXzJO2vKsP8IhWCn8voD/CosG8/0g1L46bHcjWHpfoNxwZbkCsMURtUwFOlfQ0grCBc8KeyTA==","signatures":[{"sig":"MEUCIQCaPvbLKPmw0Xb8plKO5r1LI1wduDLjPFGQmpYBM9ONzAIgYt2e+TlrhMeHIu6+ilsgWKx/VsiztNRozCnNNxNT3DQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":31060},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","gitHead":"8caa43ffd1cb35e9091256558f3ce70981502937","scripts":{"lint":"eslint .","test":"vitest","build":"tsc -p tsconfig.build.json","format":"prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"","test:ui":"vitest --ui","lint:fix":"eslint . --fix","test:run":"vitest run","format:check":"prettier --check \"**/*.{ts,tsx,js,jsx,json,md}\"","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"oliviabarnett","email":"oliviabarnett@me.com"},"deprecated":"This version has been deprecated.","_npmVersion":"11.6.2","description":"Core stealth address tools for Cloaked","directories":{},"_nodeVersion":"25.1.0","dependencies":{"tsx":"^4.20.5","viem":"^2.39.2","ts-node":"^10.9.2","typescript":"^5","@noble/secp256k1":"^3.0.0"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.18.0","devDependencies":{"eslint":"^9.39.1","vitest":"^4.0.10","prettier":"^3.6.2","@eslint/js":"^9.39.1","@vitest/ui":"^4.0.10","typescript-eslint":"^8.47.0","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.4","@typescript-eslint/parser":"^8.47.0","@typescript-eslint/eslint-plugin":"^8.47.0"},"_npmOperationalInternal":{"tmp":"tmp/clkd-stealth_1.0.1_1763652574283_0.8147972893737057","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@cloakedxyz/clkd-stealth","version":"1.0.2","keywords":[],"author":"","license":"MIT","_id":"@cloakedxyz/clkd-stealth@1.0.2","maintainers":[{"name":"oliviabarnett","email":"oliviabarnett@me.com"},{"name":"modulozero","email":"blainemalone01@gmail.com"}],"dist":{"shasum":"3a11e89736fb291f88864360f7b8dab6498b1f5a","tarball":"https://registry.npmjs.org/@cloakedxyz/clkd-stealth/-/clkd-stealth-1.0.2.tgz","fileCount":25,"integrity":"sha512-cAe2pQaKLxkw5R70JzBXP327U6ZM+fs+kYhQAtW6q4Ljotmu7V6CK/1JDq6NGZeaVE9t+EJ7S2BMzwPzivCDHA==","signatures":[{"sig":"MEQCIDKM/333yyXLaY6Wa7bCZrqTAYt/I1GylfAfuGAXM6dNAiAxEE2w629hINIcicx0UcyEglHYaXjTKWt9q3hM22ft2A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":32911},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","gitHead":"83be519cc8930fb64d5ceba1a570fd1ec108e8ae","scripts":{"lint":"eslint .","test":"vitest","build":"tsc -p tsconfig.build.json","format":"prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"","test:ui":"vitest --ui","lint:fix":"eslint . --fix","test:run":"vitest run","format:check":"prettier --check \"**/*.{ts,tsx,js,jsx,json,md}\"","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"oliviabarnett","email":"oliviabarnett@me.com"},"deprecated":"This version has been deprecated.","_npmVersion":"11.6.2","description":"Core stealth address tools for Cloaked","directories":{},"_nodeVersion":"25.1.0","dependencies":{"tsx":"^4.20.5","viem":"^2.39.2","ts-node":"^10.9.2","typescript":"^5","@noble/secp256k1":"^3.0.0"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.18.0","devDependencies":{"eslint":"^9.39.1","vitest":"^4.0.10","prettier":"^3.6.2","@eslint/js":"^9.39.1","@vitest/ui":"^4.0.10","typescript-eslint":"^8.47.0","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.4","@typescript-eslint/parser":"^8.47.0","@typescript-eslint/eslint-plugin":"^8.47.0"},"_npmOperationalInternal":{"tmp":"tmp/clkd-stealth_1.0.2_1763728387560_0.136787038080048","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@cloakedxyz/clkd-stealth","version":"1.0.3","keywords":[],"author":"","license":"MIT","_id":"@cloakedxyz/clkd-stealth@1.0.3","maintainers":[{"name":"oliviabarnett","email":"oliviabarnett@me.com"},{"name":"modulozero","email":"blainemalone01@gmail.com"}],"dist":{"shasum":"e3ecc99dee029ca7d31e0ca6bdca9f5d1c4fa41d","tarball":"https://registry.npmjs.org/@cloakedxyz/clkd-stealth/-/clkd-stealth-1.0.3.tgz","fileCount":27,"integrity":"sha512-CY7pctk6Eqm6wOUmzMRa/RSZK1Rhg8BM5d9zCP92f8DXwSzslEVz5HjpuyFIT0+mSo4qLVgJzEN95A8gbsYYXA==","signatures":[{"sig":"MEQCIF3fCQqx8kVc6iHeKWyX857jPoeJC2m2140W86TAeFw1AiASvVWWss22VItoDBFpgE0FVK3aMCcsp7eFMP7jvOHvNw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34753},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","gitHead":"098cba153a1e6bf1f82e4c99c3857cf4247e228e","scripts":{"lint":"eslint .","test":"vitest","build":"tsc -p tsconfig.build.json","format":"prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"","test:ui":"vitest --ui","lint:fix":"eslint . --fix","test:run":"vitest run","format:check":"prettier --check \"**/*.{ts,tsx,js,jsx,json,md}\"","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"oliviabarnett","email":"oliviabarnett@me.com"},"deprecated":"This version has been deprecated.","_npmVersion":"11.6.2","description":"Core stealth address tools for Cloaked","directories":{},"_nodeVersion":"25.1.0","dependencies":{"tsx":"^4.20.5","viem":"^2.39.2","ts-node":"^10.9.2","typescript":"^5","@noble/secp256k1":"^3.0.0"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.18.0","devDependencies":{"eslint":"^9.39.1","vitest":"^4.0.10","prettier":"^3.6.2","@eslint/js":"^9.39.1","@vitest/ui":"^4.0.10","typescript-eslint":"^8.47.0","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.4","@typescript-eslint/parser":"^8.47.0","@typescript-eslint/eslint-plugin":"^8.47.0"},"_npmOperationalInternal":{"tmp":"tmp/clkd-stealth_1.0.3_1763738277503_0.6572790291021433","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@cloakedxyz/clkd-stealth","version":"1.0.4","keywords":["stealth-addresses","eip-5564","privacy","ethereum","cryptography","hd-wallet","bip-32","cloaked"],"author":{"name":"Cloaked"},"license":"MIT","_id":"@cloakedxyz/clkd-stealth@1.0.4","maintainers":[{"name":"oliviabarnett","email":"oliviabarnett@me.com"},{"name":"modulozero","email":"blainemalone01@gmail.com"}],"homepage":"https://github.com/cloakedxyz/clkd-stealth#readme","bugs":{"url":"https://github.com/cloakedxyz/clkd-stealth/issues"},"dist":{"shasum":"dc267c11e794264c4587c4c538a80682b6d555ec","tarball":"https://registry.npmjs.org/@cloakedxyz/clkd-stealth/-/clkd-stealth-1.0.4.tgz","fileCount":23,"integrity":"sha512-iYR6YhQnEvzkLjG6tzt6eb/Y6AhmbsoxHiwei7iATB0DMwPNr4vNa5QqH2PMD1N6WqQVMelR74TvOF+/S+qH1w==","signatures":[{"sig":"MEUCIFC6wqhKVhcp0IMuAnbvN9uqvvvRqTkLhFfUizUTrmXqAiEA96393SzhXozFPLSYtYbqBdGMfNg8q1EfsdEAm+mtolc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":25499},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","gitHead":"bfe2154613bc6dcc3996cddffd1f0703f2bd6141","scripts":{"lint":"eslint .","test":"vitest","build":"tsc -p tsconfig.build.json","format":"prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"","test:ui":"vitest --ui","lint:fix":"eslint . --fix","test:run":"vitest run","format:check":"prettier --check \"**/*.{ts,tsx,js,jsx,json,md}\"","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"modulozero","email":"blainemalone01@gmail.com"},"repository":{"url":"git+https://github.com/cloakedxyz/clkd-stealth.git","type":"git"},"_npmVersion":"10.9.3","description":"Core stealth address tools for Cloaked","directories":{},"_nodeVersion":"22.20.0","dependencies":{"tsx":"^4.20.5","viem":"^2.39.2","ts-node":"^10.9.2","typescript":"^5","@noble/secp256k1":"^3.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.18.0","devDependencies":{"eslint":"^9.39.1","vitest":"^4.0.10","prettier":"^3.6.2","@eslint/js":"^9.39.1","@vitest/ui":"^4.0.10","typescript-eslint":"^8.47.0","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.4","@typescript-eslint/parser":"^8.47.0","@typescript-eslint/eslint-plugin":"^8.47.0"},"_npmOperationalInternal":{"tmp":"tmp/clkd-stealth_1.0.4_1769111162915_0.08482955879409149","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@cloakedxyz/clkd-stealth","version":"1.1.0","keywords":["stealth-addresses","eip-5564","privacy","ethereum","cryptography","hd-wallet","bip-32","cloaked"],"author":{"name":"Cloaked"},"license":"MIT","_id":"@cloakedxyz/clkd-stealth@1.1.0","maintainers":[{"name":"oliviabarnett","email":"oliviabarnett@me.com"},{"name":"modulozero","email":"blainemalone01@gmail.com"}],"homepage":"https://github.com/cloakedxyz/clkd-stealth#readme","bugs":{"url":"https://github.com/cloakedxyz/clkd-stealth/issues"},"dist":{"shasum":"8b86f5be71c70c49ee5b20cd31697e425b1a9858","tarball":"https://registry.npmjs.org/@cloakedxyz/clkd-stealth/-/clkd-stealth-1.1.0.tgz","fileCount":25,"integrity":"sha512-y/nUU1gYHpRDtSx5c74RX51EiG8XpxtVenIbnwEka3UoICoOlptXP5lhToTpVEbwgP4ak4Ml6rFAMF5703EakA==","signatures":[{"sig":"MEYCIQCVu+HHuBTNpj/o9LNSaJ4pEqNaEcWkXWcmyrYqkVdC7wIhAL1tJiN8anwqrNdjbclkQEU8oPYkpUTJOKk+m2dLFY/c","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":29131},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","gitHead":"07b846377d60e8c4b6ffa4d02740964b6bd16208","scripts":{"lint":"eslint .","test":"vitest","build":"tsc -p tsconfig.build.json","format":"prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"","test:ui":"vitest --ui","lint:fix":"eslint . --fix","test:run":"vitest run","format:check":"prettier --check \"**/*.{ts,tsx,js,jsx,json,md}\"","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"modulozero","email":"blainemalone01@gmail.com"},"repository":{"url":"git+https://github.com/cloakedxyz/clkd-stealth.git","type":"git"},"_npmVersion":"10.9.3","description":"Core stealth address tools for Cloaked","directories":{},"_nodeVersion":"22.20.0","dependencies":{"tsx":"^4.20.5","viem":"^2.39.2","ts-node":"^10.9.2","typescript":"^5","@noble/secp256k1":"^3.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.18.0","devDependencies":{"eslint":"^9.39.1","vitest":"^4.0.10","prettier":"^3.6.2","@eslint/js":"^9.39.1","@vitest/ui":"^4.0.10","typescript-eslint":"^8.47.0","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.4","@typescript-eslint/parser":"^8.47.0","@typescript-eslint/eslint-plugin":"^8.47.0"},"_npmOperationalInternal":{"tmp":"tmp/clkd-stealth_1.1.0_1771507439661_0.44280390444913986","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@cloakedxyz/clkd-stealth","version":"1.1.1","description":"Core stealth address tools for Cloaked","main":"dist/index.js","module":"dist/index.js","types":"dist/index.d.ts","type":"module","keywords":["stealth-addresses","eip-5564","privacy","ethereum","cryptography","hd-wallet","bip-32","cloaked"],"author":{"name":"Cloaked"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/cloakedxyz/clkd-stealth.git"},"bugs":{"url":"https://github.com/cloakedxyz/clkd-stealth/issues"},"homepage":"https://github.com/cloakedxyz/clkd-stealth#readme","publishConfig":{"access":"public"},"dependencies":{"@noble/secp256k1":"^3.0.0","ts-node":"^10.9.2","tsx":"^4.20.5","typescript":"^5","viem":"^2.39.2"},"devDependencies":{"@eslint/js":"^9.39.1","@typescript-eslint/eslint-plugin":"^8.47.0","@typescript-eslint/parser":"^8.47.0","@vitest/ui":"^4.0.10","eslint":"^9.39.1","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.4","prettier":"^3.6.2","typescript-eslint":"^8.47.0","vitest":"^4.0.10"},"scripts":{"build":"tsc -p tsconfig.build.json","test":"vitest","test:ui":"vitest --ui","test:run":"vitest run","test:coverage":"vitest run --coverage","lint":"eslint .","lint:fix":"eslint . --fix","format":"prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"","format:check":"prettier --check \"**/*.{ts,tsx,js,jsx,json,md}\""},"_id":"@cloakedxyz/clkd-stealth@1.1.1","_integrity":"sha512-29p5Bfspyi1hiYxN/Z5AlVFA7wFCNTgjjxosiTxGUMB0EKVxlJo/9B7N306jlS4voFwZe8Z61i4EVug/v6JxUA==","_resolved":"/private/var/folders/v9/7kygpnrs1db6jq7vh68m6xbr0000gn/T/051aeaacac1a04254af694c21d118868/cloakedxyz-clkd-stealth-1.1.1.tgz","_from":"file:cloakedxyz-clkd-stealth-1.1.1.tgz","_nodeVersion":"22.20.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-29p5Bfspyi1hiYxN/Z5AlVFA7wFCNTgjjxosiTxGUMB0EKVxlJo/9B7N306jlS4voFwZe8Z61i4EVug/v6JxUA==","shasum":"7f8d8b2eb9ae3326d63220ca180f263c336bf9f6","tarball":"https://registry.npmjs.org/@cloakedxyz/clkd-stealth/-/clkd-stealth-1.1.1.tgz","fileCount":25,"unpackedSize":29181,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIF2nsIYzgxyfR2mrvXVqD295RnPm45kNBM0gqpVXfPJHAiEAsv8vW3RLB1HEECjJ4WP64O+wOqlpD07snNDVIOvta7o="}]},"_npmUser":{"name":"modulozero","email":"blainemalone01@gmail.com"},"directories":{},"maintainers":[{"name":"oliviabarnett","email":"oliviabarnett@me.com"},{"name":"modulozero","email":"blainemalone01@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/clkd-stealth_1.1.1_1784815895827_0.6908097458018208"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-20T15:11:13.165Z","modified":"2026-07-23T14:11:36.250Z","1.0.0":"2025-11-20T15:11:13.888Z","1.0.1":"2025-11-20T15:29:34.504Z","1.0.2":"2025-11-21T12:33:07.742Z","1.0.3":"2025-11-21T15:17:57.707Z","1.0.4":"2026-01-22T19:46:03.058Z","1.1.0":"2026-02-19T13:23:59.804Z","1.1.1":"2026-07-23T14:11:36.105Z"},"bugs":{"url":"https://github.com/cloakedxyz/clkd-stealth/issues"},"author":{"name":"Cloaked"},"license":"MIT","homepage":"https://github.com/cloakedxyz/clkd-stealth#readme","keywords":["stealth-addresses","eip-5564","privacy","ethereum","cryptography","hd-wallet","bip-32","cloaked"],"repository":{"type":"git","url":"git+https://github.com/cloakedxyz/clkd-stealth.git"},"description":"Core stealth address tools for Cloaked","maintainers":[{"name":"oliviabarnett","email":"oliviabarnett@me.com"},{"name":"modulozero","email":"blainemalone01@gmail.com"}],"readme":"<div align=\"center\">\n  <img src=\"img/cloaked_logo.png\" alt=\"Cloaked Logo\" width=\"200\">\n</div>\n\n# clkd-stealth\n\nA TypeScript library providing cryptographic primitives for deriving spending and viewing keys from signatures, generating stealth addresses, and managing hierarchical deterministic (HD) key derivations.\n\n## Installation\n\n```bash\nnpm install @cloakedxyz/clkd-stealth\n# or\npnpm add @cloakedxyz/clkd-stealth\n# or\nyarn add @cloakedxyz/clkd-stealth\n```\n\n## Architecture\n\n```mermaid\nsequenceDiagram\n    title Cloaked\n\n    actor Alice\n    actor Bob\n    participant Client\n    participant Server\n    participant PortoRPC as \"Porto RPC\"\n    participant Blockchain\n\n    Note over Client: Sign-In derivation (p_spend, p_view, P_spend, P_view, child_p_view)\n\n    Client ->> Server: (P_view, P_spend, child_p_view)\n    Note over Server: Receive client keys\n\n    Note over Server: Server-side stealth address generation\n\n    Alice ->> Blockchain: Send 1 ETH to a_stealth\n    Client ->> Server: Request to send 1 ETH\n\n    Note over Server: Stealth address selection\n\n    Server ->> Client: {(a_stealth, index)}\n\n    Client ->> PortoRPC: RelayActions.prepareUpgradeAccount(a_stealth)\n    PortoRPC ->> Client: upgradeRequest\n\n    Note over Client: Upgrade authorization (derive p_stealth & sign auth/exec)\n\n    Client ->> PortoRPC: RelayActions.prepareCalls(a_stealth, to, amount, data)\n    PortoRPC ->> Client: paymentRequest\n\n    Note over Client: Payment authorization (sign payment digest)\n\n    Client ->> Server: authSig, execSig, paymentSig, upgradeRequest, paymentRequest\n\n    Server ->> PortoRPC: RelayActions.upgradeAccount(upgradeRequest, authSig, execSig)\n    Note over PortoRPC: Lazy deployment (store & activate 7702 delegation)\n\n    Server ->> PortoRPC: RelayActions.sendPrepareCalls(paymentRequest, paymentSig)\n\n    PortoRPC ->> Blockchain: Submit 7702 delegation + payment\n    PortoRPC ->> Server: id\n\n    Blockchain ->> Bob: 1 ETH\n\n    Server ->> PortoRPC: RelayActions.getCallsStatus(id)\n    PortoRPC ->> Server: 200 status\n```\n\n## Detailed Notes\n\n### 1. Sign-In Derivation\n\n```bash\nsig       = sign(p, msgHash)\n\np_spend   = SHA256(first_half_sig)\np_view    = SHA256(second_half_sig)\n\nP_spend   = toPubKey(p_spend)\nP_view    = toPubKey(p_view)\n\nmaster_p_view = bip32.fromMasterSeed(p_view)\nchild_p_view  = bip32.ckd(master_p_view, \"m/5564'/0'\")\n```\n\n**Security Note:** Client sends only `child_p_view`, not `p_view`, to protect the full viewing key from the server.\n\n---\n\n### 2. Server-Side Stealth Address Generation\n\n```bash\ncoin_type = ensip11(chainId)\nc0 = coin_type.firstHalf\nc1 = coin_type.secondHalf\n```\n\n```bash\nif nonce > 0xfffffff:\n    parent_nonce = nonce / (0xfffffff + 1)\n    nonce        = nonce % (0xfffffff + 1)\nelse:\n    parent_nonce = 0\n```\n\n```bash\nindex = \"m/c0'/c1'/0'/parent_nonce'/nonce'\"\n```\n\n```bash\np_derived = bip32.ckd(child_p_view, index)\nS         = p_derived * P_spend  // ECDH shared secret\nr         = keccak(S)\nP_stealth = P_spend * r\na_stealth = addr(P_stealth)      // EOA address\n```\n\n**Note:** `p_derived` replaces the random `p_ephemeral` in EIP-5564, making stealth addresses deterministic and recoverable.\n\n---\n\n### 3. Stealth Address Selection\n\nThe server maintains a set of stealth addresses it generated for the user and chooses the optimal one to spend from based on deposits, balances, and gas efficiency.\n\n---\n\n### 4. Upgrade Authorization (Client)\n\n```bash\np_derived = bip32.ckd(child_p_view, index)\nP_derived = toPubKey(p_derived)\n\nS         = P_derived * p_spend  // ECDH shared secret\nr         = keccak(S)\n\np_stealth = p_spend * r\n```\n\n```bash\nauthSig = sign(p_stealth, upgradeRequest.digest.auth)\nexecSig = sign(p_stealth, upgradeRequest.digest.exec)\n```\n\n---\n\n### 5. Payment Authorization\n\n```bash\npaymentSig = sign(p_stealth, paymentRequest.digest)\n```\n\n---\n\n### 6. Lazy Deployment (Porto RPC)\n\nPorto RPC stores ERC-7702 delegation and applies/activates it only when needed (first call requiring it).\n\n---\n\n### 7. Execution Flow\n\n1. Server sends upgrade + prepareCalls bundle.\n2. Porto RPC:\n   - publishes 7702 delegation\n   - deploys/upgrades account\n   - executes payment\n3. Blockchain transfers **1 ETH → Bob**.\n4. Server polls status until `200`.\n\n## References\n\n### Standards & Specifications\n\n- [EIP-5564: Stealth Addresses](https://eips.ethereum.org/EIPS/eip-5564) - Stealth address standard\n- [ENSIP-11: EVM Address Resolution](https://docs.ens.domains/ensip/11) - Coin type derivation for EVM chains\n- [BIP-32: Hierarchical Deterministic Wallets](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki) - HD wallet standard\n- [ERC-7702: Set code for an address using a signature](https://eips.ethereum.org/EIPS/eip-7702) - Account abstraction via delegation\n\n### Related Projects\n\n- [Umbra Protocol](https://github.com/ScopeLift/umbra-protocol) - Privacy-preserving stealth address protocol (key derivation inspiration)\n- [Fluidkey Stealth Account Kit](https://github.com/fluidkey/fluidkey-stealth-account-kit) - Stealth account implementation (HD key derivation inspiration)\n- [Porto Relay](https://porto.sh) - Account abstraction relay service\n\n## License\n\nMIT\n","readmeFilename":"README.md"}