Skip to content

Email Association

Overview

A necessary step before a user can trade his/her assets is to go through the most minimal minimal KYC: use a verified email. Each web3 address needs to be associated to a verified email.

Note

Assets can be created to web3 addresses that have never been associated to any email. It is only when those assets engage in trading that email association is required.

This is a necessary step to be able to transact in FIAT, required by any 3rd party payments provider, as well as to offer trading services in many countries. It protects clients and their users.

Code

Email registration needs to be done only once per user. In this process:

  1. The Universe owner is responsible for verifying the user's email by whatever method is preferred
  2. The Universe owner relays the user's signature accepting to link the email to a web3 address.

The first step is business as usual. The second step is easily done by following this example, which basically consists of:

const { digestLinkId, sign } = require('freeverse-marketsigner-js');

// Compute the digest to be signed:
const digest = digestLinkId({ email, web3address });

// sign with your favorite method,
// using a user's web3 account instantiated from a privKey in this example:
const signature = sign({ digest, web3account: userWeb3Account });
const signatureWithout0x = signature.substring(2, signature.length);

const graphQLMutation = `
  mutation {
    linkFreeverseId(
      input: {
        email: "${email}",
        name: "${alias}",
        freeverseId: "${web3address}",
        signature: "${signatureWithout0x}",
        encryptedId: "",
      }
    )
  }`;

Note

It is important to properly verify emails. For example, cashout links will be sent directly to the email associated to a given web3 address.