An open RPC endpoint is a free public server for strangers. Expose it deliberately, not
by accident.
The risks of an open endpoint
- Query floods that exhaust your machine and bandwidth
- Privacy leakage, because anyone who knows the endpoint can query the addresses you care
about if it serves your wallet data
- Abuse as a free API for other projects, with no compensation
- Denial of service during busy network periods, when your node is already at capacity
Isolate the node from everything else
Run the node on its own machine or container. If an application compromises the client, it
should not reach your keys or your other services.
Keep the node user account separate, with minimal permissions, and do not run applications
as the same user.
Put a proxy in front
Never expose the node port directly.
- Use a reverse proxy that terminates TLS, so traffic is encrypted
- Rate limit per client, with limits high enough for your apps and low enough to blunt abuse
- Require authentication: an API key, or a token in a header
- Restrict by IP allowlist where your clients have stable addresses
- Log requests, so you can see who is hammering you
Restrict what is exposed
Some nodes let you enable or disable specific methods. Disable the expensive or
administrative ones if your applications do not need them.
If your node supports separate ports or interfaces, bind the public listener to a narrow
scope and keep the internal one private.
Monitor and cap
- Watch memory, disk and connection counts
- Set alerts before your node becomes unresponsive
- Have a fallback: a secondary provider you can point applications at during an outage
The privacy point
If your node also serves your personal wallet, do not expose it publicly. Run a second
node for applications, or route application queries separately.
The takeaway
Proxy, authenticate, rate limit, isolate, and monitor.
A node exposed without those five things is not infrastructure. It is a free public service
you are paying for.