Skip to main content

Module sui::zklogin_verified_issuer

use std::ascii;
use std::bcs;
use std::option;
use std::string;
use std::vector;
use sui::address;
use sui::hex;
use sui::object;
use sui::party;
use sui::transfer;
use sui::tx_context;
use sui::vec_map;

Struct VerifiedIssuer

Possession of a VerifiedIssuer proves that the user's address was created using zklogin and with the given issuer (identity provider).

public struct VerifiedIssuer has key
Click to open
Fields
id: sui::object::UID
The ID of this VerifiedIssuer
owner: address
The address this VerifiedID is associated with
issuer: std::string::String
The issuer

Constants

Error if the proof consisting of the inputs provided to the verification function is invalid.

const EInvalidInput: u64 = 0;

Error if the proof consisting of the inputs provided to the verification function is invalid.

const EInvalidProof: u64 = 1;

Function owner

Returns the address associated with the given VerifiedIssuer

public fun owner(verified_issuer: &sui::zklogin_verified_issuer::VerifiedIssuer): address

Function issuer

Returns the issuer associated with the given VerifiedIssuer

public fun issuer(verified_issuer: &sui::zklogin_verified_issuer::VerifiedIssuer): &std::string::String

Function delete

Delete a VerifiedIssuer

public fun delete(verified_issuer: sui::zklogin_verified_issuer::VerifiedIssuer)

Function verify_zklogin_issuer

Verify that the caller's address was created using zklogin with the given issuer. If so, a VerifiedIssuer object with the issuers id transferred to the caller.

Aborts with EInvalidProof if the verification fails.

public fun verify_zklogin_issuer(address_seed: u256, issuer: std::string::String, ctx: &mut sui::tx_context::TxContext)

Function check_zklogin_issuer

Returns true if address was created using zklogin with the given issuer and address seed.

public fun check_zklogin_issuer(address: address, address_seed: u256, issuer: &std::string::String): bool

Function check_zklogin_issuer_internal

Returns true if address was created using zklogin with the given issuer and address seed.

Aborts with EInvalidInput if the iss input is not a valid UTF-8 string.

fun check_zklogin_issuer_internal(address: address, address_seed: u256, issuer: &vector<u8>): bool