Cointime

Download App
iOS & Android

Key Management for Autonomous AI Agents with Crypto Wallets

Cointime Official

From ethresearch by jieyilong

Autonomous AI Agents equipped with crypto wallets are attracting growing attention due to their capability to interact directly with blockchains and smart contracts. These agents can perform a variety of tasks, including sending and receiving tokens, calling smart contracts, and even writing and deploying smart contracts on-chain. Unlike traditional systems, these autonomous AI agents are proactive, capable of making independent decisions without direct human intervention. An example is an autonomous crypto trading agent which leverages sophisticated deep learning algorithms to execute trades by interacting with on-chain DEXes. In this scenario, a user might provide the agent with an initial fund and delegate trading decisions entirely to the agent, aiming for long-term profitability. This hands-off approach, powered by the agent’s ability to analyze market trends and execute trades autonomously, exemplifies the transformative potential of combining AI and crypto in decentralized finance (DeFi) and beyond.

To enable these promising capabilities, an AI Agent needs to possess a private key to initiate blockchain transactions. If the agent runs in a local device, such as a smartphone or a laptop, managing the private key becomes relatively straightforward. However, AI Agents often require substantial computational resources — for example, to run advanced large language models (LLMs) — making this simple design impractical for many use cases. To help address this challenge, below we informally define the problem:

Problem definition: A user seeks to deploy an autonomous AI Agent that proactively acts on their behalf. The user provides the Agent with a private key which enables direct or indirect access to valuable on-chain crypto assets. Due to the significant computational demands of the Agent — such as running advanced deep learning models or performing resource-intensive tasks — it may need to operate in a potentially adversarial environment, such as a remote server. The challenge is to design a system such that, even in the event of a server compromise, the crypto assets accessible through the private key remain secure.

Below we sketch a few possible approaches to tackle to the above problem:

  1. TEE based: The first approach involves the user securely storing the Agent’s private key within a Trusted Execution Environment (TEE) and executing the entire AI Agent code inside the TEE. Provided the TEE remains uncompromised, adversaries would be unable to either alter the Agent’s code or extract the private key. However, while TEEs are designed to be secure, they could still be susceptible to sophisticated attacks targeting specific vulnerabilities in their implementation. Additionally, the use of TEEs may introduce performance overhead, as running code within the protected environment can be slower compared to execution outside of it.
  2. iO based: Indistinguishable Obfuscation is a powerful cryptographic tool. As Vitalik discussed in this article, one direct application of iO is to hide the private key in the AI Agent code. The primary advantage of iO lies in its ability to ensure that, even if the key is included in the obfuscated code, adversaries should be unable to extract it, even when the code is executed on a remote server. However, iO is still in a nascent stage, both in terms of theoretical development and practical implementation. Current constructions of iO are highly resource-intensive, requiring significant computational overhead and large memory footprints, making them impractical for many real-world applications.
  3. MPC based: A more practical approach is to leverage cryptographic tools such as multi-party computation (MPC) and threshold signature scheme (TSS). In this setup, multiple instances of the AI Agent code are run in parallel across several worker nodes. In this setup, we run multiple instances of the AI Agent code in parallel with multiple worker nodes. The user splits the private key into multiple shares, and securely sends each share to a different worker node, ensuring that no single node possesses the entire key. To interact with the blockchain, the worker nodes execute a consensus algorithm to propose and agree on specific actions. Once consensus is achieved for a particular transaction, the nodes collaboratively execute an MPC-based threshold signature protocol to jointly sign the transaction. Crucially, this process allows the signature to be generated without reconstructing the private key in its entirety. This ensures that even if an adversary compromises some worker nodes, the private key remains protected, provided a majority of the nodes remain secure. Although this approach requires the additional overhead of running multiple instances of the AI Agent, it significantly enhances security while allowing the Agent to operate safely in untrusted environments.

Screenshot 2025-01-12 at 11.16.29 PM1246×1126 31.5 KB

  1. SNARK based: In this approach, we run a SNARK prover along with the Agent in the powerful server. Meanwhile, we run the corresponding SNARK verifier in a local personal device (smartphone, laptop, etc.). The local personal device also possesses the private key. The user first generates a cryptographic commitment to the AI Agent code and publish it on the blockchain. Then, each time the server generates a transaction requiring the signature of the private key, the local device uses the SNARK verifier to ensure that the transaction is generated by the committed Agent code. If the SNARK verification succeeds, the local device signs the transaction with the private key and submits the signed transaction to the blockchain. Unlike the MPC-based approach, this method eliminates the need to run multiple copies of the AI Agent code. However, despite recent advancements in zkML, generating SNARK proofs for cutting-edge deep learning models remains highly challenging due to the computational complexity involved. Nonetheless, if the Agent code is relatively simple or if the SNARK proof is required only for specific parts of the Agent’s logic, this approach becomes a practical and efficient solution.

