Skip to content

Comments

Resolve ENS signer via cl.receipt.signer and cl.sig.pub/kid; add resolveSignerKey and update verification#7

Merged
GsCommand merged 1 commit intomainfrom
codex/update-ens-txt-parsing-and-verification-logic
Feb 15, 2026
Merged

Resolve ENS signer via cl.receipt.signer and cl.sig.pub/kid; add resolveSignerKey and update verification#7
GsCommand merged 1 commit intomainfrom
codex/update-ens-txt-parsing-and-verification-logic

Conversation

@GsCommand
Copy link
Contributor

Motivation

  • Replace legacy/ambiguous ENS TXT pubkey discovery with a deterministic two-hop lookup that favors cl.sig.pub + cl.sig.kid on a signer ENS name referenced by the agent's cl.receipt.signer TXT entry.
  • Improve error messages and strictness so missing or malformed ENS TXT values produce clear, actionable errors during verification.
  • Provide a reusable utility to centralize ENS signer key resolution and make receipt verification logic simpler and more robust.

Description

  • Added resolveSignerKey(name, rpcUrl): Promise<{ algorithm, kid, rawPublicKeyBytes }> which: resolves the agent ENS name's cl.receipt.signer TXT, then resolves the signer ENS name's cl.sig.pub and cl.sig.kid, parses the cl.sig.pub into raw Ed25519 bytes, and throws clear errors when resolver/TXT keys are missing or malformed.
  • Updated verifyReceipt(...) to prefer an explicit publicKey when provided and otherwise call resolveSignerKey(opts.ens.name, opts.ens.rpcUrl) for ENS-based verification; the ens_txt_key context now indicates the two-hop path cl.receipt.signer -> cl.sig.pub, cl.sig.kid.
  • Removed the previous default/legacy reliance on cl.pubkey / cl.receipt.pubkey_pem lookups in ENS verification and replaced it with the cl.sig.pub + cl.sig.kid flow.
  • Added SignerKeyResolution type and improved error handling messages so ENS lookup failures and malformed key material produce explicit throw messages.
  • Updated documentation (README.md) to describe the new required TXT records (cl.receipt.signer, cl.sig.pub, cl.sig.kid) and adjusted the example ENS name.
  • Expanded unit tests (scripts/unit-tests.mjs) to mock ENS resolution and cover successful resolveSignerKey resolution, clear error paths for missing/malformed TXT values, and end-to-end verifyReceipt using ENS-based signer key resolution.

Testing

  • Built the TypeScript SDK with npm run build in typescript-sdk and the build completed successfully.
  • Ran unit tests with npm run test:unit and all unit tests passed (38 passed, 0 failed).
  • Ran full test suite with npm test (unit + CLI smoke) and all tests passed.

Codex Task

@GsCommand GsCommand merged commit 2cdf311 into main Feb 15, 2026
2 checks passed
@GsCommand GsCommand deleted the codex/update-ens-txt-parsing-and-verification-logic branch February 15, 2026 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant