Skip to content

feat(credentials): implement Ed25519 cryptographic credentials and institutional verification - #20

Merged
ashishsinghbora merged 2 commits into
mainfrom
feat/verifiable-credentials
Oct 30, 2026
Merged

ashishsinghbora merged 2 commits into
mainfrom
feat/verifiable-credentials

Conversation

@ashishsinghbora

Copy link
Copy Markdown
Contributor

Summary

Implements Stage 6: Verifiable Credentials & Cryptographic Infrastructure (Milestone 5) to upgrade TechNexus credentials into tamper-evident, cryptographically verifiable credentials backed by asymmetric Ed25519 digital signatures and public JWKS key discovery.

Closes #19

Architectural Invariants & Key Changes

  1. Cryptographic Engine (src/lib/credentials/crypto.ts):

    • Asymmetric Ed25519 digital signatures using Node.js built-in cryptography.
    • Deterministic JSON canonicalization (canonicalize) producing stable digests across key insertion order.
    • SHA-256 canonical digest computation and payload signing.
    • Key rotation support with Key IDs (kid: tn-ed25519-2026-v1).
    • Signature validation with strict tamper rejection.
  2. Public Key Discovery Endpoint (src/app/api/verify/keys/route.ts):

    • Publicly accessible JWKS discovery endpoint delivering public keys (kty: OKP, crv: Ed25519, alg: EdDSA) for institutional verification by universities, employers, and scanners.
    • Configured with HTTP cache headers (Cache-Control: public, max-age=3600).
  3. Database Schema & Migrations (drizzle/0009_cryptographic_credentials.sql):

    • Expanded type enum in credentials table to include:
      • learning_track_completion
      • internship_completion
      • cohort_completion
    • Added signature, signing_key_id, and canonical_hash columns.
  4. Credential Engine Upgrade (src/lib/credentials/engine.ts):

    • Introduced issueVerifiableCredential automating Ed25519 signature computation over canonical claims.
    • Updated metadata builders for fellowship and curriculum track graduation.
  5. Institutional Verification UI (src/app/verify/[id]/page.tsx):

    • Displays cryptographic verification card showing verified Ed25519 signature badge, Key ID, and canonical SHA-256 hash.
    • Tailored evidence views for GitHub PRs, curriculum tracks, and fellowship mentors.
    • Dedicated print / PDF certificate generation button (PrintButton.tsx) with print-optimized CSS.

Verification

  • Automated Tests: 110/110 tests passing across 25 test files (npm test).
  • Type Checking: Clean pass with zero errors (npm run typecheck).
  • Linting: Clean pass with zero errors/warnings (npm run lint).
  • Production Build: 27/27 routes compiled successfully (npm run build).

Copilot AI balanced review requested due to automatic review settings October 30, 2026 02:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@ashishsinghbora
ashishsinghbora merged commit 84e16e1 into main Oct 30, 2026
1 check passed
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.

feat(credentials): implement Ed25519 cryptographic credentials and institutional verification

2 participants