EQTY LabDocs

API Reference

Every method of window.eqtyNotary and of the extension message interface, what needs consent, what each returns, the events, and the error codes.

View as Markdown

The notary has one API, reached two ways:

  • From a page: window.eqtyNotary, defined in every page and iframe in a secure context before any page script runs. The caller is the page’s origin.
  • From another extension: runtime.sendMessage(notaryId, {method, params}), which replies {result} or {error: {code, message}}. The caller is the sending extension’s ID. In Firefox notaryId is browser-notary@eqtylab.io; in Chrome it is the extension’s ID. An extension may pass evidence.tabId to attest to have the notary observe the tab it acted in. The SDK’s extensionNotary(id) wraps this in the same interface as window.eqtyNotary.

The caller’s identity always comes from the browser’s sender metadata (sender.origin, sender.tab, sender.id), never from the request. Opaque origins (sandboxed iframes, data:) are refused.

Methods

All methods return Promises.

methodconsentreturns
info (property)—{name, protocol, version}
detect()no{available, anchored, state, name, protocol, version}
isReady()no{status: "ready", state: "READY", anchored, did?}
publicKey()yes{status, public_key, did, curve: "SECP256r1", alg: "ES256", type, key_scope}
getDids()yes{executedOn, operatedBy, registeredBy}
credential()yesmanifest with your key’s credential chain
sign({data, hash?, algo?})yes{status, signature, public_key, did}
signText(text) · signBytes(bytes) · signJSON(value)yessign reply + data
verifySignature({did, signature, text | bytes | json | data})no{valid}
attest({action, agent?, result?, inputs?, evidence?})yes{manifest, computation, action, observation}
registerStatement({type, body})yes{manifest, statement}
verify(manifest)no{ok, statements, badBlobs, bindings}
viperStatus()no{enabled, mode}: whether VIPER signs this site’s LLM requests, and "direct" or "relay"

Events on window: eqtyNotary#initialized, eqtyNotary#announce (detail {info, notary}); dispatch eqtyNotary#request to get an announcement.

sign has the same contract as the desktop notary’s POST /v1/sign: data is hex, only SHA256 and ECDSA are accepted, signatures are raw r||s hex with low-s, and data is at most 2 MiB. signJSON signs the RFC 8785 (JCS) form, so key order does not matter.

attest parameters

FieldDefaultMeaning
actionrequiredAny JSON object describing what the agent did. type and selector enable DOM matching; give each action a unique id.
agentnoneThe agent’s self-description, recorded as the computation
resultnoneThe outcome the agent reports
inputsnoneurn:cid: references to what the agent consumed
evidence.corroboratetrueMatch the action to a DOM event
evidence.windowMs10000How far back to look for that event
evidence.screenshotfalseAdd a PNG of the visible tab, if it is visible
evidence.domSnapshotfalseAdd the serialized DOM, up to 5 MB
evidence.tabIdcaller’s tabExtensions only: the tab to observe

Action types the DOM matching understands: click, dblclick, rightclick, type / fill / input, select, check, submit, press / keypress. Other types are signed but not matched. Form values are recorded as SHA-256 and length, never in clear; password fields not at all.

registerStatement types

typebody fields
DataRegistrationdata (CID or CIDs)
ComputationRegistrationinput, output (CID or CIDs), computation? (CID), executedOn? (DID; defaults to the browser)
MetadataRegistrationsubject, metadata (CIDs)
StorageRegistrationdata (CIDs), storedOn (DID)
GovernanceRegistrationsubject, document (CIDs)

registeredBy and operatedBy are always the caller’s key. Unknown fields are rejected.

The fetch wrapper

The page API also replaces window.fetch. LLM POSTs (paths ending in /chat/completions, /completions, /responses, /embeddings, /messages, /messages/count_tokens or /complete) from a site with VIPER on are signed and sent by the extension, and resolve to a Response with x-viper-* headers added. Everything else goes to the browser’s fetch unchanged. VIPER is authorized by the popup’s per-site switch, not the consent prompt. See VIPER.

Detection

None of these need consent or reveal a key:

SignalMeaning
window.eqtyNotaryDefined when the extension is installed
<html data-eqty-notary="1">The same, readable from CSS; the value is the protocol version
eqtyNotary#initialized eventFired once on window when the API is ready
eqtyNotary#announce eventA CustomEvent with detail: {info, notary}, fired once on load and in answer to every eqtyNotary#request dispatched on window

The attribute and the global also let any site tell the extension is installed.

Limits

LimitValue
Signing requests per caller120 a minute by default, set in the popup
sign data2 MiB
DOM snapshot5 MB
DOM event look-back10 s by default (evidence.windowMs)
VIPER request bodyunder 10 MiB

Errors

Rejections are Errors with a code:

codemeaning
DENIEDthe user declined the prompt
FORBIDDENnot a secure context, or an opaque origin (sandboxed iframe, data:)
RATE_LIMITEDtoo many signing requests a minute for this site
BAD_REQUESTmalformed input: not hex, unsupported hash/algo, bad statement fields
TOO_LARGEsign data over 2 MiB
PROVISIONINGthe notary is starting, or requires a desktop notary that isn’t ready
UNAVAILABLEthe extension restarted mid-call; retry