Disclosure of Invention
The invention aims to provide a block chain-based sharing economic account-dividing and checking method, which can ensure transparency and credibility of transaction data and reduce financial risk and management cost.
The technical scheme adopted by the invention is as follows:
the shared economic account-dividing and checking method based on the blockchain is characterized by comprising the following steps of:
Step 1, constructing a alliance chain on a blockchain platform and setting a central account, wherein the alliance chain respectively builds nodes by a plurality of preset subjects to form account relations between the central account and the plurality of preset subjects, setting corresponding alliance chain rules based on the account relations, and introducing a consensus mechanism on the basis of the alliance chain, wherein the consensus mechanism adopts a PoS+ PBFT algorithm and is used for maintaining the data consistency of all nodes of the blockchain;
step 2, defining business logic and rules between the central account and a plurality of preset subjects, and signing contracts in a blockchain platform in the form of intelligent contracts;
Step 3, the preset main body uploads the acquired data to the blockchain platform through an intelligent chip through a data acquisition module of the preset main body to acquire a consumption order on the blockchain platform;
Step 4, the blockchain platform divides the amount of the consumption order into corresponding bank accounts of the preset main body under the blockchain platform, generates transaction receipt on the chain of the blockchain platform, and generates account balance of corresponding quantity;
Step 5, submitting corresponding rendering orders on the chain by the preset main body according to account balances, conducting transaction rendering by a plurality of preset main bodies according to a blockchain platform, and completing bank transfer in response to the central account under the blockchain, wherein the blockchain platform realizes verification of two rendering records on the blockchain platform and under the blockchain platform based on a zero knowledge proof algorithm;
Step 6, after the verification in the step 5 is successful, destroying the balance of the account, and finally completing intelligent account separation and account checking;
And 7, if the preset main body is changed, returning to the step 2 again, redefining service logic and rules, and re-signing a new contract in the form of an intelligent contract in the blockchain platform.
Preferably, in the step1, the plurality of preset subjects include a shared device producer, a shared device consumer, a site provider, a platform operator and a financial institution;
The servers of the shared equipment producer, the shared equipment consumer and the site provider are respectively used as core nodes on the blockchain to form a core node set of shared economy;
The consensus mechanism adopts a strategy of combining a pos+ PBFT algorithm, particularly a dynamic random weighted PoS algorithm, with a Bayesian fault tolerance PBFT algorithm.
Preferably, in the step 1, in the process that the consensus mechanism adapts to the variation of the preset main body and the variation of the network topology by using a pos+ PBFT algorithm, the blockchain platform screens part of the preset main body as a candidate verifier according to account balance, time, liveness and reputation value held by the preset main body as a node;
the dynamic random weighting pos algorithm comprises the following specific steps:
the candidate verifiers are differentiated into groups, nodes with different account balance holding amounts in each group are randomly weighted, weighted scores of each node are ordered, cumulative probability is distributed to each node, and final verifiers are determined by generating random numbers, wherein a dynamic random weighting formula meets the following relation:
;
in the formula, Representing the weighted score of the node(s),The weight coefficients of each factor are represented separately,Representing the account balance held by the node,Indicating the time of the node's hold,Indicating the liveness of the node,Representing a reputation score of a node;
Presetting a fixed period, re-acquiring a verifier after each period is finished, and setting a cooling period for nodes of the verifier.
Preferably, the Bayesian fault tolerance PBFT algorithm comprises three stages, namely, a preparation stage, a submitting stage and a submitting stage, wherein the Bayesian fault tolerance comprises three stages, the preparation stage comprises the steps that a master node creates a transaction proposal according to a received transaction request and broadcasts the transaction proposal to all verifier nodes, the preparation stage comprises the steps that all verifier nodes verify the transaction in the proposal after receiving the proposal of the master node, respond to the verification, the alternative nodes sign the proposal and broadcast the proposal to other nodes, and the submitting stage comprises the steps of when the alternative nodes receive enough signature acknowledgements of other nodes, namely, the proposal is agreed, writing the transaction records into respective local account books by all nodes, broadcasting acknowledgement messages and ending the round of consensus;
In each round of consensus, one node of a plurality of verifiers is selected in turn as a master node according to a preset sequence, and the main responsibility of the master node comprises collecting transactions in a network and packing the transactions into new blocks, broadcasting the new blocks to other verifiers for verification, serving as an initiator responsible for starting each stage, advancing and coordinating the consensus process, and triggering a standby node mechanism by a blockchain platform if the master node fails to complete the main responsibility in the consensus process, and selecting the new master node to continue the round of consensus.
Preferably, the intelligent contract in the step 2 comprises contract signing, account dividing proportion setting, order processing mechanism and contract updating mechanism;
The structure of the order data of the intelligent contract is stored in the form of a byte sequence, wherein the byte sequence is [ state, amount, account dividing proportion, date, equipment ID, first merchant, second merchant, third merchant, expansion and check bit ], and the length of the order data is 32 bytes.
Preferably, in the step 4, in the process of generating account balances of corresponding numbers on the blockchain, the account balances are specifically distributed according to a distribution proportion set in the intelligent contract, and transferred into accounts corresponding to the blockchain of the preset main body, and transaction receipt is generated;
The transaction receipt information comprises a transaction hash, a transaction state, a block hash and a block number, a contract address, a log, a transaction receipt information and a transaction receipt information, wherein the transaction hash is used as a unique identifier of a transaction;
The account balance is generated through multiparty signature confirmation, and an asymmetric encryption algorithm and a distributed account book technology are used in the transfer process, so that the preset main body can receive the account balance of the due share.
Preferably, in the step 5, the specific steps of implementing reconciliation and synchronization of two presentment records on and under the blockchain platform by the blockchain platform based on the zero knowledge proof algorithm are as follows:
step a, acquiring a present order generated on a chain, wherein the present order comprises an order amount, an acceptance account, an order ID and an on-chain transaction hash;
step b, completing the off-chain bank transfer by the central account, and generating transfer information, wherein the transfer information comprises transfer amount, a transfer receiving account, transfer ID and off-chain transfer hash;
And c, generating random challenges by the intelligent contracts on the chain, sending the random challenges to the central account, generating responses by the central account according to bank transfer data, carrying out response verification on the basis of a zero knowledge proof algorithm on the chain, and confirming that the order is completed on the chain after the verification is successful.
Preferably, the blockchain platform respectively acquires the transaction receipt between the central account and the preset main body according to a preset time period, and carries out audit, and in the process of carrying out transaction audit verification, a real-time transaction receipt verification monitoring system is specifically built, abnormal orders are acquired and processed, and the account balance is used for tracing, so that tracing and audit are completed.
Preferably, in the step 5, in the transaction presenting process of each preset main body according to the blockchain platform, a tcc transaction management unit is specifically constructed, and the tcc transaction management module includes a Try unit, a Confirm unit and a cancer unit;
Firstly, starting a Try unit, wherein a user applies for presenting, and four branch transactions are generated, namely checking bill consistency, determining the available state of a collection account, reserving balance on a destroying chain of an intelligent contract, and reserving a presented amount by a bank;
If all branch transactions of the Try unit are successfully executed, starting to execute a Confirm unit, wherein the Confirm unit destroys the balance on the chain and transfers money to the bank, and triggering contracts after the bank transfer action destroys the balance on the chain through the Event;
and if any branch transaction in the Try unit executes errors, triggering the cancer unit, rolling back all branch transactions, and reserving resources for release.
Preferably, in the step 6, the account balance is introduced into a multi-step verification mechanism when the balance on the chain is processed, presented and destroyed, and the account balance is not regenerated after being destroyed;
the verification mechanism comprises identity verification, transaction execution and log record;
the authentication is before any lift-off and on-chain balance destruction operations begin;
The transaction verification comprises balance verification and transaction examination, wherein the balance verification comprises the steps of obtaining the current balance of a preset main body on a blockchain and comparing the current balance with a request for providing the cash amount, the transaction examination comprises the step of examining and confirming the transaction according to a device provider, and the verification transaction parameters comprise a receiver bank account and a transfer cash amount.
The invention has the technical effects that:
According to the invention, a PoS+ PBFT consensus mechanism is realized for the transfer of accounts under the chain and the balance on the chain through the intelligent contract, a preset consensus protocol can be automatically executed, and the consensus result is recorded on the chain without manual intervention, so that the running efficiency and accuracy of the system are greatly improved, the possibility of human errors is reduced, and the high efficiency of the account dividing and checking process is ensured.
According to the invention, by introducing the TCC distributed transaction management scheme and the consensus mechanism, the system can improve the accounting efficiency, thereby accurately separating accounts, and can cope with the change of the participants and the change of the network topology structure, and the stability and the reliability of the system are maintained. This provides higher extensibility and adaptability for the shared economic platform, and can support a wider business scenario and more participants.
The invention stores the structure of the order data of the intelligent contract in the form of byte sequence, wherein the byte sequence is [ state, amount, account dividing proportion, date, equipment ID, first merchant, second merchant, third merchant, expansion and check bit ], the length of the order data is 32 bytes, the bit number occupied by each byte is [8 bits, 24 bits, 8 bits, 32 bits, 16 bits, 80 bits and 8 bits ], and the bit numbers occupied by each byte are multiples of 8 bits, so that the updated bill data is 240 bits in total and is smaller than the bit number of one storage tank, and the data is ensured to be effectively compressed in 32 bytes. Compactly compressing order information in a single storage tank simplifies the data reading and processing flow. Compared with the complex operation of multi-slot scattered storage, the system can complete the inquiry and processing of order data only by reading once. This improves query efficiency, reduces delays, and is particularly noticeable when large amounts of order data are read and processed frequently.
According to the invention, the blockchain platform realizes account checking and synchronization of two presentation records accounts on the blockchain platform and under the blockchain platform based on a zero knowledge proof algorithm. The block chain application scene is innovatively provided, all transaction data are recorded and stored on the decentralized distributed account book, the transaction data are non-tamper-proof, the integrity and the safety of the data are ensured, the tracing and auditing efficiency is improved, and the risks of data tampering and information leakage in a traditional system are eliminated.
Detailed Description
The present invention will be specifically described with reference to examples below in order to make the objects and advantages of the present invention more apparent. It should be understood that the following text is intended to describe only one or more specific embodiments of the invention and does not limit the scope of the invention strictly as claimed.
As shown in fig. 1, the blockchain-based shared economic ledger method includes the following steps:
Step 1, constructing a alliance chain on a blockchain platform, setting a central account, respectively building nodes by the alliance chain through a plurality of preset subjects to form account relations between the central account and the plurality of preset subjects, setting corresponding alliance chain rules based on the account relations, and introducing a consensus mechanism on the basis of the alliance chain, wherein the consensus mechanism adopts a PoS+ PBFT algorithm and is used for maintaining data consistency of all nodes of the blockchain;
in step 1 of the present embodiment, the plurality of preset principals include a shared device producer, a shared device consumer, a site provider, a platform operator, and a financial institution;
Servers of a shared equipment producer, a shared equipment consumer and a site provider are respectively used as core nodes on a blockchain to form a core node set of shared economy;
further illustratively, the central account includes, but is not limited to, adjusting account balances, deploying smart contracts, and permissions as device producer accounts.
The federation chain rules include, but are not limited to, rules for decision making mechanisms, membership, roles and responsibilities, joining and exiting processes, consensus mechanisms, intelligent contract management, dispute resolution mechanisms, security and privacy policies, incentive mechanisms, transparency and auditing, technical governance, business management, and risk management.
Further, the invention sets an administrator role in the blockchain platform, and the responsible content comprises the online of new equipment in the system, the management of account information of equipment providers and participants, and the signing and updating of equipment contracts.
Further, a federated chain is a form of blockchain that is commonly participated in management by multiple organizations or organizations, each organization or organization managing one or more nodes whose data only allows for reading, writing and sending by different organizations within the system. This blockchain consensus process is controlled by preselected nodes, and therefore is also referred to as a license chain (PermissionedBlockchain). The alliance chain is characterized by partial decentralization, strong controllability, no default disclosure of data and high transaction speed. The system requires the participating main body to authenticate through a safe identity verifier when the node is established, thereby determining the legitimacy of the node and the safety of the system, and introducing a consensus mechanism on the basis of a alliance chain to cope with the change of the participating side and the change of a network topological structure. The consensus mechanism adopts a strategy of combining PoS+ PBFT algorithm, particularly dynamic random weighted PoS with Bayesian fault tolerance PBFT, and in the invention, a practical Bayesian fault tolerance consensus algorithm (PBFT) is introduced for ensuring the stability and the safety of a blockchain network, PBFT is suitable for a smaller-scale alliance chain network, and can efficiently process the consensus process under the condition of certain trust among nodes.
In the step 1, in the process that the consensus mechanism adapts to the variation of a preset main body and the variation of a network topology structure by adopting a PoS+ PBFT algorithm, the blockchain platform screens part of the preset main body as a candidate verifier according to account balance, time, liveness and reputation value held by the preset main body as a node;
the dynamic random weighted PoS algorithm (DWR-PoS) comprises the following specific steps:
the candidate verifiers are differentiated into groups, nodes with different account balance holding amounts in each group are randomly weighted, weighted scores of each node are ordered, cumulative probability is distributed to each node, and final verifiers are determined by generating random numbers, wherein a dynamic random weighting formula meets the following relation:
;
in the formula, Representing the weighted score of the node(s),The weight coefficients of each factor are represented separately,Representing the account balance held by the node,Indicating the time of the node's hold,Indicating the liveness of the node,Representing a reputation score of a node;
Presetting a fixed period, re-acquiring a verifier after each period is finished, and setting a cooling period for nodes of the verifier.
Preferably, the Bayesian fault tolerance PBFT algorithm comprises three stages, namely, using the Bayesian fault tolerance, wherein a preparation stage comprises the steps of creating a transaction proposal by a master node according to a received transaction request and broadcasting the transaction proposal to all verifier nodes, the preparation stage comprises the steps of verifying the transaction in the proposal by all verifier nodes after receiving the proposal of the master node, signing the proposal by an alternative node and broadcasting the proposal to other nodes in response to the verification passing, and the submission stage comprises the steps of writing the transaction record into respective local account books by all nodes when the alternative node receives enough signature confirmation of the other nodes, namely, achieving consensus for the proposal, broadcasting a confirmation message and ending the round of consensus;
In each round of consensus, one node of a plurality of verifiers is selected in turn as a master node according to a preset sequence, and the main responsibility of the master node comprises collecting transactions in a network and packing the transactions into new blocks, broadcasting the new blocks to other verifiers for verification, serving as an initiator responsible for starting each stage, advancing and coordinating the consensus process, and triggering a standby node mechanism by a blockchain platform if the master node fails to complete the main responsibility in the consensus process, and selecting the new master node to continue the round of consensus.
In each round of formula, one node in the verifier pool is selected in turn as a master node according to a preset sequence, and the master node has the main roles of collecting transactions in a network, packaging the transactions into new blocks, broadcasting the new blocks to other verifiers for verification, and serving as an initiator responsible for starting each stage to advance and coordinate formula processes.
Further described, in response to the primary node failing to complete primary responsibility in the consensus process, the system triggers a standby node mechanism to select a new primary node to continue the round of consensus.
Further, the Bayesian fault tolerance formula algorithm has fault tolerance limitation including tolerance of preset number of malicious nodes, and ensuring that the system can normally operate if three times of preset number plus 1 verifier node are provided in the system.
Step 2, defining business logic and rules between the central account and a plurality of preset subjects, and signing contracts in a block chain platform in the form of intelligent contracts;
the intelligent contract in the step 2 comprises the steps of signing the contract, setting the account dividing proportion, an order processing mechanism and a contract updating mechanism so as to improve the flexibility and adaptability of the contract, responding to the contract change, determining that the benefits of all preset main bodies are not damaged, and providing a clear communication mechanism so as to ensure smooth transition;
The structure of the order data of the intelligent contract is stored in the form of a byte sequence, wherein the byte sequence is [ state, amount, account dividing proportion, date, equipment ID, first merchant, second merchant, third merchant, expansion and check bit ], and the length of the order data is 32 bytes.
The number of bits occupied by each byte is [8 bits, 24 bits, 8 bits, 32 bits, 16 bits, 80 bits, 8 bits ], and the number of bits occupied by each byte is multiple of 8 bits, so that the total number of bits of updated bill data is 240 bits, which is smaller than the number of bits of a storage tank, and the effective compression of the data in 32 bytes is ensured.
Referring to FIG. 2, specifically, the structure of order data for a received consumption order is shown.
It should be noted that the form of the consumption order in the blockchain system is defined asAnd inquiring according to the date.
Contract content includes, but is not limited to, billing proportion, contract validation date, order processing mechanism, contract update mechanism, and the like.
It can be appreciated that the preset body contracts with each device through an intelligent contract, and the intelligent contract has high flexibility and expandability and can be adjusted according to the needs of the participants. When the contract is changed, the contract version and the contract update date are automatically updated. The benefits of all the participants are not damaged, and a clear communication and transition mechanism is provided through intelligent contracts, so that the stable operation of the system is ensured.
Further, the efficiency of the revenue generated by the sharing equipment in the process of account separation and checking among the participating principals is improved, and the problems of mutual trust and safety in the process of account separation and checking are solved through the mode of two sets of accounts on line and off line. The decentralization, non-tampering and transparency of the blockchain ensure the safe storage and the credible reconciliation of the transaction data of the sharing device. The automatic execution of the intelligent contract improves the efficiency and accuracy of the accounting and settlement, and meanwhile, the efficient exception handling and traceability of the blockchain ensures the stability of the system and the fair benefits of the participants. The characteristics make this system be superior to traditional account checking mode in sharing economy obviously, have promoted holistic security, transparency and trust.
Step 3, the preset main body uploads the acquired data to the blockchain platform through the intelligent chip through the data acquisition module of the preset main body to acquire a consumption order on the blockchain platform;
Step 4, the blockchain platform divides the amount of the consumption order into corresponding bank accounts of a preset main body under the blockchain platform, generates transaction receipts on the chain of the blockchain platform, and generates account balances with corresponding quantity;
In the step 4, in the process of generating account balances of corresponding quantity on the blockchain, the specific account balances are subjected to account dividing according to the account dividing proportion set in the intelligent contract, transferred into accounts corresponding to the preset main body blockchain, and transaction receipt is generated;
The transaction receipt information comprises a transaction hash, a transaction state, a block hash and a block number, a contract address, a log and a transaction receipt information, wherein the transaction hash is used as a unique identifier of a transaction;
The account balance is generated through multiparty signature confirmation, and in the transfer process, an asymmetric encryption algorithm and a distributed account book technology are used to ensure transaction privacy and non-falsifiability so as to ensure that all the account balances which enable a preset main body to timely and accurately receive the corresponding shares.
Further, after account separation, the preset main body submits the account balance, the submitted orders are submitted on the chain, at the moment, two orders exist on the chain, one is a consumption order produced by equipment, the other is the submitted order of the preset main body, the submitted orders are checked based on zero knowledge proof, and in the checking process, if an abnormal order appears, the abnormal order is audited and traced by an under-chain auditor. And the specific tracing process is like distributed tcc transaction management in the step 7, which is beneficial to tracing abnormal orders.
In this embodiment, the distributed ledger technique applied is the basis of a blockchain for recording and managing all transaction data. Asymmetric encryption algorithm, wherein asymmetric encryption uses a pair of keys, a public key and a private key, to encrypt and decrypt data and a hash algorithm. Asymmetric encryption in account balance transfers, a user signs a transaction using a private key, which can be verified with a corresponding public key, thereby ensuring legitimacy and non-repudiation of the transaction. Since the public key is public, anyone can verify the signature, but only the person holding the private key can generate a valid signature, which ensures the privacy and security of the transaction. The hash algorithm is SHA-256, is irreversible, and can perform data integrity verification. During the transfer, a hash value of the transaction data is stored on the blockchain. All transaction data in a block is hashed to generate a hash value (Merkle root) and stored in the block header. If there is any tampering with the transaction data, the hash value will change, so that tampering is easily detected.
Further, the distributed ledger technique is commonly maintained by a plurality of nodes, each node in the blockchain network maintaining a complete ledger copy. Each block in the blockchain contains the hash value of the previous block, which forms an indivisible chain. Any block of data falsification can cause chain breakage and cannot pass consensus verification. By the distributed ledger technique, transaction data is distributed across multiple nodes, ensuring transparency and non-tamper resistance of the transaction records, while ensuring data consistency.
Step 5, submitting corresponding rendering orders on the chain by the preset main body according to account balances, conducting transaction rendering by a plurality of preset main bodies according to a blockchain platform, and completing bank transfer in response to the central account under the blockchain, wherein the blockchain platform realizes verification of two rendering records on the blockchain platform and under the blockchain platform based on a zero knowledge proof algorithm;
Further illustratively, zero-knowledge proof (Zero-KnowledgeProof, ZKP), which is a cryptographic technique, is employed in this embodiment to allow one party to prove to another party that a statement is correct without providing any information other than the statement's correctness. This technique can prove the correctness of a certain problem without revealing a specific secret, and thus has an important value in terms of privacy protection.
Further, the zero knowledge proof obtains the hash value of the order data based on the chain through the central account, the central account transfers accounts, and obtains the hash value of the transfer data based on the bank transfer data under the chain, so as to obtain the encryption data.
In this embodiment, the hash values on the chain and the hash values off the chain are generated by using the SHA-256 hash algorithm, and it is to be noted that 16-system numbers of 32 bytes of the hash values on the chain and the hash values off the chain are converted into decimal numbers, so that large prime numbers and generating elements are further obtained, and the mutual quality is guaranteed.
Specifically, the encrypted data satisfies the following relation:
P=gs-modG;
Where P represents encrypted data, G s represents a private key that generates the power of the element G, and modG represents the operation of modulo G.
At the same time, a random number R is generated under the chain, and a temporary value R is generated based on the random number.
Specifically, the temporary value satisfies the following relation:
R=grmodG;
Where R represents a temporary value, g r represents a random number R to be the power of the generator g, and modG represents a modulo operation.
A random challenge c is generated on the chain, and a corresponding challenge is generated under the chain, so that a response result z is obtained.
Specifically, the response results satisfy the following relation:
z=(r+c*s)mod(G-1);
Where z represents the response, r represents a random number, c represents a random challenge, s represents a private key, mod (G-1) represents performing a modulo G-1 operation.
And (3) carrying out verification on the chain, wherein the verification meets the following relation:
gz-modG=(R*Pc)modG;
Where G z denotes a response result of the power of the generator G, modG denotes an operation of the line mode G, R denotes a temporary value, P c denotes a random challenge of the power of the encrypted data P, and modG denotes an operation of the line mode.
Further, the correctness of the calculation under the verification chain in the zero knowledge proof is calculated by power operation, and the detailed calculation process is a well-known technology in the art and will not be described in detail.
In response to the equation being established, the in-chain transfer data is consistent with the in-chain transaction receipt data, and the order verification is passed, otherwise, the data is inconsistent, and the order verification fails.
The consistency of the data is verified only on the chain through zero knowledge proof, the actual bank transfer is not displayed on the chain, meanwhile, the verification process prevents tampering of the data under the chain, random numbers are generated on the chain, counterfeit data cannot be prepared in advance, the safety of the data is improved, complex calculation is performed under the chain, verification of the data is only performed on the chain, data calculation and storage are reduced, and response rate is improved.
Further, after the zero knowledge proof is finished, the online and offline withdrawal actions are consistent, a complete withdrawal process is obtained, and if the zero knowledge proof verification passes, the account balance of the central account on the chain is destroyed, and the withdrawal order mark is finished.
In the transaction extraction process of each preset main body according to the blockchain platform, a tcc transaction management unit is specifically constructed, and the tcc transaction management module comprises a Try unit, a Confirm unit and a cancer unit;
Firstly, starting a Try unit, wherein a user applies for presenting, and four branch transactions are generated, namely checking bill consistency, determining the available state of a collection account, reserving balance on a destroying chain of an intelligent contract, and reserving a presented amount by a bank;
If all branch transactions of the Try unit are successfully executed, the Confirm unit starts to be executed, balance and bank transfer on a destroying chain are carried out by the Confirm unit, and after balance on the destroying chain is destroyed by the bank transfer action, contracts are triggered to be realized by an Event;
and if any branch transaction in the Try unit executes errors, triggering the cancer unit, rolling back all branch transactions, and reserving resources for release.
Specifically, the distributed transaction management scheme is implemented as follows:
Trial phase (TryPhase):
When a user initiates a presentation request, the system first enters the try phase. The blockchain platform performs the following operations:
(1) Checking whether the balance of the user account is sufficient, and ensuring the validity of the present amount.
(2) And locking the balance on the chains of the corresponding quantity in the user account, and preventing the repeated withdrawal or double payment.
(3) Funds are reserved in the under-chain financial system to ensure that the under-chain funds are sufficient to support the cash-out operation.
(4) A temporary pick-up order is generated and the current system state is recorded for status confirmation or rollback in a later stage.
Confirmation phase (ConfirmPhase):
If all operations of the try phase are successfully completed, the system enters the confirm phase to formally execute the presenting operation. The specific operation comprises the following steps:
(1) Destroying the balance on the chain locked before, reducing the balance quantity on the chain in the user account, and updating the account record on the chain.
(2) Triggering bank transfer operation, and transferring the reserved cash withdrawal funds into a bank account appointed by a user.
(3) Transaction credentials are generated and stored in the system for subsequent auditing and auditing use.
(4) And the consistency of the chain upper account book and the chain lower account book is ensured, and the synchronization of the chain upper account book and the chain lower account book is realized.
Cancel stage (CANCELPHASE):
if any operation of the try phase fails, or the user cancels the request for proposal before the confirm phase, the system enters the cancel phase, and all operations before the cancel are cancelled, and the specific operations comprise:
(1) And unlocking the balance lock on the chain, and recovering the balance quantity on the chain in the user account to the original state.
(2) And canceling the reserved funds of the bank and releasing the corresponding amount in the under-chain financial system.
(3) Deleting the temporarily generated rendering order, and rolling back the system state to the state before the rendering request, so as to ensure the consistency of the system data.
(4) The recovery of the user account and the system account is ensured, and any inconsistency or data loss is prevented.
Step 6, after the verification in the step 5 is successful, destroying the balance of the account, and finally completing intelligent account separation and account checking;
in the step 6, introducing a multi-step verification mechanism to ensure the legality of operation when the account balance is processed to present and destroy the balance on the chain, wherein the account balance is not regenerated after being destroyed at the same time, so as to ensure the stability of the account balance supply;
The verification mechanism comprises identity verification, transaction execution and log record;
Authentication is before any presentment and on-chain balance destruction operations begin to ensure that an authorized user can initiate presentment operations;
The transaction verification comprises balance verification and transaction examination, wherein the balance verification comprises the steps of obtaining the current balance of a preset main body on a blockchain and comparing the current balance with a request for the withdrawal amount to ensure that the balance of a user is enough to cover the operation, the transaction examination comprises the step of examining and confirming the transaction according to a device provider, and the transaction examination comprises the step of verifying transaction parameters including a receiver bank account and a transfer amount.
The method comprises the steps of generating a cash-making order in a checking system, specifically, enabling current cash-making order state information to be transferred, simultaneously sending tokens corresponding to cash-making quantity to a blockchain account of a central account holder, enabling a central account holder login system to receive the cash-making order sent by the cash-making side to be transferred, enabling the balance of the tokens of the blockchain account to be correspondingly increased, enabling the central account holder to transfer a bank account of the cash-making side within a set time, enabling the central account holder to upload a transfer certificate in the system after the transfer is completed, enabling the current cash-making order state to be changed into 'to be confirmed', enabling the checking system to automatically apply a zero knowledge proof algorithm to check whether the bank information is consistent with the information of the cash-making order in the system, enabling the cash-making side to check the certificate in the system after the transfer certificate is uploaded and the system checking is passed, enabling the cash-making side to check the cash-making side to click a 'cash-made' button, enabling the cash-making order to be marked as 'finished' after the cash-making button is clicked, enabling the balance of the tokens corresponding to the cash-making account in the blockchain account of the central account holder to be destroyed after the cash-making side is completed, enabling the balance of the account-making quantity of the tokens corresponding to be transferred and enabling the cash-making quantity to be consistently not consistent.
And 7, if the preset main body is changed, returning to the step 2 again, redefining service logic and rules, and re-signing a new contract in the form of an intelligent contract in the blockchain platform.
According to the invention, the blockchain platform respectively acquires the transaction receipt between the central account and the preset main body according to the preset time period, and carries out audit, and in the process of carrying out transaction audit verification, a real-time transaction receipt verification monitoring system is specifically built, abnormal orders are acquired and processed, and the account balance is used for tracing and auditing, so that tracing and auditing are completed.
In the invention, the transaction receipt of the central account and the transaction receipt of the preset main body are respectively acquired according to the preset time period, and in the process of transaction verification, a real-time transaction receipt verification monitoring system is specifically established, abnormal orders are acquired and processed, account balance is used for tracing, and the integrity of related metadata and event records on a regional chain is required to be ensured so as to support completion of tracing and auditing.
The foregoing is merely a preferred embodiment of the present invention and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present invention, which are intended to be comprehended within the scope of the present invention. Structures, devices and methods of operation not specifically described and illustrated herein, unless otherwise indicated and limited, are implemented according to conventional means in the art.