Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Table of Contents
maxLevel6
minLevel1
include
outlinefalse
indent
exclude
typelist
printablefalse
class

Overview

Alternative Authentication methods are ways to authenticated into the FIO App and sign FIO transactions without the need to use Account based on /wiki/spaces/DAO/pages/151879691.

Metamask SNAP

Authenticate

Opera

...

High-level Specification

Functionality

Details

FIO App Account Types

Alternative Account

  • Alternative Account should only contain

    • FIO Public Key

    • Account Type

      • Primary

      • Alternative

  • Alternative Account

  • FIO Public Key in Account Conflict Resolution

    • The same FIO Public Key could exist in Primary account and Alternative account and those would be considered separate accounts

      • Example:

        • User A creates Primary Account using email and password

        • User A imports seed phrase ABC

        • User A connects to FIO App using Metamask which has seed phrase ABC installed

        • User A has 2 different accounts:

          • Primary Account

            • Key generated by EDGE

            • Key imported using seed phrase ABC (Account index 0)

          • Alternative Account

            • Key imported using seed phrase ABC (Account index 0)

  • Multiple Wallets

    • For Alternative Accounts, users can Create New Wallets. When they do each additional Wallet is the next index in the derivation path (same as for Dashboard Ledger Wallet)

    • For Alternative Accounts, users can add a Ledger Wallet.

Sign-in

  • The Sign-in and Account creation process is transparent to the user

  • Process

    • User signs a nonce using FIO Public Key for index 0

    • FIO App fetch FIO Public Key for index 0

    • Create Account - if FIO Public Key is not associated to an account, create account

    • Log user in

Sign Transaction

  • Transaction signing occurs in specific wallet

  • Transaction json should be shown

Metamask SNAP

Overview

Metamask Snap is an extension of Metamask browser plug-in, which allows for new functionality, e.g. ability to sign transactions on a non-EVM chain.

The FIO Snap allows Metamask users to gain access to the FIO App and execute transactions without having to create an account, which requires email and password.

Sign-in Flow

Zenuml sequence macro lite
uuid1c980fc8-f67d-4ea9-8bec-e96c54f76514
customContentId799244302
updatedAt2024-01-09T16:42:48Z

Sign Transaction Flow

Zenuml sequence macro lite
uuida8e67555-ec07-4772-98af-2b9dab781332
customContentId743571457
updatedAt2023-10-12T20:24:18Z

Inside SNAP Functionality

Visual

Functionality

FIO Handle Resolution

image-20240909-182644.pngImage Added
  • Overview

    • When user has the FIO Snap installed, FIO Handles will be resolved inside MetaMask on send.

  • Manifest spec - this ensures OnNameLookupHandler receives any data typed for any chain

Code Block
languagejson
"endowment:name-lookup": {
  "chains": [
    "eip155:1",
    "eip155:10",
    "eip155:56",
    "eip155:61",
    "eip155:137",
    "eip155:324",
    "eip155:1101",
    "eip155:5000",
    "eip155:8453",
    "eip155:42161",
    "eip155:42220",
    "eip155:43114",
    "eip155:59144",
    "eip155:7777777"
  ]
}
  • Look-up logic

    • Verify that the string received matches the FIO Handle format

    • Convert chainId to chain_code and token_code based on the following (chainId, chain_code, token_code)

      Code Block
      eip155:1,ETH,ETH
      eip155:10,OP,ETH
      eip155:56,BSC,BNB
      eip155:61,ETC,ETC
      eip155:137,POL,POL
      eip155:324,ZKSYNC,ETH
      eip155:1101,POLZK,ETH
      eip155:5000,MNT,MNT
      eip155:8453,BASE,ETH
      eip155:42161,ARB,ETH
      eip155:42220,CELO,CELO
      eip155:43114,AVAX,AVAX
      eip155:59144,LINEA,ETH
      eip155:7777777,ZORA,ETH
    • Execute /get_pub_address

    • Return public address

    • Example OnNameLookupHandler

Code Block
languagetypescript
export const onNameLookup: OnNameLookupHandler = async (request) => {
  const { chainId, address, domain } = request;

  if (domain) {
    const resolvedAddress = '0xc0ffee254729296a45a3885639AC7E10F9d54979';
    return {
      resolvedAddresses: [{
        protocol: 'FIO Handle',
        resolvedAddress: resolvedAddress,
        domainName: domain,
      }]
    };
  }

  return null;
};

DEV NOTE: specification: https://metamask.github.io/SIPs/SIPS/sip-12

SNAP Home Page

No FIO Handle and No FIO Tokens and No Pending FIO Requests

image-20240422-164358.pngImage Added

1+ FIO Handles and >0 FIO Tokens and 1+ FIO Requests

image-20240422-171619.pngImage Added

Inside FIO App Functionality

Visual

Functionality

Authenticate

Image Added

  • Set-up SNAP

    • Install FIO SNAP

    • Grant SNAP Permissions

  • Sign-in

    • Have user sign nonce with FIO Private Key

      • SNAP Message

        • Title: Sign-in to FIO App

        • Description:
          Please approve this nonce signature to sign-in to the FIO App. Nonce signature proves that you are the owner of the associated FIO Public Key.
          ------------------------------------
          Random nonce: XXX

  • If user rejects any of these steps display error message

Sign Transaction

Image Added

Image Added

  • Trigger transaction sign in Metamask

  • SNAP Message

    • Title: Sign FIO Transaction

    • Description:
      Please approve the following transaction.
      Transaction name: trnsfiopubky
      ------------------------------------
      FIO Chain: FIO Mainnet
      ------------------------------------
      Transaction details:
      tpid: dashboard@fiouat
      max_fee: 1500000000000
      amount: 100000000000000
      payee_public_key: FIO68bYHgYTqc17jz9MuprzvUY9D7Ud9UmLzruiNiFGkaHMZNUDv5

Decrypt Content

  • When decrypting content of FIO Request or FIO Data, trigger decrypt content transaction in Metamask. If

  • SNAP Message

    • Title: Decrypt FIO Data

    • Description:
      Please approve the decryption of FIO Data. For your security and privacy, FIO Data is always encrypted and has to be decrypted before viewing.

Sign out

FIO_Dashboard - 2023 Revised - MetaMask - Dashboard-20240216-194149.pngImage Added

  • Replace Sign out with Disconnect button with icon