Transferring method and system based on blockchain smart contract
Abstract
Implementations of this specification provide a system and method for performing transfer operations based on a blockchain smart contract. An example method includes: determining, by a transferor client device, a transferee account, a transfer amount, and at least one expense asset, and constructing and submitting a transfer transaction to a blockchain network. The transfer transaction is verified by the blockchain network through a smart contract, using a homomorphic encryption algorithm to determine that a sum of a transfer amount included in a transfer asset and a change amount included in a change asset is equal to a total expense amount corresponding to the at least one expense asset. Using the smart contract, the expense asset is deducted from a transferor account associated with the transferor client device, the change asset is added to the transferor account, and the transfer asset is added to the transferee account.
Claims
exact text as granted — not AI-modifiedWhat is claimed is:
1 . A method comprising:
determining, by a transferor client device, a transferee account, a transfer amount, and at least one expense asset; creating, by the transferor client device, a change asset and a transfer asset based on the transfer amount and an amount corresponding to the at least one expense asset, the change asset including a change amount that has been encrypted with a public key of the transferee account, and the transfer asset including the transfer amount that has been encrypted with the public key of the transferee account; constructing and submitting, by the transferor client device, a transfer transaction to a blockchain network, the transfer transaction including an account identifier of the transferee account, the transfer asset, the change asset, and the at least one expense asset; verifying the transfer transaction, by the blockchain network and using a smart contract deployed in the blockchain network, the verifying comprising using a homomorphic encryption algorithm to determine that a sum of the transfer amount included in the transfer asset and the change amount included in the change asset is equal to a total expense amount corresponding to the at least one expense asset; and in response to determining, by the blockchain network, that the sum is equal to the total expense amount:
deducting the at least one expense asset from a transferor account associated with the transferor client device, using the smart contract;
adding the change asset to the transferor account, using the smart contract; and
adding the transfer asset to the transferee account, using the smart contract.
2 . The method according to claim 1 , wherein the at least one expense asset, the change asset, and the transfer asset each include a Pedersen commitment parameter g v h r and a different encrypted random number E (r) obtained by encrypting a different random number r; and
wherein determining that a sum of the transfer amount included in the transfer asset and the change amount included in the change asset is equal to a total expense amount corresponding to the at least one expense asset is based on the Pedersen commitment parameter included in the transfer asset, the Pedersen commitment parameter included in the change asset, and the Pedersen commitment parameter included in the at least one expense asset, with the homomorphic encryption algorithm being based on a Pedersen commitment mechanism.
3 . The method according to claim 1 , wherein verifying the transfer transaction further comprises:
determining, using the smart contract, whether the transfer amount included in the transfer asset and the change amount included in the change asset are both larger than or equal to zero according to a range proof.
4 . The method according to claim 1 , wherein verifying the transfer transaction further comprises:
through the smart contract, determining whether the at least one expense asset exists in assets owned by the transferor account.
5 . The method according to claim 1 , wherein a given expense asset includes a first state parameter indicating whether the given expense asset has been spent or not spent; and
wherein verifying the transfer transaction further comprises:
for each expense asset included in the transfer transaction, determining, using the smart contract, based on the first state parameter included in the expense asset, that the expense asset has been spent; and
in response to determining that the expense asset has been spent, modifying the first state parameter included in the expense asset to indicate that the expense asset has been spent.
6 . The method according to claim 1 , wherein a given expense asset includes a second state parameter indicating a presence or absence of the expense asset; and
wherein verifying the transfer transaction further comprises:
for each expense asset included in the transfer transaction, using the smart contract, determining whether the expense asset exists based on the second state parameter included in the expense asset.
7 . A computer-implemented system, comprising:
one or more computers; and one or more computer memory devices interoperably coupled with the one or more computers and having tangible, non-transitory, machine-readable media storing one or more instructions that, when executed by the one or more computers, perform operations comprising: determining, by a transferor client device, a transferee account, a transfer amount, and at least one expense asset; creating, by the transferor client device, a change asset and a transfer asset based on the transfer amount and an amount corresponding to the at least one expense asset, the change asset including a change amount that has been encrypted with a public key of the transferee account, and the transfer asset including the transfer amount that has been encrypted with the public key of the transferee account; constructing and submitting, by the transferor client device, a transfer transaction to a blockchain network, the transfer transaction including an account identifier of the transferee account, the transfer asset, the change asset, and the at least one expense asset; verifying the transfer transaction, by the blockchain network and using a smart contract deployed in the blockchain network, the verifying comprising using a homomorphic encryption algorithm to determine that a sum of the transfer amount included in the transfer asset and the change amount included in the change asset is equal to a total expense amount corresponding to the at least one expense asset; and in response to determining, by the blockchain network, that the sum is equal to the total expense amount:
deducting the at least one expense asset from a transferor account associated with the transferor client device, using the smart contract;
adding the change asset to the transferor account, using the smart contract; and
adding the transfer asset to the transferee account, using the smart contract.
8 . The system according to claim 7 , wherein the at least one expense asset, the change asset, and the transfer asset each include a Pedersen commitment parameter g v h r and a different encrypted random number E (r) obtained by encrypting a different random number r; and
wherein determining that a sum of the transfer amount included in the transfer asset and the change amount included in the change asset is equal to a total expense amount corresponding to the at least one expense asset is based on the Pedersen commitment parameter included in the transfer asset, the Pedersen commitment parameter included in the change asset, and the Pedersen commitment parameter included in the at least one expense asset, with the homomorphic encryption algorithm being based on a Pedersen commitment mechanism.
9 . The system according to claim 7 , wherein verifying the transfer transaction further comprises:
determining, using the smart contract, whether the transfer amount included in the transfer asset and the change amount included in the change asset are both larger than or equal to zero according to a range proof.
10 . The system according to claim 7 , wherein verifying the transfer transaction further comprises:
through the smart contract, determining whether the at least one expense asset exists in assets owned by the transferor account.
11 . The system according to claim 7 , wherein a given expense asset includes a first state parameter indicating whether the given expense asset has been spent or not spent; and
wherein verifying the transfer transaction further comprises:
for each expense asset included in the transfer transaction, determining, using the smart contract, based on the first state parameter included in the expense asset, that the expense asset has been spent; and
in response to determining that the expense asset has been spent, modifying the first state parameter included in the expense asset to indicate that the expense asset has been spent.
12 . The system according to claim 7 , wherein a given expense asset includes a second state parameter indicating a presence or absence of the expense asset; and
wherein verifying the transfer transaction further comprises:
for each expense asset included in the transfer transaction, using the smart contract, determining whether the expense asset exists based on the second state parameter included in the expense asset.
13 . A non-transitory, computer-readable medium storing one or more instructions executable by a computer system to perform operations comprising:
one or more computers; and
one or more computer memory devices interoperably coupled with the one or more computers and having tangible, non-transitory, machine-readable media storing one or more instructions that, when executed by the one or more computers, perform operations comprising:
determining, by a transferor client device, a transferee account, a transfer amount, and at least one expense asset;
creating, by the transferor client device, a change asset and a transfer asset based on the transfer amount and an amount corresponding to the at least one expense asset, the change asset including a change amount that has been encrypted with a public key of the transferee account, and the transfer asset including the transfer amount that has been encrypted with the public key of the transferee account;
constructing and submitting, by the transferor client device, a transfer transaction to a blockchain network, the transfer transaction including an account identifier of the transferee account, the transfer asset, the change asset, and the at least one expense asset;
verifying the transfer transaction, by the blockchain network and using a smart contract deployed in the blockchain network, the verifying comprising using a homomorphic encryption algorithm to determine that a sum of the transfer amount included in the transfer asset and the change amount included in the change asset is equal to a total expense amount corresponding to the at least one expense asset; and
in response to determining, by the blockchain network, that the sum is equal to the total expense amount:
deducting the at least one expense asset from a transferor account associated with the transferor client device, using the smart contract;
adding the change asset to the transferor account, using the smart contract; and
adding the transfer asset to the transferee account, using the smart contract.
14 . The computer-readable medium according to claim 13 , wherein the at least one expense asset, the change asset, and the transfer asset each include a Pedersen commitment parameter g v h r and a different encrypted random number E (r) obtained by encrypting a different random number r; and
wherein determining that a sum of the transfer amount included in the transfer asset and the change amount included in the change asset is equal to a total expense amount corresponding to the at least one expense asset is based on the Pedersen commitment parameter included in the transfer asset, the Pedersen commitment parameter included in the change asset, and the Pedersen commitment parameter included in the at least one expense asset, with the homomorphic encryption algorithm being based on a Pedersen commitment mechanism.
15 . The computer-readable medium according to claim 13 , wherein verifying the transfer transaction further comprises:
determining, using the smart contract, whether the transfer amount included in the transfer asset and the change amount included in the change asset are both larger than or equal to zero according to a range proof.
16 . The computer-readable medium according to claim 13 , wherein verifying the transfer transaction further comprises:
through the smart contract, determining whether the at least one expense asset exists in assets owned by the transferor account.
17 . The computer-readable medium according to claim 13 , wherein a given expense asset includes a first state parameter indicating whether the given expense asset has been spent or not spent; and
wherein verifying the transfer transaction further comprises:
for each expense asset included in the transfer transaction, determining, using the smart contract, based on the first state parameter included in the expense asset, that the expense asset has been spent; and
in response to determining that the expense asset has been spent, modifying the first state parameter included in the expense asset to indicate that the expense asset has been spent.
18 . The computer-readable medium according to claim 13 , wherein a given expense asset includes a second state parameter indicating a presence or absence of the expense asset; and
wherein verifying the transfer transaction further comprises:
for each expense asset included in the transfer transaction, using the smart contract, determining whether the expense asset exists based on the second state parameter included in the expense asset.Join the waitlist — get patent alerts
Track US2020175509A1 — get alerts on status changes and closely related new filings.
We store only your email — no account needed. See our privacy policy.