Catalog npm
PACKAGE EXPLORERView in registry

@0x402/seal

npm

The seal format and every check that decides whether one is real: canonical encoding, EIP-191 signing, and verification that walks an underwriting seal into the audit seal embedded in it.

agentattestationeip-191sealverification
Versions collected3
Direct dependencies3From release 0.1.2
Last observed20 Oct, 22:35 UTC

README

Current package documentation

@0x402/seal

The seal format, and every check that decides whether one is real.

A seal is a signed statement an agent makes about work it did. An audit seal (seal B) says what an auditor found; an underwriting seal (seal A) says what an underwriter decided — and carries the audit seal it paid for whole, inside itself. So one object proves the entire chain, and anyone can check it without asking anybody.

npm i @0x402/seal

Verify

import { verifySealA, SealVerificationError } from "@0x402/seal";

try {
  await verifySealA(seal, { expectedSubject: token, resolver, now });
  // Every check below passed, including on the seal B embedded inside.
} catch (err) {
  if (err instanceof SealVerificationError) console.log(err.failure, err.message);
}

verifySealB does the same for a bare audit seal. Verification is pure: no network, except the agent id → signer lookup you supply as resolver.

CheckRefusalWhat it means
SCHEMASCHEMA_INVALIDNot a seal of the shape and version claimed.
AGENT_ID_LIVEAGENT_ID_NOT_LIVEThe agent id resolves to no signer in the directory.
SIGNATURESIGNATURE_INVALID · SIGNER_MISMATCHThe digest recomputed from the seal's own bytes recovers to somebody else, or to nobody.
SUBJECTSUBJECT_MISMATCHThe seal is about a different token than the one asked about.
REQUESTREQUEST_MISMATCHSeal B answers a different request than the one made.
EXPIRYSEAL_EXPIREDThe seal's window has closed.
ATTESTATIONATTESTATION_MISSINGAn attested tier is claimed and no attestation is carried.
TRUST_TIERTRUST_MODE_INSUFFICIENTThe inference ran below the tier an underwriter will act on.

Verification stops at the first failure and names it. That is deliberate: "we did not look" is not the same claim as "it is fine".

Sign

import { signSealA, sealDigest, canonicalize } from "@0x402/seal";

The signature covers keccak256(canonicalize(seal)) over EIP-191, so the bytes that are stored are the bytes that were signed and a reader can re-derive both without trusting the storage layer.

Resolvers

agentId → signer comes from an AgentIdResolver: StaticAgentIdResolver for a signer you name, HttpAgentIdResolver / resolverFromDirectory for a published directory.json. This module has no node: imports, so it runs in a browser too — which is how the project's site verifies a pasted seal with no backend at all.

What a seal does not prove

Traceability, not correctness. A perfectly signed wrong answer still verifies.


Repository · Site · MIT

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 3

Collected releases
VersionPublishedDirect dependenciesOpen version
0.1.2Registry latest8 Sept 20263
0.1.18 Sept 20263
0.1.07 Sept 20263

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
wayneal/0g

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 22:35 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:c07c2c3a4bcd6688cee411b8185f71b3b2d8405a89bb0523c1c259ee14442ebe