# EAS 链下证明验签失败：核对版本、domain与UID

整理：链小知（AI 辅助）
资料核对日期：2026-10-12
引用地址：https://lianxiaozhi.com/tools/guides/eas-offchain-signature-domain-uid-record-check
难度：进阶
核验方式：官方文档整理，未执行真实账户操作

用本人已有证明及验签记录区分UID不符、签名类型/域错误与真正资格，保留旧SDK示例差异。

## 使用工具
- [Ethereum Attestation Service（EAS）](https://lianxiaozhi.com/tools/ethereum-attestation-service) · [官方入口](https://attest.org/)

## 前置条件
- 准备本人有权查看的去敏证明原文件、原SDK/协议版本与已有验签结果；不分享完整敏感data或签名。
- 另备应用认可的发行方、schema、chain/domain配置来源；不上传文件、初始化SDK或执行签名。

## 1. 先辨认链下文件与原验证方法

已有JSON、IPFS对象或URL fragment可能只是链下签名证明；不是存在一个链接就已经有链上getAttestation记录。核原方法是verifyOffchainAttestationSignature，而非签发、timestamp或上传存储。

旧固定文档展示explorer上传，但本文只看原文件和已保存结果。把原SDK版本、原文件来源与取得时间写清，公开链接不等永久存储或应用认可。

核对结果：证明格式、存储层和既有验证方法明确，未从链接推链上存在。
依据：[EAS 固定文档：链上/链下存储](https://raw.githubusercontent.com/ethereum-attestation-service/eas-docs-site/d4d3116003bcd77554c5a147e88a27fc03b19242/docs/core--concepts/onchain-vs-offchain.md)
依据：[EAS 固定旧文档：Offchain验证](https://raw.githubusercontent.com/ethereum-attestation-service/eas-docs-site/d4d3116003bcd77554c5a147e88a27fc03b19242/docs/developer-tools/verify-attestation.md)

## 2. 区分包版本、证明版本与domain版本

固定SDK package为2.10.0，OffchainAttestationVersion为Legacy0、Version1或Version2；domain.version又是EIP712域中的版本字符串，三者不应互相代填。Version2类型包含salt，legacy/v1类型不同。

当前固定源码Offchain构造器有config、version、eas三参数，旧文档和README示例只有两参数且types/签名等是占位。只对照原已安装版本记录，不拼示例运行或补随机salt来修改原证明。

核对结果：三种版本和原types/salt存在性可复核，旧示例差异保留。
依据：[EAS SDK 固定包清单2.10.0](https://raw.githubusercontent.com/ethereum-attestation-service/eas-sdk/9ebc43fc0345679c8a521a1f497592015b9deb17/package.json)
依据：[EAS SDK 固定Offchain源码](https://raw.githubusercontent.com/ethereum-attestation-service/eas-sdk/9ebc43fc0345679c8a521a1f497592015b9deb17/src/offchain/offchain.ts)
依据：[EAS SDK 固定README：已有记录字段](https://raw.githubusercontent.com/ethereum-attestation-service/eas-sdk/9ebc43fc0345679c8a521a1f497592015b9deb17/README.md)
依据：[EAS 固定旧文档：Offchain验证](https://raw.githubusercontent.com/ethereum-attestation-service/eas-docs-site/d4d3116003bcd77554c5a147e88a27fc03b19242/docs/developer-tools/verify-attestation.md)

## 3. 将domain与受信配置独立配对

从原domain保留name、chainId、verifyingContract和version，另对照应用认可的链/合约/域版本来源；把不可信文件自身值用于初始化后验证通过，不能证明该域被应用接受。

固定TypedDataHandler比较domain/primaryType/types并恢复签名者；Offchain传strict=false，会使用响应domain.version参与预期域比较，因此域版本准入必须单独核。chainId、合约和版本缺受信配置时标未知，不从chain1/旧Sepolia例子推部署。

核对结果：domain身份与应用准入来源分开，未以自填配置自证。
依据：[EAS SDK 固定Offchain源码](https://raw.githubusercontent.com/ethereum-attestation-service/eas-sdk/9ebc43fc0345679c8a521a1f497592015b9deb17/src/offchain/offchain.ts)
依据：[EAS SDK 固定TypedData验签](https://raw.githubusercontent.com/ethereum-attestation-service/eas-sdk/9ebc43fc0345679c8a521a1f497592015b9deb17/src/offchain/typed-data-handler.ts)
依据：[EAS SDK 固定包清单2.10.0](https://raw.githubusercontent.com/ethereum-attestation-service/eas-sdk/9ebc43fc0345679c8a521a1f497592015b9deb17/package.json)

## 4. 按原UID和签名错误定位失败层

固定verify先按所选证明版本和schema/recipient/time/expirationTime/revocable/refUID/data/salt核UID；不符返回false。此UID算法不等链上attestation UID或交易hash，不能互换，也不只按data哈希定位整个证明。

后续InvalidDomain、InvalidPrimaryType、InvalidTypes、InvalidAddress或签名格式异常与返回false不同。记录原错误、类型与版本；方法用ethers verifyTypedData恢复EOA地址，不据此验收EIP1271合约签名或判所有合约钱包证明伪造。

核对结果：已有结果区分UID、domain/types、签名格式与发行人不符，缺运行证据明确。
依据：[EAS SDK 固定Offchain源码](https://raw.githubusercontent.com/ethereum-attestation-service/eas-sdk/9ebc43fc0345679c8a521a1f497592015b9deb17/src/offchain/offchain.ts)
依据：[EAS SDK 固定TypedData验签](https://raw.githubusercontent.com/ethereum-attestation-service/eas-sdk/9ebc43fc0345679c8a521a1f497592015b9deb17/src/offchain/typed-data-handler.ts)
依据：[EAS SDK 固定EAS记录读取](https://raw.githubusercontent.com/ethereum-attestation-service/eas-sdk/9ebc43fc0345679c8a521a1f497592015b9deb17/src/eas.ts)

## 5. 分开发行方身份、内容与状态

把恢复/既有验证的attester与应用认可的发行方名单配对，recipient与本人目标身份配对；验签成功只说明这些字节由该签名身份认可，不自动说明data真实、schema权威或可领取。

该验签方法不读取当前时间、撤销状态或链上schema。expirationTime、revocable与已有getRevocationOffchain(user,uid)记录另列，user应对应原签名发行者，其他user或链的零值不能代替；revocable=true不是已经撤销，缺状态记录不默认仍有效。

核对结果：签名真实性、可信发行方、接收对象、期限和撤销各自有证据或缺口。
依据：[EAS SDK 固定Offchain源码](https://raw.githubusercontent.com/ethereum-attestation-service/eas-sdk/9ebc43fc0345679c8a521a1f497592015b9deb17/src/offchain/offchain.ts)
依据：[EAS SDK 固定TypedData验签](https://raw.githubusercontent.com/ethereum-attestation-service/eas-sdk/9ebc43fc0345679c8a521a1f497592015b9deb17/src/offchain/typed-data-handler.ts)
依据：[EAS SDK 固定EAS记录读取](https://raw.githubusercontent.com/ethereum-attestation-service/eas-sdk/9ebc43fc0345679c8a521a1f497592015b9deb17/src/eas.ts)
依据：[EAS SDK 固定README：已有记录字段](https://raw.githubusercontent.com/ethereum-attestation-service/eas-sdk/9ebc43fc0345679c8a521a1f497592015b9deb17/README.md)

## 6. 保留最小结论并限定核验范围

将结果写成原验签通过/失败及具体版本/domain/UID原因，另注明是否取得可信schema、当前状态和应用规则。不要把时间戳存在当完整文件上链，不从证明格式正确推具体奖励或访问权。

未运行SDK或取得当前链读证据的部分仍是documentation。保留去敏字段与原错误给应用方核对，不创建新证明、重签、上传或撤销来试错。

核对结果：输出原证明与验证记录对照，受信和资格未验范围明确。
依据：[EAS 固定文档：链上/链下存储](https://raw.githubusercontent.com/ethereum-attestation-service/eas-docs-site/d4d3116003bcd77554c5a147e88a27fc03b19242/docs/core--concepts/onchain-vs-offchain.md)
依据：[EAS SDK 固定SchemaRegistry](https://raw.githubusercontent.com/ethereum-attestation-service/eas-sdk/9ebc43fc0345679c8a521a1f497592015b9deb17/src/schema-registry.ts)
依据：[EAS SDK 固定Offchain源码](https://raw.githubusercontent.com/ethereum-attestation-service/eas-sdk/9ebc43fc0345679c8a521a1f497592015b9deb17/src/offchain/offchain.ts)
依据：[EAS SDK 固定EAS记录读取](https://raw.githubusercontent.com/ethereum-attestation-service/eas-sdk/9ebc43fc0345679c8a521a1f497592015b9deb17/src/eas.ts)

## 常见错误
- 旧两参数示例/占位types不是当前可执行程序。
- UID、交易hash与schemaUID不同；domain.version也不是SDK包版本。
- 有效签名不等可信发行方、未过期、未撤销或准入通过。

## 完成检查
- 形成证明版本/domain/UID/签名结果、发行方/接收人/状态与准入缺证表。
- 只核已有资料，未运行验签或访问链/上传文件。

## 相关知识
- [钱包签消息与签交易有什么区别？不付 Gas 的签名也要读内容](https://lianxiaozhi.com/learn/wallet-message-vs-transaction)
- [把数据上链，与只保存数据哈希有什么区别？](https://lianxiaozhi.com/learn/data-onchain-vs-offchain)
- [合约代码已验证，为什么仍不能直接判断安全？](https://lianxiaozhi.com/learn/verified-contract-boundaries)

## 官方依据
- [EAS 固定文档：链上/链下存储](https://raw.githubusercontent.com/ethereum-attestation-service/eas-docs-site/d4d3116003bcd77554c5a147e88a27fc03b19242/docs/core--concepts/onchain-vs-offchain.md)
- [EAS 固定旧文档：Offchain验证](https://raw.githubusercontent.com/ethereum-attestation-service/eas-docs-site/d4d3116003bcd77554c5a147e88a27fc03b19242/docs/developer-tools/verify-attestation.md)
- [EAS SDK 固定包清单2.10.0](https://raw.githubusercontent.com/ethereum-attestation-service/eas-sdk/9ebc43fc0345679c8a521a1f497592015b9deb17/package.json)
- [EAS SDK 固定README：已有记录字段](https://raw.githubusercontent.com/ethereum-attestation-service/eas-sdk/9ebc43fc0345679c8a521a1f497592015b9deb17/README.md)
- [EAS SDK 固定Offchain源码](https://raw.githubusercontent.com/ethereum-attestation-service/eas-sdk/9ebc43fc0345679c8a521a1f497592015b9deb17/src/offchain/offchain.ts)
- [EAS SDK 固定TypedData验签](https://raw.githubusercontent.com/ethereum-attestation-service/eas-sdk/9ebc43fc0345679c8a521a1f497592015b9deb17/src/offchain/typed-data-handler.ts)
- [EAS SDK 固定EAS记录读取](https://raw.githubusercontent.com/ethereum-attestation-service/eas-sdk/9ebc43fc0345679c8a521a1f497592015b9deb17/src/eas.ts)
- [EAS SDK 固定SchemaRegistry](https://raw.githubusercontent.com/ethereum-attestation-service/eas-sdk/9ebc43fc0345679c8a521a1f497592015b9deb17/src/schema-registry.ts)
