New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

@cellar-door/sign-protocol

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cellar-door/sign-protocol

Sign Protocol adapter for EXIT Protocol — anchor departure markers as on-chain attestations via Sign Protocol

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

@cellar-door/sign-protocol 𓉸

Anchor EXIT departure markers as privacy-minimal on-chain attestations via Sign Protocol.

𓉸 Passage Protocol · exit-door · entry-door · mcp · langchain · vercel · eliza · eas · erc-8004 · sign · python

⚠️ Pre-release software. No formal security audit has been performed. Use at your own risk. Report vulnerabilities to hawthornhollows@gmail.com.

What This Does

EXIT markers are verifiable departure records for AI agents. This package anchors them on-chain as Sign Protocol attestations — non-transferable, permanent, queryable records on any EVM chain supported by Sign Protocol.

Privacy-minimal design: Only 3 fields are stored on-chain (markerHash, timestamp, vcUri). No personal data (agent DID, origin, exitType) touches the chain. Full marker data lives behind the vcUri where it can be access-controlled, encrypted, or deleted (GDPR Art. 17).

Install

npm install @cellar-door/sign-protocol viem

Quick Start

import {
  createExitClient,
  registerDepartureSchema,
  attestDeparture,
  blindIndexingValue,
  queryDepartures,
  verifyMarkerHash,
  INDEXING_ENDPOINTS,
} from '@cellar-door/sign-protocol';
import { EvmChains } from '@ethsign/sp-sdk';

// 1. Create a client
const client = createExitClient({
  privateKey: '0xabc...',
  chain: EvmChains.baseSepolia,
});

// 2. Register the EXIT schema (one-time, costs gas)
const { schemaId } = await registerDepartureSchema(client);

// 3. Create a blinded index (never expose raw DID)
const DEPLOYER_SECRET = process.env.DEPLOYER_SECRET!;
const blindedIndex = blindIndexingValue('did:key:z6MkAgent...', DEPLOYER_SECRET);

// 4. Create a departure attestation
const result = await attestDeparture(client, {
  id: 'urn:exit:platform:agent-abc:1700000000',
  subject: 'did:key:z6MkAgent...',
  origin: 'did:web:platform.example.com',
  timestamp: 1700000000,
  exitType: 'voluntary',
  status: 'good_standing',
}, {
  schemaId,
  indexingValue: blindedIndex,
  vcUri: 'https://example.com/vc/departure/123',
});

console.log(result.attestationId); // '0x...'
console.log(result.markerHash);    // '0x...' (keccak256 commitment)
console.log(result.salt);          // '0x...' (store securely!)

// 5. Query departures
const departures = await queryDepartures(client, {
  schemaId,
  indexingValue: blindedIndex,
  endpoint: INDEXING_ENDPOINTS.mainnet, // or .testnet
});

// 6. Verify a hash against a marker
const valid = verifyMarkerHash(marker, result.markerHash, result.salt);

API

createExitClient(options)

Create a SignProtocolClient configured for EXIT departures.

OptionTypeDefaultDescription
privateKey`0x${string}`requiredHex private key
chainEvmChainsbaseSepoliaTarget chain
modeSpModeOnChainOn-chain or off-chain

registerDepartureSchema(client)

Register the EXIT departure schema on-chain. Returns { schemaId }.

attestDeparture(client, marker, options)

Create a privacy-minimal attestation. Only markerHash, timestamp, and vcUri are stored on-chain. Returns { attestationId, markerHash, salt, indexingValue }.

blindIndexingValue(agentDid, deployerSecret)

Compute a blinded index from an agent DID. The deployer secret is required — without it, the index is brute-forceable against known DID sets.

queryDepartures(client, options)

Query attestations via Sign Protocol's indexing service. Supports configurable endpoint and timeout.

OptionTypeDefaultDescription
schemaIdstringrequiredSchema ID
indexingValuestringrequiredBlinded index
pagenumber1Page number
endpointstringtestnetIndexing service URL
timeoutMsnumber10000Fetch timeout

verifyMarkerHash(marker, expectedHash, salt)

Verify a marker hash against a marker and salt. Returns true if the commitment matches.

computeMarkerHash(marker, salt?)

Compute a keccak256 commitment hash with mandatory salt. Auto-generates 256-bit random salt if not provided.

revokeDeparture(client, attestationId, options?)

Revoke an attestation. Only the original attester can revoke. Revocation marks the record but does not delete it.

On-Chain Schema

Privacy-minimal — no personal data on-chain:

FieldTypeDescription
markerHashbytes32Salted keccak256 commitment
timestampuint256Unix timestamp
vcUristringURI to full Verifiable Credential

Security Considerations

See SECURITY.md for full details.

  • Salt = private key. Anyone with the salt can verify what the markerHash commits to. Store it with the same care as a private key.
  • Permissionless attestations. Anyone can create attestations. Always verify the attester address against known operator registries.
  • Blinded indexing required. Never use raw agent DIDs as indexingValue — they create a departure history oracle queryable by anyone.
  • Third-party indexing. queryDepartures() uses EthSign's centralized indexing service. For privacy-critical deployments, scan on-chain events directly.
  • Revocation ≠ erasure. Revoking an attestation marks it but does not delete on-chain data.
  • Arweave (off-chain mode). Permanent, unjurisdictional storage. Data cannot be erased under any circumstances, including GDPR Art. 17 requests.

Ecosystem

PackageLanguageDescription
cellar-door-exitTypeScriptCore protocol (reference impl)
cellar-door-exitPythonCore protocol
cellar-door-entryTypeScriptArrival/entry markers
@cellar-door/langchainTypeScriptLangChain integration
cellar-door-langchainPythonLangChain integration
@cellar-door/vercel-ai-sdkTypeScriptVercel AI SDK
@cellar-door/mcp-serverTypeScriptMCP server
@cellar-door/elizaTypeScriptElizaOS plugin
@cellar-door/easTypeScriptEAS attestation anchoring
@cellar-door/erc-8004TypeScriptERC-8004 identity/reputation
@cellar-door/sign-protocolTypeScriptSign Protocol attestation ← you are here

Paper · Website

License

Apache-2.0 — see LICENSE.

Keywords

exit-protocol

FAQs

Package last updated on 10 Mar 2026

Related posts