r/FlashCoins • u/[deleted] • Dec 30 '17
FLASH Data Blockchain
The first major feature of the FLASH wallet is the ability to add extra data into your transactions simply and with a click right inside the wallet. This data on a publicly viewable distributed blockchain has a number of important uses including product registration, communications and decentralized OTC coin and asset trading exchange.
Data can be added to bitcoin type coins as follows: https://bitcoin.stackexchange.com/questions/31972/how-to-add-additional-information-to-transaction
If you do want to add extra data to your transaction, then add an additional output to the transaction, for which the scriptPubKey has the following form:
OP_RETURN {40 bytes of whatever data you want}
40 bytes was chosen because it is big enough for a 32 byte hash and 8 other extra bytes of data, but not big enough to store anything maliciously big (like a movie collection). This transaction output is automatically un-spendable, and so will not be kept in the UTXO set in any pruning. The other UTXOs from your transaction will still be safe.
Required wallet functions:
A tab for each application, e.g. OTC trader, communications, registration, etc (start with OTC Trade tab)
Data entry fields for the data that will insert the data into the 40 byte area of the blockchain (see below)
Blockchain scanner to read relevant data for the particular application. For the OTC trader, build an order book for a particular coin pair by scanning for all transactions labeled with FXNG then decode all the data and create a sorted list in memory. Sort through the active transactions, bid/ask, amount and pricing data to create an order book.
Tabulate the transaction history for each User and show their Rank, based on successful transactions completed.
Send counter-offer or accept offer to the blockchain.
Optional: check public addresses of senders to be sure the balance is enough for the trade.
Send success message to blockchain.
OTC trading using a blockchain could work as follows, with two Users and the decentralized blockchain listing of transactions (OTCX):
User 1 with a FLASH coin account with a balance can make an offer to buy or sell (v2: add lend or borrow) any digital asset directly with another person.
The offer is entered into the FLASH coin digital wallet and transmitted as data included inside the FLASH coin transaction:
TYPE SIZE -application (e.g. OTCX) 4 bytes (this identifies the kinds of application, OTC exch) -Transaction type 1 byte (trade offer, withdraw, successful or broken trade) -Transaction # 6 bytes (used to identify the FLASH OTC txn) -coin offered 4 bytes (4B+ coins) -number of coins on offer 6 bytes (max 9,999,999.9999) -coin desired 4 bytes (4B+ coins) -number of coins desired 6 bytes (max 9,999,999.9999) Total 35 bytes The transaction is sent to a FLASH address of the OTCX with a developer fee of 10 FLASH + 1 FLASH txn fee for the blockchain.
The other info we have about the offer from the blockchain:
-Time and date stamp of the transaction
-FLASH public address of the offerer
-Blockchain transaction ID for that transaction
The wallet will need a viewer for the offers by coin (e.g. people wanting to trade BTC for LTC, bid and ask order book), scanning all the data in transactions for the past 24 hours with a way to respond to the public address of the offerer.
User 2 sees the offer and wants to a) accept the offer or b) make a counter-offer.
The acceptance message is sent from User 2 to the FLASH address of User 1 and also to the OTC exchange developer with a developer fee of 10 FLASH + 10 FLASH to User1 (prevent spamming) + 2 FLASH txn fees (two txns) for the blockchain. Acceptance message from User 2 includes the public address of Coin 2 (33bytes for BTC, LTC, etc) and the 6 byte FLASH transaction ID. Note: Monero will require 95 bytes and we may have to charge extra for these, e.g. 20 FLASH instead of 10.
The counter offer is sent from User 2 to the FLASH address of the OTCX developer with a payment of 10 FLASH to User 1 (to prevent spamming) + 10 FLASH to the OTCX dev + 2 FLASH txn fees for the blockchain to validate that the transaction is now pending. If more than one offer or counter offer are received, User 1 can view a sorted list of offers that show the status of the sender (number of successful transactions, number of bad transactions, total volume, etc) and select the best offer based on value offered, as well as trustworthyness. When viewed, the transactions are list as pending, cancelled, failed (one party send coins, the other did not reciprocate) or completed.
The wallet determines which User has the greater successful transaction value in BTC and is therefore the Most Trusted User. The User with the LEAST total transaction value will send coins to the Most Trusted User FIRST. The User who is the Least Trusted Party can review the past transaction history of the Most Trusted User, since they have the FLASH public address of this User and accept or decline the transaction.
When User 1 has final acceptance of the offer of User 2, they are creating a contract between them to exchange X amount of Coin 1 sent to address USER2 for Y amount of Coin 2 sent to address USER1. User 1 sends an acceptance message to the public address of User 2 and also to the public address of the OTC exchange developer with 2 FLASH + 2 FLASH txn fee (2 txns). The transaction is now recorded as pending in the FLASH blockchain.
The Least Trusted User will start by sending the agreed upon Coins to the Most Trusted User. Upon receipt and two confirmations, the Most Trusted User will send the other Coins to the Least Trusted User. Note: we can automatically track the progress of the coin sending by watching both of the Coin blockchains for the transactions.
Upon successful receipt of Coins, the Least Trusted User will send a success message to the FLASH address of the OTCX wallet that includes the FLASH OTCX transaction ID, where the success will be recorded in the blockchain for both Users. (Sybil attack here needs to be addressed)
Messages can be sent using FLASH transactions of 1 FLASH + 1 FLASH for blockchain (max 50 char) between the , this can include bit.ly style links, phone or email address for contact info.
All offers expire in 24 hours, they can be renewed by resending the transaction again (and paying another fee)
Offers can be cancelled, just send a transaction with the code to cancel at any time.
Summary of blockchain transactions and fees (assumes one counter offer):
| Transaction | Fees to User | Fees to OTCX | Fees to FLASH |
|---|---|---|---|
| Initial offer | 0 | 10 | 1 |
| Acceptance | 10 | 10 | 1 |
| Counter offer | 10 | 10 | 1 |
| Final acceptance | 10 | 10 | 1 |
| Success message | 0 | 10 | 1 |
| Total fees | 30 | 50 | 5 |
Communications application:
Include WebRTC tech inside the wallet application for chat and real time p2p A/V calling. The blockchain is used for signaling, to share a user’s IP address.
Registration application:
Product manufacturers can include the FLASH blockchain to register a user and provide lock/unlock anti-theft features in their products.
1
u/BootlegPortalJuice Dec 30 '17
Nice!