API Private Key Security Is Just the First Step: How Can Institutions Prevent Digital Asset Operational Risks?
Author: Cactus Custody
Recently, the decentralized trading platform Lighter experienced a security incident involving API signatures, once again drawing industry attention to private key protection and API security management. According to public reports, the unofficial signing code used by some accounts had an issue of repeated nonce usage in signatures, allowing attackers to derive the API private keys of the affected accounts and use these keys to transfer funds. Lighter stated that its protocol, smart contracts, and official SDK were all unaffected.
(Reference source: https://x.com/Lighter_xyz/status/2122394446343946717)
As digital asset trading and institutional businesses increasingly rely on API interfaces, security risks may not only originate from underlying protocols and smart contracts, but may also emerge in signing code, account permissions, and daily operational workflows. For institutions, how to establish a multi-layered protection mechanism covering identity verification, fund management, and incident response is becoming a critical topic in digital asset risk management.

Private Key Protection Is the Foundation, but Security Cannot Rely on a Single Line of Defense
APIs are a critical interface connecting institutional internal systems with digital asset platforms, helping institutions complete asset queries, trading, and fund transfers. An API private key can be understood as a key that controls account operations, while digital signatures are used to verify operation identity and ensure requests come from authorized users. If a private key is leaked, attackers may impersonate legitimate users to initiate operations.
Therefore, private key protection is always the foundation of API security, but relying on private keys alone is not enough to address all risks. For institutional digital asset custody, multiple mechanisms such as access permissions, fund transfer rules, transaction approvals, and incident handling are also needed to reduce the impact that may result when a single point fails.
In Cactus Custody's view, API security is more like a series of progressive lines of defense: key protection addresses "who is operating," permission management determines "what can be done," fund rules limit "where money can go," and emergency mechanisms answer "what to do when something goes wrong." Any single layer can fail, but only by stacking multiple layers can a single point of failure be prevented from escalating into fund losses. Below, drawing on practical experience in institutional custody, we break this down layer by layer.

Layer One: Protect Private Keys and Standardize API Signature Management
Private keys are the core of API authentication, and once leaked, they can pose serious fund security risks. Institutions should prioritize using verified standard cryptographic libraries or official platform tools, avoiding writing their own signing algorithms or using third-party code of unknown origin. At the same time, private keys should be stored encrypted and should not appear in code repositories, chat tools, or shared files.
Cactus Custody recommends that institutions, when choosing integration methods, prioritize platforms that adopt industry-standard signature specifications (such as SHA256withECDSA), so that mature open-source cryptographic libraries can be used directly without having to implement signing algorithms themselves. For SDKs or toolkits provided by platforms, the officially published file checksums should be verified to confirm the files have not been tampered with. Key pairs should preferably be generated by the institution itself, submitting only the public key to the platform, with the private key always remaining within the institution's own control.
In addition, signatures should cover key content such as the request method, address, parameters, timestamp, and request identifier, ensuring that a request cannot pass verification once tampered with. It is particularly worth noting that this incident exposed a detail that is easily overlooked: unique API request IDs do not mean that the random numbers used internally by the signing algorithm are equally safe. Even when a standard algorithm is adopted, implementation flaws can still allow private keys to be reverse-derived. Therefore, "using thoroughly verified signing tools" is far more important than "writing a piece of signing code that works."
Layer Two: Restrict Access Permissions and Prevent Keys from Becoming "Master Keys"
Protecting API keys is only the first step. Institutions also need to clarify who can use keys, what operations can be performed, and from what locations requests can be initiated. If account permissions are overly concentrated, the risk may expand further once an account is attacked. Therefore, rationally allocating permissions and restricting access entry points are important elements of institutional API security management.
From practical experience, Cactus Custody believes institutions should prioritize three measures: first, set IP whitelists for APIs, allowing only designated servers to initiate calls; second, bind API keys to specific personnel accounts, inherit their role permissions, and configure them separately by business line to avoid one key being used across all businesses; third, adhere to separation of duties, with transfer initiation and approval handled by different roles, so that no one person can both submit and approve the same fund transfer.
For sensitive operations such as fund approvals, hardware keys like UKey or strong authentication methods like Passkey are harder to impersonate than SMS or simple one-time passwords. Another point worth noting is the "security settings change period": when a person has just reset two-factor authentication, the account is in a relatively vulnerable phase. Temporarily restricting their withdrawal and approval permissions during this time window (e.g., 24 hours) is a low-cost but effective protection approach.
Layer Three: Set Fund Rules to Reduce Abnormal Transfer Risks
For institutional digital asset management, verifying operator identity alone is not enough. It is also necessary to clarify in advance where funds can be transferred, how much can be transferred per transaction, and which transactions must undergo additional approval. Withdrawal address whitelists, transfer limits, and multi-level approvals are all important measures for reducing the risk of abnormal fund transfers.
Cactus Custody recommends that institutions design fund rules as a "final gate": enable withdrawal address whitelists so that funds can only flow to pre-authorized addresses; set cumulative outflow limits by day, week, and month, and set per-transaction caps for different assets and blockchain networks. In this way, even if identity or permission defenses are breached, the funds that may be transferred out will be limited to a controllable range.
The approval mechanism should also be linked to transaction amounts: small transactions can have simplified processes, while large transactions should require higher approval levels and more approvers; withdrawals initiated via API can also include manual review depending on risk conditions. In addition, before transactions are broadcast on-chain, using on-chain analysis tools to screen receiving addresses for risk can identify and block high-risk addresses before funds leave. After all, once a transaction is on-chain, funds are often very difficult to recover.
However, from experience serving institutional clients, whether security mechanisms can fully function depends not only on what features the platform provides, but also closely on how institutions configure and use these features. For example, settings such as allowing reviewers to approve their own submitted orders, automatically approving when asset prices cannot be determined, and exempting some internal transfers from approval may all affect the scope of security controls. Institutions should regularly review these configurations to assess whether they still meet current business needs and risk management requirements.
Layer Four: Establish an Emergency Response Mechanism to Control Risks Promptly
No security system can guarantee that risks will never occur. Therefore, in addition to preventive measures, institutions also need to clarify in advance the response procedures after an incident occurs, ensuring that measures can be taken promptly to control the scope of impact as much as possible.
For example, when an API key is suspected of being leaked or abnormal account operations are detected, institutions should be able to immediately freeze the relevant accounts, disable API keys, and adjust access permissions as appropriate. Cactus Custody believes that this kind of "emergency stop" capability should be configured and drilled in normal times, rather than figuring out the operational path only when an incident occurs. The value of emergency response often depends on the earliest period after an anomaly is detected.
In contrast to rapid freezing, modifying critical security rules should "slow down." Once settings such as withdrawal whitelists, approval workflows, and user management are maliciously modified, the preceding lines of defense may all become ineffective. Therefore, such operations are suitable for introducing multi-party confirmation mechanisms, for example requiring multiple administrators to vote approval via hardware keys before taking effect, preventing any single administrator from changing rules alone.
In addition, complete operation logs covering login, order placement, approval, and rule changes are both the basis for daily review and the key to post-incident tracing. "Freeze quickly during anomalies, approve strictly when changing rules"—this combination of fast and slow is precisely the core approach to balancing response efficiency and operational security.
Start with Daily Management and Continuously Improve API Security Protection
API security is not a one-time technical configuration but a management process requiring continuous maintenance. For institutions already using APIs for digital asset business, the following aspects can be checked regularly:
1. Key and signature security: Are verified standard cryptographic libraries or official tools being used? Are private keys stored encrypted, and has the signing code been fully tested after changes?
2. Access and permission control: Are API IP whitelists configured? Are permissions assigned to different personnel according to their actual responsibilities, avoiding excessive concentration of permissions?
3. Fund transfer management: Are withdrawal address whitelists, applicable outflow limits, and necessary approval mechanisms enabled?
4. Critical configuration checks: Are settings that may loosen controls—such as self-approval, automatic approval, and approval exemptions—regularly assessed? Do critical rule changes require additional authorization?
5. Incident response and log management: Are account freezing, key replacement, and incident handling procedures clearly defined? Are operation records and abnormal requests regularly reviewed?
For institutions, private key protection remains the top priority of API security, while mechanisms such as permission management, fund controls, and emergency response can further reduce risks, narrow the potential scope of impact, and buy time for anomaly detection and handling. As digital assets gradually integrate into institutional financial services, API security is no longer just a concern for technical teams but an important part of overall institutional risk management. Whether institutional clients, technology service providers, or custody platforms, all need to continuously improve technical measures and daily management processes to jointly raise the industry's security level.
About Cactus Custody
Cactus Custody is the institutional-grade digital asset custody business under BIT Group, providing digital asset custody and management services to funds, family offices, and other institutional clients. Cactus Custody adopts a layered hot and cold wallet security architecture, hardware security modules (HSM), and multiple risk control mechanisms, committed to providing institutional clients with secure and reliable digital asset infrastructure.
Website: www.mycactus.com
Risk disclaimer: This article is intended solely for sharing industry security knowledge and does not constitute an evaluation of any third-party security incident, nor a guarantee of asset safety. The views expressed herein are for reference only, and institutions should formulate specific security measures based on their own business and risk conditions.




