zklogin.salt
The salt and Sui address for a Google sign-in.
Details
- Endpoint
- POST /v1/zklogin/salt
- Credits
- Free
- Rate class
- Light. Counts against your light requests per second.
Checks the ID token (signature against Google's published keys, expiry, issuer, and that its aud is a client id registered to your key) and returns the user's salt and Sui address. The salt is the same every time for the same Google account and client id, so the address never changes. If you imported a salt for this user, that salt is returned. Free.
Parameters
| Name | Type | Description |
|---|---|---|
| jwtrequired | string | The ID token (JWT) from Google sign-in, with the zkLogin nonce. |
Request
Send your key in the x-api-key header, or leave it out to use the keyless tier.
curl
curl -X POST "https://api.tide.ad/v1/zklogin/salt" \
-H "x-api-key: YOUR_API_KEY" \
-H "content-type: application/json" \
-d '{
"jwt": "eyJhbGciOiJSUzI1NiIsImtpZCI6Ii4uLiJ9.eyJpc3MiOiJodHRwczovL2FjY291bnRzLmdvb2dsZS5jb20iLCJhdWQiOiIxMjM0LmFwcHMuZ29vZ2xldXNlcmNvbnRlbnQuY29tIiwic3ViIjoiMTEwMDAwMDAwMDAwMDAwMDAwMDAwIiwibm9uY2UiOiIuLi4ifQ.signature"
}'TypeScript
const res = await fetch("https://api.tide.ad/v1/zklogin/salt", {
method: "POST",
headers: {
"x-api-key": process.env.TIDE_API_KEY!,
"content-type": "application/json",
},
body: JSON.stringify({
"jwt": "eyJhbGciOiJSUzI1NiIsImtpZCI6Ii4uLiJ9.eyJpc3MiOiJodHRwczovL2FjY291bnRzLmdvb2dsZS5jb20iLCJhdWQiOiIxMjM0LmFwcHMuZ29vZ2xldXNlcmNvbnRlbnQuY29tIiwic3ViIjoiMTEwMDAwMDAwMDAwMDAwMDAwMDAwIiwibm9uY2UiOiIuLi4ifQ.signature"
}),
});
const data = await res.json();Response
JSON
{
"salt": "129390038577185583942388216820280642146",
"address": "0x1c5d8a7a1f2b2b3e9d3b0e3f6a1d0c2b4e5f60718293a4b5c6d7e8f9a0b1c2d3",
"iss": "https://accounts.google.com",
"aud": "1234567890-abc.apps.googleusercontent.com",
"source": "derived"
}