OnFinality
New RPC users get 35% off their first monthView the offer
OnFinality Learn
Integration & Development11 min read

Stealth Address: How Private Recipient Addresses Work

Learn what a stealth address is, how stealth-address protocols derive one-time recipient accounts, and how to implement and verify scanning workflows.

TL;DR

A stealth address is a recipient-facing identifier that lets a sender derive a new, one-time blockchain address for each payment without requiring the recipient to publish every address in advance. The recipient uses private scanning and spending material to detect those payments and recover control of the derived account. This article separates Monero-style integrated privacy from EVM stealth-address designs such as ERC-5564, then shows how to inspect the relevant on-chain data through an RPC endpoint. It also covers verification, operational tradeoffs, and the limits of stealth addresses as a privacy technique.

Direct meaning and protocol scope

A stealth address is not simply a second wallet address. It is usually a recipient identifier—often called a stealth meta-address—that allows a sender to derive a fresh destination address for one payment. The recipient can later recognize that destination and derive the corresponding private key, while observers cannot trivially connect it to the recipient's published identifier.

The term describes related designs rather than one universal protocol. Monero generates one-time destination addresses as part of its native transaction system. EVM implementations, including the design specified by ERC-5564, use public keys, an ephemeral sender key, a shared secret, and an announcement or registry mechanism that helps recipients scan for payments.

Stealth addresses primarily hide the recipient relationship. They do not automatically hide the transferred asset, amount, sender, transaction timing, gas payer, or every later action from blockchain observers. Treat the feature as one privacy layer inside a larger wallet and transaction design.

  • Recipient publishes a reusable meta-address rather than a payment address.
  • Sender derives a one-time destination from that information.
  • Recipient scans chain data and reconstructs control of the destination.
  • Observers may still correlate metadata around funding and spending.

Prerequisites and design assumptions

Before implementing a stealth-address flow, define the chain, asset type, wallet model, and threat model. An EVM token transfer, a native coin transfer, and a Monero transaction expose different data and require different scanning logic. Do not treat an ERC-5564-style design as interchangeable with Monero's native privacy model.

You need a wallet or key-management component that can generate ephemeral keys, protect spending and viewing material, and scan blocks or indexed events. You also need an RPC data source capable of retrieving blocks, transaction receipts, logs, and—depending on the protocol—contract code or announcement events. Review RPC endpoint concepts before choosing the access pattern.

For production work, separate documented protocol behavior from application decisions. The protocol may define how keys and announcements are encoded, but your application still chooses scan intervals, persistence, retry policy, reorg handling, encryption, fee sponsorship, and how a recovered payment is displayed to users.

  • A chain-specific protocol specification and test vectors
  • A secure key store for spending, viewing, and ephemeral keys
  • An RPC endpoint with historical access appropriate to the scan range
  • A reorganization policy and durable last-scanned block checkpoint
  • A testnet or local test environment before mainnet deployment

Cryptographic mental model

A common elliptic-curve design gives the recipient two public components: one used for detecting payments and one associated with spending. The recipient publishes an encoded meta-address containing these public values. The sender generates an ephemeral key pair, combines the ephemeral private key with the recipient's public detection key, and obtains a shared secret.

That shared secret is converted into a scalar or key-derivation value. The sender uses it to derive a one-time public key or account address from the recipient's spending public key. The sender also publishes enough ephemeral information for the recipient to reproduce the shared secret. The private recipient wallet performs the same calculation using its private detection key and the sender's ephemeral public key.

The recipient tests candidate announcements or transactions, derives candidate addresses, and checks whether the resulting address received funds. If a match is found, the recipient derives or reconstructs the private key needed to spend. Some designs add a view tag or similar short hint so wallets can reject most non-matching records before performing the more expensive full derivation.

This process is non-interactive: the recipient does not need to approve each payment or issue a fresh address manually. However, non-interactive does not mean invisible. The announcement, transfer, gas payment, token movement, and later consolidation may remain observable depending on the implementation.

Protocol differences across networks

Monero stealth addresses are part of a broader privacy system. A Monero wallet uses a public address with private view and spend keys, and the protocol creates one-time destination addresses for incoming payments. The resulting privacy properties also depend on other Monero mechanisms, wallet scanning behavior, and how view keys are shared.

On EVM networks, a stealth address is generally an ordinary account or contract-compatible destination derived for a specific recipient. The chain can show the destination, asset movement, calldata, logs, and gas activity. ERC-5564 describes a standardized approach for publishing or announcing information that recipients can monitor, but applications still need compatible wallet software, cryptographic libraries, deployment choices, and asset-transfer conventions.

