Security recommendations
- Call Coinfira only from a trusted backend, never directly from a browser.
- Store secrets in a secret manager or encrypted deployment environment.
- Never write API secrets, canonical strings containing sensitive payloads, or full authentication headers to logs.
- Use a narrow IP allowlist when stable egress addresses are available.
- Synchronize server time with NTP; signed requests allow only five minutes of drift.
- Validate all TRON addresses and business limits before submitting an order.
- Use a unique, persisted
client_order_idfor each logical purchase. - Apply retry backoff to network and
5xxfailures. - Verify webhooks against the exact raw body before parsing JSON.
- Compare HMAC values in constant time.
- Deduplicate webhooks by
event_idbefore executing business actions. - Keep old secrets available during key rotation until older orders are terminal.
- Return
2xxonly after a webhook is durably recorded.
Coinfira API credentials authorize billable energy orders. Treat them with the same care as payment credentials.