Off-Chain Issuance of FLC Native Tokens

Version: 1.0.0 / 2020.02.28 (Q1, 2020)

1. Background

This document describes the updates and new design of FLC v2 (or the “FLC native token”) which is the new update of the original FLC v1. FLC v1, as described in its legal opinion report in 2019, is a utility token that can be used in the Flowchain Network. And as a utility token, the FLC v1 token can also be offered to a market for attention, acquisition or consumption. Furthermore, to support Flowchain’s hybrid architecture, FLC requires an off-chain issuable token technology to provide minted token redeem and user withdraw capabilities. Thus, an upgrade to the original FLC v1 smart contract shall be applied in prior to the coming Flowchain mainnet launch.

2. Introduction

Launched in 2019, the FLC v1 token is designed as a mintable token that an amount of FLC tokens can be minted by the FLC mining smart contract. The smart contract can perform the token minting operations in an on-chain manner, and the smart contract is performed by a signed message of the token issuer. Subsequently, the new FLC smart contract, the FLC v2 token, is also the type of the mintable token that an amount of tokens can also be minted.

However, instead of on-chain minting in the original FLC v1 design, Flowchain proposes that the FLC v2 token adopts an “off-chain mining” mechanism within the Flowchain’s private blockchain . In short, the FLC v2 mining operations within a private blockchain network are performed in the off-chain network, and the operations are submitted to the public blockchain network (the “on-chain” blockchain network) for issuing token rewards. Accordingly, the participants (the “miner”) in the Flowchain network agreed that the FLC reward tokens was finally delivered to the corresponding block producers.

In summary, such a mining mechanism results in the need of an off-chain issuable token technology because that all blocks will be produced in the private blockchain network.

3. Mechanism

The Virtual Blocks (or “off-chain blocks”) is the main feature of the Flowchain framework that provides a new blockchain data structure designed to ensure the real-time data transactions.

A hybrid node (or “miner”, “user”, “block producer”) in the Flowchain network can mine such virtual blocks and submit virtual blocks to the public blockchain for the validity. Subsequently, an on-chain mining contract deployed in the Ethereum mainnet uses the flowing steps to issue mining rewards:

  1. The mining contract generates a certificate of validity
  2. The mining contract sends a signed transactions to deliver the certificate to the token issuance contract
  3. The mining contract should condition the authenticity of the certificate
  4. The mining contract issues an amount of tokens to the block producer

The issued tokens are kept (deposited) in the mining contract, meaning that the mining contract is the wallet of rewarded tokens (the “funds”). Accordingly, block producers (the “users”) can withdraw their funds by sending a signed “withdraw transaction” to the FLC ERC20 smart contract.

4. Standards

Flowchain proposes an extension to ERC-20 that adds off-chain issuable and mintable tokens. The following is the interface definition:

  /**
   * @title The off-chain issuable FLC tokens.
   */
  contract OffchainIssuable {
      /**
       * The minimal withdraw amount.
       */
      uint256 public MIN_WITHDRAW_AMOUNT = 100;
  
      /**
       * @dev Suspend the issuance of new tokens.
       * Once set to false, '_isIssuable' can never be set to 'true' again.
       */
      function setMinWithdrawAmount(uint256 amount) public returns (bool success);
  
      /**
       * @dev Resume the issuance of new tokens.
       * Once set to false, '_isIssuable' can never be set to 'true' again.
       */
      function getMinWithdrawAmount() public returns (uint256 amount);
  
      /**
       * @dev Redeem the value of tokens to the address 'msg.sender'
       * @param to The user that will receive the redeemed token.
       * @param amount Number of tokens to redeem.
       */
      function redeem(address to, uint256 amount) external returns (bool success);
  
      /**
       * @dev The user withdraw API.
       * @param amount Number of tokens to redeem.
       */
      function withdraw(uint256 amount) public returns (bool success);   
  }

5. Implementation

Flowchain proposes an extension to ERC-20 that adds off-chain issuable and mintable tokens.

A method to set an minimal withdraw amount:

  function setMinWithdrawAmount(uint256 amount) public returns (bool success);

A method to get the minimal withdraw amount:

  function getMinWithdrawAmount() public returns (uint256 amount);

A method to redeem the value of tokens to the address of the block producer (the "user"):

  function redeem(address to, uint256 amount) external returns (bool success);

A method to withdraw user funds:

  function withdraw(uint256 amount) public returns (bool success);

The user can send a signed message to the FLC v2 smart contract to withdraw funds (the "token rewards") to their ERC-20 compatible wallet.

A method to setup a mintable address that can mint tokens:

  function setupMintableAddress(address mintableAddress) public returns (bool success);

A method to mint an amount of tokens and transfer to the address:

  function mintToken(address to, uint256 amount) public returns (bool success);

A mintable address is the mining contract that can mint and redeem tokens.

The redeem function can only be invoked by the mining contract at the address set by setupMintableAddress.

Also, redeem shall call mintToken to mint new tokens and send the funds back to the mining contract:

  contract StandardToken {
      /**
       * @dev Redeem user mintable tokens. Only the mining contract can redeem tokens.
       * @param to The user to be redeemed tokens     
       * @param amount The amount of tokens to be withdrawn
       * @return The result of the withdraw
       */
      function redeem(address to, uint256 amount) external returns (bool success) {
          require(msg.sender == mintableAddress);    
  
          // Mint new tokens and send the funds to the account `mintableAddress`
          // Users can withdraw funds.
          mintToken(mintableAddress, amount);
  
          return true;
      }
  }

6. Future Works

This document summarizes the new features of FLC Native Token launched in Q1, 2020. As previously mentioned, a smart contract migration is required to reflect such feature changes. Specially, the new FLC smart contract has additional new features not mentioned in this document. Therefore, we are working on the version 2.0 of this document. The updated document will be published in Q2, 2020.

Regarding the FLC ERC-20 native token, it is currently offered to the market at Digifinex.

Copyright Ⓒ 2020 The Flowchain Foundation Limited. All rights reserved.