Privacy also changes when a stealth account must pay its own gas. Funding that account from a known wallet can create a visible link. Applications may use a relayer, paymaster, batching strategy, or delayed consolidation, but each introduces additional trust, cost, and metadata considerations. Compare these choices with your application's requirements rather than assuming that a stealth destination alone provides end-to-end anonymity.

  • Monero: native protocol privacy with wallet-level view and spend-key separation
  • EVM: application-level derivation, announcements, scanning, and transaction management
  • Cross-chain deployments: separate addresses, cryptographic assumptions, and indexing rules
  • Privacy outcome: determined by the complete transaction lifecycle, not only address generation

RPC inspection and announcement retrieval

An RPC node does not perform the wallet's private-key derivation for you. It supplies public chain data that the scanner evaluates locally. For an EVM implementation, begin by retrieving logs over a bounded block range. Replace the placeholders with the network RPC URL, the announcement contract, and the topic filters defined by the protocol or application. Do not put private keys in an RPC request.

The following request is a reproducible starting point for inspecting logs. A broad query may return too much data; a production scanner should use the protocol's event topic, a bounded range, pagination where needed, and durable checkpoints. Consult OnFinality API Service for request and access configuration.

curl -sS "$RPC_URL" \
  -H 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","id":1,"method":"eth_getLogs","params":[{"fromBlock":"0xSTART_BLOCK","toBlock":"0xEND_BLOCK","address":"ANNOUNCEMENT_CONTRACT","topics":[["ANNOUNCEMENT_EVENT_TOPIC"]]}]}'

Minimal scanner workflow

A scanner should treat chain data as an append-only stream that can be reorganized. Store the last examined block, the block hash, and the announcement or transaction identifiers you have processed. On restart, rescan an overlap window instead of assuming that the previous tip is final. Deduplicate records by a stable event identity such as transaction hash plus log index, while retaining enough information to replace data from an orphaned block.

The example below retrieves logs and leaves cryptographic matching as an explicit application function. That separation is deliberate: key encoding, curve choice, view-tag handling, address derivation, and event parsing must follow the selected protocol specification and audited library. Never substitute a hash of concatenated strings for the protocol's required elliptic-curve operation.

const RPC_URL = process.env.RPC_URL;
const CONTRACT = process.env.ANNOUNCEMENT_CONTRACT;
const EVENT_TOPIC = process.env.ANNOUNCEMENT_EVENT_TOPIC;
const fromBlock = process.env.FROM_BLOCK || "0x0";
const toBlock = process.env.TO_BLOCK || "latest";

if (!RPC_URL || !CONTRACT || !EVENT_TOPIC) {
  throw new Error("Set RPC_URL, ANNOUNCEMENT_CONTRACT, and ANNOUNCEMENT_EVENT_TOPIC");
}

async function rpc(method, params) {
  const response = await fetch(RPC_URL, {
    method: "POST",
    headers: { "content-type": "application/json" },
    body: JSON.stringify({ jsonrpc: "2.0", id: 1, method, params })
  });
  const body = await response.json();
  if (body.error) throw new Error(JSON.stringify(body.error));
  return body.result;
}

const logs = await rpc("eth_getLogs", [{
  address: CONTRACT,
  fromBlock,
  toBlock,
  topics: [[EVENT_TOPIC]]
}]);

console.log(`Retrieved ${logs.length} candidate announcements`);
for (const log of logs) {
  console.log({ blockNumber: log.blockNumber, transactionHash: log.transactionHash, data: log.data, topics: log.topics });
}

// Pass each decoded record to an audited, protocol-specific matcher.
// The matcher should use the recipient's private viewing material locally.

Verification and measurement procedure

Test caseProcedureExpected verificationMeasured result
Address derivationRepeat the sender derivation with the same test vectorDeterministic output matching the protocol vectorRecord pass/fail and vector identifier
Payment discoverySend a test asset to a derived destinationRecipient scanner finds exactly one matching paymentRecord discovery block and elapsed time
Rescan safetyScan the same range twiceNo duplicate credited balance or duplicate database recordRecord duplicate count
Restart recoveryStop and restart after checkpointingScanner resumes from the overlap windowRecord recovered event count
RPC completenessCompare overlapping range queries or independent sourcesMatching logs after decoding and deduplicationRecord discrepancies
Reorganization handlingTest on a controlled reorg-capable environmentOrphaned records are removed or marked non-canonicalRecord recovery behavior

python3 - <<'PY'
import json, os, time, urllib.request

