Minimal Passkey (WebAuthn) auth module per spec v0.1.
Install dependencies (yarn preferred):
yarnBuild:
yarn buildUse the minimal API:
import { createAuth } from '@pse/social-recovery';
const auth = createAuth();
// For deriveCommitment you should initialize the adapter with the guardian's
// uncompressed P-256 public key (65 bytes). In this MVP the key is provided
// out-of-band. Example below omits it for brevity.
const intent = {
account: '0x...',
action: 'setOwner',
nonce: '1',
deadline: Date.now() + 600_000,
chainId: 1,
};
// Browser-only: will call navigator.credentials.get with challenge=intentHash
const proof = await auth.methods.passkey.prove(intent);
console.log(proof);Run the demo (browser):
yarn dev:demoThen open the printed URL and click "Prove with Passkey".
- Guardian commitment: keccak256(P-256 public key || salt) per spec.
- Proof bundle includes WebAuthn assertion fields and intentHash.
- In this MVP, public key retrieval/creation is not automated; provide the uncompressed key when constructing the adapter to derive the commitment.