Skip to content

Audit decode: surface CBOR AuditEnvelope + EVM calldata decoding to the web UI #153

@hanwencheng

Description

@hanwencheng

Why

The parent-control web UI's step-9 audit view must decode every action and its Heima TX (user flow step 9: "we should be able to decode all the messages"). Today the UI ships a mock decodeCalldata (event-kind → 4-byte selector + function signature) and a deterministic txHash. We need real decoding.

Two halves to decode

  1. CBOR AuditEnvelope v1agentkeys-core: AuditEnvelope v1 cross-language CBOR vector exporter #137 shipped the cross-language CBOR vector exporter (crates/agentkeys-core/examples/export_audit_vectors.rs) + frozen vectors. We need a decoder path the web UI can call (the audit-service stores envelopes; the UI should render the decoded {op, actor_omni, intent_commitment, ...}).
  2. EVM calldata → typed args — decode registerAgentDevice / setScopeWithWebauthn / CredentialAudit.append / appendRoot calldata against the four deployed contract ABIs (AgentKeysScope, SidecarRegistry, K3EpochCounter, CredentialAudit) so the TX panel shows real selectors + decoded params, not a static map.

Proposed shape

  • A daemon (ui-bridge) endpoint, e.g. GET /v1/audit/:id/decode{ envelope: {...decoded CBOR...}, tx: { hash, to, selector, fn, args: [...] }, status }.
  • Decoder reuses agentkeys-core for the CBOR side (do not re-implement the schema in TS) and an ABI decoder (ethabi / alloy) for the calldata side.
  • The web UI's decodeCalldata mock (apps/parent-control) is replaced by a call to this endpoint — already structured as a one-function swap.

Acceptance

Refs

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/auditAudit worker, two-tier audit (off-chain feed + on-chain anchor)area/uiParent-control UI, vendor onboarding portal, audit dashboardenhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions