Skip to content

feat(nexus): implement Ed25519 signature generation and verification in registry and escrow #2780

@qubeena07

Description

@qubeena07

Package

agent-os / nexus module

Problem Statement

Three places in agent-governance-python/agent-os/modules/nexus/ skip real cryptography entirely:

1. registry.py line 110 — agent registration accepts any signature without checking it

# TODO: Verify signature against verification key
# For now, trust the signature

2. registry.py line 199 — deregistration also skips verification

# TODO: Verify signature

3. escrow.py line 360 — fake string used instead of real Ed25519 signing

# TODO: Generate actual signature
signature = f"sig_{requester_did}_{task_hash[:8]}"

AgentIdentity already stores a proper verification_key in ed25519:<base64_public_key> format. The infrastructure is there — the verification calls are just missing.

Proposed Solution

  1. Add nexus/crypto.py with Ed25519 sign/verify helpers using the cryptography library
  2. Wire verify() into AgentRegistry.register(), update(), and deregister()
  3. In ProofOfOutcome.create_escrow(), require a real requester_signature parameter instead of generating a fake one
  4. Add private_key_bytes to NexusClient and update _generate_signature() to use real Ed25519
  5. Add InvalidSignatureError to exceptions.py
  6. Add cryptography>=42.0.0,<44.0 to nexus/pyproject.toml (already used in dmz.py but undeclared)
  7. Update tests to generate real keypairs and use valid signatures

What the signature covers

  • Registration / update: agent signs the manifest hash (same hash computed by _compute_manifest_hash, which excludes timestamps for determinism)
  • Deregistration: agent signs the agent_did bytes to prove ownership
  • Escrow creation: requester signs "{requester_did}:{provider_did}:{task_hash}:{credits}".encode()

Out of scope

  • Nexus server-side key management (the _sign_registration / _sign_escrow server signatures are placeholders handled separately)
  • Remote DMZ mode (tracked separately as NotImplementedError stubs)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions