> ## Documentation Index
> Fetch the complete documentation index at: https://developer.litprotocol.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Lit Actions SDK

### Table of Contents

* [Welcome](#welcome)
* [Encryption](#encryption)
* [Encrypt](#encrypt)
  * [Parameters](#parameters)
* [Decrypt](#decrypt)
  * [Parameters](#parameters-1)
* [PKP Keys](#pkp-keys)
* [getPrivateKey](#getprivatekey)
  * [Parameters](#parameters-2)
* [getLitActionPrivateKey](#getlitactionprivatekey)
* [getLitActionPublicKey](#getlitactionpublickey)
  * [Parameters](#parameters-3)
* [getLitActionWalletAddress](#getlitactionwalletaddress)
  * [Parameters](#parameters-4)
* [Action Utilities](#action-utilities)
* [setResponse](#setresponse)
  * [Parameters](#parameters-5)
* [Runtime Globals](#runtime-globals)
* [LitActions](#litactions)
* [ethers](#ethers)

## Welcome

Welcome to the Lit Actions SDK Docs.  These functions can be used inside a Lit Action.  You should prefix each function with "Lit.Actions." so to call "encrypt()" you should do "Lit.Actions.encrypt()"  To understand how these functions fit together, please view the [Quick Start guide](/index) and [Lit Actions overview](/lit-actions/index)

## Encryption

Encryption and decryption functions.  These functions are used to encrypt and decrypt data.  The data is encrypted & decrypted using a symmetric key derived from the secret key of the PKP.

## Lit.Actions.Encrypt

### Parameters

* `params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;

  * `params.pkpId` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The ID of the PKP
  * `params.message` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The message to encrypt

Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** The ciphertext

## Lit.Actions.Decrypt

Decrypt data using AES with a symmetric key

### Parameters

* `params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;

  * `params.pkpId` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The ID of the PKP
  * `params.ciphertext` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The ciphertext to decrypt

Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** The decrypted plaintext

## PKP Keys

Key management functions for PKPs.  These functions are used to get keys for PKPs that can be used in javascript functions.

## Lit.Actions.getPrivateKey

Get the private key for a PKP wallet

### Parameters

* `params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;

  * `params.pkpId` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The ID of the PKP

Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** The private key secret

## Lit.Actions.getLitActionPrivateKey

Get the private key for the currently executing Lit Action

Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** The private key secret

## Lit.Actions.getLitActionPublicKey

Get the public key for a Lit Action by IPFS ID

### Parameters

* `params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;

  * `params.ipfsId` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The IPFS ID of the Lit Action

Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** The public key

## Lit.Actions.getLitActionWalletAddress

Get the wallet address for a Lit Action by IPFS ID

### Parameters

* `params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;

  * `params.ipfsId` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The IPFS ID of the Lit Action

Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** The wallet address

## Action Utilities

Helpers available inside actions as `Lit.Actions.*`.

## Lit.Actions.setResponse

Set the response returned to the client

### Parameters

* `params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;

  * `params.response` **any** The response to send to the client. If this is not a string, it will be JSON-encoded before being sent. A value of undefined is encoded as null.

## Runtime Globals

Globals automatically available inside the Lit Action runtime.

## LitActions

Global reference to the Lit Actions namespace for convenience.
This alias is injected in the Lit Action execution environment and mirrors `Lit.Actions`.

## ethers

The ethers.js v5 API exposed to Lit Actions for interacting with EVM chains.
Includes wallets, providers, contracts, and cryptographic helpers.
