From 1c879868fd5ac6f74d2071fbe244a8d294105bff Mon Sep 17 00:00:00 2001 From: Jessie Mongeon <133128541+jessiemongeon1@users.noreply.github.com> Date: Thu, 11 Jun 2026 17:35:20 -0400 Subject: [PATCH] docs: update packages/docs/content/sui/zklogin.mdx for PR #1082 Automated update based on: genAddressSeed now throws an error if the key claim name, value, or aud contains a backslash, double-quote, or control character (< 0x20), rejecting inputs that reveal JSON escaping. This is a behavioral change to a public zkLogin utility function. --- packages/docs/content/sui/zklogin.mdx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/docs/content/sui/zklogin.mdx b/packages/docs/content/sui/zklogin.mdx index c423369f9..91a4b09ee 100644 --- a/packages/docs/content/sui/zklogin.mdx +++ b/packages/docs/content/sui/zklogin.mdx @@ -53,6 +53,22 @@ const address = computeZkLoginAddress({ }); ``` +## Computing the address seed + +To compute the address seed directly, use `genAddressSeed`: + +```typescript +import { genAddressSeed } from '@mysten/sui/zklogin'; + +const addressSeed = genAddressSeed(userSalt, claimName, claimValue, aud); +``` + +The `claimName`, `claimValue`, and `aud` parameters must not contain backslashes (`\`), +double-quotes (`"`), or control characters (codepoints below `0x20`). `genAddressSeed` throws an +error if any of these characters are present, as they indicate improperly escaped JSON values. +Ensure you pass the raw, unescaped claim values (for example, as decoded from the JWT payload), not +JSON-encoded strings. + To use zkLogin inside a multisig, see the [Multisig Guide](../sui/cryptography/multisig) for more details. @@ -87,4 +103,4 @@ const address = toZkLoginPublicIdentifier( iss, { legacyAddress: true }, ).toSuiAddress(); -``` +``` \ No newline at end of file