The Lit SDK v3 is Live

The latest version of the Lit SDK, v3, is now live.

The Lit SDK v3 is Live

The latest version of the Lit SDK, v3, is now live! The v3 SDK is now the default for developers building on Lit, providing significant improvements to the overall developer experience and optimizations to encryption and signing.

The release of v3 is a critical precursor to the launch of the Habanero network, also known as the mainnet beta. In order to use Habanero, you’ll need to ensure your app is compatible with the v3 SDK (SDKs v1 and v2 will not be supported on any new network releases going forward).

Read on to learn about the new features that have been introduced and critical upgrade and migration instructions.

Key Feature Updates and Additions

  1. ID Encrypt

Lit now uses an identity-based encryption scheme to encrypt data (based off of this academic research). This offers the same access control functionality as before, but it is much more scalable and secure. The core difference with ID encrypt is that only decryption requires communicating with the Lit nodes, whereas encryption becomes an entirely client-side operation. Read more here.

  1. Claimable Keys

What if you could send funds to a Discord user before they've created a wallet in the first place? Or to a friend or family member using nothing but their e-mail account?

Lit’s new claimable keys feature allows you to do exactly that, using the authentication method presented to deterministically derive a wallet.

  1. Support for new ECDSA curves including
  1. A new BLS DKG algorithm

The BLS distributed key generation (DKG) process used to generate Lit encryption keys got an upgrade! The process now uses the Gennaro protocol, which is more secure, simpler to implement, and generalizable across various curve types. Soon the ECDSA DKG algorithm (used to generate PKPs) will be updated to use the same Gennaro protocol as well.

  1. Miscellaneous

Various improvements to network consensus, resiliency, and node scaling.

Feature matrix

Shown below is a matrix illustrating which features are available with each SDK version and network.

V1 refers to the deprecated lit-js-sdk

V2 refers to 2.x.x versions of js-sdk

V3 refers to 3.x.x versions of js-sdk

FEATURE V1 V2 V3
jalapeno network
serrano network
cayenne network
manzano network (decentralized testnet)
habanero network (mainnet beta)
ACC-based Encryption
ACC-based JWT signing
Updateable ACC
Programmable Key Pairs
Lit Actions
Wallet Signatures
Session Signatures

Supported Lit Networks

You can use the v3 SDK to connect to the following Lit networks:

Testnets:

Table Example
Name Description Curve Status SDK Persistent?
Cayenne Centralized testnet BLS, ECDSA Live v3 No
Manzano Decentralized testnet BLS, ECDSA Coming soon v3 Yes

Mainnets:

Table Example
Name Description Curve Status SDK Persistent?
Habanero Decentralized mainnet beta BLS, ECDSA Coming soon v3 Yes

Upgrading to v3

Upgrading to v3 can be done by following the migration docs. It is strong recommended that this upgrade be initiated as soon as possible to ensure that your application will be fully compatible with Habanero (the mainnet beta) when it is released. If your app is currently live using the v1 or v2 version of the SDK, this upgrade should be completed internally while users are kept on the previous branch until after Habanero is live. After launch, you’ll need to perform the necessary key migration tasks:

  1. If you’re using encryption (AKA decentralized access control):
    1. You’ll need to perform re-encryption using Habanero keys.
  2. If you’re using PKPs (AKA user wallets):
    1. You’ll need to re-mint PKPs on Habanero. Docs coming soon.

Installing and Importing

Make sure you’re on the latest package - version 3.0.0 or higher.

Install the @lit-protocol/lit-node-client package, which can be used in both browser and Node environments:

yarn add @lit-protocol/lit-node-client

Import the Lit JS SDK v3:

import * as LitJsSdk from "@lit-protocol/lit-node-client";

Note: To make sure you are on the latest 3.x.x version, you can check out the Lit npm packages to find the latest (like so - lit-node-client) or use ^ when installing.

Get started here.

Package Changes

A comprehensive list of per-package changes can be viewed here.

Testing and Error Handling

Info for testing and error handling.

Demos and Examples

A list of demos and examples using v3.

Closing

The Lit SDK v3 is now live. Developers are encouraged to to start building with the SDK today ahead of the public launch of the Habanero network.

If you have any feedback or questions while upgrading, please reach out to the Lit development team on Discord. You can join the Lit Builders Circle on Telegram to stay updated on all of the latest developments.