Skip to content

privacy-ethereum/social-recovery

Repository files navigation

Social Recovery SDK

Minimal Passkey (WebAuthn) auth module per spec v0.1.

Quickstart (Passkey Auth – v0.1)

Install dependencies (yarn preferred):

yarn

Build:

yarn build

Use 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:demo

Then open the printed URL and click "Prove with Passkey".

Notes

  • 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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published