Skip to main content

Function

generatePrivateKey(params)
Generates a new wrapped key inside a Lit Action, stores the encrypted payload, and returns the wrapped-key identifier together with the generated public key.

Parameters

params.pkpSessionSigs
SessionSigsMap
required
Session signatures produced for the PKP that should own the wrapped key.
params.litClient
LitClient
required
The Lit client instance used to execute the Lit Action and resolve the target network cluster.
params.network
'evm' | 'solana'
required
Determines which Lit Action to run and which key type to generate.
params.memo
string
required
Free-form description stored alongside the encrypted key metadata.
params.userMaxPrice
bigint
Optional cap on the price you are willing to pay for the underlying executeJs request.

Returns

result
GeneratePrivateKeyResult

Example

const { id, generatedPublicKey } = await wrappedKeysApi.generatePrivateKey({
  pkpSessionSigs,
  litClient,
  network: 'evm',
  memo: 'relayer wallet',
});