ZkLogin
Utilities for working with zkLogin. Currently contains functionality to create and parse zkLogin signatures and compute zkLogin addresses.
To parse a serialized zkLogin signature
Use getZkLoginSignature
to serialize a zkLogin signature.
To compute the address for a given address seed and iss you can use computeZkLoginAddressFromSeed
To compute an address from jwt:
To compute an address from a parsed jwt:
To use zkLogin inside a multisig, see the Multisig Guide for more details.
Legacy addresses
When zklogin was first introduced, there was an inconsistency in how the address seed was computed.
For backwards compatibility reasons there are 2 valid addresses for a given set of inputs. Methods
that produce zklogin addresses all accept a legacyAddress
boolean flag, either as their last
parameter, or in their options argument.