> 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).

# 选择你的核心

双通道应用可以将其核心逻辑保留在 Solidity 侧或原生 Solana 侧。这是一个判断题——请权衡对你的应用最重要的因素。

大多数 Rome 应用是双通道的：一份共享状态，由 MetaMask（EVM）和 Phantom（Solana）用户共同访问。你可以用两种镜像结构之一来构建它，区别在于 **核心逻辑由哪一侧承载。** 并没有一条硬性规则决定该选哪种——这更多是基于对以下因素的重要性的综合判断： *你的* 应用：你现有的代码和资产、你团队的专长、安全态势、你偏好的工具链、性能，以及各类用户将如何使用它。

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

你的逻辑是一个 Solidity 合约。Phantom 用户的 Solana 签名会作为来自其 Rome 派生身份的 EVM 交易执行（ `external_auth` PDA）——他们无需持有 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 解释器：我们测量的一笔 swap 在原生执行下大约便宜 6 倍。如果你的应用有一个高频、计算密集的路径，这类差异可能对你很重要；如果没有，它大概不会左右决策。把它视为众多输入因素之一，而不是规则。

## 无论你选择哪种方式

都要保持核心 **与授权方无关** ——根据签名者是谁来执行，因此调用方可以是 Solana 公钥 *或* 、EVM 用户的 PDA——保持账户集合精简并适配 ALT，以便 EVM 通道保持低成本，并且 **测试两条通道。**

## 下一步

* [从 EVM 调用 Solana](https://docs.rome.builders/zh/kai-fa-zhe-zhi-nan/call-solana-from-evm.md) ——用于形态（b）的 CPI 机制，以及任何 Solidity→Solana 调用。
* [计算预算](https://docs.rome.builders/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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
