November Progress Update: practical application of Ethereum blockchain in marketplace business processes

in #bcshop6 years ago (edited)

progress.jpg

Current state of Ethereum blockchain requires a lot of work to be done to actually use its benefits in real business processes. In this, mostly tech-focused, update we would like to tell you about progress in some of blockchain-related projects’ areas. So let’s take a quick look on the back-end heart of BCShop.io.

Testnet Smart-Contracts Updated

In one of the past reports we talked about the updated BCShop.io roadmap which includes new features such as Referral Campaign or Escrow Agents.
This month we deployed new smart-contracts to the Ropsten testnet.

pic1_conttracts.png

This figure shows connections of some of our system’s smart-contracts, particularly those that were affected by this month update. Arrow indicates that one contract (arrow’s start) uses another (arrow’s end), storing a reference to it, and calls its methods.

White rectangles represent contracts that haven’t changed at all, the only such contract is main product information storage - it is not changed by design, which we discussed in February report.
Blue rectangles are for contracts that already exist in the system, but should be updated and redeployed in order to support new features.
And last but not least (actually they are the main reason for this update) green rectangles - they are completely new contracts. They mostly serve as storage for new types of data as well as provide methods for convenient retrieval of this information.

In a nutshell contracts’ relations can be described as follows:
Main contract that users interact with is ProductPayment. It was updated to support custom escrows feature as well as new functions like revoking a purchase as a merchant or confirming product’s delivery as a customer. Escrow information is provided by Escrow contract that refers to EscrowStorage to retrieve data about escrow fees and complaint time limit for every product. The same information is needed by FeePolicy contract which is responsible for calculating amount of fees to pay to affiliate, escrow, and BCShop.io itself. Affiliate fee is provided by AffiliateStorage contract.
ProductFactory contract now also should use new types of storages to correctly create products. So that’s why it also should be updated.

Also, the API server that connects BCShop.io website with the Ethereum blockchain has been updated accordingly. Now it is capable of supporting several different versions of smart-contracts. For example it can now handle the situations when some purchase events were written in previous version of ProductPayment contract, and some - in the latest one. Website user won’t see any difference, from its point of view there is only one list of purchases.

Introducing Cache Layer

We are constantly working to increase BCShop.io performance and one of the speed bottlenecks is usually the Ethereum node itself. Sometimes it can take quite a long time to receive the list of all contract events, for example. And this information is always the same. Yes, it doesn’t change with time, only new events can be written to the blockchain, but no old event could be removed. So we decided to introduce a special caching layer that is responsible for saving and quick retrieval of such data.

pic2_old_arch.png

Current architecture of our system is shown on the figure above. Website uses API server which on its turn requests Ethereum node for all the necessary information. This approach is quite simple but it lacks performance as some of historic data can take some time to be received.
The modified architecture includes Cache Layer and new Back Sync process.

pic3_new_arch.png

API server will request the Cache Layer for some of the data (for example, events). This layer is used only for off-chain situations, like the list of purchases. If we need to send a transaction, it still goes right to the Ethereum node.
Another new component here is Back Sync process. It is his job to keep Cache Layer up-to-date constantly scanning blockchain and writing BCShop.io-related information to its database for future quick retrieval. That way website and users, of course, should get response much faster.

Reacting to Metamask New Privacy

Some time ago the famous Metamask browser extension was updated to enhance user’s privacy. Now it is possible to forbid websites to watch your Metamask accounts. User can do it using Settings page, new Privacy Mode toggle switch.

pic4_metamask.png

If it is set to ‘On’ position, website should first ask if user agrees to give access to his Metamask accounts. Further usage of Metamask is possible only if user confirms this request. Settings it to ‘Off’ position leads to old, before-the-update behaviour.
Please note that website doesn’t get access to your private keys when you allow the access, it just allows website to connect via Metamask just like it was earlier.
We updated our website code so it reflects this change. This patch goes through the last tests and soon it will hit the website. From that moment if you use Metamask you should first allow BCSHop.io to use its accounts.

About BCShop.io

BCShop.io project aims to reinvent the way digital commerce and payments work today. Focusing on digital goods and services area project’s goal is to enhance it with fast-growing opportunities blockchain technologies and cryptocurrencies have to offer. In January 2018 BCShop.io hit hard cap of 2000 ETH at its token sale.
Website: https://bcshop.io/
Twitter https://twitter.com/BCShop_io
Telegram https://t.me/bcshopio
Facebook https://www.facebook.com/BCShop.io/
Business Inquiries [email protected]

Coin Marketplace

STEEM 0.20
TRX 0.14
JST 0.030
BTC 64294.06
ETH 3427.66
USDT 1.00
SBD 2.59