| CPC G06Q 20/389 (2013.01) [G06F 21/602 (2013.01); G06F 21/64 (2013.01); G06Q 20/401 (2013.01); H04L 9/065 (2013.01); H04L 9/50 (2022.05); G06Q 30/06 (2013.01); G06Q 40/00 (2013.01); G06Q 40/04 (2013.01); H04L 2463/062 (2013.01)] | 17 Claims |

|
1. A method for tracing a transaction based on a blockchain, applied to an intermediate node, comprising:
encrypting, by the intermediate node using a private key of the intermediate node, transaction details between an upstream node of the intermediate node and the intermediate node to generate upstream transaction information of the intermediate node, and writing the upstream transaction information into the blockchain;
encrypting, the intermediate node, the private key of the intermediate node by respectively using a public key of the upstream node of the intermediate node and a public key of an end node, generating secret-key information of the upstream node of the intermediate node and secret-key information of the end node, and writing the secret-key information of the upstream node of the intermediate node and the secret-key information of the end node into the blockchain;
invoking, by the intermediate node, a smart contract between the intermediate node and a downstream node of the intermediate node;
decrypting, by the intermediate node, secret-key information of the intermediate node by using the private key of the intermediate node to obtain a private key of the downstream node of the intermediate node, wherein the secret-key information of the intermediate node is generated by the downstream node of the intermediate node by using a public key of the intermediate node to encrypt the private key of the downstream node of the intermediate node, and is written into the blockchain; and
decrypting, by the intermediate node, downstream transaction information by using the private key of the downstream node of the intermediate node to obtain transaction details between the intermediate node and the downstream node of the intermediate node, wherein the downstream transaction information is generated by the downstream node by using the private key of the downstream node to encrypt the transaction details between the intermediate node and the downstream node of the intermediate node, and is written into the blockchain.
|