Skip to content

feat(protocol): add personal server registration signing#147

Merged
tnunamak merged 7 commits into
volod/vana-storage-org-defaultfrom
tim/ps-registration-intent-signing
May 14, 2026
Merged

feat(protocol): add personal server registration signing#147
tnunamak merged 7 commits into
volod/vana-storage-org-defaultfrom
tim/ps-registration-intent-signing

Conversation

@tnunamak
Copy link
Copy Markdown
Member

Summary

  • add canonical Personal Server registration typed-data/signing helpers
  • add viem-compatible signer adapter for local accounts and wallet clients
  • add isolated first-party Account helper for the constrained PS registration signing endpoint

Architecture

  • protocol helpers are Account/Privy/OAuth-free
  • Account integration is isolated under src/account and only knows an accountOrigin + endpoint contract
  • Account helper defaults to the stable v1 route, but normalizes the current experimental Account response shape so unity can test before the v1 route is added

Validation

  • npm test --workspace @opendatalabs/vana-sdk -- --run src/protocol/eip712.test.ts src/protocol/personal-server-registration.test.ts src/account/personal-server-registration.test.ts
  • npm run typecheck --workspace @opendatalabs/vana-sdk
  • npm run build --workspace @opendatalabs/vana-sdk
  • push hook: npm run typecheck and npm run test:coverage (610 tests passed)

Notes

@vercel
Copy link
Copy Markdown

vercel Bot commented May 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Actions Updated (UTC)
vana-console Ignored Ignored May 14, 2026 3:42pm
vana-rbac-auditor Ignored Ignored May 14, 2026 3:42pm
vana-vibes-demo Ignored Ignored May 14, 2026 3:42pm

Request Review

@github-actions
Copy link
Copy Markdown

Findings:

  • packages/vana-sdk/src/account/personal-server-registration.ts:164: AccountPersonalServerRegistrationRequest exposes chainId and verifyingContract via BuildPersonalServerRegistrationTypedDataInput, but the Account POST body drops both. If a caller passes either override and Account returns a signed response without typedData, buildSignedResult() reconstructs typed data using the overrides, while Account likely signed the default/config domain. That can return a signature paired with the wrong typed data. Either send these fields, or remove them from the Account request type and only allow config.

  • packages/vana-sdk/src/account/personal-server-registration.ts:100: parseAccountResponse() always calls response.json() before checking response.ok. A 500/404 HTML or empty response will throw a JSON parse error instead of the intended status/error message. Consider await response.json().catch(() => ({})), as other gateway code does.

Verification note: I attempted the targeted tests and typecheck, but this checkout is missing installed dev deps (vitest and @types/node), so they could not run locally.

@tnunamak
Copy link
Copy Markdown
Member Author

Unity integration is merged to dev and deployed on the dev surfaces.

Local/dev validation passed on Unity: Account/Web typecheck, Account/Web tests, runtime boundary check, Account/Web build, plus Vercel dev deployments.

@tnunamak
Copy link
Copy Markdown
Member Author

Checked the automated findings. Both are addressed on current head:

  • a84748b forwards chainId and verifyingContract in the Account request body, so fallback reconstruction cannot drift from the requested domain.
  • 69436e3 changes Account response parsing to tolerate non-JSON/empty error bodies and throw AccountPersonalServerRegistrationError with status/code/details instead of leaking a JSON parse failure.

Re-ran SDK focused tests/typecheck/build locally before the Unity integration; Unity PR #54 is merged to dev and dev CI/deployments are green.

@tnunamak
Copy link
Copy Markdown
Member Author

Added support for the other signature we discussed: PS Lite owner binding.

Current SDK head now includes:

  • protocol/personal-server-lite-owner-binding: builds/signs vana.account.v1:ps-lite-owner:<wallet> using generic/viem signers
  • account/personal-server-lite-owner-binding: adapts an Account-style { getAddress, signMessage } client

Validation:

  • focused owner-binding tests pass
  • SDK typecheck/build pass
  • push hook passed full typecheck + coverage: 45 files / 619 tests

Unity follow-up PR using the helper: https://github.com/vana-com/unity-surfaces/pull/55

@tnunamak tnunamak merged commit 1357e6b into volod/vana-storage-org-default May 14, 2026
6 checks passed
@tnunamak tnunamak deleted the tim/ps-registration-intent-signing branch May 14, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant