Skip to content

sirosfoundation/web-wallet-selector

Repository files navigation

Digital Credentials Wallet Selector

A cross-browser extension that intercepts W3C Digital Credentials API calls and enables users to choose between multiple digital identity wallet providers.

License Tests OpenID4VP

🎯 What It Does

When a website requests credentials using the W3C Digital Credentials API, this extension:

  1. Intercepts the request - Captures navigator.credentials.get() calls
  2. Filters by protocol - Shows only compatible wallets (OpenID4VP, mDoc, W3C VC)
  3. Presents wallet choices - User selects their preferred wallet
  4. Routes the request - Sends the credential request to the chosen wallet
  5. Returns the credential - Wallet response goes back to the website

✨ Key Features

  • OpenID4VP Support - Full implementation with JAR, Presentation Exchange, and DCQL
  • JWT Verification Callbacks - Wallets provide their own signature verification
  • Auto-Registration API - Wallets can register themselves via JavaScript API
  • Protocol-Aware - Filters wallets by supported protocols
  • Cross-Browser - Works on Chrome, Firefox, and Safari
  • User-Friendly - Beautiful modal UI with wallet management

πŸš€ Quick Start

For Users

  1. Install the extension (from your browser's extension store)
  2. Configure wallets - Click the extension icon β†’ "Configure Wallets"
  3. Add wallets - Use pre-configured wwWallet presets or add custom wallets
  4. Done! - Visit any website that requests credentials and select your wallet

For Verifiers (Requesting Credentials)

Use the standard W3C Digital Credentials API:

const credential = await navigator.credentials.get({
  digital: {
    providers: [{
      protocol: "openid4vp",
      request: {
        client_id: "https://verifier.example.com",
        response_type: "vp_token",
        presentation_definition: { /* ... */ }
      }
    }]
  }
});

β†’ See Quick Start Guide

For Wallets (Self-Registration)

Register your wallet with the extension:

if (window.DCWS?.isInstalled()) {
  await window.DCWS.registerWallet({
    name: 'MyWallet',
    url: 'https://wallet.example.com',
    protocols: ['openid4vp'],
    icon: 'πŸ”',
    color: '#3b82f6'
  });
}

β†’ See API Reference

πŸ“‹ Implementation Status

βœ… Completed

  • W3C Digital Credentials API interception
  • OpenID4VP protocol (JAR, Presentation Exchange, DCQL)
  • JWT verification callback system
  • Wallet auto-registration API
  • Protocol-aware wallet filtering
  • Cross-browser support (Chrome, Firefox, Safari)
  • 146 passing tests (100% coverage)

🚧 Planned

  • mDoc OpenID4VP protocol plugin
  • W3C Verifiable Credentials plugin
  • Response encryption callbacks
  • Additional protocol support

πŸ“š Documentation

Getting Started

Developer Documentation

Protocol Documentation

Additional Resources

πŸ› οΈ Development

Prerequisites

  • Node.js (v14+)
  • npm or yarn
  • Chrome, Firefox, or Safari

Setup

# Clone and install
cd /home/leifj/work/siros.org/browser-extensions
npm install

# Build for all browsers
npm run build

# Or build for specific browser
npm run build:chrome
npm run build:firefox
npm run build:safari

# Development with auto-rebuild
npm run watch:chrome

Load in Browser

Chrome:

  1. Go to chrome://extensions/
  2. Enable "Developer mode"
  3. Click "Load unpacked" β†’ Select chrome/ directory

Firefox:

  1. Go to about:debugging#/runtime/this-firefox
  2. Click "Load Temporary Add-on" β†’ Select firefox/manifest.json

Safari:

  1. Convert: xcrun safari-web-extension-converter safari/
  2. Open Xcode project and run

β†’ Complete Development Guide

πŸ§ͺ Testing

# Run all tests
npm test

# Run specific test suites
npm test -- tests/openid4vp.test.js
npm test -- tests/jwt-verification.test.js

# Open interactive test pages
open test-page.html
open test-wallet-api.html

Test Coverage: 146/146 tests passing (100%)

β†’ Testing Documentation

πŸ“¦ Packaging

# Package for Chrome Web Store
npm run package:chrome

# Package for Firefox Add-ons
npm run package:firefox

# Or use Makefile
make package

β†’ Packaging Guide

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Website   β”‚ Calls navigator.credentials.get()
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
       β”‚
       v
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Extension (inject.js)              β”‚
β”‚  - Intercepts DC API calls          β”‚
β”‚  - Exposes window.DCWS API          β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚
       v
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Protocol Plugin (OpenID4VPPlugin)  β”‚
β”‚  - Parses/validates requests        β”‚
β”‚  - Handles JAR, DCQL, Pres. Ex.     β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚
       v
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Wallet Selection Modal             β”‚
β”‚  - Filters by protocol              β”‚
β”‚  - User selects wallet              β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚
       v
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Wallet    β”‚ Processes request, returns credential
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

β†’ Protocol Architecture

🀝 Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Write tests for new features
  4. Run npm test to verify
  5. Submit a pull request

β†’ Development Guide

πŸ“„ License

BSD 2-Clause License - see LICENSE file for details.

Copyright (c) 2025, SIROS Foundation

πŸ”— Resources

πŸ“ž Support


Made with ❀️ by the SIROS Foundation

About

a browser extension for making the DC API work with web wallets

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published