Skip to content

Conversation

@Ansonhkg
Copy link
Collaborator

@Ansonhkg Ansonhkg commented Oct 23, 2025

WHAT

✨ Wrapped keys for Naga (v8+) networks

Also...

  • add a wrapped keys import/export smoke test to the health manager
  • wire the wrapped keys test into the health runner and status reporting

Features

Internally

Build Lit Action

nx run wrapped-keys-lit-actions:generate-lit-actions

image

Sync the lit actions to IPFS

pnpm sync:wk
image

Externally

New auth package APIs

  • validateDelegationAuthSig - sanity-checks a delegation signature before accepting session materials from another party.
  • generatePkpDelegationAuthSig - asks the Lit network to delegate a PKP to a session keypair with scoped resources/expiration.
  • generateEoaDelegationAuthSig - has an EOA wallet sign the delegation message directly for client-generated sessions.
  • createPkpAuthContextFromPreGenerated - hydrates a PKP auth context from pre-generated session materials.
  • createPkpSessionSigs - creates fresh session signatures from a pre-generated auth context.

New wrapped-keys package APIs

  • generatePrivateKey - creates and stores a new wrapped key for EVM or Solana.
  • importPrivateKey - encrypts an existing key (K256 or ed25519) and persists it as a wrapped key.
  • exportPrivateKey - decrypts a wrapped key inside a Lit Action and returns the plaintext key plus metadata.
  • listEncryptedKeyMetadata - lists wrapped key metadata linked to the PKP without fetching ciphertext.
  • getEncryptedKey - retrieves ciphertext and metadata for a specific wrapped key.
  • storeEncryptedKey - saves third-party ciphertext/metadata as a wrapped key entry.
  • storeEncryptedKeyBatch - stores multiple ciphertext payloads in a single request.
  • batchGeneratePrivateKeys - runs multiple generation/signing actions in one call.
  • signMessageWithEncryptedKey - signs arbitrary data using the stored wrapped key.
  • signTransactionWithEncryptedKey - signs (and optionally broadcasts) EVM or Solana transactions with the wrapped key.

Meine Checklist

  • Docs update
  • Changeset update
  • Snapshot releases
  • E2E Tests
  • CI Tests
  • Uptime bot / Health check

…o-take' of github.com:LIT-Protocol/js-sdk into feature/jss-36-naga-sdk-add-a-make-a-request-function-to-take
…ure validation. This is similar to the existing `validateSessionSig` function.
…o-take' of github.com:LIT-Protocol/js-sdk into feature/jss-36-naga-sdk-add-a-make-a-request-function-to-take
…o-take' of github.com:LIT-Protocol/js-sdk into feature/jss-36-naga-sdk-add-a-make-a-request-function-to-take
…s-35-naga-js-sdk-wrapped-keys-implementation
…s-35-naga-js-sdk-wrapped-keys-implementation
Copy link
Collaborator

@glitch003 glitch003 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a question about SIWE parsing, otherwise looks good!

@@ -0,0 +1,126 @@
---
title: "Server Sessions"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice to see docs on this - i know we've informally explained it to a bunch of teams

const siweMessage = delegationAuthSig.signedMessage;

// Extract domain
const domainMatch = siweMessage.match(/^([^\s]+) wants you to sign in/m);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it's an SIWE message then you can parse using the SIWE lib, right? like i think this works const message = new SiweMessage(siweMessageString); and then you can do like message.domain etc

);
const expectedSignature = await signBytes(signingKey, messageBytes);

expect(Array.from(decodedSignatureBytes)).toEqual(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i was surprised this would work but i looked it up and ed25519 signatures are deterministic, so it does work. neat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants