ZkLogin
Utilities for working with zkLogin. Currently contains functionality to create and parse zkLogin signatures and compute zkLogin addresses.
Note: @mysten/zklogin
package contains more utilities to help with computing address etc.
To parse a serialized zkLogin signature
import { parseZkLoginSignature } '@mysten/sui.js/zklogin';
const parsedSignature = await parseZkLoginSignature('BQNNMTY4NjAxMzAyO....');
Use getZkLoginSignature
to serialize a zkLogin signature.
import { getZkLoginSignature } '@mysten/sui.js/zklogin';
const serializedSignature = await getZkLoginSignature({ inputs, maxEpoch, userSignature });
To compute the address for a given address seed and iss you can use computeZkLoginAddressFromSeed
import { computeZkLoginAddressFromSeed } '@mysten/sui.js/zklogin';
const address = await computeZkLoginAddressFromSeed(0n, 'https://accounts.google.com');
To use zkLogin inside a multisig, see the Multisig Guide for more details.