> 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/rome-xue-yuan/02-what-you-can-build.md).

# 2. 你可以构建什么

Rome 面向的六类应用，按其最擅长的场景排序，每一类都配有展示它的应用或指南，以及教授它的课程。

Rome 在 Solana 内运行 EVM 链，因此最适合在其上构建的应用，是那些同时需要两边优势的应用。本课程将六种用例按重要性排序，最重要的排在前面，帮助你在编写代码前决定从哪里入手。

## 你将学到什么

* Rome 面向的六种用例，按适配程度排序。
* Rome 为何适合每种用例，以及展示该用例的实际应用或指南。
* 课程中的哪些课会讲解各类用例。
* 如何选择起点。

## 开始之前

阅读 [第 1 课](https://docs.rome.builders/zh/rome-xue-yuan/01-what-you-are-building.md)。你需要了解同一状态如何通过两种钱包通道访问这一概念。暂时不需要钱包或任何代码。

## 列表的排序依据

Rome 将 EVM 和 Solana 融为一个市场。EVM 用户和 Solana 用户地位平等：他们使用相同的合约和流动性池，且双方都可以调用对方。排名靠前的用例直接利用了这一点。排名靠后的用例则是在此基础上构建，或围绕它增加其他功能。

每个示例都链接到一个应用或指南，你可以在动手构建之前先行查看。 [Rome 上的应用](https://docs.rome.builders/zh/rome-shang-de-ying-yong/apps.md) 是完整的应用目录。除非页面另有说明，此处列出的应用均运行在 [Hadrian](https://docs.rome.builders/zh/wang-luo/hadrian.md)公共测试网上。

## 1. 利用 Solana 流动性和程序的 Solidity 应用

**用例说明。** Solidity 合约可以在自身函数执行期间调用 Solana 程序，例如执行兑换或质押存款；也可以读取 Solana 账户，例如获取价格。模式指南还概述了一种借贷协议，它使用 Solana 预言机为抵押品定价。

**Rome 为何适合。** 该调用与函数的其余部分在同一笔交易中执行。任何一步失败，整笔交易都会回滚，因此无需清理未完成的兑换。

**示例。**

* [Cardo](https://docs.rome.builders/zh/rome-shang-de-ying-yong/apps.md) 直接调用 CPI 预编译，从 EVM 账户访问 Jupiter 永续合约、Meteora 兑换和 Marinade 质押，并将其中多个操作组合成一个原子流程。
* [Oracle Gateway](https://docs.rome.builders/zh/chan-pin/oracle-gateway.md) 通过 Chainlink 接口向 Solidity 提供 Pyth 和 Switchboard 价格数据。它已部署在 Hadrian 和 Rubicon 上，目前为预览版，尚未经过审计。
* [DeFi 协议](https://docs.rome.builders/zh/ying-yong-chang-jing/defi-protocols.md) 以示例草图展示了这些模式。

**学习内容。** [第 5 课](https://docs.rome.builders/zh/rome-xue-yuan/05-call-solana-from-solidity.md) 和 [第 6 课](https://docs.rome.builders/zh/rome-xue-yuan/06-tokens-on-both-sides.md). [第 4 课](https://docs.rome.builders/zh/rome-xue-yuan/04-how-rome-runs-your-code.md) 介绍其底层运行机制。

## 2. 同时支持两类钱包的应用

**用例说明。** 同一份部署同时服务 MetaMask 用户和 Solana 钱包用户。双方都能访问相同的合约、状态和流动性。Rome 将这种应用称为双通道应用。

**Rome 为何适合。** Solana 钱包使用自己的密钥签名。Rome 会根据该密钥推导出一个 EVM 地址，因此用户无需 EVM 密钥。应用只需部署一次。流动性集中在同一个池中，而不会因钱包类型不同而分散。

**示例。**

* [Rome DEX](https://docs.rome.builders/zh/rome-shang-de-ying-yong/apps.md)：一个原生 Solana 流动性池，EVM 和 Solana 钱包都可以在其中交易。
* [Aerarium](https://docs.rome.builders/zh/rome-shang-de-ying-yong/apps.md)：一个 Compound v3 借贷市场，双方用户都可以在其中提供资产并借款。
* [构建双通道应用](https://docs.rome.builders/zh/kai-fa-zhe-zhi-nan/dual-lane-app.md) 逐步讲解最精简的实现：金库。
* [选择核心](https://docs.rome.builders/zh/he-xin-gai-nian/choose-your-core.md) 比较 Solidity 核心与原生 Solana 核心。

**学习内容。** [第 7 课](https://docs.rome.builders/zh/rome-xue-yuan/07-open-to-solana-wallets.md) 将 EVM 应用开放给 Solana 钱包使用。 [第 9 课](https://docs.rome.builders/zh/rome-xue-yuan/09-build-a-dual-lane-app.md) 构建完整应用。

## 3. 让 Solana 程序触达 EVM 用户

**这是什么。** 你已经在运行的 Solana 程序，可以供仅持有 EVM 钱包的人使用。程序本身无需更改。

**为什么 Rome 合适。** 每个 EVM 地址在 Rome 上都有对应的 Solana 身份。你的程序看到的是普通的 Solana 签名者，无需知道 EVM 地址的存在。

**示例。**

* [Cardo](https://docs.rome.builders/zh/rome-shang-de-ying-yong/apps.md) 让 EVM 钱包能够使用原本为 Solana 用户构建的程序。
* [Rome DEX](https://docs.rome.builders/zh/rome-shang-de-ying-yong/apps.md) 将核心功能保留在原生 Solana 程序中，并在前端为 EVM 用户提供一个轻量级路由器。
* [集成 Solana 程序](https://docs.rome.builders/zh/kai-fa-zhe-zhi-nan/integrate-solana-program.md) 介绍由谁签名、资产如何转入和转出，以及影响设计的限制。

**了解详情。** [第 8 课](https://docs.rome.builders/zh/rome-xue-yuan/08-open-your-solana-program-to-evm-users.md).

## 4. 跨链资产与用户

**这是什么。** 用户从 Ethereum、Base、Arbitrum 和其他链进入，使用你的应用，然后将资金转出。你的应用直接集成桥接功能，而不是让用户自行寻找桥。

**为什么 Rome 合适。** Rome Bridge 在链上通过用户自己的签名完成结算。它不持有托管密钥，其公共 API 会为路线报价并赞助结算手续费。

**示例。**

* [Rome Bridge](https://docs.rome.builders/zh/rome-shang-de-ying-yong/bridge-api.md) 在主网 Rubicon 和 Hadrian 上运行。USDC 可通过 CCTP v2 在多个 EVM 链之间转移；SOL 和 USDC 则可从 Solana 钱包转移。
* Solgate 可双向连接 Solana 资产与 AggLayer EVM 链，并支持主网和测试网。在测试网上，SPL 代币注册无需许可。USDC 使用 CCTP。概览请参阅 [单一市场](https://docs.rome.builders/zh/kuai-su-ru-men/one-market.md) 。
* [从家出发](https://docs.rome.builders/zh/kai-fa-zhe-zhi-nan/from-home.md) 展示如何将应用接入桥接 API。
* [Appia](https://docs.rome.builders/zh/rome-shang-de-ying-yong/apps.md) 让用户从 EVM 链进入，在 Solana 上管理头寸，然后返回原链。目录中标注其仍在验证中。

**了解详情。** [第 10 课](https://docs.rome.builders/zh/rome-xue-yuan/10-from-other-chains.md). [第 11 课](https://docs.rome.builders/zh/rome-xue-yuan/11-ship-to-rubicon.md) 带你将其部署到主网。

## 5. 在两条链路上发行许可型现实世界资产

**这是什么。** 发行方只需创建一次资产，持有人即可通过 EVM 钱包和 Solana 钱包购买并持有。谁可以持有该资产的规则由代币合约本身执行。

此示例基于用例 2 构建。同一个 Solidity 资产同时服务于两条链路，并配有 Rome 上的 Trade 池和 Credit 借贷市场，二者使用同一资产。

**为什么 Rome 合适。** 由于规则内置于资产中，因此无论通过哪条链路转移，规则都始终有效。同一代币和部署可服务于这两种钱包。

**示例。**

* [Bloom](https://docs.rome.builders/zh/rome-shang-de-ying-yong/bloom.md) 是这款应用。它为投资者、发行方和开发者提供指南，还有用于流动性池的 Trade 应用，以及基于相同资产开展借贷的 Credit 应用。它运行在 Hadrian 上。
* [在 Bloom 上构建](https://docs.rome.builders/zh/rome-shang-de-ying-yong/bloom/building.md) 循序渐进地将 Solidity 资产部署到 Rome，打造许可型代币。

**了解详情。** 没有专门介绍它的课程。第 6、7 和 9 课会讲解其中用到的各项内容。

## 6. 使用自有 Gas 代币运行自有链

**这是什么。** 你的应用运行在专属 Rome 链上，拥有自己的链 ID，用户使用你选定的 SPL 代币支付 Gas。手续费归你的应用所有。用户仍可通过 MetaMask 访问这条链，且链上状态与 Solana 共享。

**为什么 Rome 合适。** 你在前面用例中构建的大部分内容都可以原样迁移到自己的链上。变化在于经济模型：谁获得 Gas 收入，以及用哪种代币支付 Gas。

**查看详情。** [应用主权](https://docs.rome.builders/zh/chan-pin/app-sovereignty.md) 列出你能获得的内容，以及如何启动一条链。Rome 团队负责运行链的基础设施。页面将该产品标记为已上线，并注明合作伙伴。

**开始学习。** [第 12 课](https://docs.rome.builders/zh/rome-xue-yuan/12-launch-your-own-chain.md)，简要概览。

## 如何选择从哪里开始

选择与你当前情况相符的一行。

| 你已有               | 从此处开始                 | 然后                      |
| ----------------- | --------------------- | ----------------------- |
| Solidity 合约       | 用例 1：从该合约调用 Solana 程序 | 用例 2：让 Solana 钱包能够使用它   |
| Solana 程序         | 用例 3：让 EVM 用户能够使用它    | 用例 2：如果你还想要 Solidity 前端 |
| 一个新想法             | 用例 2：从第一天起就构建双通道应用    | 用例 4：引入用户               |
| 已在 Hadrian 上运行的应用 | 用例 4，然后部署到主网          | 用例 6：如果你需要自己的链上经济体系     |

从用例 1 或 2 开始，之后再添加其他用例。用例 6 是最后一步，而不是第一步。

Rome 并不适用于所有情况。如果你只需要面向 Solana 用户的标准 Solana 程序，请原生构建。如果你需要在 Ethereum 主网上结算，Rome 无法提供这项服务。如果你需要跨链消息传递，但不需要 EVM 执行，请直接使用消息传递协议。 [为什么选择 Rome？](https://docs.rome.builders/zh/kuai-su-ru-men/why-rome.md) 涵盖了相关比较。

## 自测

1. 你的团队有一个经过审计的 Solana 借贷程序，并希望让 MetaMask 用户向其提供资金。这属于哪个用例？你应该学习哪一课？ *用例 3，* [*第 8 课*](https://docs.rome.builders/zh/rome-xue-yuan/08-open-your-solana-program-to-evm-users.md)*.*
2. 为什么双通道应用只使用一个资金池，而不是针对每种钱包类型各设一个资金池？ *两种钱包类型都能访问同一个合约和同一份状态，因此流动性是共享的。*
3. 哪个用例是最后一步，而不是第一步？ *用例 6：你自己的链。它会改变 Gas 费用的收益归属，而此前的用例也都能沿用。*

## 下一步

[第 3 课：在 Hadrian 上部署你的第一个合约](https://docs.rome.builders/zh/rome-xue-yuan/03-first-contract-on-hadrian.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/rome-xue-yuan/02-what-you-can-build.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.
