Disclosure of Invention
The invention aims to provide a block chain-based creditor and debt registering and offsetting method to improve the transaction security of creditor and debt information and funds.
In order to achieve the above object, the present invention adopts a block chain-based creditor and debt registration and cancellation method, which includes:
acquiring the creditor/debt registration information of a user, wherein the creditor/debt information comprises unique identification of the creditor/debt, a creditor/debtor, a creditor amount, a cancellation amount and creditor/debt information registration confirmation time;
acquiring the creditor/debt registration information of the user and carrying out digital signature;
processing the creditor/debt registration information of the user by utilizing a hash algorithm, and calculating a creditor basis hash value;
and writing the creditor/debt registration information and the creditor of the user into a block chain according to the hash value.
Preferably, the method further comprises the following steps:
searching the creditor/debt registration information of the user by using a closed-loop algorithm to obtain all debt cancellation closed-loop chains;
the method comprises the steps of sending cancellation information to a user on a debt cancellation closed-loop chain, and waiting for cancellation confirmation information sent by the user on the chain;
after cancellation confirmation information sent by a user on a chain is obtained, closed-loop cancellation is carried out;
and carrying out data storage of the block chain on each piece of closed loop cancellation data information.
Preferably, before the acquiring the creditor/debt registration information of the user, the method further includes:
and acquiring a CA registration certificate of the user, wherein the CA registration certificate is generated by associating real-name authentication information of the user, and the user comprises a creditor and a debtor.
Preferably, the method further comprises the following steps:
and sending the creditor/debt registration information of the user and the corresponding debt cancellation closed-loop chain to a client for displaying for the user to confirm.
Preferably, before the processing the creditor/debt registration information of the user by using the hash algorithm and calculating the creditor-dependent hash value, the method further includes:
and carrying out validity check on the digital signature data of the creditor/debt registration information.
On the other hand, the system for registering and canceling the creditor and debtor based on the block chain comprises a client, a server and a block chain end, wherein the client comprises a registering module, an endorsement node of the block chain end is provided with a digital signature module and a hash value calculating module, and a bookkeeping node of the block chain end is provided with a data storage module;
the registration module is used for acquiring the creditor/debt registration information of the user, wherein the creditor/debt information comprises unique identification of the creditor/debt, creditor/debtor, creditor amount, offset amount and creditor/debt information registration confirmation time;
the server side is used for acquiring the creditor/debt registration information of the user in the registration module, carrying out validity check on the creditor/debt registration information of the user, and sending the creditor/debt registration information of the user to the block link end after the check is passed;
the digital signature module is used for digitally signing the creditor/debt registration information of the user;
the hash value calculation module is used for processing the creditor/debt registration information of the user by utilizing a hash algorithm and calculating a creditor basis hash value;
and the data storage module is used for writing the creditor/debt registration information and the creditor of the user into the block chain according to the hash value.
Preferably, the accounting node of the block link end is further provided with a creditor/debt cancellation module;
the creditability/debt cancellation module searches the creditability/debt registration information of the user by using a closed-loop algorithm to obtain all debt cancellation closed-loop chains;
and the cancellation information is sent to the user on the debt cancellation closed-loop chain, the cancellation confirmation information sent by the user on the chain is waited, and the closed-loop cancellation is carried out after the user confirmation is obtained;
and carrying out data storage of the block chain on each piece of closed loop cancellation data information.
Preferably, the client further comprises a registration module for acquiring real-name authentication information of a user, and generating a CA registration certificate according to the real-name authentication information association of the client, wherein the user comprises a creditor and a debtor.
Preferably, the registration module comprises a registration unit and a confirmation unit;
the registration unit is used for acquiring the creditor/debt registration information of the user;
the confirming unit is used for displaying the creditor/debt registration information of the user and the corresponding debt cancellation closed-loop chain for the user to confirm, and acquiring the creditor/debt information registration confirming time.
Preferably, the accounting node of the block link end is also provided with a data signature verification module;
and the data signature verification module is used for performing signature verification on data sent by the client or the block chain end endorsement node.
Compared with the prior art, the invention has the following technical effects: the invention calculates the credit right basis hash value of the user by utilizing the hash algorithm and writes the credit right basis hash value into the block chain by adopting the block link technology, thereby ensuring that the credit right basis information can not be tampered and ensuring the security of the credit right in the credit information and funds. And by adopting a closed-loop algorithm, the creditor and debt information registered by each user is searched and matched to obtain a creditor and debt closed loop capable of being cancelled, and cancellation data is generated after cancellation and written into a block chain, so that the problem of triangular debt is solved, and the transaction records cannot be tampered.
Detailed Description
To further illustrate the features of the present invention, refer to the following detailed description of the invention and the accompanying drawings. The drawings are for reference and illustration purposes only and are not intended to limit the scope of the present disclosure.
As shown in fig. 1 to 2, the present embodiment discloses a method for creditor and debt registration and cancellation based on blockchain, which includes the following steps S1 to S4:
s1, acquiring the creditor/debt registration information of the user, wherein the creditor/debt information comprises the unique identifier of the creditor/debt, the creditor/debtor, the creditor amount, the offset amount and the creditor/debt information registration confirmation time;
s2, acquiring the creditor/debt registration information of the user and carrying out digital signature;
it should be noted that, the digital signature is performed by using a private key signature public key signature verification method to ensure the integrity of the data and no tampering.
S3, processing the creditor/debt registration information of the user by utilizing a hash algorithm, and calculating a creditor basis hash value;
and S4, writing the creditor/debt registration information and the creditor of the user into a block chain according to the hash value.
It should be noted that, in the embodiment, the user creditability basis hash value is calculated by using a hash algorithm, and is written into the block chain by using a block link technology, so that it is ensured that the creditability basis information cannot be tampered, and the security of the creditability in the creditability information and the fund is ensured.
Preferably, the embodiment further includes step S5, finding out the closed-loop chain of debt cancellation by using the closed-loop algorithm, and writing the transaction details into the block chain through the smart contract after the cancellation confirmation. The specific process comprises the following steps:
searching the creditor/debt registration information of the user by using a closed-loop algorithm to obtain all debt cancellation closed-loop chains;
the method comprises the steps of sending cancellation information to a user on a debt cancellation closed-loop chain, and waiting for cancellation confirmation information sent by the user on the chain;
after cancellation confirmation information sent by a user on a chain is obtained, closed-loop cancellation is carried out;
one-stroke closed-loop cancellation is one-stroke transaction flow, and data storage of the block chain is carried out through the intelligent contract.
It should be noted that in this embodiment, all closed-loop data of the debt registration are found through a closed-loop algorithm, for example, if the user a owes the user B for 100 yuan, the user B owes the user B for C for 50 yuan, and the user C owes the user a for 20 yuan, the debt cancellation related to the three debt registration data is performed, and the three users, the user a, the user B, and the user C, respectively perform cancellation confirmation.
After the three parties of the user A, the user B and the user C agree, a debt cancellation request is initiated, and an intelligent contract is triggered to carry out closed-loop cancellation. If the user A account: C-A20, A-B100; user B accounts A-B100, B-C50; user C account B-C50, C-A20; transaction flow: c-a 20-20=0, a-B100-20 = 80, B-C50-20 = 30. A transaction pipeline is a closed loop cancellation.
The design of the creditor and debt registration and cancellation system summarized in the embodiment is based on the reality of the large amount of creditors and debts, and by means of the convenience of internet registration, creditors and debts of creditors register and confirm the creditors and find out the optimal scheme for solving the creditors and the debts by using a block chain technology and a closed-loop algorithm. Compared with the traditional mode, the method has the advantages of convenient registration, high safety, wide debt solving range, cost saving, reduction of social contradiction and the like.
Preferably, before the acquiring the creditor/debt registration information of the user, the method further includes:
and acquiring a CA registration certificate of the user, wherein the CA registration certificate is generated by associating real-name authentication information of the user, and the user comprises a creditor and a debtor.
In this embodiment, the creditor and the debtor need to perform real-name registration in advance, submit corresponding real-name authentication materials according to the registration type of the client, and then issue a CA registration certificate by using a CA server according to the real-name authentication information submitted by the user, and associate the CA registration certificate with the account of the user. Note that, in the present embodiment, only the record of the debt and the right of the debt with the authenticated person or institution as the debt or the creditor can be registered.
Preferably, the method for registering and canceling creditor and debt based on block chains in this embodiment further includes the following steps:
and sending the creditor/debt registration information of the user and the corresponding debt cancellation closed-loop chain to a client for displaying for the user to confirm.
In this embodiment, the credit and debt records of other users related to the user are displayed for the user to browse, and the detected cancelable closed-loop credit and debt relationship is provided to the current user to perform the operation of confirming the cancellation of the credit and debt.
Preferably, the credit/debt registration information of the user is processed by using a hash algorithm, and before calculating the credit according to the hash value, the credit/debt registration and cancellation method based on the blockchain further includes:
and carrying out validity check on the digital signature data of the creditor/debt registration information.
Specifically, the server side carries out digital signature on the creditor/debt registration information, signature data are sent to the block chain end, the block chain end receives a signing transaction request initiated by the server side, and validity check is carried out on the creditor/debt registration information. And processing the creditor/debt registration information of the user by utilizing a hash algorithm after the verification is finished, and calculating a creditor basis hash value.
It should be noted that, by using the digital signature for verification, the authenticity and security of the digital signature can be verified, and the security of the transaction is ensured.
The creditor and debt registration and cancellation method based on the blockchain can effectively solve various individual and enterprise triangular debts, help enterprises to realize sleeve opening, effectively reduce operating risks and promote development of the enterprises and individuals.
As shown in fig. 3, the embodiment discloses a creditor and debt registration and cancellation system based on a block chain, which includes a client, a server and a block chain end, where the client includes a registration module, an endorsement node of the block chain end is provided with a digital signature module and a hash value calculation module, and an accounting node of the block chain end is provided with a data storage module;
the registration module is used for acquiring the creditor/debt registration information of the user, wherein the creditor/debt information comprises unique identification of the creditor/debt, creditor/debtor, creditor amount, offset amount and creditor/debt information registration confirmation time;
the server side is used for acquiring the creditor/debt registration information of the user in the registration module and carrying out validity check on the creditor/debt registration information of the user;
the digital signature module is used for carrying out digital signature on the creditor/debt registration information of the user and sending a recording request to the accounting node according to the corresponding relation between the user and the signature public and private keys;
the hash value calculation module is used for processing the creditor/debt registration information of the user by utilizing a hash algorithm and calculating a creditor basis hash value;
and the data storage module is used for writing the creditor/debt registration information and the creditor of the user into the block chain according to the hash value.
It should be noted that, the client in this embodiment is further provided with a registration module, and the registration module is configured to accept a registration request of a client, log in a CA server to obtain a signature certificate, complete initial account registration, and submit a relevant real-name authentication material according to a registered client type.
The registration module of the client may accept a creditor and debt registration request of the user, the registered creditor and debt need to be associated with a real-name authenticated individual or institution, i.e. the authenticated individual or institution is a creditor or a creditor's creditor record.
Further, the registration module comprises a registration unit and a confirmation unit;
the registration unit is used for acquiring the creditor/debt registration information of the user;
the confirming unit is used for displaying the creditor/debt registration information of the user and the corresponding debt cancellation closed-loop chain for the user to confirm, and acquiring the creditor/debt information registration confirming time.
Preferably, the accounting node at the end of the block link is also provided with a creditor/debt cancellation module;
the creditability/debt cancellation module searches the creditability/debt registration information of the user by using a closed-loop algorithm to obtain all debt cancellation closed-loop chains;
and the cancellation information is sent to the user on the debt cancellation closed-loop chain, the cancellation confirmation information sent by the user on the chain is waited, and the closed-loop cancellation is carried out after the user confirmation is obtained;
one-stroke closed-loop cancellation is one-stroke transaction flow, and data storage of the block chain is carried out through the intelligent contract. Preferably, the accounting node of the block link end is also provided with a data signature verification module;
and the data signature verification module is used for performing signature verification on data sent by the client or the block chain end endorsement node.
It should be noted that, in the invention, after the creditor/debtor relationship confirmed by the user is monitored and the accounting entry is completed by the accounting node at the end of the block, the creditor/debtor relationship that has been recorded in the block chain where the creditor/debtor of the creditor/debtor is located is detected, whether a cancelable closed loop relationship exists is searched for step by step, if a cancelable closed loop exists, the cancelable creditor/debtor relationship chain is recorded, and whether the cancellation is confirmed by each related individual or institution client on the creditor/debtor chain is notified; and monitoring the cancelable closed loop of the creditor and debtor, performing cancellation operation on the closed loop which is confirmed to be cancelled by all the related clients, generating cancellation data, and initiating an accounting request to the accounting node. By adopting the block chain technology and the closed-loop algorithm, the invention can ensure the safety of the credit and debtor settlement information and funds, can effectively solve various triangular debts and effectively reduce the operation risk.
Moreover, as the encryption authentication technology and the decentralized consensus mechanism are adopted in the blockchain technology to ensure the safety of information and fund, the intermediary link of a third party is omitted, point-to-point butt joint is realized, the cost is reduced, and the high efficiency of transaction can be ensured.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.