Enoki API Specification

POST

/v1/zklogin/nonce

Create zkLogin nonce

Generates a nonce used in the zkLogin OAuth flow. Using this API is not required, you can also construct a nonce client-side if desired.

Request Body (Optional)

networkstring

The Sui network you wish to use. Defaults to mainnet.

Default: "mainnet"Value in: "testnet" | "mainnet" | "devnet"

ephemeralPublicKey
Required
string

The ephemeral public key created during the zkLogin process, encoded as a base64 string.

additionalEpochsnumber

The amount of epochs that you would like to have the nonce be valid for.

Default: 2Minimum: 0Maximum: 30
Status codeDescription
200Successful response
curl
curl -X POST "https://api.enoki.mystenlabs.com/v1/zklogin/nonce" \
  -d '{
  "network": "testnet",
  "ephemeralPublicKey": "string",
  "additionalEpochs": 2
}'
Example Response
{
	"data": {
		"nonce": "string",
		"randomness": "string",
		"epoch": 0,
		"maxEpoch": 0,
		"estimatedExpiration": 0
	}
}

POST

/v1/zklogin/zkp

Create zkLogin ZKP

Creates a zero-knowledge proof, which is used to submit transactions to Sui.

Request Body (Optional)

networkstring

The Sui network you wish to use. Defaults to mainnet.

Default: "mainnet"Value in: "testnet" | "mainnet" | "devnet"

ephemeralPublicKey
Required
string

The ephemeral public key created during the zkLogin process, encoded as a base64 string.

maxEpoch
Required
integer

The maxEpoch created during the zkLogin process.

Minimum: 0

randomness
Required
string

The randomness created during the zkLogin process.

Header Parameters

zklogin-jwt
Required
string

The JWT of the user signed in with zkLogin.

Status codeDescription
200Successful response
curl
curl -X POST "https://api.enoki.mystenlabs.com/v1/zklogin/zkp" \
  -H "zklogin-jwt: string" \
  -d '{
  "network": "testnet",
  "ephemeralPublicKey": "string",
  "maxEpoch": 0,
  "randomness": "string"
}'
Example Response
{
	"data": {
		"proofPoints": null,
		"issBase64Details": null,
		"headerBase64": null,
		"addressSeed": "string"
	}
}

POST

/v1/transaction-blocks/sponsor

Create sponsored transaction

Creates sponsored transaction

Request Body (Optional)

networkstring

The Sui network you wish to use. Defaults to mainnet.

Default: "mainnet"Value in: "testnet" | "mainnet" | "devnet"

transactionBlockKindBytes
Required
string

Bytes of the transaction with the onlyTransactionKind flag set to true.

senderstring

The address sending the transaction. Include this parameter if not including the zklogin-jwt header. This option is only supported when calling the API from a backend service using a private key.

allowedAddressesarray of string

List of Sui addresses that can be present in the transaction. These addresses are combined with the list configured in the Enoki Developer Portal. Transactions attempting to refer to or transfer assets outside of these addresses are rejected.

allowedMoveCallTargetsarray of string

List of permitted Move targets the sponsored user's transactions can call.

Header Parameters

zklogin-jwtstring

The JWT of the user signed in with zkLogin.

Status codeDescription
200Successful response
curl
curl -X POST "https://api.enoki.mystenlabs.com/v1/transaction-blocks/sponsor" \
  -H "zklogin-jwt: string" \
  -d '{
  "network": "testnet",
  "transactionBlockKindBytes": "string",
  "sender": "string",
  "allowedAddresses": [
    "string"
  ],
  "allowedMoveCallTargets": [
    "string"
  ]
}'
Example Response
{
	"data": {
		"digest": "string",
		"bytes": "string"
	}
}

POST

/v1/transaction-blocks/sponsor/{digest}

Submits a sponsored transaction for execution

Submits a transaction created from /transaction-blocks/sponsor for execution.

Request Body (Optional)

signature
Required
string

User signature of the transaction.

Path Parameters

digest
Required
string

The digest of the previously-created sponsored transaction block to execute.

Status codeDescription
200Successful response
curl
curl -X POST "https://api.enoki.mystenlabs.com/v1/transaction-blocks/sponsor/string" \
  -d '{
  "signature": "string"
}'
Example Response
{
	"data": {
		"digest": "string"
	}
}

GET

/v1/zklogin

Get address for zkLogin user

Returns the address and salt value for the given JWT. If the JWT is not valid, the API will return an error code.

Header Parameters

zklogin-jwt
Required
string

The JWT of the user signed in with zkLogin.

Status codeDescription
200Successful response
curl
curl -X GET "https://api.enoki.mystenlabs.com/v1/zklogin" \
  -H "zklogin-jwt: string"
Example Response
{
	"data": {
		"salt": "string",
		"address": "string"
	}
}

GET

/v1/app

Get app metadata

Returns the public metadata (configured in the Enoki Developer Portal) of the app associated with the API key.

Status codeDescription
200Successful response
curl
curl -X GET "https://api.enoki.mystenlabs.com/v1/app"
Example Response
{
	"data": {
		"allowedOrigins": ["https://example.com"],
		"authenticationProviders": [
			{
				"providerType": "google",
				"clientId": "..."
			}
		]
	}
}