Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Non-Custodial Design

ETHPayServer never holds a spending key. This isn’t a policy — it’s enforced in code.

How it’s enforced

  • Merchants configure a wallet with an extended public key (xpub), not a private key. validate_xpub checks the base58 version-byte prefix and refuses an extended private key (xprv) outright — a merchant cannot hand over a spending key even by pasting the wrong line.
  • Payment addresses are derived from that xpub. The server can compute as many receive addresses as it needs, but derivation from a public key cannot produce a private key for any of them.
  • The payment monitor only ever watches addresses for incoming transfers. It has no code path that constructs a transaction, signs one, or broadcasts one in the shipped build.
  • The xpub itself is encrypted at rest (envelope encryption, pluggable key provider — a plain secret for a single-VPS deployment, or AWS KMS), not stored in plaintext.

What this means for refunds

Because the server never holds a spending key, it genuinely cannot issue a refund on a merchant’s behalf — there’s no key to sign one with. The refund API endpoint exists and is permanently disabled (501 Not Implemented) rather than removed, so integrations get a clear, documented answer instead of a 404. Refunding a customer is the merchant’s own responsibility, from their own wallet.

Other security measures

  • Address validation (checksum verification) before anything is registered for watching.
  • Whitelisted token contracts only — ERC20 addresses are checked against the issuer’s or chain operator’s own published list, not discovered from arbitrary input.
  • Confirmation requirements per chain, with reorg detection that re-validates a payment rather than assuming a transaction that disappeared from one block is gone for good.
  • Webhook payloads are signed with HMAC-SHA256 — see Webhooks.
  • API keys are scoped to exactly the permissions granted at creation — see API Keys & Permissions.

Reporting a vulnerability

This is a public, open-source repository. Please do not open a public issue for an unfixed vulnerability. See the repository’s own security policy for how to report one privately.