Skip to content

DemosSdkProvider.sign keypair-init gap breaks Verify + Community Bounty #940

Description

@linear

What

Both the Verify identity app and the Community Bounty app fail at the "sign ownership" step with Cannot read properties of undefined (reading 'publicKey'). Both flows go through byte-identical adapter code that calls selectedProvider.request({ method: "sign", params: [message] }). These are the only two provider.request({ method: "sign" }) call sites in the codebase, and both fail the same way — so the bug is in the shared sign provider method, not in either page.

randomblocker confirmed the failure shape and posted the lead on incentives PR #81 (https://github.com/kynesyslabs/incentives/pull/81): DemosSdkProvider.sign (the seed-phrase path) calls demos.crypto.sign("ed25519", ...) directly and skips the keypair-init step (getIdentity('ed25519') → generate) that the SDK's own demos.signMessage performs. With the keypair never initialised, this.keypair.publicKey is undefined when the signing call dereferences it. The extension-handler path may have a separate variant of the same bug.

Acceptance

  • Reproduce both failures locally (extension + seed-phrase) and capture the console stack trace at the point of throw
  • Confirm which provider implementation each path takes (extension handler vs DemosSdkProvider.sign)
  • Fix DemosSdkProvider.sign so it walks the same keypair-init sequence as demos.signMessage before reaching the underlying signer
  • Verify both apps' "Verify" / "Sign ownership" flows succeed end-to-end with extension wallet AND with seed-phrase fallback
  • Add a regression test covering provider.request({ method: "sign", params: [message] }) so a future SDK refactor cannot silently re-introduce the gap

Source

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No 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