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
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
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:- Obtain recipient’s P2PK public key
- Create send token with P2PK lock
- Only the recipient with matching private key can claim
Personal Recovery
Lock tokens to your own P2PK key for additional security:- Generate or import a P2PK key
- Lock tokens to your public key
- Keep private key secure as backup recovery method
Nostr Integration
Use Nostr keys (nsec/npub) for P2PK locking:- Import your Nostr nsec
- Share your npub as receiving address
- Tokens locked to your Nostr identity