Principal wallet for registration, or agent wallet for notarization
storageRpcUrl
string
0G Storage indexer URL
computeRpcUrl
string
0G Compute broker URL
computeDefaultModel
string
Default model ID for sealed inference (e.g. qwen/qwen-2.5-7b-instruct)
AgentPassport
register()
Mints a new AgentPassport. Generates a fresh agent keypair, encrypts the permission manifest with AES-256-GCM (key derived from the principal's EIP-712 signature), uploads ciphertext to 0G Storage, then calls SigilRegistry.register() on-chain.
IMPORTANTThe returned agentPrivateKey is delivered exactly once. Store it immediately in a secrets manager or env var. Sigil never persists it.
Read a PassportRecord from on-chain. Anyone can call this — no authentication required.
typescript
const passport = await sigil.passport.resolve(passportId);
passport.passportId // bytes32
passport.principal // principal wallet address
passport.agentAddress // agent wallet address
passport.active // false after revokeAgent()
passport.reputationScore // bigint, 0–1000
passport.taskCount // number of keeper-attested tasks
passport.failureCount // number of failed tasks
passport.provenanceRecordCount // total notarized outputs
passport.executionFingerprintCount
getManifest()
Decrypt and return the permission manifest. Only succeeds if the configured signer is the principal that registered the passport — the AES-GCM key is derived from the principal's signature.
typescript
// signer must be the principal wallet
const manifest = await sigil.passport.getManifest(passportId);
manifest.agentDescription
manifest.permissions.whitelistedContracts
manifest.permissions.authorizedApis
ProvenanceNotary
notarize()
Notarize an AI-generated artifact on-chain. The signer must be the registered agent wallet for this passport. The method:
Encrypts and uploads the input context to 0G Storage
Builds a v2 provenance envelope wrapping the sealed receipt and raw output
Uploads the envelope to 0G Storage
Signs an EIP-712 typed-data payload
Calls ProvenanceNotary.notarize() on-chain
Optionally triggers the auto-attest sidecar (reputation update)
typescript
const result = await agentSigil.provenance.notarize({
passportId,
inferenceReceipt, // SealedInferenceReceipt from 0G Compute
inputContext: prompt, // plaintext — encrypted before upload
output: response, // plaintext — hashed on-chain
artifactType: ArtifactType.GENERIC_REPORT,
});
result.recordId // bytes32 — permanent record identifier
result.txHash // on-chain transaction hash
result.outputHash // keccak256 of the output
result.inputContextHash // keccak256 of the ciphertext
result.proofRootHash // 0G Storage root hash of the proof envelope
result.attestation?.txHash // auto-attest sidecar tx (if configured)
Parameter
Type
Description
passportIdrequired
PassportId
The agent's passport identifier (bytes32)
inferenceReceiptrequired
SealedInferenceReceipt
Receipt from ZeroGComputeAdapter.runSealedInference() or a manually constructed receipt
inputContextrequired
string
The input prompt or context. Encrypted with HKDF-derived AES-256-GCM key before upload.
outputrequired
string
The model output or artifact text. Hashed on-chain; also inlined in the proof envelope.
const record = await sigil.provenance.resolve(recordId);
record.recordId
record.passportId
record.principal // principal at notarization time
record.agent // agent wallet address
record.modelId // e.g. "qwen/qwen-2.5-7b-instruct"
record.outputHash
record.artifactType
record.timestamp
resolveFull()
Resolve on-chain record + download proof envelope from 0G Storage + (optionally) decrypt input context.
typescript
const full = await agentSigil.provenance.resolveFull(recordId);
full.record // on-chain ProvenanceRecord
full.proofEnvelope // parsed JSON proof envelope from 0G Storage
full.output // raw output text (v2 envelopes only)
full.envelopeSchema // "sigil.provenance-envelope/2"
full.inputContext // decrypted input context (only if signer is the agent)
TIPLive model IDs on 0G Galileo testnet: qwen/qwen-2.5-7b-instruct. The vendor prefix is required — passing qwen-2.5-7b-instruct without the prefix will not match the on-chain broker listing.
Credentials
The persistAs option in register() writes a discoverability file. Agent runtimes can later read it without re-scanning the chain.
typescript
import { readCredential, listCredentials } from "sigil-protocol";
// Read a specific credential
const me = readCredential("risk-agent");
console.log(me.passportId);
console.log(me.agentAddress);
console.log(me.principal);
// List all stored credentials
const all = listCredentials();
Credentials are stored at ~/.sigil/credentials/<name>.json. They contain only public metadata — never the agent private key.