Skip to content

Latest commit

 

History

History
205 lines (92 loc) · 7.3 KB

native_validator.md

File metadata and controls

205 lines (92 loc) · 7.3 KB

Module 0x3::native_validator

This module implements the native validator.

Struct NativeValidator

struct NativeValidator has drop, store

Constants

there defines auth validator id for each blockchain

const NATIVE_VALIDATOR_ID: u64 = 0;

Function auth_validator_id

public fun auth_validator_id(): u64

Function rotate_authentication_key_entry

public entry fun rotate_authentication_key_entry(ctx: &mut context::Context, account: &signer, public_key: vector<u8>)

Function remove_authentication_key_entry

Function get_public_key_from_authenticator_payload

public fun get_public_key_from_authenticator_payload(authenticator_payload: &vector<u8>): vector<u8>

Function get_signature_from_authenticator_payload

public fun get_signature_from_authenticator_payload(authenticator_payload: &vector<u8>): vector<u8>

Function get_authentication_key_from_authenticator_payload

Get the authentication key of the given authenticator from authenticator_payload.

public fun get_authentication_key_from_authenticator_payload(authenticator_payload: &vector<u8>): vector<u8>

Function public_key_to_address

public fun public_key_to_address(public_key: vector<u8>): address

Function public_key_to_authentication_key

Get the authentication key of the given public key.

public fun public_key_to_authentication_key(public_key: vector<u8>): vector<u8>

Function get_authentication_key_with_default

Get the authentication key of the given account, if it not exist, return the account address as authentication key.

public fun get_authentication_key_with_default(ctx: &context::Context, addr: address): vector<u8>

Function default_authentication_key

public fun default_authentication_key(addr: address): vector<u8>

Function validate_signature

Only validate the authenticator's signature.

public fun validate_signature(authenticator_payload: &vector<u8>, tx_hash: &vector<u8>)

Function validate

public fun validate(ctx: &context::Context, authenticator_payload: vector<u8>)