> For the complete documentation index, see [llms.txt](https://docs.rome.builders/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rome.builders/zh/he-xin-gai-nian/choose-your-core.md).

# 选择你的核心

大多数 Rome 应用都是双通道的：一套共享状态，可同时被 MetaMask（EVM）和 Phantom（Solana）用户访问。你可以用两种镜像式架构之一来构建，区别在于 **哪一侧承载核心逻辑。** 选择哪一种并没有硬性规则——这是一个基于以下因素重要性的权衡判断： *你的* 应用：你已经拥有的代码和资源、团队的专业能力、安全性方案、你偏好的工具链、性能，以及不同受众将如何使用它。

## （a）Solidity 核心；Solana 用户通过合成发送者

你的逻辑是一个 Solidity 合约。Phantom 用户的 Solana 签名会作为来自其 Rome 派生身份（即 `external_auth` PDA）的 EVM 交易来执行——他们从不需要 EVM 密钥。通常在你已经有一个 Solidity 合约（尤其是经过加固或审计的合约）时、想使用标准 EVM 工具链（Hardhat / Foundry / viem）时，或者逻辑较为直接时，这种方案很合适。

*阅读：* [aerarium](https://github.com/rome-protocol/aerarium) ——一个 Compound v3 借贷市场（Solidity 核心），供 EVM 和 Solana 用户共享。

## （b）原生 Solana 程序核心；EVM 用户通过轻量 CPI 路由器

你的逻辑是一个原生 Solana 程序；一个轻量的 Solidity 路由器让 EVM 用户可以通过 CPI 访问它。通常在你已经有一个 Solana 程序时，或者当核心以原生方式运行对你正在构建的内容很重要时，这种方案很合适。

*阅读：* [rome-dex](https://github.com/rome-protocol/rome-dex) ——一个原生 AMM（Solana 核心），带有 EVM 路由器，因此两个通道都交易同一个池子。

## 例如：性能

性能是一个 *可能* 左右选择的因素——把它当作一个例子来考虑。对于计算密集型逻辑，原生 Solana 执行可能比 EVM 解释器便宜得多：我们测量的一笔交换在原生环境下运行，成本大约低 6 倍。如果你的应用有一条热点、计算密集型路径，这种差异可能对你很重要；如果没有，它大概率不会左右决策。把它视为众多输入中的一个，而不是规则。

## 无论你选择哪种

保持核心 **与授权主体无关** ——对任一签名的授权主体执行操作，因此调用方可以是一个 Solana 公钥 *或* EVM 用户的 PDA——保持账户集合精简并对 ALT 友好，以便 EVM 通道保持低成本，并且 **测试两个通道。**

## 接下来

* [从 EVM 调用 Solana](/zh/kai-fa-zhe-zhi-nan/call-solana-from-evm.md) ——形态（b）的 CPI 机制，以及任何 Solidity→Solana 调用。
* [计算预算](/zh/he-xin-gai-nian/compute-budget.md) ——更多关于执行成本的内容。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.rome.builders/zh/he-xin-gai-nian/choose-your-core.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
