> 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 的庄园集成到你的市场中

Decentraland 的庄园是符合 ERC721 标准的 NFT，运行在以太坊主网。因此，许多第三方市场都可以交易它们。为此，该市场必须遵循某些规则，以确保为用户进行安全交易。

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

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

不建议挂售空庄园。庄园智能合约有一个方法 `getEstateSize` ，它返回该庄园中的 LAND 数量。如果结果是 `0`，我们建议不要挂售该庄园。如果你仍然想挂售它们，你会看到如下图像：

![](https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-cc72f276a0f7c5a7aa5eb2dab3a3d1213e96fb0e%2Fdissolved_estate.png?alt=media\&token=e063628d-c3f8-40b2-b51e-0b344158847f)

## 示例

### 未使用庄园指纹

* Bob 拥有庄园 1，其中包含 LAND (1,1) 和 (1,2)。庄园 1 指纹：hash1
* Bob 向庄园 1 添加了 LAND (1,3)。庄园 1 现在包含 LAND (1,1)、(1,2) 和 (1,3)。庄园 1 指纹：hash2（指纹已更改）
* Bob 从庄园 1 中移除了 LAND (1,1)。庄园 1 现在包含 LAND (1,2) 和 (1,3)。庄园 1 指纹：hash3（指纹已更改）
* Bob 将庄园 1 挂牌出售。该列表在以太坊主网上链创建，包含庄园智能合约地址、庄园 ID、价格和到期日期。
* Alice 发起了一笔购买该庄园的交易，指定了庄园 ID 和预计支付的价格。
* Bob 检测到有人正试图购买他的庄园 1，于是发起了一笔比 Alice 更高 gas 费用的交易，从庄园 1 中移除 LAND (1,2) 和 (1,3)。
* Bob 的交易先被打包。庄园 1 现在有 0 个 LAND。庄园 1 指纹：hash4（指纹已更改）
* Alice 的交易随后被打包。Alice 购买到的是一个没有任何 LAND 的庄园 1。这意味着 Alice 被 Bob 抢先了（并被盗走/诈骗了）。

### 使用庄园指纹

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

## 庄园智能合约指纹接口

庄园的智能合约符合一个 [指纹接口](https://github.com/decentraland/land/blob/master/contracts/estate/EstateStorage.sol#L19)。当一个庄园挂牌出售或收到出价时，请通过调用 *`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.
