Not common cryptocurrencies: our blockchain platform for factoring
What do you primarily associate the word “blockchain” with? That's right, with cryptocurrencies and German Oscarovich. And although we will not discover America for specialists, but for most people who are not so sophisticated in blockchains, it may be a revelation that this technology is applicable in various fields, and not only for accounting for transactions of bitcoins, ethereum and other virtual coins. For example, blockchain is perfect for use in factoring. At the beginning of the year, we completed the development of a joint project with Sberbank to create a factoring platform based on a blockchain that is open to all comers. What is this platform, why is it needed and how is it arranged - our story is under the cut.
A few words about factoring
What is factoring?
Expressed by a high financial calm, factoring is one of the tools for financing working capital. The bulk of our working capital is goods that are in warehouses and stores and are awaiting 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, he needs to receive confirmation from the seller that he really 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. A partner contacts 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 a while. For example, a supplier brings a bunch of invoices and says, “ Finance 10 million .” They are answered: " We would be glad, but it is important for us to first find out that these deliveries really were ." For this information, factors turn to us.
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 the data into our system. Then the bank turned 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 long enough, in addition, too much manual labor and process participants did not contribute to confidentiality.
Blockchain on the horizon
We do not limit our suppliers in any way in choosing a bank or factor. Therefore, today, 12 financial organizations are working with us on factoring, the total amount of open limits for contracts with M. Video is about 50-55 billion rubles. And each of them uses its own IT solution for verification of supplies.
Therefore, we were regularly approached with a proposal to integrate our system with the IT system of a bank or 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 one million rubles. But then you still need to support each system, as they are developed and updated.
We have long been interested in the opportunity to somehow simplify the factoring procedure. And when in the IT environment they started talking more actively about the blockchain, the idea came up to try this technology for factoring operations. It is safe, simple and open to all participants. It can be traced from beginning to end the entire chain of operations. There is no need to transfer confidential data to a third-party expensive storage, because at each moment of time each participant has a local database of all operations: suppliers - what they shipped, with us - what goods were accepted, from banks - to whom and how much was paid. It is only necessary to establish an information exchange between these registries. At the same time, the issue of information security was extremely acute for us.
So, the idea came up: to fasten the blockchain to factoring. It remained the case for the "small" - to implement. But there were no blockchain specialists in M.Video. But they were at Sberbank. He had a resource, we had an idea, and as a result, a joint project to create a factoring blockchain platform arose.
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, different information can be specified for each transaction. This is exactly what we use: our development has nothing to do with payments, it is a means of fixing information on commodity-money transactions between participants in the factoring scheme.
Ethereum, as an open source platform, allows you to build your own blockchain: without restricting access to smart contracts and transaction data records. We decided to build a private network, because it provides several advantages. First, transactions are recorded in a chain that is in no way associated with the Ethereum public network. Secondly, a limited number of participants can create transaction blocks (entries in a 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 functionality, as well as change the logic of data recording and reconciliation. In addition, a private network can reduce the cost of transactions, since they are checked for validity by trusted and high-performance nodes.
The platform is a network consisting of node miners - servers that each member of the network has. At any time, new miners can be added to the network, that is, new participating companies can freely join the platform.
Miners are Ethereum network clients that are running mining. They participate in the process of confirming incoming transactions and adding them to new blocks.
Our network uses the "classic" Ethereum. We did not change hashing algorithms or write transaction blocks. 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.
On miners, it is recommended to install Ubuntu. 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. A gateway is an Ethereum client without mining running, located on a server in the DMZ zone. Through it, data goes between the client part and the entire network. In addition to the Ethereum client, a server’s web service is deployed on the server for downloading and reconciling documents, which is a Node.js service and PostgreSQL DBMS. The web client of the running service is available only on the internal subnet.
DBMS is in no way tied to blockchain technology and ongoing operations. Its main tasks are to differentiate user rights in the web client and store the history of downloading files with supplies. Any control system can handle this. We chose PostgreSQL because it is fairly simple, and our developers have already worked with it.
Smart contracts uploaded to the network use accounting documents in the form of Excel files at the input. The data format is harmonized: we agreed that we will have so many fields, such separators, you can use such and such characters, and so on. For each delivery of the goods, a hash is generated based on the key fields using the SHA-3 algorithm. The smart contract records:
- delivery hash;
- all amounts in the document currency for this hash;
- Posting dates corresponding to the amounts.
If we factor in the same document and the resulting hashes match, then this is confirmation of the successful delivery of the goods. The bank has a confirmation record, and after that it can pay the supplier the required amount.
Occasionally, suppliers' invoices and ours do not coincide in amounts - the result of typos when filling out documents, the notorious human factor. The platform provides a mechanism for processing such situations: at first, the smart contract only hashes the details of the document, and leaves the amount open. If at us and at the supplier attribute hashes coincided, then access to the sum opens. If the supplier has it less, then the bank should pay less, for him the risk is lower. If the amount of the supplier is much larger, the bank may additionally contact us and clarify the information. This happens rarely, for half a year two to three times.
Faster, higher, stronger
The blockchain platform will allow us to get rid of a number of shortcomings inherent in the usual scheme of interaction with factors. First, banks and factors will not need to create or adjust their software in order to exchange 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 for exchanging data with a common network. This year we plan to gradually add most of the factor banks to our blockchain platform. In addition, the platform excludes a number of intermediaries and various “manual” operations from factoring operations, so that data exchange between participants is faster, and most importantly, much safer.
And we were just pleased to find and implement for ourselves a new, elegant, simple, cost-effective, safe and unstressed business application of promising technology. We have some more ideas on the use of blockchain in other areas of retail - we will test and study the potential.