Overview
OpenFX uses Ed25519 asymmetric key pairs for request signing. You generate a key pair locally, register the public key with OpenFX, and keep the private key securely in your infrastructure. The server never sees your private key. This guide covers the full lifecycle of your signing keys: generation, registration, secure storage, rotation, and revocation.Generating Ed25519 Key Pairs
Ed25519 is a modern elliptic-curve signature scheme that produces compact 64-byte signatures with excellent performance. Key pairs consist of:- Private key (32-byte seed) — kept secret in your infrastructure
- Public key (32 bytes) — registered with OpenFX
openfx_ed25519.pem (PRIVATE -- never share)
openfx_ed25519_pub.pem (register with OpenFX)
Registering Your Public Key
After generating your key pair, register the public key with OpenFX so the server can verify your request signatures.Via the Dashboard
- Log in to the OpenFX Dashboard.
- Navigate to Settings > API Keys.
- Click Create API Key.
- Enter a descriptive label (e.g.,
production-payments-service). - Select the role: read or write.
- Paste your public key PEM content into the Public Key field.
- Click Create.
- Copy the generated API key (prefixed
ofx_sk_sandbox_orofx_sk_live_). This is shown only once.
Via Onboarding
If your OpenFX account is provisioned through a partner program, your account manager will provide instructions for submitting your public key during the onboarding process.Each API key is bound to exactly one public key. To use a different key pair, create
a new API key with the new public key and revoke the old one.
Storing Private Keys Securely
Your Ed25519 private key is the most sensitive credential in your OpenFX integration. Choose a storage solution appropriate for your security requirements.Recommended: Hardware Security Module (HSM) or Cloud KMS
For production workloads handling significant payment volumes, store your private key in a hardware-backed key store:| Provider | Service | Ed25519 Support |
|---|---|---|
| AWS | CloudHSM or KMS | Ed25519 supported via CloudHSM; KMS supports Ed25519 signing keys |
| Google Cloud | Cloud KMS | Ed25519 supported for asymmetric signing |
| Azure | Key Vault (Managed HSM) | Ed25519 supported in Premium/Managed HSM tiers |
| HashiCorp | Vault Transit Secrets Engine | Ed25519 supported natively |
Acceptable: Environment Variables or Secrets Manager
For smaller deployments, inject the private key via environment variables or a secrets manager at runtime:Never Do This
Key Rotation
Rotating your signing key pair regularly is a security best practice. OpenFX supports seamless key rotation with zero-downtime transition.Rotation Process
Step-by-Step
1. Generate a new key pair. Follow the generation instructions above to create a fresh Ed25519 key pair. 2. Register the new public key. Create a new API key in the OpenFX Dashboard with the new public key. You will now have two active API keys temporarily. 3. Update your services. Deploy your application with the new API key and private key. If you have multiple services, roll out the update progressively. 4. Verify in production. Confirm that requests signed with the new key pair succeed. Monitor forauthentication_error responses during the transition.
5. Revoke the old API key. Once all traffic is using the new credentials, revoke the
old API key in the Dashboard. Requests signed with the old key will immediately start
returning 401.
6. Delete the old private key. Remove the old private key from all secrets stores,
environment variables, and backups.
During the transition window (steps 2-5), both key pairs are valid simultaneously.
This allows rolling deployments without authentication failures. Keep this window as
short as operationally practical.
Rotation Frequency
| Risk Level | Recommended Frequency |
|---|---|
| Standard | Every 90 days |
| High-value (> $1M daily volume) | Every 30 days |
| After personnel change | Immediately |
| After suspected compromise | Immediately |
Multiple API Keys for Different Environments
Maintain separate credentials for each environment and each service that connects to the OpenFX API.| Environment | Key Prefix | Use |
|---|---|---|
| Sandbox | ofx_sk_sandbox_ | Development, testing, CI/CD |
| Production | ofx_sk_live_ | Live payment operations |
Per-Service Key Separation
If your architecture has multiple services that call the OpenFX API, issue each service its own API key and key pair:- Least privilege — each service has only the permissions it needs
- Audit isolation — API activity is attributable to a specific service
- Blast radius reduction — revoking one compromised key does not affect other services
- Independent rotation — each service can rotate on its own schedule
Best Practices Summary
Follow these practices for production-grade key management:
- Generate unique key pairs per environment. Never share keys between sandbox and production.
- Use the minimum required role. Read-only services should use read-only keys.
- Issue separate keys per service. Do not share a single API key across multiple applications.
- Store private keys in HSM or KMS for production payment workloads.
- Rotate keys on a regular schedule (at least every 90 days).
- Revoke immediately when team members with key access depart or when compromise is suspected.
- Monitor authentication failures. A spike in
authentication_errorresponses may indicate misconfiguration or attempted abuse. - Keep an inventory. Maintain a record of which API keys are active, which services use them, and when they were last rotated.
Emergency Revocation
If you suspect a private key has been compromised, revoke the associated API key immediately.Immediate Steps
- Revoke the API key in the OpenFX Dashboard under Settings > API Keys. Click the key and select Revoke. This takes effect instantly.
- Contact OpenFX support at api-support@openfx.com or call the emergency support line. Inform them of the suspected compromise so they can audit recent activity on your account.
- Generate a new key pair and register the new public key.
- Deploy the new credentials to your services.
- Review recent API activity in the Dashboard to identify any unauthorized requests made with the compromised key. Check for unexpected payments, counterparty creations, or webhook subscription changes.
What OpenFX Does During Compromise Response
When notified of a potential key compromise, the OpenFX security team will:- Audit all requests made with the affected API key in the past 30 days
- Flag any suspicious payment or configuration changes for manual review
- Place temporary holds on pending payments if instructed by you
- Provide a detailed activity log for your incident response
Related
- Authentication Overview — Why OpenFX uses three-part authentication
- Request Signing — Step-by-step signing guide with code examples
- Environments — Sandbox vs production details