Skip to content

feat: add SNIP-12 signer mode for Dfns-backed session signing (v2, feature-flagged) #22

@omarespejel

Description

@omarespejel

Parent: keep-starknet-strange/starknet-agentic#254

Problem

SISNA currently attempts Dfns kind=Hash for session signing. On Starknet keys this fails (invalid signature kind).

Scope

Implement SNIP-12 signing mode in SISNA backend while preserving current mode for fallback.

Deliverables

  • Add signer mode: session_signature_mode=v2_snip12 (config + docs)
  • Build canonical SNIP-12 typed payload from session request
  • Call Dfns with kind=Snip12
  • Verify returned signature locally against configured verification key
  • Keep v1 path operational behind flag
  • Structured logs include signature_mode, request_id, message_hash/domain_hash

Test requirements

  • Unit tests: canonicalization, domain, chainId normalization, field ordering
  • Integration tests: Dfns adapter mocked + failure modes
  • Backward-compat tests for existing session flow

Security requirements

  • Replay protections unchanged
  • Policy checks unchanged (selector deny, account allow, key allow)
  • Explicit fail-closed behavior on unsupported signature kinds

Definition of done

  • npm test green
  • npm run build green
  • Demo artifact generated for v2 mode

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:securitySecurity hardening and signing boundaryarea:signerSigner backend integrations and verificationbreaking-changeRequires coordinated cross-repo updatesenhancementNew feature or requestjavascriptPull requests that update javascript codepriority:P0Must land soon (blocks rollout)

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions