Welcome to XConnect’s documentation!¶
Introduction¶
Abstract¶
The tech world is one of the most dynamic segments of this universe. For the one moment everyone is behind technology and the next moment the technology becomes obsolete. Each day a new framework and technology is released but still, there needs to be something which should have the power to carry the mass together. D-Apps are the decentralised way of communicating to each other using mobile and web applications. In this time of world, where data becomes crucial part of any human being , we can’t risk to give it to any central authority to govern and control. D-Apps solves this problem, here you hold your data and you are the sole person to make it secure using your cryptographic keys. Proof of work is one of the most important feature of blockchain, this tells us that what ever you do in your business is recorded and stored in blockchain. So if you are a musician and you play guitar and publish your music in the blockchain network, it’s always yours. The proof fo work algorithm of Ethereum preserves your work. XConnect is also built using the similar ideologies of D-Apps. It is true that in today’s time its impossible to completely decentralised something but we can still tend towards maximum decentralisation.
An Example¶
To start with an example lets compare how we can leverage the features of three major E-commerce giants in XConnect using de-centralisation.
- E-Bay - It is an online E- commerce website which provides you an opportunity to list your products on its dashboard and if some buyer shows some interest they can connect to each other and proceed with the deal. You can list any kind of electronic products, second hand products, vehicles etc.
- Soundcloud- You can upload your music, share it and listen to other’s music.
- Zoom-car - You can list you car if you are not using it for others to rent and then earn money.
These platforms provide you a great solution to today’s major problem statements but in a centralised way. You don’t have the access to the whole data fragment and 90 percentage of the data is stored in the central servers which is controlled by E-Bay, SoundCloud and Zoom-car. This leads to 2 major problems.
- Origin of products [Transparency] - You may not know from where the product is originating. May be it is a fake product or a tampered product. You lack knowledge of origin.
- Proof of work - You don’y get your reward for your genuine effort. In case of Soundcloud , you many not get your copyright if someone uses it again and again.
XConnect solves these 2 major problems by making the full framework decentralised. As the system is decentralised you have - * Data residing on public ledger- Since the data is communicated to all the ledgers connected by the peers, everyone has access to it. It is not hidden. A node can use its private key mixed with the public key to fetch the data. This solves the transparency problem which was in the centralised system. * Ethereum Proof of Work- The ethereum’s proof of work algorithm keeps track of every block in the blockchain. Since, your data ( your music in case of sound-cloud ) is generated as a block and a miner has invested its computing resource to solve it’s existence, it gets connected to the blockchain network and hence its resides there forever. This ensures you’re copyright to your work is maintained.
QuickStart Guide¶
The Web Application of XConnect¶
XConnect comes with Web application which can be accessed using any web browser. You need to install Metamask extension to your browser. These are the features which will be provided to Users-
[As a seller] * Identify yourself as a seller or a buyer, you can create multiple accounts if you wish to have both roles. But you need to have separate private keys for all the accounts. * Use your google account linked to XConnect. * Create your profile/portfolio. * Add your products/ showcase what you do and want to sell. * Advertise it. * View potential buyers in your area.
[As a buyer] * List the products you want to buy. * Create your profile/ portfolio. * Connect to potential sellers in your area. * Communicate with them using XConnect chat. * Find a deal and move forward in blockchain.
Market Opportunity¶
Case Studies¶
Let’s discuss some of these interesting case Studies.
XConnect in Farming¶
Directly from Lena's farm to Dominos toppings.
Meet Lena !! She is an independent part time farmer.She grows olives in her backyard and likes to sell it to earn likes from all over the world.
-
Lena registers herself in XConnect.
She creates her profile, posts her freshly grown olives and shares the detail that she is looking for buyers.
-
Dan ! A small scale buyer connects to Lena via XConnect and places an order.
While browsing through the app he finds Lena's freshly grown olives.
-
Mark !! A small logistic owner, finds that Dan and Lena needs a logistic supplier to ship their shipment.
He provides his logistics to pack and ship the olives from Lena's location to Dan's warehouse.
-
Dominos Pizaa !! A store from the city calls up Dan to place an order of certain amount of Olives for their pizza toppings.
Dominos store manager in the city connects to a supplier, Dan via XConnect and places a huge order.
Architecture of XConnect¶
The peer to peer network¶
- Database - All the transactions which happens around the application are stored in the Ethereum blockchain as a package of blocks which are linked together. Let’s take and example - Assume someone placed an order using XConnect platform and after few days cancelled it and asked for a refund, then all these steps will be recorded in the blockchain ledgers and shared to everyone. Hence this becomes tamper less. Ethereum uses and algorithm of proof of work to ensure the integrity of data pushed into the blockchain.
- The Algorithm and Code- So where does all the code base resides ? So first of all, every login in XConnect is written in Solidity in the form of Smart Contracts. The buy, sell , refund, dispute etc is a specific smart contract individually. Each one of them is deployed in Ethereum Virtual Machine, it converts the code into Ethereum byte code and then deploys it into the ethereum blockchain.
The model¶
Here, the model of XConnect’s architecture is discussed in terms of top view, where the three main parts of the application is shown, one is the front-end which is the end users tab, the backend APIs, the ether payment gateway called as metamask and the EVM (Ethereum Virtual Machine). Later we will discuss about its core event transactional model.
Top View¶
- The Decentralisation
- Front-End
- Backend
- Metamask
XConnect’s Transactional Model¶
- The Transaction
- Crypto Identify
- Backend
- Listening to the network events (like token transfers) / reading the network state.
- Publishing transactions- invoking state-changing smart contract functions like token transfer
- We listen to a particular network event by continuously polling the network.
- Once we get an event, we perform some business logic and then decide to publish a transaction in response.
- Prior to publishing the transaction, we want to ensure that it will likely be mined (in Ethereum, the successful transaction gas estimation means there are no errors against the current network state). However, we can’t guarantee that the transaction will be mined successfully.
- Using a private key, we sign and publish the transaction. In Ethereum we also have to determine the gas price and gas limit of the transaction.
- After publishing the transaction, we continuously poll the network for its status.
- If it takes too long and we can’t get the status of the transaction, we have to re-publish it or trigger a “fail scenario”. Transactions can be lost for various reasons: network congestion, dropping peers, network load increase, etc. In Ethereum, you can also consider re-signing a transaction with a different (actual) gas price.
- After we finally get our transaction mined, we can perform more business logic if needed. For example, we can notify other back end services about the fact of the transaction being completed. Also, consider waiting for a couple of confirmations prior to making final decisions regarding the transaction: the network is distributed and hence the result can change in a matter of seconds.
- Publishing Transaction
- Preparing the transaction. Along with transaction data, this step implies requesting the network state in order to find out whether this transaction is valid and is going to be mined (gas estimation in Ethereum) and the transaction’s sequential number (nonce in Ethereum).
- Signing the transaction. This step implies the usage of the private key. Most likely, here you’ll want to embed the custom private key assembly solution.
- Publishing and republishing the transaction. One of the key points here is that your published transaction always has a chance to get lost or dropped from the de-centralised network. For example, in Ethereum, the published transaction can be dropped if the network’s gas price suddenly increases. In this case, you have to republish the transaction. Moreover, you may want to republish the transaction with other parameters (at least with higher gas price) in order to get it mined as soon as possible. Thus, republishing the transaction can imply re-signing it, if the replacement transaction wasn’t pre-signed before (with different parameters).
- The user executes a function in a smart contract, which ultimately allows the back end to perform a successful charge transaction.
- A back end service responsible for a particular task listens to the event of charge allowance and publishes a charge transaction.
- Once the charge transaction is mined, this back end service responsible for a particular task receives an event from the Ethereum network and performs some logic (including setting the next charge date).
Deep dive to XConnect’s Solution Architecture¶
Business Architecture¶
XConnect’s business architecture shows the four major areas of which can enhance the business growth of XConnect in the public blockchain market. As it has been already stated that the audience of this application not only involves the big market monopoly leaders such as Reliance industries but also includes small businessmen who make money by connecting to small backyard farmers or small fishermen. Let’s discuss each of the major areas in detail.
1. Usability - This depicts the functional usability of XConnect. We claim X~ tends to everything. You can advertise any product you own or have on this platform. Even a buyer who wants to buy anything can buy it from the platform by connecting to the particular seller. You don’t need to have a specific - * System to sell only groceries ( don’t need big-basket) * System to sell electronics. (don’t need an E-Bay) * System to rent out my vehicle (don’t need a Zoom-car and Drivezy) | XConnect gives you a decentralised platform where you can do all these easily. One application that perform everything.
2. Revenue - The revenue model of XConnect is designed in a way that it keeps the blockchain stiff every time. The gas values of the transaction is one of the main part which governs generation of revenue. Let’s discuss the features of XConnect which generates money- * Transactional value for each transaction. For every services in XConnect the customer has to pay a small amount in the form of ether. For creating an account to advertise the products or services you provide, all remains ether chargeable. * Subscription Charges - XConnect has premium features which is extra chargeable. For example- in a free subscription you can only connect to 50 sellers/buyers a month. In premium versions you can connect to more consumers and producers. For now this is kept out of scope. * Advertisements- This also generates a huge revenue. Per advertisement it is ether chargeable.
3. Security- The security concerns of XConnect is ensured by various cryptographic algorithms using public and private keys. To proceed with any transaction, one need to register to Metamask, which is a gateway to ethereum blockchain network. You need to create your private key which needs to be kept secure. | The other most important concern of blockchain is credits and copyrights. This is achieved by Ethereum’s proof of work algorithms.
DFD ( Data Flow Diagram )¶
In XConnect the data flow depends on the services we use. Typically there are four service which generates data following nested services. So each time the user uses XConnect it generates data , a block gets created and the public ledgers get updated for all. Once the block is ready it depends on the gas value to mine the block and chain it to the blockchain.
Technical Architecture¶
1. The Central Part | In terms of technical architecture, as XConnect comes in two variants, one as a web application and other as a mobile application to serve the purpose on every kind of available devices. The former is built on Angular 7 and the mobile version is built using React native. Both of them are packaged as an image on a docker container and hosted on Google cloud platform. Further , these front ends are connected to the decentralised part using python wrappers. The local data is stored in MongoDB which sometimes serves as a local cache. In some cases where you want data fetching speed to be high and can’t rely on block-chain network XConnect uses its local DB to make processing faster. Further, these wrappers are connected using RabbitMQ messaging services which works on a publish-subscribe fashion. These web hooks provide an asynchronous connection of the front end of XConnect and the blockchain network. All these wrapper services, local database and messaging queues resides under Amazon EC2 instance. 2. The Decentralised Part | Until now, all the technical dependencies were hosted on Google cloud or AWS, which is completely centralised. The decentralised part contains Ganache-Truffle-Web3.js framework which allows the central part to connect to the decentralised world. Ganache is a in memory blockchain which provides test ethers to develop any application. In current scope of XConnect, Ganache is used as a blockchain network. Web3.js is a very powerful javascript library which allows any javascript based framework to connect to Ethereum blockchain. XConnect is based on Web3 and Truffle. For the core part, which is smart contracts XConnect uses Solidity.
System Architecture¶
Technical Documentation¶
- APIs
- Solidity as Core
- Ganache Local Arena
- Using Web3.js
- XConnect to public blockchain
Note
This part will be coming up once the XConnect MVP is completely ready. Before 30th June :)
Initial POC¶
About¶
Founder and Developer¶
Contact¶
Email- gorai.rahul2022@gmail.com