Browser extension for did:nostr and Solid authentication
Podkey is a beautiful, secure browser extension for did:nostr and Solid authentication. It provides a NIP-07-compatible Nostr wallet that enables seamless authentication to Solid pods using did:nostr identities, while remaining fully compatible with the broader Nostr ecosystem.
Clone the repository:
git clone https://github.com/JavaScriptSolidServer/podkey.git
cd podkey
Install dependencies:
npm install
Build the extension:
npm run build
Load in Chrome:
chrome://extensions/podkey directoryTest it:
window.nostr API implementation@noble/secp256k1// Check if Podkey is available
if (window.nostr) {
// Get your public key
const pubkey = await window.nostr.getPublicKey()
console.log('Your public key:', pubkey)
// Sign an event
const event = {
kind: 1,
created_at: Math.floor(Date.now() / 1000),
tags: [],
content: 'Hello from Podkey! π'
}
const signed = await window.nostr.signEvent(event)
console.log('Signed event:', signed)
}
Visit the interactive test page to:
βββββββββββββββββββββββββββββββββββββββββββ
β Browser Extension (Podkey) β
β β
β βββββββββββββββββββββββββββββββββββββ β
β β Popup UI (popup/) β β
β β - Key generation/import β β
β β - Trust management β β
β β - Settings & identity display β β
β βββββββββββββββββββββββββββββββββββββ β
β β
β βββββββββββββββββββββββββββββββββββββ β
β β Background Worker (src/) β β
β β - Key storage (storage.js) β β
β β - Event signing (crypto.js) β β
β β - Permission management β β
β βββββββββββββββββββββββββββββββββββββ β
β β
β βββββββββββββββββββββββββββββββββββββ β
β β Content Script (src/injected.js)β β
β β - Injects window.nostr β β
β β - Bridges page β extension β β
β βββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββ
@noble/secp256k1 v3.0.0 with Schnorr signaturespodkey/
βββ manifest.json # Extension manifest (MV3)
βββ package.json # npm package configuration
βββ src/
β βββ background.js # Service worker (message handling)
β βββ crypto.js # Key generation & signing
β βββ storage.js # Secure key storage
β βββ injected.js # Content script (page bridge)
β βββ nostr-provider.js # window.nostr implementation
βββ popup/
β βββ popup.html # Popup UI structure
β βββ popup.css # Beautiful styling
β βββ popup.js # Popup logic
βββ test-page/
β βββ index.html # Interactive test page
βββ scripts/
β βββ bundle.js # Build script for dependencies
βββ icons/ # Extension icons
# Install dependencies
npm install
# Build the extension (bundles dependencies)
npm run build
# Lint code
npm run lint
# Run tests
npm test
Build the extension:
npm run build
Load in Chrome (see Installation above)
Visit the test page:
test-page/index.html in your browserCheck the console for any errors
Podkey is built for did:nostr and Solid authentication. All public keys are proper 64-character hexadecimal strings, making them fully compatible with the did:nostr specification:
const pubkey = await window.nostr.getPublicKey()
const did = `did:nostr:${pubkey}`
// did:nostr:3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d
This enables:
window.nostr.getPublicKey()Returns the userβs public key (64-char hex).
const pubkey = await window.nostr.getPublicKey()
window.nostr.signEvent(event)Signs a Nostr event. Shows permission prompt if origin is not trusted.
const signed = await window.nostr.signEvent({
kind: 1,
created_at: Math.floor(Date.now() / 1000),
tags: [],
content: 'Hello!'
})
window.nostr.getRelays()Returns relay configuration (coming soon).
const relays = await window.nostr.getRelays()
We love contributions! Hereβs how to get started:
git checkout -b feature/amazing-feature)npm test)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)chrome://extensions/npm installnode_modules and package-lock.json, then npm install againAGPL-3.0 License - see LICENSE for details
Made with π by the JavaScriptSolidServer team
Podkey v0.0.7 - Your keys, your identity, your data