
What do you have in the first place associated with the word "blockchain"? That's right, with cryptocurrencies and Herman Oskarovich. And although for specialists we will not discover America, but for most people who are not so tempted in blockchains, it may be a revelation that this technology is applicable in various fields, and not only for accounting for bitcoin transactions, ethereums and other virtual coins. For example, the blockchain is well suited for use in the field of factoring. At the beginning of the year, we completed the development of a joint project with Sberbank to create a blockchain-based factoring platform that is open to everyone. What kind of platform is it, why is it needed and how is it arranged - our story is under the cut.
A few words about factoring
What is factoring?
Expressing high financial calm, factoring is one of the instruments for financing working capital. The main part of our working capital is goods that are in warehouses and in stores and are waiting for their new owner.
')
Imagine a scheme: there is a bank, a supplier of goods and a seller. The supplier ships the goods to the seller, the bank pays him for it, and the seller then pays the bank. In order for the bank to pay for the delivery, it needs to receive confirmation from the seller that he actually received the goods in full and of proper quality.
This scheme is called factoring. We actively use factoring, according to this scheme several hundred suppliers work with us. The partner turns to one of the factoring companies - they are called “factors” - and she allocates funds to pay for the goods here and now. But the main condition is the availability of information that “M.Video” accepted this product and will pay for it after some time. For example, the supplier brings a bunch of overhead and says: "
Finance 10 million ." They are answered: "
We would be happy, but it is important for us to first find out what these supplies really were ." Factors contact us for this information.
Previously, all operations of confirming deliveries with us were done "manually": after receiving the goods from the supplier, specially trained employees checked the delivery and loaded data into our system. Then the bank went to the accounting department and asked if we had received such a batch. The request was sent either by mail or by phone. Our experts clarified the information inside the company and answered the bank that everything is in order, you can pay. It turned out for a long time, besides too much manual labor and participants in the process did not contribute to confidentiality.
Blockchain on the horizon
We do not limit our suppliers in any way by choosing a bank or a factor. Therefore, today, 12 financial organizations are working with us on factoring, the aggregate amount of open limits for contracts with M.Video amounts to about 50-55 billion rubles. And each of them uses their own IT-solution for verification of deliveries.
Therefore, we were regularly asked to integrate our system with the IT system of a bank or a factor. But since we use SAP, it is difficult and expensive for us to integrate. According to our estimates, each of the integrations would cost us from one million rubles. But then you still need to maintain each system, since they are being developed and updated.
We have long been interested in the possibility of somehow simplifying the factoring procedure. And when, in an IT environment, they began to talk more and more actively about the blockchain, an idea arose to try this technology for factoring operations. It is safe, simple and open to all participants. From it you can trace from the beginning to the end the entire chain of operations. There is no need to transfer confidential data to an expensive third-party repository, because at each moment of time each participant has a local database of all operations: the suppliers have what they shipped, we have what goods they have accepted, the banks have paid and to whom. It is necessary only to establish information exchange between these registries. Moreover, the issue of information security was extremely acute for us.
So, there was an idea: screw the blockchain to factoring. It remained the case for "small" - to implement. But in M.Video there were no blockchain experts. But they were in Sberbank. He had a resource, we had an idea, and as a result, a joint project emerged to create a factoring blockchain platform.
Factoring blockchain platform
The main advantages that formed the basis of the project: simple, cheap, confidential, scalable. The platform can be used by any bank, factor or supplier who wants to work with us on factoring.
The platform is based on Ethereum smart contracts. Within this technology, you can specify various information for each transaction. This is what we use: our development has no relation to payments, it is a means of recording information about commodity-money transactions between the participants of the factoring scheme.
Ethereum, as an open source platform, allows you to build “your blockchain”: without limiting access to smart contracts and transaction data records. We decided to build a private network, because it gives a number of advantages. First, transactions are recorded in a chain that is not related to the Ethereum public network. Secondly, a limited number of participants can create transaction blocks (entries in the decentralized registry) and receive data from the registry.
Our network is technically no different from the “classic” Ethereum network, but its privacy allows you to control the network and quickly update the functionality, as well as change the logic of data recording and reconciliation. In addition, a private network allows you to reduce transaction costs, since they are checked for validity by trusted and high-performance nodes.
The platform is a network consisting of node-miners - servers, standing at each network participant. At any time, new miners can be added to the network, that is, new participating companies can freely join the platform.
Miners are the Ethereum network clients that are running mining. They participate in the procedure for confirming incoming transactions and adding them to new blocks.
Our network uses the “classic” Ethereum. We did not change either the hashing algorithms or the transaction block entries. It was important for us that participants could create and publish their smart contracts — classes that describe the rules for writing data to the blockchain — and receive data from other participants. Ethereum algorithms provide decentralized data storage and smart contract execution. Hashing is performed locally, already hashed data becomes public, this is done to improve network security.
It is recommended to install Ubuntu on miners. Each node contains a copy of the database and information for connecting to other nodes — the public key, IP address, and port. A node consists of a gateway and a client part. The gateway is an Ethereum client without running mining, located on a server in the DMZ zone. Through it go the data between the client and the entire network. In addition to the Ethereum client, a system web service is developed on the server for loading and checking documents, which is the Node.js service and the PostgreSQL DBMS. The web client of the running service is available only on the internal subnet.
The DBMS is in no way tied to blockchain technology and operations. Its main tasks are the delineation of user rights in the web client and storing the download history of files with deliveries. Any control system can handle this. We chose PostgreSQL because it is fairly simple, and our developers have already worked with it.
Network-loaded smart contracts use accounting documents as Excel files as input. The data format is harmonized: we agreed that we will have so many fields, such and such delimiters, we can use such and such characters, and so on. For each delivery of goods, a hash is generated based on the key fields using the SHA-3 algorithm. In a smart contract is written:
- delivery hash;
- all amounts in the document currency for this hash;
- Posting dates corresponding to amounts.
If we and the factor have hashed the same document, and the resulting hashes coincided, then this is a confirmation of the successful delivery of the goods. The bank has a record of confirmation, and after that it can pay the supplier the necessary amount.
Occasionally, invoices from suppliers and we do not coincide in the amounts - a consequence of typos when filling out documents, the notorious human factor. The platform provides a mechanism for handling such situations: a smart contract first hashes only the details of the document, and leaves the amount open. If we and the supplier of the attribute hashes match, then access to the amount is opened. If the supplier has less, then the bank will pay less, for him the risk is lower. If the amount from the supplier turns out to be significantly larger, the bank can additionally contact us and clarify the information. This happens rarely, in half a year, two or three times.
Faster, higher, stronger
Blockchain platform will allow us to get rid of a number of shortcomings inherent in the usual pattern of interaction with factors. First, banks and factors will not need to create or customize their software to share data with us. They will be able to use ready-made tools to quickly create a miner node and connect it to their information system to exchange data with the general network. Already this year we plan to gradually add to our blockchain platform most of the bank factors. In addition, the platform excludes a number of intermediaries and various “manual” operations from factoring operations, so that the data exchange between the participants is faster, and most importantly, it is much safer.
And it was just nice for us to find and implement for ourselves a new, elegant, simple, cost-effective, safe and unlearned business application of promising technology. We have a few more ideas on the use of blockchain in other areas of retail - we will test and explore the potential.