LOCI Nexus
Published in

LOCI Nexus

Building Fiat-to-Utility Token Onramps

Problem Scenario: New User Arrives at Loci.io and Wants to Sign up, but has no Crypto. No LOCIcoin, no Ether, not even a wallet.

Solution: Custodial Tokens & Pleasant User Experience

The value of a Utility Token is derived from the Utility you can gain by using the token on the platform it is associated with. Unfortunately it is still true that cryptocurrency, tokens, coin exchanges and gas fees are still a very difficult thing to understand for many people. We’re introducing a Custodial option for purchasing, securing and using LOCIcoin through a Fiat Processor & Smart Contract integration. This will effectively eliminate the friction that is experienced by new customers that wish to sign up right here, right now, and might not have the ability or desire to jump through hoops just to start using the LOCIcoin Utility Token in the platform.

In a nutshell, buying a Utility Token like LOCIcoin will be as easy as…

Now of course that image hides a lot of complexity, and that’s the point.

While education in this space is improving, there are simply those who don’t want to go through the hassle of cryptocurrency, but still want to make use of LOCI’s proprietary search technology. This is going to be key to reducing the admittedly painful 13 step process a new user is required to go through as itemized below, and produce a pleasant user experience in 3 simple steps: Sign up, Purchase LOCIcoin, and start using the tokens assigned to the user they purchased for the “base price”. The tokens will be held in a smart contract that assigns the balances to the user and held in a custodial smart contract on the Blockchain. Loci will have an available pool of tokens from which the smart contract is able to transferFrom initially, but will be replenishing it by purchasing tokens on the secondary market to ensure there is ample liquidity and available tokens for users to purchase.

If a user is so inclined, they may have a financial incentive to learn the depths of crypto to save themselves money by going through an exchange and purchase tokens at the market price. But for the convenience of a seamless user experience and immediate access to Utility Tokens and the LOCIsearch platform, new users can get on-boarded as fast as possible. In order to be able to provide this Custodial service to the user, there is a gas fee incurred by Loci each time the tokens are transferred in and out of the LOCIcredits smart contract.* Normally individuals would pay this fee for their own transactions to be processed by the Ethereum network. Lifting that burden off the shoulders of users that opt for the Custodial model is another way users will benefit from this solution.

*LOCIcredits smart contract is a term used to describe the internal custodianship of LOCIcoin. LOCIcredits is called a credit to simplify internal and technological differences. Any reference to credit just refers to a LOCIcoin in custodianship of Loci.

This solution does not undercut existing users because purchases will be made at the “base price” of LOCIcoin based on the monthly subscription fee for using LOCIsearch. If at some point in the future the price of the market came more in line with the base price, then yes, Loci would reserve the right to make changes to the pricing model or pause the ability to obtain tokens through this method.

In addition, there are diagrams below along with a technical explanation that ensure the solution stays true to the transparency and open, public goals of Blockchain while remaining compliant with “Know Your Customer” (KYC) and “Anti-Money Laundering” (AML) requirements. KYC obligations require Fiat Processors to collect and maintain information on all customers. These requirements come from regulators and financial partners of the Fiat Processors, and are intended to prevent abuse of the financial system. Please also note that we will be setting a limit on the total amount purchasable from us each month. Still working out the details, but this limit is mainly to stay compliant with AML reporting requirements.

Marketing will be able to point at our unique technology and solution so that the community and the world can see how we’ve been spending time and how we want to help affect the crypto world. Since our proposed solution is written with the already established ERC20 StandardToken contract in mind, it can actually be used as a model for every other platform that accepts ERC20 utility tokens.

Yes, the custodial option will make it easier to obtain, allowing the user base to grow and creating organic demand for the utility token. Smart contracts can still be written to require the use of the LOCIcoin as being a requirement for being spent, whereas that was not quite enforceable nor transparent without a crypto currency or token.

In addition, there could be a time where users wish to take full control of their crypto education and wish to withdraw their funds to their own wallets. This is in the contract as well. I suspect some might do that but many regular old non-crypto folks will be satisfied with a custodial solution.

In any case, this is nothing but excellent news for existing token holders because it essentially eliminates the old option where fiat subscription was not 1:1 tied to the token. Now this will enforce it. That was essential, in my opinion, to meeting both the community needs and the company needs for user adoption.

This is a well thought out compromise and a much needed “onramp”. As you may all know, the barrier to entry for crypto is quite high. This solution provides new customers with a better user experience for entering the LOCIsearch ecosystem, and gently introduces the concept of Utility Tokens as a form of payment and digital money within applications. As more onramps get built with better user experiences, we hope the concept of crypto and tokens will reach mainstream critical mass faster than it ever could before!

Here is the full explanation of how it works under the surface!

Abstract

Optimal Case:

Many users do have LOCIcoin, and signup is much easier for them.If you already have LOCIcoin and Ether in your Ethereum account, all you need to do is:

1) Sign up for Loci.io.
2) Click ‘Upgrade’ to access premium features.
3) Register Metamask wallet with Loci.io.
4) Transfer LOCI from Metamask wallet to upgrade LOCI platform account.

Problem Identified:

User has no LOCIcoin, wants to use the platform, but doesn’t really understand crypto at all. There are at least 13 steps for the user to perform before they can even sign up for the platform. That’s a ton of additional steps, with several potential points of failure in between!

Currently, the user would have to:

1) Sign up for Coinbase (or any other exchange that accepts fiat).
2) Purchase Ether on Coinbase with Fiat.
3) Wait a few days for Ether to be placed in account.
4) Sign up for Kucoin (the only exchange that lists LOCIcoin.
5) Send some Ether from Coinbase to Kucoin account.
6) Bid to buy LOCIcoin, but also buy more than is required in order to send to Metamask account.
7) Download Metamask and make note of Ethereum based address.
8) Send some Ether from Coinbase to Metamask controlled Ethereum address.
9) Withdraw from Kucoin by sending LOCI to Ethereum address.
10) Sign up for Loci.io account.
11) Click ‘Upgrade’ to access premium features.
12) Register Metamask wallet with Loci.io.
13) Transfer 1 LOCI from Metamask wallet to LOCI platform account.

All the while, the user would have to understand private keys, security, network considerations and gas fees. That’s a lot to keep track of, and potentially a daunting experience for anyone new to crypto.

Proposed Solution:

In order to reduce friction for purchasing the coin, and signing up for the platform with a promotion, while also complying with KYC/AML laws, we have an idea.

In this potential solution, we will provide a way for a customer with zero crypto knowledge to be able to participate in promotions and effectively introduce people to the LOCIcoin concept by allowing customers to ‘purchase’ LOCI from an available LOCI liquidity pool.

Workflow:

1) User signs up for Loci.io.
2) User “Purchases” 100 LOCI @ $2.50 with Fiat Processor (Credit/Debit).
3) User is granted access to the system while their LOCIcredits balance > 0.

In order to do this effectively, we must enforce that the LOCI purchased come from a LOCI owned liquidity pool, and not purchased from the exchange by some sort of manual process. This means that an Ethereum-based Smart Contract called LOCIcredits will keep track of an internal balance of LOCIcoin assigned to a LOCI guid (globally unique identifier), which is used to uniquely identify a user in the LOCI ecosystem. This also ensures coins cannot be double-spent. In the interest of the spirit of transparency, the blockchain smart contract allows a user to check their balance any time.

The LOCIcredits smart contract has the following capabilities:

// A: given a guid, a value in wei, and a reason code, increase internal balance for user by withdrawing from the liquidity pool

function increaseCredits( string _id, uint256 _value, uint8 _reason, address _register ) public onlyOwnerOrOverride returns(uint256)

// B: given a guid, a value in wei, and a reason code, decrease (spend) tokens for user by moving LOCIcoin back to liquidity pool

// Alternatively, a user could choose to withdraw their tokens to their own account once they are comfortable with crypto.

function reduceCredits( string _id, uint256 _value, uint8 _reason, address _register ) public onlyOwnerOrOverride returns(uint256)

// C: This is a combination of A & B. First, a user buys LOCIcoin, but atomically spends a utility token in order to use the platform immediately.

function buyCreditsAndSpend( string _id, uint256 _value, uint8 _reason, address _register, uint256 _spend ) public onlyOwnerOrOverride returns(uint256)

// D. This is the same as C, but allows a user to immediately transfer their tokens to a wallet they control.

function buyCreditsAndSpendAndRecover(string _id, uint256 _value, uint8 _reason, address _register, uint256 _spend, address _recover )

// E: User could gift a token to another user in order to use the platform, or we could use this to combine 2 user accounts into one.

function transferCreditsInternally( string _id, uint256 _value, uint8 _reason, string _beneficiary ) public onlyOwnerOrOverride returns(uint256)

// F: See the total supply of LOCIcoin assigned to the smart contract

function getTotalSupply() public constant returns(uint256)

// G: Get credits for a supplied guid. Useful displaying on the User interface

function getCreditsFor( string _id ) public constant returns(uint256)

// H: In order to support withdrawing coin that has been deposited, we would have a secure mechanism for letting us associate their wallet to their guid. Then, the user, now familiar with how crypto works, can call our custom withdraw function.

function assignUserWallet( string _id, address _wallet ) public onlyOwnerOrOverride returns(uint256)function withdrawUserSpecifiedFunds( string _id, uint256 _value, uint8 _reason ) public returns(uint256) 

Here’s how it gets integrated into the LOCI ecosystem. It started as a proof of concept:

Proof of Concept Workflow for using Fiat to purchase LOCIcoin using Fiat Processor & Smart Contracts

