TECHNICAL CASE STUDY · Unreleased · Local-first frontend
Tornado Cash frontend
An upstream interface adapted for local testing.
Unreleased frontend adaptation · no production launch
FROM THE IMPLEMENTATION
Classify normalized loopback RPC URLs
const LOOPBACK_RPC_SCHEMES = new Set(['http:', 'https:', 'ws:', 'wss:'])
const LOOPBACK_RPC_HOSTS = new Set(['localhost', '127.0.0.1', '[::1]'])
const isLoopbackRpcUrl = (url) => {
let parsed
try {
parsed = new URL(url)
} catch {
return false
}
return LOOPBACK_RPC_SCHEMES.has(parsed.protocol) && LOOPBACK_RPC_HOSTS.has(parsed.hostname)
}
The endpoint policy parses the URL before comparing its scheme and host. This exact helper handles the loopback branch; configured-endpoint matching follows elsewhere in the original module.
THE ENGINEERING PROBLEM
What needed to work
I explored how the upstream Tornado Cash Classic interface could run as a local, self-hosted application with explicit RPC selection and a controlled testing environment. The engineering work was an adaptation of an existing Nuxt/Vue frontend: make its network assumptions visible, constrain outbound dependencies and give the operator understandable configuration and failure states.
Constraints and requirements
- The original interface, visual language, cryptographic tooling and protocol were upstream work. My contribution was the local integration, source patching, configuration validation and supporting development/test tooling.
- Local hosting does not remove the need for RPC. A selected endpoint can be absent, syncing or on a different chain. Persisted settings need validation before another part of the application uses them.
ARCHITECTURE & DESIGN
How the system fits together
- Vue / Nuxt interface
- Local endpoint selection
- Readiness + recovery state
- Local test RPC / fork workflow
- Privacy boundary checks
The frontend retains Nuxt, Vue and Vuex. A shared settings store validates RPC selection, checks chain identity and synchronization, and falls back to the configured entries when a saved selection is outside the allowed set.
Supporting tooling prepares the local frontend and its source archive, applies guarded upstream adaptations and provides local test-environment orchestration. The project separates browser traffic from the local node/proxy boundary.
Decisions and tradeoffs
Normalize URLs before deciding whether an RPC selection is allowed.
The settings helper uses the platform URL parser and explicit scheme and loopback-host sets. Other allowed endpoints must match configured URLs, rather than passing a loose substring test.
Tradeoff The allowed set is intentionally narrower than arbitrary pasted URLs. That makes configuration more deliberate and requires useful feedback when a selection cannot be accepted.
Keep wallet-mode selection consistent with the patched application boundary.
The withdrawal settings component exposes wallet mode and commits that same mode on Save. Reset cannot quietly re-enable an unavailable relayer path.
Tradeoff This adaptation gives up some upstream flexibility. A smaller supported surface is easier to explain and exercise, while any wider mode would need its own implementation and qualification.
Treat source adaptation and network isolation as verifiable tooling work.
The patching and test scripts check expected source shapes, URL boundaries and redaction behavior instead of relying only on a successful frontend bundle.
Tradeoff An upstream change can invalidate a patch assumption. Failing visibly requires maintenance, but is preferable to silently shipping an adaptation whose network behavior has changed.
PLANNING & EXECUTION
From requirements to working behavior
- The work connected endpoint policy to actual settings UI: malformed selections, chain mismatch, synchronization progress and an unavailable RPC have distinct responses. The settings view and shared store participate in the same workflow.
- I also built surrounding local-run, source packaging and regression tooling. This was an unreleased engineering project; the portfolio presents the implementation and design decisions without turning them into a launch claim.
VALIDATION & RECOVERY
How the behavior is checked
- Maintained project scripts address patch drift, privacy boundaries, local serving and harness guards. Their existence identifies the intended test surfaces, rather than establishing a fresh release verdict for this portfolio capture.
- The screenshot was captured from the existing static frontend in a fresh browser context with local RPC responses mocked and other outbound traffic blocked. The wallet remained disconnected; no transaction was executed. It demonstrates the unreleased interface, not protocol correctness or a functioning financial service.
Implementation references
Repository-relative references identify the implementation behind this case study. Selected code excerpts are also available in the portfolio.
- tornado/applications/private-classic-ui/src/store/settings.js: isLoopbackRpcUrl
- tornado/applications/private-classic-ui/src/store/settings.js: checkRpc
- tornado/applications/private-classic-ui/src/components/Settings.vue
- tornado/applications/private-classic-ui/src/components/settings/SettingsModalBox.vue
- tornado/scripts/patch-classic-ui-source.cjs
- tornado/scripts/test-patch-scan.cjs
- tornado/scripts/test-privacy-pins.cjs
- tornado/scripts/test-harness-guards.cjs