Are Public RPC Endpoints Safe? The Risks of Free Endpoints From AI Coding Tools

Updated November 5, 2026 · Spectrum Nodes
Short answer: For a test or a weekend project, usually. For an app that holds anyone's money, no. A public RPC endpoint is a server run by an operator you haven't vetted, with no contract and no service level. It sees every address your app looks up and every transaction it sends, and when your frontend calls it from the browser, your users' IP addresses too. It can also return stale data or refuse your transactions, and you'd have no way to tell. AI coding tools often paste these endpoints into generated code because they need no signup. Before you ship, swap them for an endpoint you control, from a provider that can show you an audit.
Would You Take a Pill You Found on the Street?
You have a headache and there's a pill on the pavement. It's probably paracetamol. You still wouldn't take it, because you can't tell who left it there or what's in it.
A public RPC endpoint is the same bet. It probably works. But you don't know who runs the server, what it records, or whether the data it sends back is correct. Most days nothing goes wrong. When something does, it's your app and your users' funds on the line.
Why Do AI Coding Tools Suggest Public RPC Endpoints?
Because they work on the first run. A public endpoint needs no account, so code an assistant writes runs the moment you paste it. Ask for a script that reads a balance or sends a transaction and you'll often get a hardcoded public URL, sometimes a list of them with code that rotates to the next one when a call fails.
That's fine for a demo. The trouble starts when the demo becomes the product and nobody goes back to change the URL.
There's a second risk: language models make things up. A study presented at USENIX Security 2025 looked at 576,000 code samples from 16 models and found they recommended software packages that don't exist: at least 5.2% of packages from commercial models and 21.7% from open source models, 205,474 made up names in all (source). An attacker can register one of those names and fill it with malware, a trick security researchers call slopsquatting.
The study covered packages, not RPC URLs. The logic carries over, though. If a model suggests a hostname that has expired or never existed, whoever registers it receives your app's traffic. Check every endpoint URL a tool gives you before it reaches production.
What Can a Public RPC Endpoint See?
Everything your app asks it, tied to where the request came from.
- Addresses. Every balance, token, and history lookup tells the operator which wallets your app cares about.
- Transactions. A signed transaction reaches the endpoint before it reaches the chain, so the operator sees it before anyone else does.
- IP addresses. Calls from a backend reveal your servers. Calls from a browser app or a wallet reveal each user's IP address next to their wallet address.
ethereum.org says it directly: "When sending transactions using public nodes, personal information can be leaked to these third-party services," including your IP address and the Ethereum addresses you own (source).
What it never sees is your private key. Signing happens in the wallet or on your backend, and the endpoint only receives the signed result, unless your code sends the key somewhere it shouldn't.
What Can Go Wrong With a Public RPC Endpoint?
Five things:
| Risk | What happens | Who notices |
|---|---|---|
| Rate limits | Shared capacity runs out at busy moments and calls fail with HTTP 429 | Your users, first |
| Stale data | The node falls behind the chain and returns old blocks or balances | Nobody, until the numbers don't add up |
| Inconsistent nodes | Rotated endpoints sit at different block heights, so one call sees a block the next can't find | You, as flaky bugs |
| Refused transactions | The operator drops or delays what you send | Your users, as stuck transactions |
| False answers | A hostile operator returns wrong balances, receipts, or contract reads | Possibly nobody |
Rate limits and stale data are the everyday problems. A public endpoint is shared by everyone who finds it, so its limits are strict. Base's own docs say its public RPC is "not suitable for production apps", and when we tested it, it refused traces and answered eth_getLogs with "request limit reached". Full results: Can You Use the Base Public RPC in Production?
Rotation looks like a fix and adds a problem. Each endpoint on the list is another operator you now trust, and one bad one in five is enough. The nodes behind them also sit at different heights: read the latest block number from one, ask the next for that block's logs, and you can get an empty result for a block that exists.
Refused transactions and false answers are rarer and worse. ethereum.org warns that "a 3rd-party node could choose to refuse transactions from specific IP addresses", and that with your own node "you don't need to trust information about the state of the network provided by a third party." An app that reads a balance and acts on it can't check the number unless it verifies the data itself.
When Is a Public RPC Endpoint Fine?
When nothing valuable depends on it:
- Following a tutorial or a hackathon starter
- Reading a block number to check that your code runs
- Testnet work with test tokens
- One off scripts you run yourself and throw away
If your code holds keys, moves funds, shows balances to customers, or runs unattended, it's past that line.
What Should a Team Use Instead of a Public Endpoint?
An endpoint that's yours, from an operator you can check.
| Public endpoint | Your own Spectrum endpoint | |
|---|---|---|
| Who runs the server | Unknown, with no contract | Spectrum Nodes, on hardware we own in Tier III data centers in the US and Europe, plus a bare metal deployment in Singapore |
| Audit | None you can see | SOC 2 Type II attested, and we have never had a breach |
| Who can call it | Anyone who finds the URL | Only your servers' IP addresses and your app's domains, once you set the IP allowlist and CORS list in the dashboard |
| Capacity | Shared with everyone | Your plan: 25 requests per second free, 50 from $1.99 a month, up to 350 on Enterprise, custom above |
| Uptime | No commitment | Over a billion requests a day at 99.99% uptime across our platform |
Spectrum plans from spectrumnodes.com/pricing, checked November 3, 2026.
Our free plan includes 10M credits a month at 25 requests per second, so moving off a public endpoint costs nothing to try.
How Do You Get Public Endpoints Out of Your Code?
Four steps, about ten minutes.
1. Find Them
Search your code and config for RPC URLs:
grep -rnE "https?://[^\"' ]*rpc" src/ scripts/ config/ .env.example
Check .env.example files and default configs too. Generated code often puts a fallback URL there.
2. Move the URL Into Your Environment
// before const client = createPublicClient({ chain: mainnet, transport: http('https://some-public-rpc.example') }) // after const client = createPublicClient({ chain: mainnet, transport: http(process.env.RPC_URL) })
3. Check the Chain on Startup
One call catches a wrong or swapped URL before your app does any work:
import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(process.env.RPC_URL) }) const id = await client.getChainId() if (id !== mainnet.id) throw new Error(`RPC_URL serves chain ${id}, expected ${mainnet.id}`)
4. Tell Your AI Assistant
Add one rule to the instructions file your coding assistant reads, such as an AGENTS.md or your tool's rules file:
Never hardcode RPC URLs or use public RPC endpoints. Read the endpoint from the RPC_URL environment variable.
The next script it writes uses your endpoint instead of a stranger's.
FAQ
Can a Public RPC Endpoint Steal My Private Key?
Not on its own. An RPC endpoint receives signed transactions, never the key that signed them, unless your code sends the key somewhere it shouldn't. The risks are what it sees, what it returns, and what it chooses to forward.
Is a Public RPC Endpoint Safe for Testnets?
Usually. Testnet tokens have no value, so the main costs are rate limits and flaky results.
What's the Difference Between a Public and a Private RPC Endpoint?
A public endpoint is open to anyone, with no account. A private endpoint is issued to you, counts usage against your plan and, on Spectrum, can be limited to your own servers and domains.
Why Does My AI Assistant Keep Using Public RPC Endpoints?
Because they need no signup, so its code runs on the first try. Give it an environment variable and a rule, as in step 4 above.
Is a Free RPC Plan the Same as a Public Endpoint?
No. A free plan from a provider gives you your own endpoint with an account behind it. On Spectrum, the free plan includes 10M credits a month at 25 requests per second.
Start With Your Own Endpoint
Create a free account and swap the URL today: https://dashboard.spectrumnodes.com/auth/signup
Running production traffic for a team? Book a call with our engineers: https://calendly.com/spectrumnodes-sales/30min
