Skip to main content

Module sui::authenticator_state

Struct AuthenticatorState​

Singleton shared object which stores the global authenticator state.
The actual state is stored in a dynamic field of type AuthenticatorStateInner to support future versions of the authenticator state.

public struct AuthenticatorState has key
Click to open
Fields
id: sui::object::UID
version: u64

Struct AuthenticatorStateInner​

public struct AuthenticatorStateInner has store
Click to open
Fields
version: u64
active_jwks: vector<sui::authenticator_state::ActiveJwk>
List of currently active JWKs.

Struct JWK​

Must match the JWK struct in fastcrypto-zkp

public struct JWK has copy, drop, store

Struct JwkId​

Must match the JwkId struct in fastcrypto-zkp

public struct JwkId has copy, drop, store
Click to open
Fields

Struct ActiveJwk​

public struct ActiveJwk has copy, drop, store
Click to open
Fields

Constants​

Sender is not @0x0 the system address.

const ENotSystemAddress: u64 = 0;
const EWrongInnerVersion: u64 = 1;
const EJwksNotSorted: u64 = 2;
const CurrentVersion: u64 = 1;

Function active_jwk_equal​

Function jwk_equal​

Function jwk_id_equal​

Function string_bytes_lt​

Function jwk_lt​

Function create​

Create and share the AuthenticatorState object. This function is call exactly once, when the authenticator state object is first created.
Can only be called by genesis or change_epoch transactions.

Function load_inner_mut​

Function load_inner​

Function check_sorted​

fun check_sorted(new_active_jwks: &vector<sui::authenticator_state::ActiveJwk>)

Function update_authenticator_state​

Record a new set of active_jwks. Called when executing the AuthenticatorStateUpdate system transaction. The new input vector must be sorted and must not contain duplicates.
If a new JWK is already present, but with a previous epoch, then the epoch is updated to indicate that the JWK has been validated in the current epoch and should not be expired.

Function deduplicate​

Function expire_jwks​

Function get_active_jwks​

Get the current active_jwks. Called when the node starts up in order to load the current.
JWK state from the chain.