See SDK Reference for more details on the PKP Sign. PKP Sign Reference

Prerequisites

  • authContext is required. This is the result from the authentication flow.
  • pubkey is required. This is the public key of the PKP to sign with.

Quick Example

// The message string will be UTF-8 encoded before signing.
// Hashing (e.g., Keccak256 for Ethereum, SHA256 for Bitcoin)
// is handled automatically by the Lit Protocol based on the selected chain.
const messageBytes = new TextEncoder().encode(messageToSign);

const signatures = await litClient.chain.raw.pkpSign({
  chain: "ethereum",
  signingScheme: "EcdsaK256Sha256",
  pubKey: pkpInfo.pubkey,
  authContext: authContext,
  toSign: messageBytes, // UTF-8 encoded message
});

Available signing schemes

ECDSA Schemes

SchemeCurve
EcdsaK256Sha256secp256k1
EcdsaP256Sha256NIST P‑256
EcdsaP384Sha384NIST P‑384

EdDSA Schemes

SchemeCurve
SchnorrEd25519Sha512ed25519
SchnorrEd448Shake256ed448

Schnorr Variants

SchemeCurve
SchnorrK256Taprootsecp256k1
SchnorrK256Sha256secp256k1
SchnorrP256Sha256NIST P‑256
SchnorrP384Sha384NIST P‑384

ZK/Privacy Schnorr Variants

SchemeCurve
SchnorrRistretto25519Sha512Ristretto25519
SchnorrRedJubjubBlake2b512Jubjub
SchnorrRedDecaf377Blake2b512Decaf377
SchnorrkelSubstratesr25519