@agenticprimitives/attestations

中文文档
0.0.0-alpha.42发布于 2026/10/26MITTypeScriptES Module近 30 天下载 6739

AttestationRegistry SDK — EAS-aligned with bilateral consent. Owns Association + JointAgreement + Evidence + Outcome + Validation + TrustUpdate credential types asserted into a single on-chain registry per ADR-0023.

原始使用文档
文档目录4 节
  1. What ships today
  2. How it's different
  3. Status
  4. Build

@agenticprimitives/attestations

Part of Agentic Primitives — the open-source trust substrate for agentic applications: identity that can sign, authority checked at act time, evidence the owner carries. Developer kit · All packages

Agent reputation needs public, revocable claims pinned to a persistent identity — not to a key that rotates away. When an agent's track record lives on chain, three things must be true: the subject is an address that survives credential recovery, the claim cannot be anchored against a different subject by replaying a signature, and a "joint" claim genuinely carries both parties' consent. This package is the SDK for AttestationRegistry.sol, the single on-chain registry where those guarantees are enforced — bilateral consent is verified on chain from both party signatures, not assumed from a stored reference.

It is EAS-aligned where alignment helps (UID model, schema IDs, refUID chaining) and deliberately stricter where EAS is loose: one registry, credential types as discriminators rather than per-type contracts, and no issuer-unilateral revocation entrypoint at all.

Part of agenticprimitives — the trust substrate for the agent economy: one canonical Smart Agent identity with custody, delegation, naming, credentials, and audit evidence designed as one system.

What ships today

The W1 foundational slice — the cryptographic spine the contract and downstream packages already rely on:

  • CREDENTIAL_TYPE — keccak discriminators for Association, Evidence, Outcome, Validation, TrustUpdate, JointAgreement, PaymentReceipt (one registry, many types — ADR-0024 Decision 2).
  • computeAttestationUid(...) — recomputes the on-chain UID per AttestationRegistry._computeUid.
  • JOINT_CONSENT_TYPEHASH + jointConsentDigest(...) — the digest BOTH parties sign to consent to a joint agreement. assertJointAgreement recomputes it on chain and verifies both signatures (ERC-1271 / ECDSA); a stored consent reference is not consent (RW1-1, ADR-0027). chainId and the registry address are bound, so consent cannot be replayed cross-chain (ATT-3).
  • JOINT_ISSUER_TYPEHASH + jointIssuerDigest(...) — the issuer signs parties, schema, credential type/hash, agreement commitment, chain, and registry — never a bare hash (ATT-1).
  • ASSOCIATION_ATTESTATION_TYPEHASH + associationAttestationDigest(...) — binds the subject, so a known credential hash cannot be anchored against someone else (SC-2).
  • Request payload shapes — AssociationAttestationRequest, JointAgreementAttestationRequest, matching the contract ABI.

Every typehash above MUST byte-equal its AttestationRegistry.sol constant — enforced by the cross-stack check:eip712-typehash-equality CI gate.

Planned for later waves per the W1 implementation wave plan: assertion builders (buildAssociationAssertion, buildJointAgreementAssertion), the AttestationClient read client, and revocation encoders (holder-only / either-party / validator-only per type).

How it's different

Against EAS and Verax, three concrete deltas:

  1. Contracts and SDK are one artifact. The EIP-712 typehashes in this package are CI-locked to the Solidity constants. In EAS-style stacks the client SDK and the chain are separate codebases that drift; here drift fails the build.
  2. Bilateral consent is verified, not asserted. A joint attestation requires both parties' signatures over a digest the contract recomputes. There is no resolver/module hook where consent semantics can be customized away (ADR-0023, D2).
  3. No issuerRevoke. Holders revoke their own associations; joint agreements revoke by either party; issuer revocation is off-chain via StatusList2021 (D-18). An issuer cannot unilaterally erase a subject's record.

The credential bodies themselves are W3C VCs from verifiable-credentials (type-only dependency); only their canonical hashes touch the chain. Vault-resident bodies stay private unless explicitly opted into public assertion (D-46).

Status

Foundational (W1) — code shipped; not production enforcement. The digest math, typehashes, and payload shapes above are real and gate-checked; the full builder/client surface lands in Wave 4 per the wave plan. See AUDIT.md.

Testnet/pilot-ready. Production launch is gated on the public checklist in the root README — including third-party contract audit and governance key rotation. Track every security finding live in docs/audits/findings.yaml.

Owns spine layers: 12–15. Authoritative spec: specs/242-trust-credentials-and-public-assertions.md — see spec.md for the symlink. Bounded surface: CLAUDE.md + capability.manifest.json.

Build

pnpm --filter @agenticprimitives/attestations typecheck
pnpm --filter @agenticprimitives/attestations test
pnpm --filter @agenticprimitives/attestations build

版本与发布记录

@agenticprimitives/attestations 共发布 40 个版本,首次发布于 2026/06/11;过去 12 个月发布了 40 个版本。

版本发布日期距今
0.0.0-alpha.42latest2026/10/2610 天前
0.0.0-alpha.412026/10/2610 天前
0.0.0-alpha.402026/10/1720 天前
0.0.0-alpha.392026/10/1720 天前
0.0.0-alpha.382026/10/1620 天前
0.0.0-alpha.372026/10/1620 天前

其他发布通道:alpha → 0.0.0-alpha.3。

关于 @agenticprimitives/attestations 的常见问题

@agenticprimitives/attestations 是什么?

AttestationRegistry SDK — EAS-aligned with bilateral consent. Owns Association + JointAgreement + Evidence + Outcome + Validation + TrustUpdate credential types asserted into a single on-chain registry per ADR-0023.

如何安装 @agenticprimitives/attestations?

在项目目录运行 npm install @agenticprimitives/attestations,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:viem(^2.52.2)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@agenticprimitives/attestations 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@agenticprimitives/attestations 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@agenticprimitives/attestations 可以商用吗?

@agenticprimitives/attestations 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@agenticprimitives/attestations 的下载量有多少?

根据 npm 官方下载统计,@agenticprimitives/attestations 在 2026/10/05 – 2026/11/03 这 30 天内被下载 6,739 次,日均约 225 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@agenticprimitives/attestations 还在维护吗?

最新版本 0.0.0-alpha.42 发布于 2026/10/26(10 天前);至今共发布 40 个版本,其中过去 12 个月发布了 40 个;首次发布于 2026/06/11。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。