Matrix logo

Deus - Chain Access, Auth, Wallet, Registries, and Manifests

Caller authentication, EVM chain client, on-chain ServiceRegistry binding, wallet HTTP client, registry orchestration, and manifest validation and hashing.

Caller Authentication

Source: deus/internal/auth/auth.go

Caller is the authenticated agent identity passed through request context via auth.Middleware.

Header behavior

HeaderBehavior
AuthorizationRequired bearer token in normal mode
X-Caller-DIDOptional DID hint (dev mode fallback when bearer absent)
X-Caller-WalletOptional wallet address

In dev mode, a missing bearer can still produce a Caller if X-Caller-DID is present.

Chain Client

Source: deus/internal/chain/client.go

Client wraps ethclient.Client for Paxeer chain 125. New can reject a connection if the remote chain ID does not match. Ping issues a lightweight BlockNumber call.

On-Chain ServiceRegistry

Source: deus/contracts/src/ServiceRegistry.sol, deus/internal/chain/bindings/service_registry.go

The ServiceRegistry contract stores service records, ownership, payout addresses, manifest/pricing hashes, and status on Paxeer chain 125.

Service struct

PropertyTypeMeaning
iduint256Numeric service identifier
owneraddressCurrent owner
payoutaddressPayout address
manifestHashbytes32Manifest content hash
pricingHashbytes32Pricing content hash
statusuint80=draft, 1=active, 2=paused, 3=delisted
hostedboolWhether hosted
confidentialboolWhether confidential
registeredAtuint64Registration timestamp
updatedAtuint64Last update timestamp

Contract methods

MethodAccessDescription
registerAnyoneCreate active service, emits ServiceRegistered
updateOwnerUpdate manifest/pricing hashes
setStatusOwner/GovernorChange status (0-3)
setPayoutOwnerUpdate payout address
transferOwnerOwnerTransfer ownership
getServiceAnyoneRead full service record

Chain Registry facade

Source: deus/internal/chain/registry.go

Registry is the Go facade that signs and submits register transactions, waits for receipts, and extracts the ServiceRegistered event to get the on-chain service ID.

Wallet HTTP Client

Source: deus/internal/wallet/client.go

HTTPClient forwards the caller bearer token to the Paxeer embedded wallet API:

MethodDescription
SendDirect native PAX transfer via /v1/agent/send
AuthorizeSpendPre-flight wallet configuration check
OpenStreamOpen PaymentStreams session
StreamSettleSettle a stream
StreamCloseClose a stream

HTTP 403 responses are mapped to PolicyDenied with the cap_wei preserved.

Registry Orchestration

Source: deus/internal/registry/registry.go

Service orchestrates listing lifecycle:

MethodDescription
CreateValidate manifest, insert draft in store, return id + slug + manifest hash
PublishSign + submit on-chain register, mirror chain state to store, push to discovery indexer

Manifest Schema

Source: deus/pkg/manifest/manifest.go

Manifest struct

FieldTypeDescription
schema_versionstringManifest version
slugstringURL-safe identifier
kindstring"agent" or "data"
display_namestringHuman-readable name
summarystringShort description
descriptionstringFull description
tags[]stringDiscovery tags
ownerstringOwner address
payout_addressstringPayout address
payee_didstringLayerX earnings identity (LXP rail)
modestring"proxy" or "hosted"
settlement_modestring"exact" (default) or "hold"
hold_ttl_sint64Hold lifetime seconds
confidentialboolTEE-backed execution
operations[]OperationCallable operations
pricing[]PricingPer-operation pricing
endpoint*EndpointProxy routing hints
sla*SLAUptime/latency targets

Pricing

Pricing supports dual denomination: wei (price_wei) for legacy plans and USDX (unit_price_usdx) for LayerX settlement. USDX-only listings are enforced when the LXP rail flag is on.

Operation

FieldType
namestring
methodstring (HTTP method)
input_schemamap[string]any
output_schemamap[string]any
timeout_msint
max_response_bytesint