> 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/shi-chang/estates-marketplace-integrations.md).

# Estate 市场集成

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

## 将 Decentraland 的 Estate 集成到你的市场中

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

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

对于市场，尤其是没有托管系统的市场，强烈建议在有人将 Estate 上架出售或发出报价时，记录该 Estate 的 *`指纹`* 。这样，当订单/报价成功执行时，当前所有者就不能通过试图抢跑订单执行来更改该 estate。

不建议上架空的 Estates。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-cc72f276a0f7c5a7aa5eb2dab3a3d1213e96fb0e%2Fdissolved_estate.png?alt=media)

## 示例

### 未使用 Estate 指纹

* Bob 拥有 Estate1，其中包含 LAND (1,1) 和 (1,2)。Estate1 指纹：hash1
* Bob 向 Estate1 添加了 LAND (1,3)。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 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 向 Estate1 添加了 LAND (1,3)。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 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 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.decentraland.org/creator/content-creator-zh/shi-chang/estates-marketplace-integrations.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.
