Introducing Natural Language based token creation & transfer system on FLO Blockchain
Vivek Teega and Rohit Tripathy, Ranchi Mall
Let’s say we could create tokens just like this:
Create 21 million tokens with name alphacoin#
Start an alphacoin# token system with 21 million tokens
Begin a token system called alphacoin# with an initial supply of 21 million tokens
In a system like this, there’d be no need to write technical code. Everyone would be able to create and launch their own token systems, without knowing any kind of programming.
Once such tokens have been created, we would have to figure a way to transfer these tokens to someone who pays for them. Assuming the commands were as simple as:
Transfer 100 alphacoin# tokens to Romeo
Give 100 alphacoin# tokens to Juliet
The above commands would be a complete description of any token creation and transfer system.
Let’s see some more examples:
100 alphacoin# transfer
alphacoin# 100 transfer to Sherlock
alphacoin# give 100 to Sherlock
SEND 100 COINS OF ALPHACOIN# TO SHERLOCK
A user friendly token creation and transfer system should be able to understand common English language constructions for it to be acceptable at mass level. Creating a system that can parse user commands like this is relatively easy with a couple of if/then/else statements.
So we created a parsing system for token creation and transfer : https://flodata-tester.duckdns.org/
Execution on the blockchain
To execute a natural language based token creation and transfer system we first need a blockchain that permits storage of free text. That blockchain exists. It’s called FLO.
We will use the floData feature of FLO blockchain which permits storage of 1040 characters in a transaction as part of transaction comments.
Once data goes into the blockchain it stays there forever. So a user instruction issued inside the blockchain can never be altered. Using that property of the blockchain we can create a data interpretation system outside the blockchain with the following rules :
- Any FLO address can create a new token system by supplying a name which has not been taken earlier. Any word ending with ‘#’ is the name.
- The supply of tokens is specified; either in decimal numbers or number followed by thousand/million/billion/trillion.
- An explicit instruction is given to invoke the token creation system with one of the following keywords: create, start, begin, incorporate.
- The token supply amount will be credited to the sender’s FLO address.
- Any confusing instruction is rejected.
- The words in an instruction can be provided in any order.
Similarly for token transfer system, the following rules can be specified:
- An explicit instruction is given to invoke the token transfer system with one of the following keywords: send, transfer, give.
- The name of the token system is specified.
- The amount of tokens to be transferred is specified.
- There can be only one sender address on the input side, and only two addresses on the output side, one belonging to the receiver and the other, is the sender address, acting as change address.
- The sender address must have a token balance greater or equal to the amount being transferred.
- Additional text can be used so long as it does not obscure the meaning of essential instructions.
- The words in an instruction can be provided in any order.
These rules themselves are global specifications of the Token Creation and Transfer system. Rules need to be put in the blockchain just once in order to become immutable and inform all operators and users of the rules of the system.
Implementation of the system
Our system design is such that data will be inside the blockchain and the interpretation of data will be outside the blockchain.
We have already specified the format of data that will go into the blockchain, and now we have to create the implementation script outside the blockchain. We have used python for this, although any client language that implements the rules should work.
Now lets say someone creates an rmt# token with the instruction “create 21 million rmt#”. They can avail the services listed below:
- Token explorer at http://flo-tokenexplorer.duckdns.org/
- RESTful API for the token explorer
Token explorer APIs [ for developers ]
API endpoint : flo-tokenexplorer.duckdns.org/v1.0
Return a JSON object with a token's informationMethod - GETParameters
1. token - Name of the token system
Return a JSON object with token balance at the given FLO addressMethod - GETParameters
1. address - FLO address to query
2. token - Name of the token system
Return a JSON object with a token's transaction informationMethod - GETParameters
1. token - Name of the token system (Optional)
2. senderFloAddress - Filter results to show only transactions with the given sender Address 3. destFloAddress - Filter results to show only transactions with the given receiver Address
For example, if a token is created on the FLO blockchain with the name rmt#, one could use the API in the following way:
- Token Info
- Address Balance
- Get Last Transactions
User access to the blockchain
For users to make use of this system they need a way to enter floData into the blockchain by doing a transaction, in a rather not-too-technical way. To facilitate easy access we provide a companion wallet where a person can generate a FLO address and write the data in the FLO blockchain if he provides the private key of that address.
Note — Any FLO wallet which cannot send the change to the sender address will not work because the system will not know which, among the two output addresses in a transaction, is the receiving address.
List of tools used
- FLO data tester — Test weather the data being entered into the FLO blockchain is correct or not flodata-tester.duckdns.org
- Token Tracking System source code https://github.com/ranchimall/flo-token-tracking
- Checking the status of tokens through token explorer https://flo-tokenexplorer.duckdns.org (Token explorer)
- Source Code of token explorer for any token created https://github.com/ranchimall/flo-token-explorer
- User Accessibility: A web based wallet to generate FLO addresses and write data into the FLO blockchain, at the link https://flo-webwallet.duckdns.org
- Source Code of Web Based FLO Wallet: https://github.com/ranchimall/FLO_webWallet
FLO token transfer vs Other token transfer systems
This approach brings a dramatic simplification in the application of blockchain technology in real life use cases. Every other token creation or transfer systems currently needs some knowledge of coding or deep technical knowledge to be able to use them. This approach also reduces the number of steps needed compared to any other leading asset creation and transfer system.
We have compared the token creation and transfer system on Ethereum, Stellar, EOS, Tron and Omni at this medium article
Credits and Updates
This is a Ranchi Mall FLO Blockchain Contract project.
Updates are available at https://twitter.com/ranchimallFLO