Screenshot 2025-01-12 at 11.03.19 PM820×1262 22.6 KB

The above outlines several potential solutions we are exploring to address the AI Agent key management challenge. We welcome any feedback or suggestions to refine and improve these approaches!

Comments

All Comments

Recommended for you

  • Nasdaq Golden Dragon China Index Falls Over 3%

    On May 21, the Nasdaq Golden Dragon China Index fell over 3%, with Beike down 7.42%, Youdao down 6.33%, NetEase down 6.03%, Kingsoft Cloud down 5.95%, and GDS Holdings down 5.73%.

  • Nvidia Stock Price Turns Down to 2%

    On May 21, Nvidia's stock price decline expanded to 2%, after previously rising by 1.5%.

  • Turkey's Stock Market Plummets, Triggering Market-Wide Circuit Breaker

    On May 21, the Istanbul Stock Exchange in Turkey triggered a market-wide circuit breaker after major stock indices fell by as much as 6%.

  • SMIC: Approval Received from CSRC for Acquisition of 49% Stake in SMIC North

    On May 21, SMIC announced that on May 21, 2026, the company received a reply from the China Securities Regulatory Commission (CSRC) regarding the approval of its application for the issuance of shares to purchase assets. The CSRC approved the company's issuance of 357,343,396 shares to the National Integrated Circuit Industry Investment Fund Co., Ltd., 100,502,830 shares to Beijing Integrated Circuit Manufacturing and Equipment Equity Investment Center (Limited Partnership), 64,210,141 shares to Beijing E-Town International Investment and Development Co., Ltd., 12,562,853 shares to Zhongguancun Development Group Co., Ltd., and 12,562,853 shares to Beijing Industrial Development Investment Management Co., Ltd. for the purchase of related assets.

  • International Oil Prices Continue to Rise

    On May 21, U.S. and Brent crude oil prices continued to rise in the U.S. market, with WTI crude reaching $106 per barrel, up 3.39% for the day. Brent crude is currently reported at $105.81 per barrel, up 3.26% for the day. (Jinshi)

  • Report: Bitcoin Shows Signs of Repeating 2022 Trading Patterns

    On May 21, CryptoQuant stated in a report that Bitcoin's recent price movements resemble those from over four years ago. CryptoQuant noted that Bitcoin's recent rise to around $82,000 is similar to a surge seen back in early 2022, when Bitcoin started at approximately $44,000 and climbed to over $72,000, the then historical high, by March of that year. Subsequently, Bitcoin fell back to around $16,000 before gradually recovering, reaching a near historical high of nearly $125,000 last October. CryptoQuant believes a similar situation may occur now. 'As stagnant stablecoin liquidity and negative price momentum simultaneously erode comprehensive signals, CryptoQuant's bullish score index has fallen from 40 to 20, entering an extremely bearish zone,' CryptoQuant stated.

  • U.S. Stock Indices Open Lower

    On May 21, U.S. stock markets opened with the Dow Jones down 0.27%, the S&P 500 down 0.39%, and the Nasdaq down 0.5%. Microsoft (MSFT.O) rose 1.1% amid reports that Anthropic is in talks to use its artificial intelligence chips. U.S. Rare Earths (USAR.O) increased by 2.7% as the company was selected for a pilot rare earth processing project by the U.S. Department of Energy. IBM (IBM.N) saw a 3% rise, as the company is set to receive $1 billion in government funding to advance quantum computing. NIO Inc. (NIO.N) surged 5%, reporting a 112.2% year-over-year increase in revenue for the first quarter.

  • U.S. Stock Indices Open Lower

    On May 21, U.S. stocks opened with the Dow Jones down 0.27%, the S&P 500 down 0.39%, and the Nasdaq down 0.5%. Microsoft (MSFT.O) rose 1.1% amid reports that Anthropic is in talks to use its artificial intelligence chips. U.S. Rare Earths (USAR.O) increased by 2.7% after being selected for a pilot rare earth processing project by the U.S. Department of Energy. IBM (IBM.N) saw a 3% rise as the company is set to receive $1 billion in U.S. government funding to advance quantum computing development. NIO Inc. (NIO.N) rose by 5%, reporting a 112.2% year-on-year increase in revenue for the first quarter.

  • BTC Falls Below $77,000

    Market data shows that BTC has fallen below $77,000, currently priced at $76,976.12, with a 24-hour decline of 0.06%. The market is experiencing significant volatility, so please ensure proper risk management.

  • Nasdaq China Golden Dragon Index Drops Nearly 3%

    On May 21, the Nasdaq China Golden Dragon Index saw an expanded decline, currently down 2.84%, with the latest reading at 6,568 points.