BLOCKCHAIN-BASED TRANSACTION METHOD AND APPARATUS, AND REMITTER DEVICE
Implementations of the present specification provide a blockchain-based transaction method and apparatus, and a remitter device. The method includes: calculating a transaction amount commitment, a first commitment random number ciphertext, and a second commitment random number ciphertext; and submitting transaction data to the blockchain, the transaction data including the transaction amount commitment, the first commitment random number ciphertext, and the second commitment random number ciphertext, for the transaction amount commitment and the first commitment random number ciphertext to be recorded into a remitter account, and the transaction amount commitment and the second commitment random number ciphertext to be recorded into a remittee account.
1 . A method, comprising:
calculating a remitter balance commitment based on a remitter random number and a remitter balance of a remitter account;
calculating a remitter random number ciphertext by encrypting the remitter random number based on the remitter balance by using a homomorphic encryption algorithm; and
registering the remitter balance commitment and the remitter random number ciphertext with a blockchain.
2 . The method according to claim 1 , comprising:
calculating a remittee balance commitment based on a remittee random number and a remittee balance of a remittee account;
calculating a remittee random number ciphertext by encrypting the remittee random number based on the remittee balance by using the homomorphic encryption algorithm; and
registering the remittee balance commitment and the remittee random number ciphertext with the blockchain.
3 . The method according to claim 1 , comprising:
receiving a transaction commitment between the remitter account and a remittee account, the transaction commitment including a transaction commitment amount and a remitter commitment random number ciphertext;
updating the remitter balance commitment based on the transaction commitment amount; and
updating the remitter random number ciphertext based on the remitter commitment random number ciphertext.
4 . The method according to claim 3 , wherein:
the updating the remitter balance commitment includes calculating a quotient of the remitter balance commitment and the transaction amount commitment; and
the updating the remitter random number ciphertext includes calculating a quotient of the remitter random number ciphertext and the remitter commitment random number ciphertext;
5 . The method according to claim 3 , wherein:
the transaction commitment includes a remittee commitment random number ciphertext; and
the method further comprises:
updating the remittee balance commitment based on the transaction commitment amount; and
updating a remittee random number ciphertext based on the remittee commitment random number ciphertext.
6 . The method according to claim 5 , wherein:
the updating the remittee balance commitment includes calculating a product of the remittee balance commitment and the transaction amount commitment; and
the updating the remittee random number ciphertext includes calculating a product of the remittee random number ciphertext and the remittee commitment random number ciphertext.
7 . The method according to claim 3 , wherein the updating the remitter balance commitment based on the transaction commitment amount is conducted by a consensus node of a blockchain network that maintains the blockchain.
8 . A computing device comprising a processor and a memory, the memory storing executable instructions that are executable by the processor to enable the processor to implement acts including:
calculating a remitter balance commitment based on a remitter random number and a remitter balance of a remitter account;
calculating a remitter random number ciphertext by encrypting the remitter random number based on the remitter balance by using a homomorphic encryption algorithm; and
registering the remitter balance commitment and the remitter random number ciphertext with a blockchain.
9 . The computing device according to claim 8 , wherein the acts include:
calculating a remittee balance commitment based on a remittee random number and a remittee balance of a remittee account;
calculating a remittee random number ciphertext by encrypting the remittee random number based on the remittee balance by using the homomorphic encryption algorithm; and
registering the remittee balance commitment and the remittee random number ciphertext with the blockchain.
10 . The computing device according to claim 8 , wherein the acts include:
receiving a transaction commitment between the remitter account and a remittee account, the transaction commitment including a transaction commitment amount and a remitter commitment random number ciphertext;
updating the remitter balance commitment based on the transaction commitment amount; and
updating the remitter random number ciphertext based on the remitter commitment random number ciphertext.
11 . The computing device according to claim 10 , wherein:
the updating the remitter balance commitment includes calculating a quotient of the remitter balance commitment and the transaction amount commitment; and
the updating the remitter random number ciphertext includes calculating a quotient of the remitter random number ciphertext and the remitter commitment random number ciphertext;
12 . The computing device according to claim 10 , wherein:
the transaction commitment includes a remittee commitment random number ciphertext; and
the acts further include:
updating the remittee balance commitment based on the transaction commitment amount; and
updating a remittee random number ciphertext based on the remittee commitment random number ciphertext.
13 . The computing device according to claim 12 , wherein:
the updating the remittee balance commitment includes calculating a product of the remittee balance commitment and the transaction amount commitment; and
the updating the remittee random number ciphertext includes calculating a product of the remittee random number ciphertext and the remittee commitment random number ciphertext.
14 . The computing device according to claim 10 , wherein the computing device includes a consensus node of a blockchain network that maintains the blockchain.
15 . A non-transitory storage medium having computer executable instructions stored thereon, the computer executable instructions, when executed by a processor, configuring the processor to implement acts comprising:
calculating a remitter balance commitment based on a remitter random number and a remitter balance of a remitter account;
calculating a remitter random number ciphertext by encrypting the remitter random number based on the remitter balance by using a homomorphic encryption algorithm; and
registering the remitter balance commitment and the remitter random number ciphertext with a blockchain.
16 . The storage medium according to claim 15 , wherein the acts include:
calculating a remittee balance commitment based on a remittee random number and a remittee balance of a remittee account;
calculating a remittee random number ciphertext by encrypting the remittee random number based on the remittee balance by using the homomorphic encryption algorithm; and
registering the remittee balance commitment and the remittee random number ciphertext with the blockchain.
17 . The storage medium according to claim 16 , wherein the acts include:
receiving a transaction commitment between the remitter account and a remittee account, the transaction commitment including a transaction commitment amount and a remitter commitment random number ciphertext;
updating the remitter balance commitment based on the transaction commitment amount; and
updating the remitter random number ciphertext based on the remitter commitment random number ciphertext.
18 . The storage medium according to claim 17 , wherein:
the updating the remitter balance commitment includes calculating a quotient of the remitter balance commitment and the transaction amount commitment; and
the updating the remitter random number ciphertext includes calculating a quotient of the remitter random number ciphertext and the remitter commitment random number ciphertext;
19 . The storage medium according to claim 17 , wherein:
the transaction commitment includes a remittee commitment random number ciphertext; and
the acts further include:
updating the remittee balance commitment based on the transaction commitment amount; and
updating a remittee random number ciphertext based on the remittee commitment random number ciphertext.
20 . The storage medium according to claim 19 , wherein:
the updating the remittee balance commitment includes calculating a product of the remittee balance commitment and the transaction amount commitment; and
the updating the remittee random number ciphertext includes calculating a product of the remittee random number ciphertext and the remittee commitment random number ciphertext.