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

@cellar-door/erc-8004

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/erc-8004

EXIT Protocol adapter for ERC-8004 Trustless Agents — link departure records to on-chain agent identities

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
1
-88.89%
Maintainers
1
Weekly downloads
 
Created
Source

𓉸 @cellar-door/erc-8004

EXIT Protocol adapter for ERC-8004 Trustless Agents — link departure records to on-chain agent identities and reputation registries.

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

⚠️ Pre-release software — no formal security audit has been conducted. Report vulnerabilities to hawthornhollows@gmail.com.

Install

npm install @cellar-door/erc-8004 ethers

Usage

import { resolveAgent, registerDeparture, queryDepartures } from '@cellar-door/erc-8004';
import { JsonRpcProvider, Wallet } from 'ethers';

const provider = new JsonRpcProvider('https://mainnet.base.org');

// Resolve an agent's on-chain identity
const agent = await resolveAgent(1n, { provider, chain: 'base' });
// → { agentId: 1n, owner: '0x...', agentURI: '...', did: 'did:pkh:eip155:8453:0x...' }

// Register an EXIT departure as a reputation signal
const signer = new Wallet(privateKey, provider);
const result = await registerDeparture(exitMarker, {
  signer,
  agentId: 1n,
  chain: 'base',
  markerUri: 'ipfs://bafybeig...',
});
// → { txHash: '0x...', blockNumber: 12345, feedbackIndex: 0n }

// Query an agent's departure history
const departures = await queryDepartures(1n, { provider, chain: 'base' });
// → [{ origin, exitType, timestamp, feedbackURI, feedbackHash, txHash }]

API

resolveAgent(agentId, options)

Query the IdentityRegistry for an agent's owner, URI, and DID.

ParameterTypeDescription
agentIdbigint | numberAgent token ID
options.providerProviderethers v6 provider
options.chainChainName?Chain name (auto-detected if omitted)

registerDeparture(marker, options)

Register an EXIT marker as a reputation signal via giveFeedback().

ParameterTypeDescription
markerExitMarkerLikeEXIT departure marker
options.signerSignerethers v6 signer
options.agentIdbigint | numberTarget agent ID
options.chainChainName?Chain name (auto-detected if omitted)
options.markerUristring?URI to full marker (IPFS, HTTP)

queryDepartures(agentId, options)

Query NewFeedback events filtered by tag1="departure".

ParameterTypeDescription
agentIdbigint | numberAgent token ID
options.providerProviderethers v6 provider
options.chainChainName?Chain name (auto-detected if omitted)

Contract Addresses

Deterministic across all chains (CREATE2):

NetworkIdentityRegistryReputationRegistry
Mainnet0x8004A169FB4a3325136EB29fA0ceB6D2e539a4320x8004BAa17C55a88189AE136b182e5fdA19dE9b63
Testnet0x8004A818BFB912233c491871b3d84c89A494BD9e0x8004B663056A597Dffe9eCcC1965A193B7388713

Supported chains: Ethereum, Base, Arbitrum, Optimism, Avalanche, BSC, Celo, Gnosis, Abstract, GOAT, Sepolia, Base Sepolia, Arbitrum Sepolia.

Feedback Signal Format

Departures are encoded as ReputationRegistry feedback:

giveFeedback(agentId, 0, 0, "departure", origin, "", markerUri, markerHash)
  • value=0 — neutral signal (departure is informational, not positive/negative)
  • tag1="departure" — indexed for efficient querying
  • tag2=origin — the platform the agent departed from
  • feedbackURI — pointer to full EXIT marker
  • feedbackHash — keccak256 commitment of marker content

Security Considerations

Permissionless Feedback

ERC-8004's ReputationRegistry allows anyone to post feedback for any agent. This means fake departure records can be created at low cost (fractions of a cent on L2). Consumers of departure data should verify:

  • The msg.sender is the agent's owner or authorized operator
  • The feedbackURI resolves to a valid, signed EXIT marker
  • The marker's cryptographic proof is valid

Hash Salt

computeMarkerHash() automatically generates a 256-bit random salt to prevent brute-force attacks on the hash. The salt is returned alongside the hash and must be stored for later verification. Without the salt, the hash cannot be recomputed.

On-Chain Data

Departure records written on-chain are immutable. The origin field (platform name) is stored in cleartext. Consider privacy implications before registering departures for sensitive platforms.

Known Limitations

  • Three-DID problem: EXIT markers use did:key, ERC-8004 derives did:pkh, and registration files may declare other DIDs. These are not cryptographically linked in v0.1.0.
  • Ed25519/secp256k1 mismatch: EXIT proofs use Ed25519 or P-256, but did:pkh resolves to secp256k1 keys. Cross-algorithm binding is not yet implemented.

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 ← you are here
@cellar-door/sign-protocolTypeScriptSign Protocol attestation

Paper · Website

License

Apache-2.0

Keywords

exit

FAQs

Package last updated on 10 Mar 2026

Related posts