rpc_url = os.environ["RPC_URL"]
request = {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "eth_blockNumber",
    "params": []
}
body = json.dumps(request).encode()
start = time.perf_counter()
with urllib.request.urlopen(
    urllib.request.Request(rpc_url, data=body, headers={"content-type": "application/json"}),
    timeout=20,
) as response:
    result = json.load(response)
elapsed_ms = (time.perf_counter() - start) * 1000
if "error" in result:
    raise RuntimeError(result["error"])
print({"blockNumber": result["result"], "elapsedMs": round(elapsed_ms, 2)})
PY

Operational troubleshooting

If a payment is not discovered, first verify that the sender used the intended protocol, curve, key encoding, chain identifier, and announcement mechanism. Decode the raw transaction and logs independently of the wallet UI. Confirm that the scanner searched the block range containing the transaction and that its event filter did not exclude the relevant contract or topic.

If the scanner finds a payment but cannot spend it, check whether the derived private key was calculated from the correct private viewing and spending components. Confirm address normalization, compressed versus uncompressed public-key handling, scalar arithmetic, and token-specific transfer semantics. A matching destination does not prove that the wallet has correctly reconstructed the spending key.

If results differ between scans, inspect reorgs, pagination boundaries, provider timeouts, and rate limits. Keep block hashes with checkpoints, retry transient failures with backoff, and rescan a safety window. For large historical scans, use an indexing strategy or an appropriate dedicated node rather than issuing unbounded requests from a user-facing process.

If RPC access is the bottleneck, compare request duration and error rate using the same block ranges and payloads. The RPC pricing page can help you evaluate access options, while network documentation helps confirm chain-specific availability and assumptions. Concrete endpoint selection belongs in the RPC integration layer, not in the cryptographic derivation code.

  • No event returned: check contract address, topic encoding, block range, and chain.
  • Event returned but no match: check private viewing material and protocol decoding.
  • Match found but no spend: check derived private key and asset transfer rules.
  • Intermittent discovery: check reorgs, pagination, rate limits, and checkpoints.
  • Unexpected privacy leak: inspect funding, gas, timing, consolidation, and metadata.

Privacy limitations and engineering tradeoffs

Stealth addresses reduce address reuse and make recipient attribution harder, but they are not a guarantee of anonymity. A recipient can be identified through an exchange deposit, an ENS name, social disclosure, IP or application telemetry, a distinctive payment amount, or a later transaction that links the derived account to a known wallet.

Scanning also has a privacy cost. A remote RPC provider can observe queried ranges, timing, and possibly application-specific access patterns. Mitigate this with local scanning where appropriate, request minimization, encrypted key storage, controlled telemetry, and a clear data-retention policy. Do not upload private viewing keys to an indexing service unless the trust and disclosure model explicitly permits it.

There are usability and cost tradeoffs. Users may need specialized wallets, recipients may need to scan more data, derived accounts may require gas funding, and recovery becomes more complex when keys are split between viewing and spending roles. Relayers and paymasters can improve usability but add dependencies and may reveal metadata.

Finally, protocol security is not the same as implementation security. Use audited cryptographic libraries, test vectors, strict input validation, and independent review. Avoid custom elliptic-curve code, ad hoc key derivation, or assuming that a contract announcement is authentic merely because it appears in a valid block.

Production rollout and next steps

Start with a written threat model and a single supported chain. Implement deterministic test vectors, local key derivation, bounded scanning, checkpoint recovery, and reorg handling before adding multiple assets or networks. Keep private spending material offline from the RPC process whenever the wallet architecture allows it.

Next, test the complete lifecycle: publish a meta-address, derive a destination, send an asset, scan and recover it, fund any required gas, spend or consolidate it, and restore the wallet from backup. Document which observations remain public at every step. This produces a more useful privacy assessment than checking only whether two addresses look different.

For infrastructure planning, use OnFinality API Service for the access model, RPC endpoint guidance for request design, and the best RPC provider for Web3 projects guide for the provider-selection layer. Keep that layer replaceable so cryptographic correctness does not depend on one endpoint.

  • Choose one protocol and implement its specification exactly.
  • Use test vectors and a controlled testnet before mainnet funds.
  • Persist checkpoints, block hashes, decoded events, and scan outcomes.
  • Measure latency, completeness, retries, and recovery with your own workload.
  • Review privacy leakage across funding, scanning, spending, and application telemetry.

Never Worry about Infrastructure Again

OnFinality takes away the heavy lifting of DevOps so you can build smarter and faster.

Get Started