Skip to main content

Overview

P2PK (Pay-to-Public-Key) locking allows you to lock ecash tokens so that only the holder of a specific private key can redeem them. This provides an additional layer of security for ecash transfers.

Key Management

Sovran includes a built-in keyring for managing P2PK keys:

Key Types

Derived Keys:
app/settings-pages/keyring.tsx
Imported Keys:
app/settings-pages/keyring.tsx

Keyring Storage

Keys are stored securely and managed through the keyring API:
app/settings-pages/keyring.tsx

Quick Access

Enable quick access to show your latest P2PK key in the receive menu:
stores/settingsStore.ts

Receive Screen Integration

components/screens/ReceiveScreen.tsx

P2PK Tab

When quick access is enabled, a P2PK tab appears in the receive screen:
components/screens/ReceiveScreen.tsx

Auto-regeneration

Automatically generate a new P2PK key after redeeming locked tokens for improved privacy:
stores/settingsStore.ts
Default: Enabled (recommended for privacy)

Key Display Formats

P2PK Format

Derived keys are displayed as P2PK hex:
app/settings-pages/keyring.tsx

NPUB Format

Imported keys can be displayed as Nostr npub:
app/settings-pages/keyring.tsx

Current Key Display

app/settings-pages/keyring.tsx

Key Import

Supported Formats

Sovran supports importing keys in multiple formats:
app/settings-pages/keyring.tsx

Import Flow

app/settings-pages/keyring.tsx

Key Generation

app/settings-pages/keyring.tsx

Settings

Preferences

app/settings-pages/keyring.tsx

Use Cases

Locked Transfers

Send ecash tokens that can only be redeemed by a specific recipient:
  1. Obtain recipient’s P2PK public key
  2. Create send token with P2PK lock
  3. Only the recipient with matching private key can claim

Personal Recovery

Lock tokens to your own P2PK key for additional security:
  1. Generate or import a P2PK key
  2. Lock tokens to your public key
  3. Keep private key secure as backup recovery method

Nostr Integration

Use Nostr keys (nsec/npub) for P2PK locking:
  1. Import your Nostr nsec
  2. Share your npub as receiving address
  3. Tokens locked to your Nostr identity