> For the complete documentation index, see [llms.txt](https://docs.decentraland.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.decentraland.org/creator/content-creator-zh/marketplace/estates-marketplace-integrations.md).

# 庄园市场集成

如果你想在自己的市场中集成 Decentraland 的庄园，需注意的重要事项

## 在你的市场中集成 Decentraland Estate

Decentraland Estate 是符合 ERC721 标准的 NFT，运行于以太坊主网。因此，许多第三方市场都可以交易这些 NFT。为了确保用户交易安全，这些市场必须遵循一些规则。

如你所知，每个 [Estate](https://docs.decentraland.org/decentraland/faq/#what-is-an-estate) 都由一组 [LAND](https://docs.decentraland.org/decentraland/faq/#what-is-land) 组成，并且有一个与该组关联的 *字节* 哈希，称为 *`fingerprint`*。每次 Estate 因添加或移除 LAND 而发生变化时，其 *`fingerprint`* 也会随之变化。

对于市场而言，尤其是没有托管系统的市场，强烈建议在有人挂牌出售或发出报价时，记录该 Estate 的 *`fingerprint`* 。这样一来，当订单/报价成功执行时，当前所有者就无法通过抢先执行订单来更改 Estate。

不建议挂牌出售空 Estate。Estate 智能合约提供了一个名为 `getEstateSize` 的方法，用于返回 Estate 中 LAND 的数量。如果结果为 `0`，我们建议不要挂牌出售该 Estate。如果你仍想挂牌出售，就会看到类似这样的图像：

![](https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-e98d87470ca9ff53ce25f1950c9b9649357e8511%2Fdissolved_estate.webp?alt=media)

## 示例

### 未使用 Estate 指纹

* Bob 拥有 Estate1，其中包含 LAND (1,1) 和 (1,2)。Estate1 指纹：hash1
* Bob 将 LAND (1,3) 添加到 Estate1。Estate1 包含 LAND：(1,1)、(1,2) 和 (1,3)。Estate1 指纹：hash2（指纹已更改）
* Bob 从 Estate1 中移除 LAND (1,1)。Estate1 包含 LAND：(1,2) 和 (1,3)。Estate1 指纹：hash3（指纹已更改）
* Bob 挂牌出售 Estate1。该挂牌信息通过 Estate 智能合约在以太坊主网上链创建，其中包含 Estate 智能合约地址、Estate ID、价格和到期日期。
* Alice 发送一笔交易来购买 Estate，并指定 Estate ID 和预期支付的价格。
* Bob 发现有人正试图购买他的 Estate1，于是发送一笔 Gas 费高于 Alice 的交易，从 Estate1 中移除 LAND (1,2) 和 (1,3)。
* Bob 的交易先被打包。Estate1 中有 0 个 LAND。Estate1 指纹：hash4（指纹已更改）
* Alice 的交易随后被打包。Alice 买下了一个不含任何 LAND 的 Estate1。这意味着 Alice 遭到 Bob 的抢先交易（并被窃取/诈骗）。

### 使用 Estate 指纹

* Bob 拥有 Estate1，其中包含 LAND (1,1) 和 (1,2)。Estate1 指纹：hash1
* Bob 将 LAND (1,3) 添加到 Estate1。Estate1 包含 LAND：(1,1)、(1,2) 和 (1,3)。Estate1 指纹：hash2（指纹已更改）
* Bob 从 Estate1 中移除 LAND (1,1)。Estate1 包含 LAND：(1,2) 和 (1,3)。Estate1 指纹：hash3（指纹已更改）
* Bob 挂牌出售 Estate1。该挂牌信息通过 Estate 智能合约在以太坊主网上链创建，其中包含 Estate 智能合约地址、Estate ID、价格和到期日期。
* Alice 发送一笔交易来购买 Estate，并指定 Estate ID、预期支付的价格，以及 **她看到的指纹（hash3）**.
* Bob 发现有人正试图购买他的 Estate1，于是发送一笔 Gas 费高于 Alice 的交易，从 Estate1 中移除 LAND (1,2) 和 (1,3)。
* Bob 的交易先被打包。Estate1 中有 0 个 LAND。Estate1 指纹：hash4（指纹已更改）
* Alice 的交易被回滚，因为智能合约检查后发现，Alice 发送的参数中的指纹与当前 Estate1 的指纹不匹配（hash3 != hash4）。这一检查阻止 Alice 买下不符合预期的 Estate。

## Estate 智能合约指纹接口

Estate 智能合约符合 [指纹接口](https://github.com/decentraland/land/blob/master/contracts/estate/EstateStorage.sol#L19)标准。当 Estate 挂牌出售或收到报价时，调用 *`getFingerprintV2(uint256 estateId)`* 记录其指纹，并存储该方法返回的值。若要在执行时检查该订单/报价是否仍然有效，请调用 *`verifyFingerprint(uint256 estateId, bytes fingerprint)`* 并传入存储的值。

始终存储 *`getFingerprintV2`*&#x8FD4;回的值。较旧的 *`getFingerprint`* 方法仅为向后兼容而保留，并正在逐步弃用：从 2026 年 11 月 26 日起， *`verifyFingerprint`* 将不再接受由该方法生成的值。新的集成应使用 *`getFingerprintV2`*.

你可以在此处查看一个可运行的生产环境示例： [此处](https://github.com/decentraland/marketplace-contracts/blob/master/contracts/marketplace/MarketplaceV2.sol#L382).


---

# 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.decentraland.org/creator/content-creator-zh/marketplace/estates-marketplace-integrations.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.
