Mvmultifactor.abi.json

Overview

This file defines the Application Binary Interface (ABI) for a smart contract responsible for managing multifactor authentication and cryptographic key management on a blockchain platform. It specifies the contract's version, initialization parameters, state variables (fields), and a comprehensive set of functions that handle creation, update, removal, and querying of multifactor authentication factors, cryptographic keys, security cards, transactions, and recovery mechanisms.

The contract enables a multifactor cryptographic identity management system by controlling ephemeral public keys, JSON Web Key (JWK) moduli, zero-knowledge proof (ZKP) factors, security cards, and a transaction submission and confirmation mechanism with various safeguards such as whitelists and expiration timestamps.

Key Functional Areas

Detailed Function Descriptions

constructor

Purpose: Initializes the contract with all necessary identity and security parameters.

Parameters:

Returns: None.

Usage Example:

contract.constructor(
  "Alice",
  "zkid-string",
  proofBytes,
  ephemeralPubKey,
  ephemeralPubKeySig,
  epkExpireTimestamp,
  jwkModulusBytes,
  kidBytes,
  jwkModulusExpireAt,
  2,
  "issuerBase64",
  "providerName",
  "headerBase64",
  pubRecoveryKey,
  pubRecoveryKeySig,
  jwkUpdateKey,
  jwkUpdateKeySig,
  rootProviderCertMap,
  indexValue
);

cleanWhiteList

Purpose: Removes entries from the whitelist based on expiration timestamp.

Parameters:

Returns: None.


updateWhiteList

Purpose: Updates the whitelist entry for a specific index and name.

Parameters:

Returns: None.


setWhiteList

Purpose: Sets or replaces whitelist entry for a given address and index.

Parameters:

Returns: None.


addJwkModulus

Purpose: Adds a new JWK modulus entry validated by a root certificate.

Parameters:

Returns:


deleteJwkModulusByUpdateJwkKey

Purpose: Deletes a JWK modulus entry authorized by the update JWK key.

Parameters:

Returns: None.


cleanAllExpiredJwks

Purpose: Cleans all expired JWK modulus entries based on expiration timestamp.

Parameters:

Returns: None.


addZKPfactor

Purpose: Adds a zero-knowledge proof factor.

Parameters:

Returns:


deleteZKPfactorByItself

Purpose: Deletes a ZKP factor by its expiration timestamp.

Parameters:

Returns: None.


cleanAllExpiredZKPFactors

Purpose: Cleans all expired zero-knowledge proof factors.

Parameters:

Returns: None.


setWasmHash

Purpose: Sets the WebAssembly (WASM) hash for the contract, possibly for code verification.

Parameters:

Returns: None.


setForceRemoveOldest

Purpose: Enables or disables automatic removal of the oldest entries.

Parameters:

Returns: None.


addRootProviderCertificate

Purpose: Adds a new root provider certificate.

Parameters:

Returns: None.


deleteRootProviderCertificate

Purpose: Deletes a root provider certificate by serial number.

Parameters:

Returns: None.


cleanRootProviderCertificates

Purpose: Cleans all root provider certificates.

Parameters: None.

Returns: None.


cleanAllJwks

Purpose: Cleans all JWK modulus entries regardless of expiration.

Parameters: None.

Returns: None.


cleanAllZKPFactors

Purpose: Cleans all zero-knowledge proof factors.

Parameters: None.

Returns: None.


updateRecoveryPhrase

Purpose: Updates the public recovery key and its signature.

Parameters:

Returns: None.


updateJwkUpdateKey

Purpose: Updates the JWK update key and its signature.

Parameters:

Returns: None.


updateZkid

Purpose: Updates the zero-knowledge ID and related parameters.

Parameters:

Returns: None.


updateSeedPhrase

Purpose: Updates the owner's public key and its signature for seed phrase recovery.

Parameters:

Returns: None.


deleteJwkModulus

Purpose: Deletes a JWK modulus by key ID.

Parameters:

Returns: None.


deleteZKPfactor

Purpose: Deletes a zero-knowledge proof factor by expiration and ephemeral public key.

Parameters:

Returns: None.


deleteZKPfactor_

Purpose: Deletes a zero-knowledge proof factor by ephemeral public key only.

Parameters:

Returns: None.


changeSeedPhrase

Purpose: Initiates a change of seed phrase with expiration and signatures.

Parameters:

Returns: None.


acceptCandidateSeedPhrase

Purpose: Accepts a candidate seed phrase to finalize the seed phrase change.

Parameters:

Returns: None.


deleteCandidateSeedPhrase

Purpose: Deletes a candidate seed phrase based on expiration timestamp.

Parameters:

Returns: None.


addSecurityCard

Purpose: Adds a security card public key with its signature.

Parameters:

Returns: None.


turnOffSecurityCards

Purpose: Disables the use of all security cards.

Parameters: None.

Returns: None.


turnOnSecurityCards

Purpose: Enables the use of security cards.

Parameters: None.

Returns: None.


deleteSecurityCard

Purpose: Deletes a security card by public key.

Parameters:

Returns: None.


deleteAllSecurityCards

Purpose: Deletes all registered security cards.

Parameters: None.

Returns: None.


sendTransaction

Purpose: Sends a transaction from the contract with specified parameters.

Parameters:

Returns:


submitTransaction

Purpose: Submits a transaction and returns a transaction ID.

Parameters:

Returns:


confirmTransaction

Purpose: Confirms a transaction by its ID.

Parameters:

Returns: None.


setMaxCleanupTxns

Purpose: Sets the maximum number of transactions to clean up.

Parameters:

Returns: None.


setMinValue

Purpose: Sets the minimum value for transactions.

Parameters:

Returns: None.


getTransaction

Purpose: Retrieves details of a specific transaction.

Parameters:

Returns:


getTransactions

Purpose: Retrieves all transactions stored in the contract.

Parameters: None.

Returns:


getTransactionIds

Purpose: Retrieves the list of all transaction IDs.

Parameters: None.

Returns:


getZKPEphemeralPublicKeys

Purpose: Retrieves all ephemeral public keys used in zero-knowledge proofs.

Parameters: None.

Returns:


getTimeStamp

Purpose: Retrieves the current contract timestamp.

Parameters: None.

Returns:


getSecurityCardKeys

Purpose: Retrieves all registered security card public keys.

Parameters: None.

Returns:


get_epk_expire_at

Purpose: Retrieves expiration timestamp for a given ephemeral public key.

Parameters:

Returns:


getVersion

Purpose: Retrieves the contract version information.

Parameters: None.

Returns:


Accessor Functions

Functions beginning with underscore (_) provide read access to internal state variables including:

Important Implementation Details and Algorithms

Interaction with Other System Components