PigeonIdP
Accounts without a company: one name on every app, and your own keys sign what you write.
npm install pigeonidpGitHub · npm · Accounts guide
Account records
An account is a signed record: the name, the public keys, and the private keys sealed with the account's password. Relays keep these records (on by default in a freertc Node relay; FREERTC_IDP=off turns it off), so a person can sign in on a new device even when none of their other devices is online.
import { createAccountRecord, openAccountRecord } from 'pigeonidp/records'
// Register: the record is signed with the account's own key.
const record = await createAccountRecord({ alias: 'alice', namespace: 'my-app', keys, password })
// Sign in on another device: fetch the record, then open it.
const opened = await openAccountRecord(record, password) // throws on a wrong password- A relay keeps the first record for a name, and afterwards only a newer one signed by the same key. A name can't be taken over by registering it again.
- The relay never sees a password or an unsealed key.
Post-quantum records
Records are version 2: the key pair (UnSea 3) carries ML-DSA-65 and ML-KEM-768 keys next to its P-256 ones, the record is signed with both, and the keys inside are sealed with Argon2id.
- Version 1 records (P-256 only) still verify and open;
upgradeAccountRecord(record, password)makes a version 2 record with the same public key. - Once a name has a version 2 record, a relay replaces it only with another version 2 record with the same post-quantum key: it can be neither downgraded nor handed to another key.
- Relays take new names only as version 2 records.
The PigeonIdP class
import { PigeonIdP } from 'pigeonidp'
const idp = new PigeonIdP({ namespace: 'my-app' })
await idp.init()
await idp.createIdentity('alice', 'a long password')
const token = await idp.generateAuthToken({ username: 'alice' }, 3600)
const { valid } = await idp.verifyAuthToken(token)It also signs, verifies, encrypts and decrypts with the identity's keys, exports and imports them, and can act as a SAML 2.0 identity provider for ordinary single sign-on (see the README).