Disclosure of Invention
In view of the above, the present invention provides a method for processing tax information based on a block chain, which can effectively improve the sharing convenience of the tax information and protect the security of the tax information based on the block chain when processing the tax information.
The invention provides a tax information processing method based on a block chain, which comprises the following steps:
the tax institution generates tax information of an enterprise after receiving the tax, encrypts the tax information and stores the encrypted tax information to an off-link distributed database;
the tax agency generates a block by the hash value of the tax information, the signed tax information, the storage position of the distributed database and the access authority, and uploads the block to a block chain;
a financial institution sends a tax data acquisition request to the tax institution, wherein the request comprises a public key of the financial institution;
the tax institution judges whether the financial institution is legal and has information reading authority, if so, the identity information and the public key of the financial institution are calculated based on the private key of the tax institution to generate an agent key, and the agent key is copied to generate a first agent key and a second agent key;
the tax agency sends the first proxy key, the storage address of the encrypted tax information and the first priority information to a first proxy node, and sends the second proxy key, the storage address of the encrypted tax information and the second priority information to a second proxy node;
the first proxy node reads the encrypted tax information in the distributed database, and re-encrypts the encrypted tax information by using the first proxy key to obtain first re-encrypted tax information;
the second proxy node reads the encrypted tax information in the distributed database, and re-encrypts the encrypted tax information by using the second proxy key to obtain second re-encrypted tax information;
and the financial institution receives the first re-encrypted tax information and/or the second re-encrypted tax information, decrypts the first re-encrypted tax information and/or the second re-encrypted tax information based on a private key of the financial institution, and acquires the tax information of the enterprise.
Preferably, the method further comprises:
and generating a private key of the tax institution and a private key of the financial institution.
Preferably, the receiving, by the financial institution, the first re-encrypted tax information and/or the second re-encrypted tax information, and decrypting, based on a private key of the financial institution, the first re-encrypted tax information or the second re-encrypted tax information to obtain the tax information of the enterprise includes:
the financial institution receives the first re-encrypted tax information, or the first re-encrypted tax information and the second re-encrypted tax information;
and decrypting the first re-encrypted tax information based on the private key of the financial institution to obtain the tax information of the enterprise.
Preferably, the receiving, by the financial institution, the first re-encrypted tax information and/or the second re-encrypted tax information, and decrypting, based on a private key of the financial institution, the first re-encrypted tax information or the second re-encrypted tax information to obtain the tax information of the enterprise includes:
the financial institution receives the second encrypted tax information;
decrypting the second encrypted tax information based on the private key of the financial institution to obtain decrypted tax information;
encrypting the decrypted tax information by using a public key of the tax authority;
receiving the tax authority to decrypt the tax information encrypted by the public key of the tax authority, and comparing the decrypted tax information with the tax information of the enterprise after tax payment to obtain a comparison result;
and when the decrypted tax information is consistent with the tax information of the enterprise after tax payment, the financial institution stores the tax information of the enterprise.
Preferably, after the obtaining the tax information of the enterprise, the method further includes:
based on the acquired tax information of the enterprise, comparing the enterprise with a plurality of standard objects;
determining a standard object model corresponding to the enterprise based on the comparison result;
and performing risk assessment on the enterprise based on the corresponding standard object model.
A block-chain-based tax information processing system, comprising: the system comprises a tax institution, a financial institution, a first proxy node and a second proxy node; wherein:
the tax institution is used for generating tax information after the enterprise receives the tax, encrypting the tax information and storing the encrypted tax information to an off-link distributed database;
the tax institution is also used for generating blocks by the hash value of the tax information, the signed tax information, the storage position of the distributed database and the access authority and uploading the blocks to a block chain;
the financial institution is used for sending a tax data acquisition request to the tax institution, wherein the request comprises a public key of the financial institution;
the tax institution is also used for judging whether the financial institution is legal and has information reading authority, if so, calculating the identity information and the public key of the financial institution based on the private key of the tax institution to generate an agent key, and copying the agent key to generate a first agent key and a second agent key;
the tax authority is further configured to send the first proxy key, the storage address of the encrypted tax information, and the first priority information to a first proxy node, and send the second proxy key, the storage address of the encrypted tax information, and the second priority information to a second proxy node;
the first proxy node is used for reading the encrypted tax information in the distributed database, and re-encrypting the encrypted tax information by using the first proxy key to obtain first re-encrypted tax information;
the second proxy node is used for reading the encrypted tax information in the distributed database, and re-encrypting the encrypted tax information by using the second proxy key to obtain second re-encrypted tax information;
the financial institution is further used for receiving the first re-encrypted tax information and/or the second re-encrypted tax information, and decrypting the first re-encrypted tax information and/or the second re-encrypted tax information based on a private key of the financial institution to obtain the tax information of the enterprise.
Preferably, the tax authority is further configured to generate a private key of the tax authority; the financial institution is further configured to generate a private key of the financial institution.
Preferably, the financial institution is specifically configured to:
receiving the first re-encrypted tax information, or the first re-encrypted tax information and the second re-encrypted tax information;
and decrypting the first re-encrypted tax information based on the private key of the financial institution to obtain the tax information of the enterprise.
Preferably, the financial institution is specifically configured to:
receiving the second re-encrypted tax information;
decrypting the second encrypted tax information based on the private key of the financial institution to obtain decrypted tax information;
encrypting the decrypted tax information by using a public key of the tax authority;
receiving the tax authority to decrypt the tax information encrypted by the public key of the tax authority, and comparing the decrypted tax information with the tax information of the enterprise after tax payment to obtain a comparison result;
and when the decrypted tax information is consistent with the tax information of the enterprise after tax payment, the tax information of the enterprise is saved.
Preferably, the financial institution is further configured to:
based on the acquired tax information of the enterprise, comparing the enterprise with a plurality of standard objects;
determining a standard object model corresponding to the enterprise based on the comparison result;
and performing risk assessment on the enterprise based on the corresponding standard object model.
In summary, the invention discloses a tax information processing method based on a block chain, a tax organization generates tax information after an enterprise receives tax, encrypts the tax information, and stores the encrypted tax information to an off-chain distributed database; the tax agency generates a block by the hash value of the tax information, the signed tax information, the storage position of the distributed database and the access authority, and uploads the block to a block chain; the financial institution sends a tax data acquisition request to the tax institution, wherein the request comprises a public key of the financial institution; the tax institution judges whether the financial institution is legal and has information reading authority, if so, the identity information and the public key of the financial institution are calculated based on the private key of the tax institution to generate a proxy key, and the proxy key is copied to generate a first proxy key and a second proxy key; the tax agency sends the first proxy key, the storage address of the encrypted tax information and the first priority information to the first proxy node, and sends the second proxy key, the storage address of the encrypted tax information and the second priority information to the second proxy node; the first proxy node reads the encrypted tax information in the distributed database, and re-encrypts the encrypted tax information by using a first proxy key to obtain first re-encrypted tax information; the second proxy node reads the encrypted tax information in the distributed database, and re-encrypts the encrypted tax information by using the second proxy key to obtain second re-encrypted tax information; the financial institution receives the first re-encrypted tax information and/or the second re-encrypted tax information, decrypts the first re-encrypted tax information and/or the second re-encrypted tax information based on a private key of the financial institution, and acquires the tax information of the enterprise. When the tax information is processed, the sharing convenience of the tax information can be effectively improved and the safety of the tax information can be protected based on the block chain.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As shown in fig. 2, which is a flowchart of a method in embodiment 1 of a block chain-based tax information processing method disclosed in the present invention, the method may include the following steps:
s201, generating tax information after an enterprise receives tax by a tax institution, encrypting the tax information, and storing the encrypted tax information to an off-link distributed database;
and after the enterprise E taxes, the tax institution T generates tax information of the enterprise E. The tax authority T encrypts the tax information D, and stores the encrypted tax information M1 in the out-of-link distributed database.
S202, the tax authority generates blocks by the hash value of the tax information, the signed tax information, the storage position of the distributed database and the access authority, and uploads the blocks to a block chain;
and the tax institution T generates the signed tax information D and the hash value thereof, the storage position of the distributed database and the access authority into a block and uploads the block to a block chain.
S203, the financial institution sends a tax data acquisition request to the tax institution, wherein the request comprises a public key of the financial institution;
when a user, for example, financial institution 1, wants to obtain tax data for an enterprise, it first sends a request (including the public key of the financial institution 1) to tax institution T.
S204, the tax institution judges whether the financial institution is legal and has information reading authority, if so, the identity information and the public key of the financial institution are calculated based on the private key of the tax institution to generate an agent key, and the agent key is copied to generate a first agent key and a second agent key;
after verification, if the financial institution 1 is judged to be legal and has the information reading authority, the tax institution T calculates the identity information (for example, bank ID) of the financial institution 1 and the public key of the financial institution 1 by using its own private key to generate a proxy key, and copies the proxy key to generate a first proxy key and a second proxy key.
S205, the tax authority sends the first proxy key, the storage address of the encrypted tax information and the first priority information to the first proxy node, and sends the second proxy key, the storage address of the encrypted tax information and the second priority information to the second proxy node;
then, the tax authority T sends the first proxy key, the storage address of the encrypted tax information, and the first priority information to the first proxy node, and sends the second proxy key, the storage address of the encrypted tax information, and the second priority information to the second proxy node.
It should be noted that one of the two agent nodes may be, for example, an administrator node, and the other agent node may be, for example, a miner node voted for selection by a consensus algorithm, such as the DPOS algorithm. The administrative nodes typically have a higher degree of confidence than the miner nodes produced by the consensus algorithm.
The first priority and the second priority are used for determining the priority order of the first re-encrypted tax information and the second re-encrypted tax information used by the subsequent financial institution, for example, the first priority is represented as "1" indicating the order of priority use, and the second priority is represented as "0" indicating the order of no priority use.
S206, the first proxy node reads the encrypted tax information in the distributed database, and re-encrypts the encrypted tax information by using the first proxy key to obtain first re-encrypted tax information;
the first proxy node reads the encrypted tax information M1 in the distributed database, re-encrypts the encrypted tax information M1 by using the first proxy key to obtain first re-encrypted tax information M21, and marks the first re-encrypted tax information M21 by using the first priority information.
S207, the second proxy node reads the encrypted tax information in the distributed database, and re-encrypts the encrypted tax information by using a second proxy key to obtain second re-encrypted tax information;
the second proxy node reads the encrypted tax information M1 in the distributed database, re-encrypts the encrypted tax information M1 using the second proxy key to obtain second re-encrypted tax information M22, and marks the second re-encrypted tax information M22 using the second priority information.
For example, the re-encrypted tax information may be marked by adding a data header to the re-encrypted tax information and using the priority information as the data header, and the data structure of the re-encrypted tax information is shown in fig. 6. Wherein, in the data structure, the priority part is non-encrypted information and is available for a user to read.
S208, the financial institution receives the first re-encrypted tax information and/or the second re-encrypted tax information, decrypts the first re-encrypted tax information and/or the second re-encrypted tax information based on a private key of the financial institution, and obtains the tax information of the enterprise.
Then, the financial institution 1 receives the re-encrypted tax information, decrypts the re-encrypted tax information by using its own private key, and obtains the clear text of the tax information D.
Specifically, if the financial institution 1 can obtain the first re-encrypted tax information M21 and the second re-encrypted tax information M22 at the same time, it is determined whether to use the first re-encrypted tax information M21 or the second re-encrypted tax information M22 according to the priority, and then, it is decrypted using its own private key.
If the re-encrypted tax information with high priority of use is obtained, the decryption is performed by using the own private key.
If the re-encrypted tax information with low use priority is obtained, decrypting by using a private key of the tax authority to obtain tax information D, encrypting the tax data by using a public key of the tax authority, after receiving the encrypted data and decrypting by the tax authority, comparing with the original data information, and returning a comparison result to the financial authority, wherein the financial authority stores the tax information according to the returned result if the two are consistent, otherwise, abandons the tax information.
In summary, in the above embodiments, when sharing the tax information, the sharing convenience of the tax information can be effectively improved and the security of the tax information can be protected based on the block chain. In addition, in the tax information sharing process, the use priority of the re-encrypted data is set, the re-encrypted data can be decrypted and used by a credible financial management organization, and the re-encrypted data can be used by a semi-credible consensus node after being verified by a data provider, so that the security of the shared data is improved.
As shown in fig. 3, which is a flowchart of a method in embodiment 2 of the method for processing tax information based on a block chain disclosed on the basis of the foregoing embodiment of the present invention, the method may include the following steps:
s301, generating a private key of the tax institution and a private key of the financial institution;
when sharing and risk assessment of tax information are needed, the tax institution and the financial institution may generate their own private keys in advance. Specifically, when the tax institution and the financial institution generate the private key, the polynomial function can be selected to generate the secret value, and the private key of the tax institution and the financial institution can be generated according to the secret values of other institutions, that is, the private keys of the tax institution and the financial institution can be determined through a negotiation algorithm.
S302, generating tax information after the enterprise receives the tax by a tax institution, encrypting the tax information, and storing the encrypted tax information to an off-link distributed database;
and after the enterprise E taxes, the tax institution T generates tax information of the enterprise E. The tax authority T encrypts the tax information D, and stores the encrypted tax information M1 in the out-of-link distributed database.
S303, the tax authority generates a block by the hash value of the tax information, the signed tax information, the storage position of the distributed database and the access authority, and uploads the block to a block chain;
and the tax institution T generates the signed tax information D and the hash value thereof, the storage position of the distributed database and the access authority into a block and uploads the block to a block chain.
S304, the financial institution sends a tax data acquisition request to the tax institution, wherein the request comprises a public key of the financial institution;
when a user, for example, financial institution 1, wants to obtain tax data for an enterprise, it first sends a request (including the public key of the financial institution 1) to tax institution T.
S305, the tax institution judges whether the financial institution is legal and has information reading authority, if so, the identity information and the public key of the financial institution are calculated based on the private key of the tax institution to generate an agent key, and the agent key is copied to generate a first agent key and a second agent key;
after verification, if the financial institution 1 is judged to be legal and has the information reading authority, the tax institution T calculates the identity information (for example, bank ID) of the financial institution 1 and the public key of the financial institution 1 by using its own private key to generate a proxy key, and copies the proxy key to generate a first proxy key and a second proxy key.
S306, the tax agency sends the first agency key, the storage address of the encrypted tax information and the first priority information to the first agency node, and sends the second agency key, the storage address of the encrypted tax information and the second priority information to the second agency node;
then, the tax authority T sends the first proxy key, the storage address of the encrypted tax information, and the first priority information to the first proxy node, and sends the second proxy key, the storage address of the encrypted tax information, and the second priority information to the second proxy node.
It should be noted that one of the two agent nodes may be, for example, an administrator node, and the other agent node may be, for example, a miner node voted for selection by a consensus algorithm, such as the DPOS algorithm. The administrative nodes typically have a higher degree of confidence than the miner nodes produced by the consensus algorithm.
The first priority and the second priority are used for determining the priority order of the first re-encrypted tax information and the second re-encrypted tax information used by the subsequent financial institution, for example, the first priority is represented as "1" indicating the order of priority use, and the second priority is represented as "0" indicating the order of no priority use.
S307, the first proxy node reads the encrypted tax information in the distributed database, and re-encrypts the encrypted tax information by using the first proxy key to obtain first re-encrypted tax information;
the first proxy node reads the encrypted tax information M1 in the distributed database, re-encrypts the encrypted tax information M1 by using the first proxy key to obtain first re-encrypted tax information M21, and marks the first re-encrypted tax information M21 by using the first priority information.
S308, the second proxy node reads the encrypted tax information in the distributed database, and re-encrypts the encrypted tax information by using a second proxy key to obtain second re-encrypted tax information;
the second proxy node reads the encrypted tax information M1 in the distributed database, re-encrypts the encrypted tax information M1 using the second proxy key to obtain second re-encrypted tax information M22, and marks the second re-encrypted tax information M22 using the second priority information.
For example, the re-encrypted tax information may be marked by adding a data header to the re-encrypted tax information and using the priority information as the data header, and the data structure of the re-encrypted tax information is shown in fig. 6. Wherein, in the data structure, the priority part is non-encrypted information and is available for a user to read.
S309, the financial institution receives the first re-encrypted tax information and/or the second re-encrypted tax information, decrypts the first re-encrypted tax information and/or the second re-encrypted tax information based on a private key of the financial institution, and obtains the tax information of the enterprise.
Then, the financial institution 1 receives the re-encrypted tax information, decrypts the re-encrypted tax information by using its own private key, and obtains the clear text of the tax information D.
Specifically, if the financial institution 1 can obtain the first re-encrypted tax information M21 and the second re-encrypted tax information M22 at the same time, it is determined whether to use the first re-encrypted tax information M21 or the second re-encrypted tax information M22 according to the priority, and then, it is decrypted using its own private key.
If the re-encrypted tax information with high priority of use is obtained, the decryption is performed by using the own private key.
If the re-encrypted tax information with low use priority is obtained, decrypting by using a private key of the tax authority to obtain tax information D, encrypting the tax data by using a public key of the tax authority, after receiving the encrypted data and decrypting by the tax authority, comparing with the original data information, and returning a comparison result to the financial authority, wherein the financial authority stores the tax information according to the returned result if the two are consistent, otherwise, abandons the tax information.
S310, comparing the enterprise with a plurality of standard objects based on the acquired tax information of the enterprise;
after the financial institution acquires the tax information of the enterprise, the financial risk of the enterprise can be evaluated according to the acquired tax information.
Specifically, firstly, based on the acquired tax information of an enterprise, the enterprise is compared with a plurality of standard objects; the standard corresponds to a virtual enterprise model constructed based on tax information, the model having different risk indices.
S311, determining a standard object model corresponding to the enterprise based on the comparison result;
and then, determining a standard object model corresponding to the enterprise according to the obtained comparison result.
And S312, carrying out risk assessment on the enterprise based on the corresponding standard object model.
And finally, performing risk assessment on the enterprise according to the determined corresponding standard object model to obtain a risk assessment result.
In summary, in the present embodiment, based on the above embodiments, the risk assessment of the tax information can be further implemented based on the block chain.
As shown in fig. 4, which is a schematic structural diagram of an embodiment 1 of a block chain-based tax information processing system according to the present disclosure, the system may include a tax authority 41, a financial authority 42, a first proxy node 43, and a second proxy node 44; wherein:
the tax institution 41 is used for generating tax information after the enterprise receives the tax, encrypting the tax information and storing the encrypted tax information to an off-link distributed database;
the tax authority 41 is further configured to generate a block from the hash value of the tax information, the signed tax information, the storage location of the distributed database, and the access right, and upload the block to the block chain;
the financial institution 42 is used for sending a tax data acquisition request to the tax institution 41, wherein the request comprises a public key of the financial institution;
the tax authority 41 is further configured to determine whether the financial institution 42 is legal and has an information reading authority, and if so, calculate the identity information and the public key of the financial institution based on a private key of the tax authority to generate a proxy key, and copy the proxy key to generate a first proxy key and a second proxy key;
the tax authority 41 is further configured to send the first proxy key, the storage address of the encrypted tax information, and the first priority information to the first proxy node 43, and send the second proxy key, the storage address of the encrypted tax information, and the second priority information to the second proxy node 44;
the first proxy node 43 is configured to read the encrypted tax information in the distributed database, and re-encrypt the encrypted tax information using the first proxy key to obtain first re-encrypted tax information;
the second proxy node 44 is configured to read the encrypted tax information in the distributed database, and re-encrypt the encrypted tax information using the second proxy key to obtain second re-encrypted tax information;
the financial institution 42 is further configured to receive the first re-encrypted tax information and/or the second re-encrypted tax information, and decrypt the first re-encrypted tax information and/or the second re-encrypted tax information based on a private key of the financial institution to obtain the tax information of the enterprise.
The working principle of the block chain based tax information processing system disclosed in this embodiment is the same as that of the block chain based tax information processing method in embodiment 1, and details are not repeated here.
As shown in fig. 5, which is a schematic structural diagram of an embodiment 2 of a block chain based tax information processing system disclosed on the basis of the above embodiment of the present invention, the system may include a tax authority 51, a financial authority 52, a first proxy node 53 and a second proxy node 54; wherein:
a tax authority 51 for generating a private key of the tax authority;
a financial institution 52 for generating a private key of the financial institution;
the tax institution 51 is used for generating tax information after the enterprise receives the tax, encrypting the tax information and storing the encrypted tax information to an off-link distributed database;
the tax authority 51 is further configured to generate a block from the hash value of the tax information, the signed tax information, the storage location of the distributed database, and the access right, and upload the block to the block chain;
the financial institution 52 is used for sending a tax data acquisition request to the tax institution 51, wherein the request comprises a public key of the financial institution;
the tax authority 51 is further configured to determine whether the financial institution 52 is legal and has an information reading authority, and if so, calculate the identity information and the public key of the financial institution based on a private key of the tax authority to generate a proxy key, and copy the proxy key to generate a first proxy key and a second proxy key;
the tax authority 51 is further configured to send the first proxy key, the storage address of the encrypted tax information, and the first priority information to the first proxy node 53, and send the second proxy key, the storage address of the encrypted tax information, and the second priority information to the second proxy node 54;
the first proxy node 53 is configured to read the encrypted tax information in the distributed database, and re-encrypt the encrypted tax information using the first proxy key to obtain first re-encrypted tax information;
the second proxy node 54 is configured to read the encrypted tax information in the distributed database, and re-encrypt the encrypted tax information using the second proxy key to obtain second re-encrypted tax information;
the financial institution 52 is further configured to receive the first re-encrypted tax information and/or the second re-encrypted tax information, and decrypt the first re-encrypted tax information and/or the second re-encrypted tax information based on a private key of the financial institution to obtain tax information of the enterprise;
the financial institution 52 is further configured to compare the enterprise with a plurality of standard objects based on the acquired tax information of the enterprise; determining a standard object model corresponding to the enterprise based on the comparison result; and performing risk assessment on the enterprise based on the corresponding standard object model.
The working principle of the block chain based tax information processing system disclosed in this embodiment is the same as that of the block chain based tax information processing method in embodiment 2, and details are not repeated here.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.