Proof of Concept Diagram Explanation. User only cares about Step 1.

  1. Customer Browser clicks button to “Purchase 100LOCI for $2.50/each” to Pay with Fiat Processor in LOCIsearch.
  2. Customer Info is sent to Fiat Processor, and a Fiat Processor API token is sent back to the client browser.
  3. API Token + User Form Data is sent to the LOCIserver.
  4. A Charge Request is made from LOCIserver to Fiat Processor.
  5. A Response of Paid is sent back to LOCIserver.
  6. LOCIserver updates the LOCIdatabase.
  7. An Ethereum Transaction is sent to LOCIcredits.buyCreditsAndSpend( guid, 10000000000000000000, reasonCode, “0x12345….”, 1000000000000000000 ).
  8. LOCIcredits smart contract transaction is mined and Event of CreditsAdjusted is fired from the EVM (Ethereum Virtual Machine).
  9. LOCIsearch listens for the event, and when the internal balance is > 1, the user can use premium features.

The smart contract is well tested and suitable for segregating custodial LOCIcoin.

Below, you will find several technical diagrams to help people understand all the moving parts of the fiat/crypto purchase with the use of Fiat Processor & LOCIcredits smart contract.

User, Browser, Server, DB, LOCIcredits, LOCIcoin integration.

Here’s how to read an interaction diagram. Arrows point from one object to another, sending messages to the other objects. Time only goes one day: down. So the interaction of all the objects is represented with arrows and messages.

I found a nice tool called https://www.websequencediagrams.com/that lets you define the picture in text. This will let us quickly create more diagrams to break down other ways the system operates.

Scenario: New User Arrives at Loci.io and Wants to Sign Up, but has no crypto.

The above diagram can be broken apart into 2 pieces:

1) Fiat Processor integration

2) Blockchain integration

Fiat Processor integration — user arrives to buy tokens with the use of credit card, but it assigned those tokens internally in the smart contract later.

We can also combine purchasing and spending LOCIcoin, as ONE ATOMIC OPERATION.

Here we can see the call to the LOCIcredits smart contract has been simplified to one call, where LOCIcoin is both transferred into and out of the LOCIcredits contract, and is responsible for assigning a certain number of credits to the guid of the user.

Now that a user has purchased LOCI that is held in the LOCIcredits contract and assigned to his guid, he has the ability to use them for Utility within the application. Here we see the diagram for spending the LOCIcoin, and returning the coin assigned to his guid back to the liquidity pool.

There may be times when a user accidentally signs up for two different accounts, and an administrator needs to transfer those LOCIcredits from one guid to another beneficiary. That’s supported too. Note in that scenario, no interaction with the LOCIcoin is needed, since it’s only updating an internal balance between 2 guids.

Another supported scenario — User Buys 25, Spends 5, and sends his balance to his own wallet specified at 0x12345… In other words, the user would like the convenience of using fiat to purchase LOCIcoin and still understands crypto enough to control their own cryptocurrency and tokens.

The user may buy LOCIcredits through the site, use some on Utility in the application, and recover his balance to his own wallet. These actions would all be supported as ONE ATOMIC OPERATION.

Finally, a customer may already have LOCIcoin in their possession, but wish to participate in the services of the custodial contract. This is also supported.

Scenario — User that already owns LOCIcoin in his wallet wants to convert to LOCIcredits

This is a *special operation* that will require 2 steps:

1) User grants “approval” to the LOCIcredits.address in order to spend his deposit amount.

2) Browser sends Server a message with txHash, so that when the approval completes, a new action triggers transferFrom user wallet to LOCIcredits.

In the deposit scenario, the user grants the LOCIcredits contract ‘approval’ for an allowance so that the wallet is used in place of the liquidity pool. Here, we are not buying more LOCIcoin, but moving them out of circulation to be spent from the user’s wallet.

For those more technically inclined, you can audit the contract for yourself at the mainnet deployed LOCIcredits Contract: https://etherscan.io/address/0xc60de1a27ae8395b7c2a0034aa060ed4d31b39aa

Again, we are happy to provide this Fiat-to-LOCI Custodial option as a way to reduce friction, increase adoption, and at the same time, introduce new members to the cryptoeconomic model behind LOCIcoin and LOCIsearch. Let us know what you think! #BUIDL #Ethereum #Blockchain #Utility

Dan Emmons is the Blockchain Developer for Loci.io, owner of Emmonspired LLC, a Certified Bitcoin Professional, Certified Ethereum Developer, Full Stack Developer and Advisor on Cryptocurrency projects. He is also the creator of a Youtube Channel and iTunes Podcast called #ByteSizeBlockchain.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Dan Emmons

Dan Emmons

A leader who strives to make issues that seem complex, overwhelming, or insurmountable more manageable for the Team & provide exceptional service to my clients.