Research and Application of Electronic Invoice Based on Blockchain

Blockchain technology can effectively solve the problems of intermediaries' trust risk, reduce transaction costs and improve synergy efficiency in a multi-agent environment. This paper discusses the feasibility of applying blockchain technology to electronic invoices, and designs the overall structure of the electronic invoice blockchain. Moreover, in the paper, it is proposed to establish an electronic invoice alliance chain, and realize the research ideas of various transactions within the alliance through intelligent


Introduction to blockchain technology
In 2008, Nakamoto published a paper entitled "Bitcoin: A Peer-to-Peer Electronic Cash System", detailing how to create a set of decentralized Electronic trading system. For the first time, the establishment of a consensus mechanism among transaction entities is realized through technical means, and the "blockchain" is the basic technology that constitutes such an electronic trading system.
Blockchain is not a disruptive technology, but an integrated innovation of existing technologies. It is a fusion of distributed storage, consensus mechanisms, data encryption and smart contracts. In recent years, the continuous development of blockchain technology and the ensuing digital currency boom have aroused widespread concern in various fields, and people has carried out extensive and beneficial research on blockchain technology research, industrial application, policy supervision and other issues. The mature application of blockchain technology will take time, but the idea of multi-agent consensus synergy mechanism will have a profound impact on social governance and business operations.

Feasibility analysis of blockchain technology applied to electronic invoice
The electronic invoice refers to the receipt and payment vouchers in the form of electronic information issued or received in the purchase and sale of goods, the provision or acceptance of services, and other business activities, which are uniformly issued by the tax bureau.
Blockchain technology and electronic invoice management have a high degree of compatibility. Through the use of blockchain structure, distributed storage, data encryption and other technologies, it can realize the full cycle management of products and services from production purchase to reimbursement and deducting input tax. Detailed information on all transactions is unchangeable, transparent and efficient, can better solve the current difficulties in electronic invoice management, improve tax collection and management, and reduce social costs.

Removing the intermediaries of bill value transfer
A ticket is a valuable document that always requires a hidden "third party" role in the delivery to ensure the security of both parties. For example, in the electronic bill transaction, both parties of the transaction actually passed the information exchange and certification of the electronic commercial bill of exchange system of the People's Bank of China; in the paper bill transaction, the third party trusted by both parties of the transaction is the authenticity of the bill. However, with the help of the blockchain, it is not necessary for the third party to supervise and verify the information transmitted by the two parties, nor does it require a specific physical object to prove the trust between the two parties, and realize the "invisible" transfer of value between peers.

Improving operational efficiency
Since the blockchain does not require a centralized server, this greatly optimizes the existing system development model. Once system optimization or change is required, there is no need to pass the time span of multiple links such as demand-code-test-production-verification, which is a major advantage for the billing system that now relies on the system to handle the business.

Changing the structure of existing electronic commercial bill of exchange system
The existing electronic commercial bill of exchange system is a typical centralized mode, which is led by The People's Bank of China to develop a centralized registration and data exchange system. Other banks or enterprises access through direct connection or online banking agent. This makes all the bill acceptance, transaction, collection and other aspects need to be the data channel through the ECDS system, which is not only a centralized data storage platform, but also a third-party authentication and resource interaction platform.
After adopting a distributed structure decentralized by blockchain, the existing system storage and transmission structure was changed, and a more secure "multi-center" model was stablished. It is also possible to fully reflect the process of the bill from generation to extinction through time stamps, which has the characteristics of traceable history. This model has a new continuous "endorsement" mechanism, which truly reflects the transfer process of bill rights.

Technical goal
The core of the electronic invoice blockchain is to build alliances between State Taxation Administration, electronic invoice operators, invoicing companies, enterprise users, individual users and other related parties. Through the blockchain technology development platform to achieve the full lifecycle management of electronic invoice assets, through the intelligent contract to achieve business operations within the alliance, consensus decision-making, management operations, fulfillment of rights and obligations. Finally, through the transfer of electronic invoice value to mediate, reduce the risk of electronic invoice circulation, improve operational efficiency and other means to create commercial value.

Design principles
First,the architecture and implementation of the electronic invoice blockchain is geared towards specific services. From the typical use cases of enterprise applications, we should design the electronic invoice blockchain protocol and system function characteristics to ensure that the system can finally meet the needs of a wide range of enterprises.
The second is standardization. Since the blockchain application scenario is a multi-party participation and collaboration scenario, the electronic invoice blockchain needs to design standardized protocols and data structures from the top layer to solve the problem of data interaction between enterprises and avoid multi-chain coexistence. The formation of data islands in the evolution of blockchain technology makes the blockchain truly a basic protocol for standardized Internet value exchange and trust transfer.
The third is loose coupling and modularity. The electronic invoice blockchain adopts a modular design to achieve loose expansion of modules by defining clear interfaces between modules, thereby achieving good scalability of the entire system. The system can use different pluggable module components according to the needs of different users and scenarios.
Finally, we must follow the principle of simple and efficient system design, and define a more concise system conceptual model as much as possible, so that the user's learning cost is lower, and the risk of coding defects in the process of implementing complex distributed systems is reduced.

Basic technology architecture
The overall structure of the electronic invoice blockchain is divided into three levels: the core layer, the service layer, and the application layer. Adopting a bottom-up design approach, first focus on the design of the bottom layer of the blockchain core to solve the problem of data standardization and multi-chain interoperability in enterprise-level applications; the second is to define a general blockchain system service layer, to achieve specific functional components loosely coupled and pluggable, to solve the needs of enterprise-level applications can be customized according to specific circumstances; finally, based on the core and service layers, a specific blockchain implementation platform and related tools and development kits are provided to realize enterprise-level blockchain applications rapidly.

Construction of electronic invoice alliance chain
Combining blockchain technology, we could build an electronic invoice alliance chain based on the Internetbased alliance chain model. In this blockchain, the tax authorities are introduced to implement the regulatory mechanism on the blockchain system, and the tax authorities uniformly formulate the operational standards and contract conditions of the blockchain, each node and entrant in the blockchain must participate and operate in accordance with pre-established trading rules.
In the electronic invoice alliance chain constructed, the third-party service platform has the tax digital certificate issued by the tax authority, and as the producer of the blockchain invoice, is responsible for the authenticity and validity of the invoice data; Each node on the blockchain operates on its own in accordance with a public algorithm of the relevant invoice business that has been developed in advance, maintains the normal operation of the blockchain, and is responsible for the recording of distributed invoice books. In this way, a distributed invoice management system that is not tamperable, non-repudiation, traceable, and accessible can be formed in the lockchain.
The basic framework of the alliance chain is as shown: The network structure of the electronic invoice alliance chain is shown in the following figure: The electronic invoice alliance chain uses an optimized BFT consensus protocol and P2P communication to support multi-chain parallel consensus. The improved BFT algorithm is used to dynamically adjust the network topology to achieve dynamic join and active exit. At the same time, users can choose a better performance non-Byzantine consensus protocol (such as Raft) according to their needs to improve the efficiency of the entire blockchain. In order to cope with diverse business scenarios, meet information security needs, and improve business throughput, the blockchain supports multi-chain architecture. Unrelated business runs on multiple parallel blockchains, providing linear scalability for the business. For the interoperability between multiple chains, a relay chain mode was adopted, and the relay chain nodes participating in each direction submitted proposals, and the results were confirmed after the consensus.