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

  • Trump Shares Op-Ed Claiming He is Winning the War Against Iran

    On August 29, U.S. President Trump shared a commentary article from the New York Post on Truth Social on Saturday, which stated that he is winning the war against Iran and should maintain the current strategy. The title of the article Trump shared read: 'Trump is Winning the War Against Iran - Stay the Course.'

  • Morgan Stanley: 2028 as a Key Observation Point for Global Memory Competition Landscape

    On August 29, Morgan Stanley pointed out that the rise of Chinese memory manufacturers should not be viewed merely as a technological catch-up or low-cost substitution; what is truly noteworthy is that their production capacity may gradually become large enough to alter the supply structure of the global memory market. Changxin Technology and Yangtze Memory Technologies are currently entering the mainstream product market and gradually extending into high-profit markets such as HBM, high-end server DRAM, and enterprise SSDs. Morgan Stanley considers 2028 as an important observation point for the global memory competition landscape. From 2026 to 2027, demand for AI servers, capacity crowding of advanced wafers by HBM, import substitution, and the time required for customer certification may absorb most of the new supply from Chinese memory manufacturers. By 2028, as Chinese manufacturers expand production, the additional capacity from Samsung, SK Hynix, and Micron, which had previously initiated expansions, will also be released. At that time, the supply variables in the global memory market will significantly increase. Morgan Stanley estimates that Changxin's DRAM monthly production capacity will rise from 180,000 wafers in 2025 to 300,000 in 2026, accounting for approximately 13% of global DRAM wafer capacity and about 11% of bit shipments; by 2028, it is expected to further increase to 500,000 wafers, and by 2031, it could reach 800,000 wafers. If the expansion proceeds smoothly, Changxin's global DRAM bit shipment market share could approach 15% by 2030, and it may even have the opportunity to surpass Micron in production capacity around 2028, becoming the third-largest DRAM supplier in the world.

  • US Spot Ethereum ETF Sees Net Inflow of $102.17 Million Yesterday

    On August 29, according to monitoring by Trader T, the US spot Ethereum ETF recorded a net inflow of $102.17 million yesterday.

  • US Spot Ethereum ETF Sees Net Inflow of $102.17 Million

    On August 29, according to monitoring by Trader T, the US spot Ethereum ETF experienced a net inflow of $102.17 million yesterday.

  • US Spot Bitcoin ETF Sees Net Outflow of $201.81 Million

    On August 29, according to monitoring by Trader T, the US spot Bitcoin ETF experienced a net outflow of $201.81 million yesterday.

  • US Spot Bitcoin ETF Sees Net Outflow of $201.81 Million Yesterday

    On August 29, according to monitoring by Trader T, the US spot Bitcoin ETF experienced a net outflow of $201.81 million yesterday.

  • BTC Surpasses $78,000

    Market data shows that BTC has surpassed $78,000, currently priced at $78,009.49. The 24-hour decline has narrowed to 3.23%. Due to significant market fluctuations, please ensure proper risk management.

  • BTC Surpasses $78,000

    Market data shows that BTC has surpassed $78,000, currently priced at $78,009.49, with a 24-hour decline narrowing to 3.23%. The market is experiencing significant volatility, so please ensure proper risk management.

  • BTC Briefly Drops Below $77,000

    Market data shows that BTC briefly fell below $77,000, currently reported at $77,694, with a 24-hour decline of 3.3%. The market is experiencing significant volatility, so please ensure proper risk management.

  • BTC Briefly Drops Below $77,000

    Market data shows that BTC briefly fell below $77,000, currently reported at $77,694, with a 24-hour decline of 3.3%. The market is experiencing significant fluctuations, so please ensure proper risk management.