Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion packages/docs/content/sui/zklogin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -87,4 +103,4 @@ const address = toZkLoginPublicIdentifier(
iss,
{ legacyAddress: true },
).toSuiAddress();
```
```
Loading