Skip to content

Key

The Porto Key provides key management for Porto Accounts with support for various key types including WebAuthn (passkeys), WebCrypto-P256, P256, and Secp256k1.

Key Diagram

Usage

example.ts
import { Account, Key, RelayActions } from 'porto/viem'
import { client } from './config'
 
const passkey = await Key.createWebAuthnP256({ 
  label: 'My Passkey', 
}) 
 
const account = Account.fromPrivateKey('0x...', {
  keys: [passkey] 
})
 
await RelayActions.upgradeAccount(client, {
  account,
})