Blockchain-based point issuance method, device and electronic equipment
By deploying smart contracts in blockchain nodes and utilizing signature information and user-side payments, the problem of high payment fees for points issuers is solved, achieving the effect of saving points issuance costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NETEASE (HANGZHOU) NETWORK CO LTD
- Filing Date
- 2023-02-07
- Publication Date
- 2026-06-09
AI Technical Summary
In traditional blockchain technology, the cost of issuing points to blockchain nodes (such as gasoline costs) is relatively high, leading to increased costs.
By deploying smart contracts in blockchain nodes, the points issuer generates signature information and sends a transaction request. The first user pays a preset fee to the blockchain node, and the blockchain node calls the smart contract to issue points to the first user, thus avoiding the point issuer paying the fee directly.
While ensuring the demand for points issuance, it saves the fees paid by the points issuer to the blockchain nodes, thus reducing the cost of points issuance.
Smart Images

Figure CN116308314B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of blockchain technology, and in particular to a blockchain-based points issuance method, apparatus, and electronic device. Background Technology
[0002] Blockchain technology refers to a technological solution that collectively maintains a reliable database in a decentralized and trustless manner. It is the underlying technology of cryptocurrencies such as Bitcoin and Ethereum. In other words, blockchain technology refers to a way of recording transactions through public participation. Transaction confirmation on the blockchain is achieved through consensus among all nodes on the blockchain, and once consensus is successful, the transaction is packaged and written into a block. The blockchain maintains a public ledger to store all transactions on the blockchain network. Blockchain 2.0, represented by Ethereum, implements more complex distributed contract records, namely smart contracts. A smart contract is a computer protocol designed to disseminate, verify, or execute contracts in an informational way. A smart contract is a set of promises defined in digital form, which control digital assets and contain the rights and obligations agreed upon by the contract participants, and is automatically executed by a computer system. The contract is recorded in the blockchain, and once the contract's triggering conditions are met, the predefined code logic can be executed autonomously, and the result after execution is recorded on the chain and cannot be changed. After executing a transaction on a smart contract on the blockchain, the data associated with that transaction can be queried from the ledger maintained by the blockchain, and the associated data can be analyzed to obtain details of the transaction. In a business model based on a blockchain network, users can submit business transactions to the blockchain network, triggering each node in the blockchain network to execute the business through smart contracts.
[0003] With the development of blockchain technology, a points issuance model that incentivizes users by issuing points (such as, but not limited to, points in accounts recorded in the blockchain) to blockchain users has gradually become popular. In traditional technology, the points issuer uses smart contracts deployed in the blockchain to issue points to users (also known as points acquirers), requiring the points issuer to pay the blockchain nodes for the costs incurred in issuing points (e.g., fuel costs). Therefore, using the above technical solution, when issuing points to multiple users in the blockchain according to the points issuer's needs, the points issuer needs to pay substantial fees to the blockchain nodes.
[0004] Therefore, there is an urgent need for a blockchain-based points issuance method that, while ensuring that points are issued to users according to the points issuer's needs, eliminates the need for the points issuer to pay the blockchain nodes for the fees incurred in points issuance, thus saving the points issuer's expenses. Summary of the Invention
[0005] This application provides a blockchain-based points issuance method, apparatus, and electronic device. This method ensures that points are issued to users according to the points issuance needs of the points issuer, without requiring the points issuer to pay the blockchain node for the fees incurred in points issuance, thus saving the points issuer's expenses.
[0006] The first aspect of this application provides a blockchain-based points issuance method applied to a blockchain node in a blockchain network. The users of the blockchain node include a first user terminal and a points issuance terminal. A smart contract deployed in the blockchain node is a contract created at the request of the points issuance terminal. The method includes: receiving a transaction request from the first user terminal to invoke the smart contract, wherein the transaction request includes signature information of the points issuance terminal and payment information of the first user terminal; the signature information represents points issuance information of the points issuance terminal for the first user terminal; the payment information represents a preset amount of fee paid by the first user terminal to the blockchain node; and, according to the transaction request, invoking points issuance logic in the smart contract to issue points to the first user terminal based on the points issuance information.
[0007] A second aspect of this application provides a blockchain-based points issuance method applied to a points issuance terminal. The method includes: generating signature information of the points issuance terminal, wherein the signature information represents points issuance information of the points issuance terminal for a first user terminal; sending the signature information of the points issuance terminal, causing the first user terminal to send a transaction request to a blockchain node to invoke a smart contract based on the obtained signature information of the points issuance terminal, so that the blockchain node, based on the transaction request, invokes the points issuance logic in the smart contract to issue points to the first user terminal based on the points issuance information; wherein the transaction request includes the signature information of the points issuance terminal and payment information of the first user terminal, the payment information representing a preset amount of fee paid by the first user terminal to the blockchain node, the smart contract being a contract requested by the points issuance terminal to be created in the blockchain node, and the users of the blockchain node including the first user terminal and the points issuance terminal.
[0008] A third aspect of this application provides a blockchain-based points issuance method applied to a first user terminal. The method includes: obtaining signature information of a points issuing terminal, wherein the signature information represents points issuance information of the points issuing terminal for the first user terminal; generating a transaction request to invoke a smart contract based on the signature information of the points issuing terminal and payment information of the first user terminal, wherein the transaction request includes the signature information of the points issuing terminal and payment information of the first user terminal; the payment information represents a preset amount of fees paid by the first user terminal to the blockchain node; the smart contract is a contract created at the request of the points issuing terminal in the blockchain node; the users of the blockchain node include the first user terminal and the points issuing terminal; and sending the transaction request to invoke the smart contract to the blockchain node, so that the blockchain node, according to the transaction request, invokes the points issuance logic in the smart contract to issue points for the first user terminal based on the points issuance information.
[0009] A fourth aspect of this application provides a blockchain-based points issuance device applied to a blockchain node in a blockchain network. The users of the blockchain node include a first user terminal and a points issuance terminal. A smart contract deployed in the blockchain node is a contract created at the request of the points issuance terminal. The device includes: a transceiver unit configured to: receive a transaction request sent by the first user terminal to invoke the smart contract, wherein the transaction request includes signature information of the points issuance terminal and payment information of the first user terminal; the signature information represents points issuance information of the points issuance terminal for the first user terminal; and the payment information represents a preset amount of fee paid by the first user terminal to the blockchain node; and a processing unit configured to: according to the transaction request, invoke the points issuance logic in the smart contract to issue points to the first user terminal based on the points issuance information.
[0010] A fifth aspect of this application provides a blockchain-based points issuance device applied to a points issuance terminal. The device includes: a processing unit configured to: generate signature information of the points issuance terminal, wherein the signature information represents points issuance information of the points issuance terminal for a first user terminal; and a transceiver unit configured to: send the signature information of the points issuance terminal, causing the first user terminal to send a transaction request to a blockchain node to invoke a smart contract based on the obtained signature information of the points issuance terminal, so that the blockchain node, based on the transaction request, invokes the points issuance logic in the smart contract to issue points to the first user terminal based on the points issuance information; wherein the transaction request includes the signature information of the points issuance terminal and payment information of the first user terminal, the payment information representing a preset amount of fees paid by the first user terminal to the blockchain node, the smart contract being a contract 5 created by the points issuance terminal at the request of the points issuance terminal in the blockchain node, and the users of the blockchain node including the first user terminal and the points issuance terminal.
[0011] A sixth aspect of this application provides a blockchain-based points issuance device applied to a first user terminal. The device includes: a transceiver unit configured to: acquire signature information of a points issuing terminal, wherein the signature information represents points issuance information of the points issuing terminal for the first user terminal; a processing unit configured to: generate a transaction request to invoke a smart contract based on the signature information of the points issuing terminal and payment information of the first user terminal, wherein the transaction request includes the signature information of the points issuing terminal and payment information of the first user terminal; the payment information represents a preset amount of fees paid by the first user terminal to the blockchain node; the smart contract is a contract created in the blockchain node at the request of the points issuing terminal; the users of the blockchain node include the first user terminal and the points issuing terminal; the transceiver unit is further configured to: send the transaction request to invoke the smart contract to the blockchain node, so that the blockchain node, according to the transaction request, invokes the points issuance logic in the smart contract to issue points for the first user terminal based on the points issuance information.
[0012] A seventh aspect of this application also provides a computer-readable storage medium storing one or more computer instructions, characterized in that the instructions are executed by a processor to implement the blockchain-based points issuance method described in any of the above technical solutions.
[0013] An eighth aspect of this application also provides an electronic device, including: a processor; and a memory for storing a data processing program, wherein after the server is powered on and runs the program through the processor, it executes the blockchain-based points issuance method as described above.
[0014] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments disclosed in this application, nor is it intended to limit the scope of this application's disclosure. Other features disclosed in this application will become readily apparent from the following description.
[0015] The blockchain-based points issuance method provided in this application embodiment is applied to a blockchain node in a blockchain network. The users of this blockchain node include a first user terminal and a points issuance terminal. The smart contract deployed in the blockchain node is a contract created at the request of the points issuance terminal. The method includes: the blockchain node receiving a transaction request from the first user terminal to invoke the smart contract. The transaction request carries the signature information of the points issuance terminal and the payment information of the first user terminal. The signature information of the points issuance terminal includes points issuance information (i.e., the points issuance demand of the points issuance terminal) for issuing points to the first user terminal; the payment information indicates that the first user terminal pays a preset amount of fees to the blockchain node. Further, after receiving the transaction request from the first user terminal to invoke the smart contract, the blockchain node, according to the transaction request, invokes the points issuance logic in the smart contract to issue points to the first user terminal based on the points issuance information. In the above implementation process, the transaction request sent by the first user client to invoke the smart contract, received by the blockchain node, carries the payment information of the first user client. This allows the first user client to pay the blockchain node for the fees incurred by the blockchain node in executing the smart contract. The transaction request also carries the signature information of the points issuing end. This allows the blockchain node to execute the points issuance logic within the smart contract to issue points to the first user client based on the points issuing end's issuance needs. In this implementation process, the first user client pays the blockchain node for the fees incurred in points issuance. In other words, the points issuing end does not need to pay the blockchain node for the fees incurred in points issuance, thus saving the points issuing end's costs. In summary, this method, while ensuring that points are issued to the user client according to the points issuing end's needs, eliminates the need for the points issuing end to pay the blockchain node for the fees incurred in points issuance, thereby saving the points issuing end's costs. Attached Figure Description
[0016] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1This is a schematic diagram illustrating an application scenario of the blockchain-based points issuance method provided in the embodiments of this application.
[0018] Figure 2 This is a schematic diagram illustrating the creation and invocation of a smart contract applicable to the blockchain-based points issuance method provided in the embodiments of this application.
[0019] Figure 3 This is a schematic diagram of a blockchain-based points issuance method provided in an embodiment of this application.
[0020] Figure 4 This is a schematic diagram of another blockchain-based points issuance method provided in the embodiments of this application.
[0021] Figure 5 This is a schematic diagram of the structure of a blockchain-based points issuance device provided in an embodiment of this application.
[0022] Figure 6 This is a schematic diagram of the structure of a blockchain-based points issuance system provided in an embodiment of this application.
[0023] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0024] To enable those skilled in the art to better understand the technical solutions of this application, the application will be clearly and completely described below with reference to the accompanying drawings of the embodiments. However, this application can be implemented in many other ways different from those described above. Therefore, based on the embodiments provided in this application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this application.
[0025] It should be noted that the terms "first," "second," "third," etc., in the claims, specification, and drawings of this application are used to distinguish similar objects and are not used to describe a specific order or sequence. Such data are interchangeable where appropriate so that the embodiments of this application described herein can be implemented in a sequence other than that shown or described herein. Furthermore, the terms "comprising," "having," and their variations are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or apparatuses.
[0026] To facilitate understanding, the technical terms involved in the embodiments of this application will be introduced first.
[0027] 1. Blockchain
[0028] A blockchain is a chain of blocks. Each block stores specific information, and these blocks are linked together in chronological order of their creation. This chain is stored on all servers, and as long as at least one server in the system is operational, the entire blockchain is secure. These servers are called blockchain nodes (or simply nodes), and they provide storage space and computing power for the entire blockchain system. To modify information in the blockchain, the consent of more than half of the nodes must be obtained, and the information in all nodes must be modified. Since these nodes are typically controlled by different entities, tampering with information in the blockchain is extremely difficult. Compared to traditional networks, blockchain has two core characteristics: data is difficult to tamper with, and it is decentralized. Based on these two characteristics, the information recorded in the blockchain is more authentic and reliable, helping to solve the problem of mutual distrust.
[0029] Blockchains are generally classified into three types: public blockchains, consortium blockchains, and private blockchains. A public blockchain is defined as follows: any individual or group in the world can send transactions, and these transactions can be effectively confirmed by the blockchain; anyone can participate in its consensus process. A consortium blockchain is defined as follows: a group designates multiple pre-selected nodes as ledger keepers. The generation of each block is jointly decided by all pre-selected nodes (pre-selected nodes participate in the consensus process). Other access nodes can participate in transactions but do not interfere with the ledger process (essentially still escrow ledger management, just distributed; the number of pre-selected nodes and how to determine the ledger keeper for each block are the main risks of this blockchain). Anyone else can perform limited queries through the blockchain's open API. A private blockchain is defined as follows: it only uses the blockchain's ledger technology for record keeping; it can be a company or an individual, and they have exclusive write permissions to the blockchain.
[0030] 2. Blockchain Account
[0031] The three key elements of a blockchain account are: a private key, a public key, and the account's blockchain address.
[0032] Private and public keys are components of asymmetric encryption algorithms in cryptography. Public keys can be publicly shared, while private keys must be securely stored. Private keys are generated from a random seed, and public keys are derived from them using an algorithm. Because public keys are too long, "addresses" were introduced for simplicity and practicality; addresses are derived from public keys. These derivation processes are one-way and irreversible. That is, the public key cannot be derived from the address, and the private key cannot be derived from the public key.
[0033] 3. Smart Contracts
[0034] A smart contract is essentially a program that executes automatically when conditions agreed upon in advance by the contract creator are met. Smart contracts make the transaction process deterministic, the transaction result irreversible, and allow the transacting parties to trust each other even without third-party notarization.
[0035] In Ethereum, a smart contract specifically refers to a collection of code and data created by an external account or other contract account and residing at a specific address. After writing a smart contract using a high-level language (such as Solidity), users need to compile it into bytecode that the Ethereum Virtual Machine (EVM) can run, and then deploy it on Ethereum by initiating a transaction. Once deployed, users can invoke methods within the smart contract by sending transactions to the contract address, implementing the functions pre-defined by the contract creator. Methods within a smart contract must be invoked via a transaction; these invocations can be direct from an external account or indirect from an internal transaction triggered by another contract account. Although the contract code cannot be modified after deployment, it can be deleted by initiating a transaction to execute EVM opcodes.
[0036] 4. Ethereum
[0037] Ethereum is a public blockchain platform with smart contract functionality. Through Ethereum's smart contract capabilities, developers can build a wide variety of decentralized applications on the blockchain.
[0038] Ethereum has accounts, which are divided into two types: external accounts and contract accounts. External accounts are similar to those in Bitcoin. External accounts can be understood as accounts directly controlled by the user, also known as user accounts. Ethereum contract accounts are created after a smart contract is deployed and contain the contract code. Contract accounts can be understood as accounts created by users through external accounts, containing the smart contract code.
[0039] 5. Gas fee
[0040] In blockchain, gas fees can be used to measure the computational and storage resources consumed by nodes in the blockchain when executing messages (e.g., invoking smart contract transactions). Gas fees paid to nodes in the blockchain can serve as compensation for the computational and storage resources consumed by those nodes in executing messages.
[0041] 6. Consensus Mechanism
[0042] Consensus mechanisms verify and confirm transactions quickly through voting by specific nodes. If several nodes with unrelated interests can reach a consensus on a transaction in a blockchain, we can assume that the entire network can also reach a consensus. Common consensus mechanisms include Proof-of-Work (PoW), Proof-of-Stake (PoS), and Practical Byzantine Fault Tolerance (PBFT).
[0043] 7. Digital signature
[0044] A digital signature, also known as a public-key digital signature, is a unique string of numbers that only the sender of the information can generate and that cannot be forged by others. This string also serves as valid proof of the authenticity of the information sent by the sender. It is similar to a physical signature written on paper, but implemented using public-key cryptography techniques to authenticate digital information. A digital signature typically defines two complementary operations: one for signing and the other for verification. Digital signatures are an application of asymmetric key encryption and digital digest techniques.
[0045] In Bitcoin's blockchain, digital signatures are used to ensure the immutability of data throughout the system and to guarantee the authenticity of the identities of both parties in a transaction. Digital signatures employ asymmetric encryption and digital digest technologies to ensure data integrity during transmission and the authenticity of the sender's identity. Asymmetric encryption generates a public key and a private key, which are a pair. The private key is kept secret from outsiders, while the public key can be shared with other recipients. Data encrypted with the private key can only be decrypted with the public key, and vice versa.
[0046] Blockchain technology is a novel distributed infrastructure and computing paradigm built on a peer-to-peer (P2P) network. It utilizes a chain-like data structure to verify and store data, a distributed node consensus algorithm to generate and update data, cryptography to ensure secure data transmission and access, and smart contracts composed of automated script code to program and manipulate data. In a blockchain, consensus data is generated by sending transactions and having nodes execute them. These transactions may include calls to smart contracts, which, upon execution, alter the state of the world, including, for example, account balances and smart contract-stored variables.
[0047] Computing devices can construct data into a standard transaction format supported by the blockchain, and then publish it to the blockchain. The nodes in the blockchain will process the received transactions through consensus. After consensus is reached, the nodes in the blockchain that act as ledger nodes will package the transaction into a block and permanently store it in the blockchain.
[0048] Each time a new block is generated on the blockchain, the corresponding states of these executed transactions change after execution. For example, in blockchains built on an account model (such as Ethereum), the state of external accounts or the contract account state of smart contracts typically changes with transaction execution. External accounts are accounts directly controlled by users, also known as user accounts, while contract accounts are accounts created by users through external accounts and contain smart contract code. For instance, after a "transfer transaction" in a block is executed, the balances (i.e., the values of the Balance field in these accounts) of the sender and receiver accounts associated with that "transfer transaction" typically change accordingly. Similarly, a "smart contract call transaction" in a block is used to invoke a smart contract deployed on the blockchain. The EVM corresponding to the node device invokes the smart contract to execute the "smart contract call transaction," and updates the account state of the smart contract account after execution.
[0049] In practical applications, public, private, and consortium blockchains can all provide smart contract functionality. A smart contract on a blockchain is a contract that can be triggered and executed by transactions. Smart contracts can be defined in the form of code. Taking Ethereum as an example, it allows users to create and invoke complex logic within the Ethereum network. As a programmable blockchain, Ethereum's core is the Ethereum Virtual Machine (EVM), which can be run by every Ethereum node. The EVM is a Turing-complete virtual machine that can implement various complex logics. Users publishing and invoking smart contracts in Ethereum are running them on the EVM. In fact, the EVM directly runs virtual machine code (virtual machine bytecode, hereinafter referred to as "bytecode"), so smart contracts deployed on the blockchain can be bytecode.
[0050] With the development of blockchain technology, a points issuance model that incentivizes blockchain users by issuing points (such as, but not limited to, points in accounts recorded in the blockchain) has become increasingly popular. In traditional technology, the points issuer uses smart contracts deployed in the blockchain to issue points to users, requiring the issuer to pay the blockchain nodes for the costs incurred in issuing points. Specifically, the points issuer calls the smart contract deployed in the blockchain based on points issuance requirements (e.g., user information and the number of points to be issued), triggering the smart contract to execute the corresponding request. During this points issuance process, the issuer calls the smart contract, and this call requires the issuer to pay the blockchain nodes for the costs incurred in issuing points (e.g., the cost of points). Therefore, using this technical solution, when issuing points to multiple users in the blockchain according to the issuer's points issuance requirements, the issuer needs to pay significant fees to the blockchain nodes.
[0051] To address the aforementioned problems, this application provides a blockchain-based method, apparatus, and electronic device for issuing points. This method ensures that points are issued to users according to the point issuer's needs, without requiring the point issuer to pay fees to blockchain nodes for point issuance, thus saving costs for the point issuer.
[0052] The application scenarios and methods of the blockchain-based points issuance method applicable to embodiments of this application will be described in detail below with reference to the accompanying drawings. It is understood that, where there is no conflict between the various embodiments provided in this application, the following embodiments and features can be combined with each other. Furthermore, the timing of the steps in the following method embodiments is merely an example and not a strict limitation.
[0053] First, the application scenarios of the blockchain-based points issuance method applicable to the embodiments of this application are introduced with reference to the accompanying drawings.
[0054] Figure 1 This is a schematic diagram illustrating an application scenario of the blockchain-based points issuance method provided in the embodiments of this application. For example... Figure 1 As shown, this application scenario includes: blockchain network 130, client 110, and client 120.
[0055] For example, see Figure 1 This illustrates the process of creating a smart contract in an application scenario. After Bob sends a transaction 1 containing information about creating a smart contract to blockchain network 130, all blockchain nodes within blockchain network 130 can execute this transaction in the EVM. Figure 1 The From field of transaction 1 shown records the address of the account that initiated the creation of the smart contract. The Data field of transaction 1 stores the contract code, which can be bytecode. The To field of transaction 1 has a null (empty) value. Once the nodes in blockchain network 130 reach a consensus through the consensus mechanism, the smart contract corresponding to transaction 1 is successfully created on the various blockchain nodes of blockchain network 130. Users can then call the smart contract corresponding to transaction 1. The Data field of transaction 1, which creates the smart contract, can store the bytecode of that smart contract. Bytecode consists of a series of bytes, each byte representing an operation. For reasons of development efficiency and readability, developers can choose to write smart contract code in a high-level language instead of directly writing bytecode. For example, high-level languages could include Solidity, Serpent, or LLL. Smart contract code written in a high-level language can be compiled by a compiler to generate bytecode that can be deployed to the blockchain. Taking Solidity as an example, contract code written in it is very similar to a class in object-oriented programming languages. A contract can declare various members, including state variables, functions, function modifiers, events, etc. State variables are values that are permanently stored in the smart contract's Storage field and are used to save the contract's state.
[0056] After a smart contract is created, each blockchain node in the blockchain network 130 locally records the contract accounts corresponding to the smart contract for transaction 1. Each contract account corresponds to a specific address. For example, Figure 1The address "0x68e13f…" recorded locally by each node in the illustrated blockchain network 130 represents the address of the contract account of the smart contract corresponding to the created transaction 1; the contract code and account storage are stored in the account storage of this contract account. The behavior of the smart contract is controlled by the contract code, while the contract account storage of the smart contract preserves the state of the contract. In other words, the smart contract enables the creation of a virtual account on the blockchain that contains contract code and contract account storage.
[0057] For example, see Figure 1 This illustrates the process of invoking a smart contract in an application scenario. After Alice sends a transaction 2 containing information about invoking a smart contract to blockchain network 130, all blockchain nodes within blockchain network 130 can execute this transaction in the EVM. Figure 1 The From field of transaction 2 shown records the address of the account initiating the smart contract call, the To field records the address of the called smart contract, and the Data field records the method and parameters used to call the smart contract. After the smart contract is called, the account state of the contract account may change. Subsequently, a client can view the account state of the contract account through any node included in the connected blockchain network 130. For example, the account state can be stored in the smart contract's Storage tree in the form of key-value pairs. The execution result of the smart contract call transaction can be stored in the form of a Merklepatricia trie (MPT) receipt tree.
[0058] Smart contracts can be executed independently on each node of the blockchain network in a prescribed manner. All execution records and data are stored on the blockchain. Therefore, once such a transaction is completed, the blockchain stores an immutable and unlost transaction certificate.
[0059] It should be understood that the above Figure 1 The application scenarios shown are for illustrative purposes only and do not constitute any limitation on the application scenarios applicable to the blockchain-based points issuance method provided in the embodiments of this application.
[0060] Figure 2 This is a schematic diagram illustrating the creation and invocation of a smart contract applicable to the blockchain-based points issuance method provided in the embodiments of this application.
[0061] For example, see Figure 2Creating a smart contract in a blockchain (such as Ethereum) involves writing the smart contract, converting it into bytecode, and deploying it to the blockchain. Calling a smart contract in the blockchain involves initiating a transaction that points to the smart contract's address. The EVMs of the various nodes in the blockchain can execute this transaction separately, distributing the smart contract code across the virtual machines of the various nodes in the blockchain.
[0062] For accounts in a blockchain, an account state is typically maintained through a structure. When a transaction in a block is executed, the state of the account associated with that transaction usually changes. For example, in the Ethereum blockchain, an account structure typically includes the following fields: Balance, Nonce, Code, and Storage. Specifically: The Balance field maintains the account's current balance. The Nonce field maintains the number of transactions for the account; it's a counter to ensure each transaction can be processed exactly once, effectively preventing replay attacks. The Code field maintains the account's contract code; in practice, the Code field is usually used to maintain the hash value of the contract code. The Storage field maintains the account's stored content (default value is empty); for contract accounts, a separate storage space is typically allocated to store the contract account's content; this separate storage space is usually called the contract account's account storage. The contract account's stored content is usually constructed into an MPT tree data structure and stored in the aforementioned separate storage space; the MPT tree built based on the contract account's stored content is also commonly referred to as the Storage tree. The Storage field typically only maintains the root node of the Storage tree; therefore, it is often called the Storage Root field. It should be noted that for externally owned accounts, the Code and Storage fields described above have null values. Externally owned accounts are controlled by a key. For example, an externally owned account can be a user account created by a user using a key.
[0063] Next, the blockchain-based points issuance method provided in the embodiments of this application will be described in conjunction with the accompanying drawings.
[0064] Figure 3 This is a schematic diagram illustrating a blockchain-based points issuance method provided in an embodiment of this application. For example, Figure 3 The methods shown can be applied, but are not limited to, those described above. Figure 1 In the application scenarios shown, Figure 3 The method shown is applied to the above. Figure 1In the application scenarios shown, Figure 3 The described points issuing platform can be Figure 1 Client 110 is shown; Figure 3 The first user terminal described can be Figure 1 Client 120 is shown; Figure 3 The described blockchain network can be Figure 1 Blockchain node 130 is shown. (For example...) Figure 3 As shown, the blockchain-based points issuance methods include S301 to S305. Below, S301 to S305 will be described in detail.
[0065] In the introduction Figure 3 Before showing S301 to S305, the executing entity that performs the blockchain-based points issuance method described in the embodiments of this application is first introduced. See Figure 3 As shown, the execution entities involved in this application embodiment include a points issuing terminal, a first user terminal, and a blockchain node in the blockchain network. The users of the blockchain node include the first user terminal and the points issuing terminal, and the smart contract deployed in the blockchain node is a contract created at the request of the points issuing terminal. Optionally, before executing S301 to S305, the following steps may also be performed in this application embodiment: the points issuing terminal and the first user terminal register with the blockchain node to become users of the blockchain node; the points issuing terminal requests the creation of a smart contract from the blockchain node. Optionally, in some implementations, after the first user terminal and the points issuing terminal become users of the blockchain node, the blockchain node will also record the accounts of the first user terminal and the points issuing terminal. The account of the first user terminal may at least include the account address and account balance of the first user terminal, where the account address represents the address of the first user terminal located in the blockchain node; the account of the points issuing terminal may at least include the account address and account balance of the points issuing terminal, where the account address represents the address of the points issuing terminal located in the blockchain node.
[0066] The number of blockchain nodes included in the aforementioned blockchain network, as well as the type of blockchain network, are not specifically limited. For example, the aforementioned blockchain network could be... Figure 1 The illustrated blockchain network 130 includes any one of nodes 1 through 6, meaning any one of nodes 1 through 6 possesses the functions of a blockchain node. For example, the blockchain network can be a public blockchain or a consortium blockchain. The first user terminal and the points issuing terminal can be any type of electronic device; for example, the first user terminal or the points issuing terminal can be, but is not limited to, any of the following devices: personal computer, smartphone, tablet computer, or server, etc.
[0067] The following describes, with examples, the steps of a points-issuing end requesting the creation of a smart contract on a blockchain node, and the blockchain node creating the smart contract on the blockchain node according to the request. The blockchain node can be any blockchain node in the blockchain network. In some implementations, the points-issuing end's request to create a smart contract on a blockchain node may include the following steps: sending a creation request to the blockchain node, so that the blockchain node creates the smart contract according to the request; wherein the creation request includes the address information of the points-issuing end and the contract code of the smart contract, the contract code being used to execute the points-issuing logic. Accordingly, after receiving the above-mentioned creation request, each node in the blockchain network can create a smart contract according to the creation request. Optionally, in some implementations, the blockchain node may perform the following operations to create a smart contract: receiving a creation request for a smart contract sent by the points-issuing end; wherein the creation request includes the address information of the points-issuing end and the contract code of the smart contract, the contract code being used to execute the points-issuing logic; and deploying the smart contract on the blockchain node according to the creation request. In the above implementations, the address information of the points-issuing end serves as the source address information for creating the aforementioned smart contract. Optionally, in some implementations, after a blockchain node creates the aforementioned smart contract, the blockchain node will also record the smart contract's contract account. The smart contract's contract account may include: the smart contract's contract code, the contract account's address, and the contract account's balance. In some implementations, the address information of the points issuing end represents the account address of the points issuing end's account, where the account address of the points issuing end's account is the account address recorded in the blockchain node. In some implementations, the smart contract's contract code is bytecode.
[0068] Below, on Figure 3 The S301 to S305 shown are described in detail.
[0069] S301, The points issuing terminal generates signature information for the points issuing terminal, wherein the signature information represents the points issuing information of the points issuing terminal for the first user terminal.
[0070] The signature information of the points issuing terminal represents the points issuance information issued by the points issuing terminal to the first user terminal. In some implementations, the signature information specifically includes the points issuance information and the corresponding signature information, wherein the signature information corresponding to the points issuance information is obtained by the points issuing terminal digitally signing the points issuance information using its own private key. Optionally, in some implementations, the signature information of the points issuing terminal may only include the points issuance information.
[0071] The points issuance information is used to indicate the issuance of points by the points issuing end to the first user end. The points issuance information does not specifically limit the points issuance by the points issuing end to the first user end and can be set according to the points issuance needs of the points issuing end. Below, an example of the points issuance information provided in this application embodiment is described. In some implementations, the blockchain node records the account of the first user end; the points issuance information includes: a preset number of points to be issued and the account of the first user end; the signature information specifically includes: the points issuance information and the signature data corresponding to the points issuance information, wherein the signature data is a digital signature generated by the points issuing end using its private key for the points issuance information; the payment information specifically includes: a preset number of fees paid by the account of the first user end to the blockchain node. The source of the preset number of points to be issued is not specifically limited. For example, the preset number of points to be issued may be points in an account recorded in the blockchain, such as, but not limited to, the account of the points issuing end. Another example is that the preset number of points to be issued may be points generated by the points issuance logic in a smart contract based on a transaction request; in this method, the points to be issued are generated by the points issuance logic in the smart contract. The preset quantity is not limited and can be set according to the points issuance needs of the points issuing terminal. For example, the preset quantity of points to be issued can be 5 points. Optionally, in some implementations, the points issuance information also includes the expiration time of the points issuance transaction, wherein the expiration time of the points issuance transaction indicates that the preset quantity of points to be issued will be issued to the first user terminal within the expiration time of the points issuance transaction. The expiration time of the points issuance transaction is not specifically limited and can be set according to the actual points issuance needs. For example, the expiration time of the points issuance transaction can represent a preset time period, or the expiration time of the points issuance transaction can also represent a specific point in time. Based on the two specific implementations of the points issuance information, optionally, before executing S301, the points issuing terminal can also interact with the blockchain node to obtain the account of the first user terminal from the blockchain node.
[0072] In this embodiment, the implementation method of "generating signature information of the points issuing terminal" described in S301 above is not specifically limited. For example, the following describes a method for generating signature information of the points issuing terminal, taking the example that the signature information of the points issuing terminal includes points issuance information and the signature data corresponding to the points issuance information. The generation of signature information of the points issuing terminal includes: the points issuing terminal performing hash processing on the points issuance information to obtain digest information 1; the points issuing terminal using its private key and employing an asymmetric encryption algorithm to encrypt digest information 1 to obtain the signature data corresponding to the points issuance information; and the points issuing terminal packaging the points issuance information and the signature data corresponding to the points issuance information to generate the signature information of the points issuing terminal. The hash processing described above can also employ a hash algorithm, and the hash algorithm is not specifically limited. For example, the hash algorithm can be, but is not limited to, a secure hash algorithm (SHA). It is understandable that the private key and public key of the points issuing terminal are a public-private key pair. That is, information encrypted using the points issuing terminal's private key can be decrypted using the points issuing terminal's public key, and vice versa. The points issuing terminal's private key is owned by the points issuing terminal itself, while its public key is a public key.
[0073] The triggering condition for the points issuing terminal to generate the signature information of the points sending terminal is not specifically limited and can be determined according to actual needs. For example, the triggering condition could be that the points issuing terminal determines that it needs to issue points to the first user terminal; that is, when the points issuing terminal determines that it needs to issue points to the first user terminal, the points issuing terminal executes the above-described S301. Alternatively, the points issuing terminal can send its signature information according to a preset period so that the user terminal can obtain the signature information. The points issuing terminal can be any type of electronic device, such as, but not limited to, a personal computer, smartphone, tablet computer, or server.
[0074] S302, the points issuing terminal sends its signature information, causing the first user terminal to send a transaction request to the blockchain node to invoke the smart contract based on the obtained signature information. This allows the blockchain node to invoke the points issuance logic within the smart contract to issue points to the first user terminal based on the points issuance information. Correspondingly, the first user terminal obtains the signature information from the points issuing terminal.
[0075] The specific method by which the points issuing terminal sends its signature information to the first user terminal, enabling the first user terminal to obtain this signature information, is not detailed here. In other words, the points issuing terminal can send its signature information in any way possible so that the first user terminal can access it. For example, the points issuing terminal can directly send its signature information to the first user terminal. Alternatively, the points issuing terminal can publish its signature information to a third-party platform (e.g., a webpage or application), and the first user terminal can obtain the signature information by accessing that third-party platform. It should be noted that... Figure 3 The S302 shown is for illustrative purposes only. It describes an implementation method where the signature information of the points issuing terminal is published to a third-party platform so that the first user terminal can obtain the signature information. Figure 3 No third-party platforms are shown in the text.
[0076] Executing S302 above means that the points issuing terminal can successfully send the signature information generated by the points issuing terminal to the first user terminal, and the first user terminal will receive the signature information from the points issuing terminal.
[0077] S303, the first user terminal generates a transaction request to invoke the smart contract based on the signature information of the points issuing terminal and the payment information of the first user terminal.
[0078] The transaction request to invoke the smart contract includes signature information from the points issuing end and payment information from the first user end; the payment information indicates that the first user end pays a preset amount of fees to the blockchain node. In some implementations, the blockchain node records the first user's account, and the payment information specifically includes: the preset amount of fees paid by the first user end's account to the blockchain node. The type of the preset amount of fees paid by the first user end is not specifically limited. In some implementations, the preset amount of fees is a preset amount of gasoline. The preset amount of fees is not specifically limited; for example, the preset amount of fees could be 1 Ethereum. Optionally, in some implementations, the transaction request to invoke the smart contract may further include: the address information of the first user end as the source address of the transaction request, and the contract address of the smart contract as the destination address of the transaction request.
[0079] The implementation method of "the first user terminal generating a transaction request to invoke the smart contract based on the signature information of the points issuing terminal and the payment information of the first user terminal" is not specifically limited. For example, the first user terminal generating a transaction request to invoke the smart contract based on the signature information of the points issuing terminal and the payment information of the first user terminal includes: the first user terminal packaging the signature information of the points issuing terminal and the payment information of the first user terminal to generate a transaction request to invoke the smart contract.
[0080] After executing S303 above, the transaction request that calls the smart contract includes the signature information of the points issuing end and the payment information of the first user end. The signature information of the points issuing end indicates the points issuance information of the points issuing end for the first user end, and the payment information indicates the amount of fees paid by the first user end to the blockchain node.
[0081] S304, the first user client sends a transaction request to a blockchain node in the blockchain network to invoke a smart contract. This causes the blockchain node to invoke the points issuance logic within the smart contract, based on the points issuance information, to issue points to the first user client. Correspondingly, the blockchain node receives the smart contract invocation request from the first user client.
[0082] The method by which the first user client sends a transaction request to invoke a smart contract to a blockchain node in the blockchain network is not specifically limited. For example, the first user client could send the transaction request to invoke a smart contract to one blockchain node in the blockchain network; after receiving the transaction request, that blockchain node would forward the transaction request to other blockchain nodes in the blockchain network. Alternatively, the first user client could send the transaction request to invoke a smart contract to each block node included in the blockchain network.
[0083] S305, in the blockchain network, the blockchain node calls the points issuance logic in the smart contract according to the transaction request and issues points to the first user based on the points issuance information.
[0084] In this embodiment of the application, according to the transaction request, invoking the points issuance logic in the smart contract to issue points to the first user terminal based on the points issuance information includes:
[0085] If the predetermined amount of payment meets the predetermined payment requirements of the blockchain node, and the signature information passes the validity verification, points are issued to the first user terminal according to the points issuance information. The validity verification of the signature information indicates that the signer of the signature information is the points issuing terminal. In the above implementation, if it is determined that the payment fee corresponding to the payment information of the first user terminal in the transaction request sent by the first user terminal meets the payment requirements of the blockchain node, and the signature information passes the validity verification, the blockchain node will trigger the points issuance logic in the smart contract to issue points to the first user terminal based on the points issuance information represented by the signature information. In other words, if it is determined that the payment fee of the first user terminal in the transaction request sent by the first user terminal does not meet the payment requirements of the blockchain node, or the signature information fails the validity verification, the blockchain node will not call the points issuance logic in the smart contract to issue points to the first user terminal based on the points issuance information according to the transaction request. The predetermined amount of payment meets the payment requirements of the blockchain node, that is, the predetermined amount of payment is not less than the payment required by the predetermined payment requirements of the blockchain node. The aforementioned signature information, after passing legality verification, indicates that the signer of the signature information is the points issuing end, meaning that the points issuance information represented by the aforementioned signature information was generated by the points issuing end. In other words, the aforementioned signature information was not tampered with during transmission, and the signature information is authentic and reliable.
[0086] The following describes a method for "determining that signature information passes the legality verification" provided in an embodiment of this application. Optionally, in some implementations, the aforementioned signature information specifically includes: points issuance information and signature data corresponding to the points issuance information, wherein the signature data is a digital signature generated by the points issuing end using its private key for the points issuance information; before triggering the points issuance logic in the smart contract based on the signature information, the method further includes: calling the points issuance logic in the smart contract, using the public key published by the points issuing end to perform legality verification on the points issuance information and the signature data corresponding to the points issuance information, and determining that the signature information passes the legality verification, wherein the private key and the public key are a public-private key pair. Calling the points issuance logic in the smart contract, using the public key published by the points issuing end to perform legality verification on the points issuance information and the signature data corresponding to the points issuance information, and determining that the signature information passes the legality verification, may include the following steps: calling the points issuance logic in the smart contract to decrypt the signature data corresponding to the points issuance information using the public key published by the points issuing end, obtaining a digest of the signature information; if the content indicated by the digest of the signature information is consistent with the content indicated by the points issuance information, determining that the signature information passes the legality verification. It should be noted that the methods provided in this application for generating signature information for the points issuance terminal based on points issuance information and for verifying the legality of such signature information are merely illustrative and do not constitute any limitation. In other words, other methods for generating digital signatures can also be used to generate signature information corresponding to the points issuance information, and other methods for verifying the legality of digital signatures can also be used to verify the signature information corresponding to the points issuance information.
[0087] Optionally, in some implementations, the blockchain node records the account of the first user; the points issuance information includes: a preset number of points to be issued and the account of the first user; the signature information specifically includes: points issuance information and signature data corresponding to the points issuance information, wherein the signature data is a digital signature generated by the points issuer using its private key for the points issuance information; the payment information specifically includes: a preset number of fees paid by the first user's account to the blockchain node. Based on the above implementation, if it is determined that the preset number of fees meets the preset payment requirements corresponding to the blockchain node, and the signature information passes the legality verification, points are issued to the first user according to the points issuance information, including: issuing the preset number of points to be issued to the account of the first user. In the above implementation, if it is determined that the preset number of fees paid by the first user to the blockchain node meets the payment requirements corresponding to the blockchain node, and the signature information passes the legality verification, the purpose of issuing the preset number of points to be issued as indicated by the points issuance information to the account of the first user can be achieved.
[0088] Optionally, in other implementations, the aforementioned signature information also includes a first count value corresponding to the first user's account. This first count value represents the transaction sequence number for the first user's account calling the points issuance logic in the smart contract to execute points issuance. Before issuing a preset number of points to be issued to the first user's account, the method further includes: determining that the smart contract's contract account records the first count value, wherein the blockchain node also records the contract account; and updating the first count value recorded in the smart contract's contract account to a second count value, wherein the second count value and the first count value are equal to a preset threshold. In the above implementation, before issuing a preset number of points to be issued to the first user's account, the first count value corresponding to the first client recorded in the smart contract is first updated to a second data value. This implementation effectively prevents the smart contract from repeatedly executing the transaction requested by the transaction request, thus effectively preventing reentrancy attacks. The second count value is different from the first count value, meaning the preset threshold is non-zero. No specific limitations are placed on the values of the second count value, the first count value, and the preset threshold. The aforementioned first count value represents the transaction sequence number for the first user's account to invoke the points issuance logic in the smart contract to execute points issuance. For example, if the first user's account has never invoked the points issuance logic in the smart contract to execute points issuance at any time before the current moment, then the aforementioned first count value can be equal to zero. When the aforementioned second count value is equal to 1, the preset threshold is equal to 1. Optionally, the aforementioned preset threshold can also be equal to other natural numbers, such as 2 or 3.
[0089] Optionally, in other implementations, the aforementioned points issuance information also includes the expiration time of the points issuance transaction. The expiration time indicates that a preset number of points will be issued to the first user within the expiration time of the points issuance transaction. Before issuing the preset number of points to the first user's account, the method further includes: determining that the current time has not exceeded the expiration time of the points issuance transaction. In the above implementation, the points issuance information also specifies the expiration time of the points issuance transaction. The blockchain node should perform the following operations before the expiration time of the points issuance transaction: call the points issuance logic in the smart contract, or trigger the points issuance logic based on the transaction request. It is understood that if the current time exceeds the expiration time of the points issuance transaction, the signature information of the points issuing end will be expired, meaning that the points issuance process cannot be triggered by the points issuance logic in the smart contract based on the expired signature information. Based on this, if the signature information on the points issuing end expires, the points issuing end can also generate new signature information. The new signature information may include new points issuance information for the points issuing end to the first user end. The new points issuance information may include the aforementioned preset number of points to be issued, the account of the first user end, and the expiration time of the new points issuance transaction, and the current time has not exceeded the expiration time of the new points issuance transaction; and send the new signature information to the first user end.
[0090] In this embodiment, the source of the preset number of points to be issued is not specifically limited. The following describes the implementation of "issuing the preset number of points to be issued to the account of the first user terminal" in conjunction with the source of the preset number of points to be issued. In some implementations, the preset number of points to be issued is the points generated by the points issuance logic in the smart contract according to the transaction request. Before issuing the preset number of points to be issued to the account of the first user terminal, the method further includes: generating the preset number of points to be issued. In this implementation, the preset number of points to be issued is generated by the points issuance logic in the smart contract. Specifically, when issuing points, the points generated by the smart contract are transferred to the account of the first user terminal to achieve the purpose of issuing the preset number of points to the first user terminal. Optionally, in other implementations, the preset number of points to be issued is the points in the account recorded in the blockchain node. Issuing the preset number of points to be issued to the account of the first user terminal includes: transferring the preset number of points to be issued recorded in the account in the blockchain node to the account of the first user terminal. In this implementation, the preset number of points to be issued are the points in the account recorded in the blockchain. When issuing points, the points in the account are transferred to the account of the first user terminal to achieve the purpose of issuing the preset number of points to be issued to the first user terminal.
[0091] It should be understood that the above Figure 3 The described blockchain-based points issuance method is for illustrative purposes only and does not constitute any limitation on the blockchain-based points issuance method provided in this application. For example, other smart contracts besides the aforementioned smart contracts can also be deployed in the blockchain node, such as those used to execute auction processes. Furthermore, the blockchain node can also receive transaction requests from multiple first user clients, and correspondingly, the blockchain node can execute the points issuance method described in S301 to S305 for each transaction request sent by the multiple first user clients.
[0092] In this embodiment, the points issuing terminal deploys a smart contract corresponding to points issuance on a blockchain node in the blockchain network. The points issuing terminal can send its generated signature information so that the first user terminal can obtain the signature information. The signature information includes points issuance information from the points issuing terminal to the first user terminal. The first user terminal generates a transaction request to invoke the smart contract in the blockchain based on the obtained signature information. This transaction request includes the signature information of the points issuing terminal and payment information from the first user terminal, indicating that the first user terminal pays a preset amount of fees to the blockchain node. Subsequently, the first user terminal sends the transaction request to the blockchain node to invoke the smart contract in the blockchain, thereby invoking the deployed smart contract to execute the points issuance transaction requested in the smart contract invocation transaction request. In the above implementation, the first user client sends a transaction request to invoke the smart contract, carrying its payment information, to pay the blockchain node for the fees incurred by the blockchain node in executing the smart contract. The first user client also sends a transaction request to invoke the smart contract, carrying the signature information of the points issuing end, so that the blockchain node, based on the points issuing end's issuance needs, invokes the smart contract in the blockchain node to execute the points issuance logic and issue points to the first user client. In this implementation, the first user client pays the fees incurred by the points issuance to the blockchain node. That is, in this implementation, the points issuing end does not need to pay the blockchain node for the fees incurred by the points issuing end, thus saving the points issuing end's expenses. In summary, this method, while ensuring that points are issued to the user client according to the points issuing end's needs, eliminates the need for the points issuing end to pay the blockchain node for the fees incurred by the points issuing end, which helps save the points issuing end's expenses. In the implementation method where the points issuance information includes the first count value, the above blockchain-based points issuance method also prevents reentrancy attacks, avoids the blockchain node repeatedly invoking the smart contract to execute the corresponding points issuance process based on the transaction request, and also helps save the blockchain node's resources.
[0093] Below, in conjunction with Figure 4 This application introduces another blockchain-based points issuance method provided by its embodiments. It is understood that... Figure 4 The blockchain-based points issuance method described above is as follows. Figure 3 This is a concrete example of the described blockchain-based points issuance method. Specifically, Figure 4 The project party described is the above Figure 3 An example of the points issuing platform described. Figure 4 The user 1 described above Figure 3 An example of the first user terminal described. Figure 4 The blockchain described above Figure 3 An example of the described blockchain network, Figure 4 The described random number 1 takes the value 1 as described above. Figure 3 An example of the first count value described, and Figure 4 The value of the described random number 2 is equal to the value 2 mentioned above. Figure 3 An example of the second count value described.
[0094] Figure 4 This is a schematic diagram illustrating another blockchain-based points issuance method provided in an embodiment of this application. It should be understood that... Figure 4 The examples provided are merely to help those skilled in the art understand the embodiments of this application, and are not intended to limit the embodiments to the specific numerical values or specific scenarios illustrated. Those skilled in the art will understand based on the following... Figure 4 The examples clearly demonstrate that various equivalent modifications or variations can be made, and such modifications and variations also fall within the scope of the embodiments of this application. For example... Figure 4 As shown, this blockchain-based points issuance method includes S401 to S410. S401 to S410 are described in detail below.
[0095] S401, User 1 and the project team register with the blockchain respectively, obtaining User 1's Account 1 and the project team's Account 2.
[0096] Executing step S401 above, user 1 and the project team register with the blockchain, including: user 1 sending registration information 1 to the blockchain, wherein registration information 1 is used to instruct each node in the blockchain to allocate user 1's account 1; the project team sending registration information 2 to the blockchain, wherein registration information 2 is used to instruct each node in the blockchain to allocate project team's account 2; each node in the blockchain generates user 1's account 1 locally based on registration information 1; each node in the blockchain generates project team's account 2 locally based on registration information 2.
[0097] User 1's account 1 refers to the account 1 recorded in all the nodes of the blockchain. User 1's account 1 can record: User 1's account address and User 1's account content 1. Among them, the account content 1 can at least include the account balance 1, and there is no specific limitation on the account balance 1. For example, the account balance 1 can be equal to zero.
[0098] Project Party Account 2 refers to the project party's account recorded in each node of the blockchain. Project Party Account 2 can record: the project party's account address and the project party's account balance 2, where the account balance 2 represents the points held by the project party's account related to the target task.
[0099] In this embodiment, the blockchain includes at least two nodes. The number of nodes in the blockchain can be set according to actual needs and is not specifically limited. Optionally, the blockchain described in S401 may also include more data blockchain nodes. For example, the blockchain described in S401 may be the one described above. Figure 1 The illustrated blockchain network 130 consists of six nodes, designated as nodes 1 through 6. The type of blockchain is not specifically limited. For example, the blockchain described above could be a public blockchain or a consortium blockchain.
[0100] S402, the project team creates smart contract A in the blockchain and obtains contract account #1 of smart contract A.
[0101] Smart contract A defines points trading rules. These rules are used to transfer points corresponding to the amount issued in the project's account 2 (address information) to the target user's account (e.g., account 1) based on the target user's account address information, the project's account address information, and the points issued. The target user's account is the account obtained by the target user (e.g., user 1) after registration on the blockchain. In other words, the contract code in the contract account of smart contract A is used to implement the points issuance process described by the points trading rules. In some implementations, smart contract A can be a smart contract generated according to the ERC20 standard.
[0102] The implementation method of creating the aforementioned smart contract A in the blockchain is not specifically limited. For example, creating smart contract A in the blockchain can include the following steps: The project sends a transaction to the blockchain to create smart contract A. This transaction includes the address of the project's account 2, the contract code of smart contract A, and digital signature 1. The contract code of smart contract A is used to implement the aforementioned points transaction rules, and digital signature 1 is the result obtained by the project using the aforementioned private key to digitally sign the transaction of smart contract A. After receiving the transaction to create smart contract A, the nodes in the blockchain reach a consensus through a consensus mechanism, and successfully create smart contract A in the blockchain. After smart contract A is created, the nodes in the blockchain will record the contract account #1 corresponding to smart contract A, and contract account #1 has a specific address. The contract code of smart contract A will be stored in contract account #1. Contract account #1 may also include the account balance of smart contract A. The behavior of smart contract A is controlled by the corresponding contract code.
[0103] In this embodiment, the contract account #1 corresponding to smart contract A records a random number 1. The value of random number 1 represents the count of the number of times user 1's account address requests points issuance from smart contract A deployed in the blockchain. The value of this random number 1 is not specifically limited. For example, if user 1 has never called smart contract A deployed in the blockchain to trigger the points transaction rules in smart contract A to issue points to user 1's account 1, the value 1 is zero. Conversely, if user 1 has already called smart contract A once to trigger the points transaction rules in smart contract A to issue points to user 1's account 1, the value 1 is 1. It is understood that for each node in the blockchain, regarding the random number 1 corresponding to user 1's account 1, each node will prioritize executing the points issuance transaction indicated by the random number with the smallest value corresponding to each account 1. For example, if the smart contract A of a node deployed in the blockchain records transaction 1 when the value of random number 1 is 0, and transaction 2 when the value of random number 1 is 0, then the node will first execute transaction 1 when the value of random number 1 is 0, and then execute transaction 2 when the value of random number 1 is 1.
[0104] It should be noted that after deploying smart contract A on the blockchain, the blockchain can assign a corresponding public-private key pair to contract account #1 corresponding to smart contract A. That is, the administrator corresponding to contract account #1 (i.e., each node that deployed smart contract A) can hold this public-private key pair. The private key can be used to digitally sign transactions initiated by the administrator, and the public key can be used to verify the signature. The public key can be broadcast within the blockchain, and correspondingly, each node in the blockchain can receive the public key.
[0105] S403, the project team generates signature information 1 based on the points issuance information 1.
[0106] Points issuance information 1 includes: user 1's account 1, the points issuance quantity 1 corresponding to the target task, and the value of random number 1 equal to value 1. Signature information 1 indicates that the points associated with the points issuance quantity 1 corresponding to the target task in the project party's account 2 will be issued to user 1's account 1. Optionally, before executing the above S403, the project party can also access the blockchain node to obtain user 1's account address and random number 1 included in user 1's account.
[0107] Signature information 1 includes data to be signed 1 and signature data 1. Data to be signed 1 is points issuance information 1, and signature data 1 is the result obtained by the project team digitally signing points issuance information 1 using their own private key. It can be understood that signature data 1 is obtained by encryption using the project team's own private key, and this signature data 1 can be decrypted using the project team's publicly disclosed public key to obtain data to be signed 1. The project team's own private key and the project team's publicly disclosed public key form a public-private key pair.
[0108] The specific implementation method for the project party to generate signature information 1 based on points issuance information 1 is not limited. In some implementation methods, the project party generates signature information 1 based on points issuance information 1, including: the project party hashes the data to be signed 1 (i.e., points issuance information 1) to obtain a digest of the data to be signed 1; the project party uses its own private key and an asymmetric encryption algorithm to encrypt the digest of the data to be signed 1 to obtain digital signature 1; the project party packages the data to be signed 1 and digital signature 1 to generate signature information 1.
[0109] Optionally, in other implementations, the aforementioned points issuance information 1 may further include points redemption time information, wherein the points redemption time information is used to instruct the target user to redeem the points indicated by the points issuance information 1 within a preset time period. That is, if the current time exceeds the time indicated by the points redemption time information, the aforementioned signature information 1 is invalid, meaning that at the current time, the invalid signature information 1 cannot successfully invoke smart contract A to execute the points transaction rules defined in smart contract A.
[0110] In this embodiment, the triggering condition for the project party to execute S403 is not specifically limited. For example, the points issuance information 1 is points associated with the target task; that is, the triggering condition could be that the target user completes the target task. In this implementation, executing S403, i.e., in response to the target user completing the target task, causes the project party to generate signature information 1 based on the points issuance information 1. For example, the project party can also generate signature information 1 based on the points issuance information 1 according to a preset period. In this implementation, it is not necessary to require the target user to execute the target task.
[0111] S404, the project team sends signature information 1 to user 1. Correspondingly, user 1 receives signature information 1 sent by the project team.
[0112] The specific implementation method for the project team to send signature information 1 to user 1 is not limited. For example, Figure 4 This illustrates the process where the project team directly sends signature information 1 to user 1. Optionally, in other implementations, the project team can also publish the generated signature information 1 to a third-party platform, and user 1 can periodically access the third-party platform to obtain signature information 1.
[0113] S405, User 1 generates call request 1 based on signature information 1. Call request 1 is used to request the execution of the points issuance step corresponding to the points transaction rules by calling smart contract A in the blockchain. Call request 1 includes User 1's account address, smart contract A's contract address, and signature information 1 sent by the project party.
[0114] The process involves User 1 generating a call request 1 based on signature information 1. This includes: User 1 parsing signature information 1 to obtain call request 1; User 1 verifying signature information 1 using the project's publicly available public key, confirming that signature information 1 has passed verification, and obtaining signature data 1 included in signature information 1 and the number of points issued corresponding to the target task included in the data to be signed 1; User 1 packaging signature data 1 and the number of points issued corresponding to the target task 1 to generate the call request. It can be understood that when User 1 confirms that signature information 1 has passed verification, that is, User 1 can determine that signature information 1 was sent by the project and that the data included in signature information 1 has not been tampered with by any other third party during transmission, meaning that signature information 1 is authentic and trustworthy.
[0115] Optionally, in some implementations, when each node in the blockchain executes a transaction sent by a user to invoke a smart contract within that node, the user needs to pay a certain GAS fee to each node so that each node can successfully trigger the smart contract to execute the process corresponding to the transaction based on the transaction sent by the user. In this implementation, the invocation request 1 described in S405 above further includes: GAS fee payment information, wherein the GAS fee payment information indicates that user 1 pays a certain GAS fee to the blockchain so that each node in the blockchain deploying smart contract A triggers smart contract A to execute the points transaction rules in smart contract A according to invocation request 1.
[0116] S406, User 1 sends Invocation Request 1 to the blockchain to invoke smart contract A in the blockchain to execute the points transaction rules in smart contract A. Correspondingly, each node in the blockchain receives Invocation Request 1 sent by User 1.
[0117] S407, the smart contract A in each node of the blockchain verifies call request 1 to determine whether call request 1 passes the verification.
[0118] In this embodiment of the application, the process of executing S407 described above is related to the content of the points issuance information 1. Below, we will introduce one implementation method (i.e., implementation method one) of executing S407 provided by this embodiment of the application, in conjunction with the points issuance information 1 described in implementation method one below, and another implementation method (i.e., implementation method two) of executing S407 provided by this embodiment of the application, in conjunction with the points issuance information 1 described in implementation method two below.
[0119] Implementation method 1:
[0120] In implementation method one, the points issuance information 1 includes: user 1's account 1, the number of points issued for the target task 1, and the value of the random number 1.
[0121] In this implementation, executing S407 above, i.e., the smart contract A in each node of the blockchain verifies call request 1 to determine whether call request 1 passes verification, includes: each node parses call request 1 to obtain data to be signed 1, signature data 1, and user 1's account address; each node uses the public key published by the project to decrypt signature data 1 to obtain the digest information of signature data 1, wherein the digest information of signature data 1 indicates the following: user 1's account address, and the value of random number 1 equals the value 1; each node determines that the user 1's account address indicated by the digest information of signature data 1 is the same account as the user 1's account address included in call request 1; and the value of random number 1 indicated by the digest information of signature data 1 is the same as the value of random number 1 recorded in contract account #1 of smart contract A recorded by each node, then call request 1 is determined to pass verification.
[0122] Implementation Method Two:
[0123] In implementation method two, the points issuance information 1 includes: user 1's account 1, the number of points issued for the target task 1, the points collection time information, and the value of random number 1 equal to value 1.
[0124] In this implementation, S407 is executed, where smart contract A in each node of the blockchain verifies call request 1 to determine whether it passes verification. This includes: each node parsing call request 1 to obtain data to be signed 1, signature data 1, and user 1's account address; each node decrypting signature data 1 using the project's public key to obtain a digest of signature data 1, where the digest of signature data 1 indicates the following: preset collection time information, user 1's account address, and the value of random number 1 equal to 1; each node determining that the user 1's account address indicated by the digest of signature data 1 is the same account as the user 1's account address included in call request 1; determining that the value of random number 1 indicated by the digest of signature data 1 is the same as the value of random number 1 recorded in contract account #1 of smart contract A recorded by each node; and determining that the current time has not exceeded the time period indicated by the preset collection time information, thus confirming that call request 1 passes verification.
[0125] In this embodiment of the application, after executing S407, if it is determined that the call request 1 has passed the verification, S408 is executed; or, after executing S407, if it is determined that the call request 1 has failed the verification, S410 is executed.
[0126] S408, each node in the blockchain updates the value of the random number 1 recorded in contract account #1 of smart contract A from value 1 to value 2, where the difference between value 2 and value 1 is equal to 1.
[0127] After executing S408 above, each node in the blockchain updates the value of random number 1 recorded in contract account #1 of smart contract A from value 1 to value 2. The difference between value 2 and value 1 is equal to 1. That is, after executing S408, the value of random number 1 recorded in contract account #1 of smart contract A is increased by 1. In other words, after executing S408, the value of random number 1 recorded in contract account #1 of smart contract A by each node in the blockchain is equal to value 2. The purpose of executing S408 is to prevent reentrancy attacks, i.e., to prevent smart contract A from repeatedly executing the points issuance process requested by call request 1. For example, when the value of random number 1 recorded in the points issuance information 1 described in S403 above is equal to value 1, and value 1 is equal to zero, after executing S408, the value of random number 1 is equal to 1.
[0128] S409, each node in the blockchain executes the points transaction rules in smart contract A, and issues the points issuance quantity 1 corresponding to the target task requested by call request 1 to user 1's account.
[0129] Executing S409 above, i.e., smart contract A in the blockchain will issue the points issuance quantity 1 corresponding to the target task requested by call request 1 to user 1's account, including: reducing the number of points associated with the target task recorded in the project party's account 2 by the number of points issued by points issuance quantity 1, and transferring the reduced number of points in the project party's account 2 to user 1's account, so that the number of points associated with the target task recorded in user 1's account increases by the number of points issued by points issuance quantity 1.
[0130] Understandably, after executing S409 above, the number of points associated with the target task recorded in the project's account 2 decreases by the number of points indicated by the points issuance quantity 1, and the number of points associated with the target task recorded in the user's account increases by the number of points indicated by the points issuance quantity 1.
[0131] S410, no node in the blockchain issues the points requested by call request 1 to user 1.
[0132] After executing S407 above, execute S410 above, that is, if call request 1 fails to pass verification, the nodes in the blockchain will not issue the points requested by call request 1 to user 1.
[0133] It should be understood that the above Figure 4 The blockchain-based points issuance method illustrated is merely illustrative and does not constitute any limitation on the blockchain-based points issuance method provided in this application. For example, the above... Figure 4The described blockchain-based points issuance method is illustrated using the example of points in the project's account recorded in the blockchain, where the points issuance quantity of 1 indicates points in total. Optionally, the points indicated by the aforementioned points issuance quantity of 1 can also be points generated by smart contract A according to points transaction rules. In this implementation, the points transaction rules defined in smart contract A are also used to generate the number of points indicated by points issuance quantity of 1.
[0134] In this embodiment, the project team deploys a smart contract A corresponding to points issuance in the blockchain. The project team can also send signature information to user 1 (i.e., the project team sends signature information off-chain), where signature information 1 includes the points issuance request issued by the project team to user 1 (i.e., points issuance information 1). User 1 generates a call request 1 to invoke smart contract A in the blockchain based on the signature information 1 sent by the project team. That is, user 1's call request 1 to invoke smart contract A created by the project team in the blockchain carries the signature information 1 sent by the project team. Subsequently, user 1 invokes smart contract A in the blockchain to execute the points issuance transaction requested by call request 1. During the process of user 1 invoking smart contract A deployed in the blockchain, if it is necessary to pay gasoline fees to various nodes in the blockchain, user 1 will pay gasoline fees to each node when invoking smart contract A deployed in each node in the blockchain to execute the points issuance transaction requested by call request 1. In the above implementation process, user 1 pays the gasoline cost consumed by issuing points to each node in the blockchain. That is, the project does not need to pay the gasoline cost consumed by issuing points to each node in the blockchain. This method can save the project party the gasoline cost.
[0135] The above, combined with Figures 1 to 4 This paper details the application scenarios and methods for implementing the blockchain-based points issuance method provided in this application. The following section will combine... Figures 5 to 7 This application introduces a blockchain-based points issuance device, a blockchain-based points issuance system, and an electronic device. It should be understood that the blockchain-based points issuance method described above corresponds to the blockchain-based points issuance device, blockchain-based points issuance system, and electronic device described below. Any content not described in detail below can be found in the relevant descriptions in the above method embodiments.
[0136] Figure 5 This is a schematic diagram of the structure of a blockchain-based points issuance device provided in an embodiment of this application. Figure 5 As shown, the device includes a transceiver unit 501 and a processing unit 501.
[0137] Implementation method one,
[0138] In implementation method one, Figure 5 The illustrated blockchain-based points issuance device is applied to a blockchain node in a blockchain network. The users of the blockchain node include a first user terminal and a points issuance terminal. The smart contract deployed in the blockchain node is a contract created at the request of the points issuance terminal. The functions of the transceiver unit 501 and the processing unit 502 in this implementation are described below.
[0139] The transceiver unit 501 is configured to: receive a transaction request sent by the first user terminal to invoke the smart contract, wherein the transaction request includes signature information of the points issuing terminal and payment information of the first user terminal, the signature information representing points issuance information of the points issuing terminal for the first user terminal; the payment information representing a preset amount of fees paid by the first user terminal to the blockchain node; and the processing unit 502 is configured to: invoke the points issuance logic in the smart contract according to the transaction request to issue points for the first user terminal according to the points issuance information.
[0140] Implementation method two
[0141] In implementation method two, Figure 5 The blockchain-based points issuance device shown is applied to the points issuance terminal. The functions of the transceiver unit 501 and the processing unit 502 in this implementation are described below.
[0142] The processing unit 502 is configured to: generate signature information of the points issuing terminal, wherein the signature information represents points issuance information of the points issuing terminal for the first user terminal; the transceiver unit 501 is configured to: send the signature information of the points issuing terminal, so that the first user terminal sends a transaction request to the blockchain node to invoke the smart contract according to the obtained signature information of the points issuing terminal, so that the blockchain node invokes the points issuance logic in the smart contract to issue points for the first user terminal according to the points issuance information; wherein the transaction request includes the signature information of the points issuing terminal and the payment information of the first user terminal, the payment information represents a preset amount of fee paid by the first user terminal to the blockchain node, the smart contract is a contract created in the blockchain node at the request of the points issuing terminal, and the users of the blockchain node include the first user terminal and the points issuing terminal.
[0143] Implementation method three
[0144] In implementation method three, Figure 5The blockchain-based points issuance device shown is applied to the first user terminal. The functions of the transceiver unit 501 and the processing unit 502 in this implementation are described below.
[0145] The transceiver unit 501 is configured to: acquire signature information from the points issuing terminal, wherein the signature information represents points issuance information issued by the points issuing terminal for the first user terminal; the processing unit 502 is configured to: generate a transaction request to invoke a smart contract based on the signature information from the points issuing terminal and the payment information from the first user terminal, wherein the transaction request includes the signature information from the points issuing terminal and the payment information from the first user terminal; the payment information represents a preset amount of fees paid by the first user terminal to the blockchain node; the smart contract is a contract created in the blockchain node at the request of the points issuing terminal; the users of the blockchain node include the first user terminal and the points issuing terminal; the transceiver unit 501 is further configured to: send the transaction request to invoke the smart contract to the blockchain node, so that the blockchain node, based on the transaction request, invokes the points issuance logic in the smart contract to issue points for the first user terminal based on the points issuance information.
[0146] Figure 6 This is a schematic diagram of the structure of a blockchain-based points issuance system provided in an embodiment of this application. Figure 6 As shown, the system includes an points issuing terminal 601, a blockchain node 602 in the blockchain network, and a first user terminal 603.
[0147] Specifically, the points issuing terminal 601 is used to execute the various steps executed by the points issuing terminal or the project party in the blockchain-based points issuing method described above; the blockchain node 602 in the blockchain network is used to execute the various steps executed by the blockchain node in the blockchain-based points issuing method described above; and the first user terminal 603 is used to execute the various steps executed by the first user terminal or user 1 in the blockchain-based points issuing method described above. For details not elaborated here, please refer to the relevant descriptions above.
[0148] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. For example... Figure 7 As shown, it includes a memory 701, a processor 702, a communication interface 703, and a communication bus 704. The memory 701, processor 702, and communication interface 703 are interconnected via the communication bus 704.
[0149] The memory 701 may be a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 701 may store a program. When the program stored in the memory 701 is executed by the processor 702, the processor 702 and the communication interface 703 are used to execute the various steps of the blockchain-based points issuance method of this application embodiment.
[0150] The processor 702 may be a general-purpose central processing unit (CPU), microprocessor, application-specific integrated circuit (ASIC), graphics processing unit (GPU), or one or more integrated circuits, used to execute relevant programs to achieve the functions required by the units in the blockchain-based points issuance device of this application embodiment, or to execute the various steps of the blockchain-based points issuance method of this application embodiment.
[0151] The processor 702 can also be an integrated circuit chip with signal processing capabilities. In implementation, each step of the blockchain-based points issuance method provided in this application can be completed by the integrated logic circuits in the hardware of the processor 702 or by instructions in software form. The aforementioned processor 702 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in the memory 701. The processor 702 reads the information in the memory 701 and, in conjunction with its hardware, performs the functions required by the units included in the blockchain-based points issuance device of this application embodiment, or executes the blockchain-based points issuance method of this application method embodiment.
[0152] The communication interface 703 uses a transceiver device, such as, but not limited to, a transceiver, to implement 7 Figure 7 The device shown communicates with other devices or communication networks.
[0153] Communication bus 704 may be included in Figure 7 The illustrated device shows a pathway for transmitting information between its various components (e.g., memory 701, processor 702, communication interface 703).
[0154] This application provides a computer-readable storage medium, which includes computer instructions. When executed by a processor, the computer instructions are used to implement any of the blockchain-based points issuance methods in this application.
[0155] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored on a computer-readable medium and includes several instructions to cause a computing device (which may be a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments disclosed in this application.
[0156] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0157] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0158] Computer-readable media include both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage media, or any other non-transferable media that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include non-transitory computer-readable media, such as modulated data signals and carrier waves.
[0159] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0160] Although this application discloses preferred embodiments as described above, it is not intended to limit this application. Any person skilled in the art can make possible changes and modifications without departing from the spirit and scope of this application. Therefore, the scope of protection of this application should be determined by the scope defined in the claims of this application.
Claims
1. A blockchain-based points issuance method, characterized in that, A blockchain node applied in a blockchain network, wherein the users of the blockchain node include a first user terminal and a points issuing terminal, and the smart contract deployed in the blockchain node is a contract requested by the points issuing terminal to be created in the blockchain node, the method comprising: The system receives a transaction request from the first user terminal to invoke the smart contract. The transaction request is sent by the first user terminal after obtaining the signature information of the points issuing terminal. The transaction request includes the signature information of the points issuing terminal and payment information from the first user terminal. The signature information indicates points issuance information from the points issuing terminal for the first user terminal. The points issuance information includes a preset number of points to be issued, the first user terminal's account, and a first count value corresponding to the first user terminal's account. The first count value indicates that the first user terminal's account invokes the points issuance logic in the smart contract to execute the points issuance transaction sequence number. The payment information indicates that the first user terminal's account pays a preset amount of fees to the blockchain node. According to the transaction request, the points issuance logic in the smart contract is invoked to issue points to the first user based on the points issuance information, including: Verify whether the preset amount of fees meets the preset payment requirements corresponding to the blockchain node; The signature information is validated to determine whether the signer who generated the signature information is the points issuing end. Verify whether the first count value of the first user account recorded in the smart contract is consistent with the first count value in the transaction request; After all the above verifications pass, the first count value corresponding to the first client recorded in the smart contract is updated to the second count value, and points are issued to the first user client according to the points issuance information.
2. The method according to claim 1, characterized in that, The signature information specifically includes: the points issuance information and the signature data corresponding to the points issuance information, wherein the signature data is a digital signature generated by the points issuing end using the private key of the points issuing end for the points issuance information; Before issuing points to the first user based on the points issuance information, the method further includes: The points issuance logic in the smart contract is invoked, and the public key published by the points issuance terminal is used to verify the legality of the points issuance information and the signature data corresponding to the points issuance information, and to determine that the signature information passes the legality verification. The private key and the public key are a public-private key pair.
3. The method according to claim 1, characterized in that, The blockchain node records the account of the first user terminal; The signature information specifically includes: the points issuance information and the signature data corresponding to the points issuance information, wherein the signature data is a digital signature generated by the points issuing end using the private key of the points issuing end for the points issuance information.
4. The method according to claim 3, characterized in that, Issuing points to the first user terminal based on the points issuance information includes: The preset number of points to be issued are issued to the account of the first user terminal.
5. The method according to claim 4, characterized in that, Before issuing a preset number of points to be issued to the account of the first user terminal, the method further includes: It is determined that the smart contract's contract account records the first count value, wherein the blockchain node also records the contract account; and, The first count value recorded in the smart contract's contract account is updated to a second count value, wherein the second count value and the first count value are equal to a preset threshold.
6. The method according to claim 4 or 5, characterized in that, The points issuance information also includes the expiration time of the points issuance transaction, wherein the expiration time of the points issuance transaction indicates that the preset number of points to be issued will be issued to the first user terminal within the expiration time of the points issuance transaction; Before issuing a preset number of points to the account of the first user terminal, the method further includes: It is determined that the current time has not exceeded the expiration time of the points issuance transaction.
7. The method according to claim 4 or 5, characterized in that, The preset number of points to be issued are the points generated by the points issuance logic in the smart contract based on the transaction request. Before issuing a preset number of points to the account of the first user terminal, the method further includes: Generate the preset number of points to be issued.
8. The method according to claim 4 or 5, characterized in that, The preset number of points to be issued are the points in the accounts recorded in the blockchain nodes. The step of issuing a preset number of points to be issued to the account of the first user terminal includes: The preset number of points to be issued, recorded in the account in the blockchain node, are transferred to the account of the first user terminal.
9. The method according to any one of claims 1, 2, 4, and 5, further comprising: The system receives a creation request from the points issuing terminal to create the smart contract; wherein the creation request includes the address information of the points issuing terminal and the contract code of the smart contract, and the contract code is used to execute the points issuing logic; The smart contract is deployed in the blockchain node according to the creation request.
10. The method according to any one of claims 1, 2, 4, and 5, wherein the preset amount of cost is the preset amount of gasoline cost.
11. A blockchain-based points issuance method, characterized in that, Applied to the points issuance terminal, the method includes: Generate signature information for the points issuing terminal, wherein the signature information represents points issuance information for the points issuing terminal to the first user terminal; the points issuance information includes a preset number of points to be issued, the account of the first user terminal, and a first count value corresponding to the account of the first user terminal, wherein the first count value represents the transaction sequence number for the first user terminal to call the points issuance logic in the smart contract to execute the points issuance. The signature information of the points issuing terminal is sent, causing the first user terminal to send a transaction request to the blockchain node to invoke the smart contract based on the obtained signature information of the points issuing terminal. This allows the blockchain node to invoke the points issuance logic within the smart contract to issue points to the first user terminal based on the points issuance information. The transaction request is a request sent by the first user terminal after obtaining the signature information of the points issuing terminal. The transaction request includes the signature information of the points issuing terminal and the payment information of the first user terminal. The payment information indicates that the first user terminal's account pays a preset amount of fees to the blockchain node. The smart contract is a contract that the points issuing terminal requests to be created in the blockchain node. The users of the blockchain node include both the first user terminal and the points issuing terminal. The blockchain node, based on the transaction request, invokes the points issuance logic in the smart contract to issue points to the first user based on the points issuance information, including: Verify whether the preset amount of fees meets the preset payment requirements corresponding to the blockchain node; The signature information is validated to determine whether the signer who generated the signature information is the points issuing end. Verify whether the first count value of the first user account recorded in the smart contract is consistent with the first count value in the transaction request; After all the above verifications pass, the first count value corresponding to the first client recorded in the smart contract is updated to the second count value, and points are issued to the first user client according to the points issuance information.
12. The method according to claim 11, characterized in that, The blockchain node records the account of the first user terminal; The points issuance information includes: a preset number of points to be issued and the account of the first user terminal; The signature information specifically includes: the points issuance information and the signature data corresponding to the points issuance information, wherein the signature data is a digital signature generated by the points issuing end using the private key of the points issuing end for the points issuance information.
13. The method according to claim 12, characterized in that, The points issuance information also includes the expiration time of the points issuance transaction, wherein the expiration time of the points issuance transaction indicates that the preset number of points to be issued will be issued to the first user terminal within the expiration time of the points issuance transaction.
14. The method according to any one of claims 11 to 13, characterized in that, Before generating the signature information of the points issuing terminal, the method further includes: A creation request to create the smart contract is sent to the blockchain node, so that the blockchain node creates the smart contract according to the creation request; wherein, the creation request includes the address information of the points issuing terminal and the contract code of the smart contract, and the contract code is used to execute the points issuing logic.
15. The method according to any one of claims 11 to 13, wherein the preset amount of cost is a preset amount of gasoline cost.
16. A blockchain-based points issuance method, characterized in that, Applied to a first user terminal, the method includes: Obtain the signature information of the points issuing terminal, wherein the signature information represents the points issuance information of the points issuing terminal for the first user terminal; the points issuance information includes a preset number of points to be issued, the account of the first user terminal, and a first count value corresponding to the account of the first user terminal, wherein the first count value represents the transaction sequence number of the points issuance by the account of the first user terminal in calling the points issuance logic in the smart contract to execute the points issuance. Based on the signature information of the points issuing terminal and the payment information of the first user terminal, a transaction request to invoke the smart contract is generated. The transaction request is sent by the first user terminal after obtaining the signature information of the points issuing terminal. The transaction request includes the signature information of the points issuing terminal and the payment information of the first user terminal. The payment information indicates that the first user terminal's account pays a preset amount of fees to the blockchain node. The smart contract is a contract that the points issuing terminal requests to be created in the blockchain node. The users of the blockchain node include the first user terminal and the points issuing terminal. Sending a transaction request to the blockchain node to invoke the smart contract, so that the blockchain node, based on the transaction request, invokes the points issuance logic in the smart contract to issue points to the first user based on the points issuance information, including: Verify whether the preset amount of fees meets the preset payment requirements corresponding to the blockchain node; The signature information is validated to determine whether the signer who generated the signature information is the points issuing end. Verify whether the first count value of the first user account recorded in the smart contract is consistent with the first count value in the transaction request; After all the above verifications pass, the first count value corresponding to the first client recorded in the smart contract is updated to the second count value, and points are issued to the first user client according to the points issuance information.
17. The method according to claim 16, characterized in that, The blockchain node records the account of the first user terminal; The points issuance information includes: a preset number of points to be issued, and the account of the first user terminal; The signature information specifically includes: the points issuance information and the signature data corresponding to the points issuance information, wherein the signature data is a digital signature generated by the points issuing end using the private key of the points issuing end for the points issuance information.
18. The method according to claim 17, characterized in that, The points issuance information also includes the expiration time of the points issuance transaction, wherein the expiration time of the points issuance transaction indicates that the preset number of points to be issued will be issued to the first user terminal within the expiration time of the points issuance transaction.
19. The method according to any one of claims 16 to 18, wherein the preset amount of cost is a preset amount of gasoline cost.
20. A blockchain-based points issuance device, characterized in that, A blockchain node used in a blockchain network, wherein the users of the blockchain node include a first user terminal and a points issuing terminal, and the smart contract deployed in the blockchain node is a contract requested by the points issuing terminal to be created in the blockchain node, the device comprising: The transceiver unit is configured to: receive a transaction request sent by the first user terminal to invoke the smart contract, wherein the transaction request is a transaction request sent by the first user terminal after obtaining the signature information of the points issuing terminal to invoke the smart contract, the transaction request includes the signature information of the points issuing terminal and the payment information of the first user terminal, the signature information indicating points issuance information of the points issuing terminal for the first user terminal; the points issuance information includes a preset number of points to be issued, the account of the first user terminal, and a first count value corresponding to the account of the first user terminal, the first count value indicating that the account of the first user terminal invokes the points issuance logic in the smart contract to execute the points issuance transaction sequence number; the payment information indicates that the account of the first user terminal pays a preset amount of fees to the blockchain node. The processing unit is configured to: based on the transaction request, invoke the points issuance logic in the smart contract to issue points to the first user terminal according to the points issuance information, including: Verify whether the preset amount of fees meets the preset payment requirements corresponding to the blockchain node; The signature information is validated to determine whether the signer who generated the signature information is the points issuing end. Verify whether the first count value of the first user account recorded in the smart contract is consistent with the first count value in the transaction request; After all the above verifications pass, the first count value corresponding to the first client recorded in the smart contract is updated to the second count value, and points are issued to the first user client according to the points issuance information.
21. A blockchain-based points issuance device, characterized in that, The device, applied to the points issuance terminal, includes: The processing unit is configured to: generate signature information of the points issuing terminal, wherein the signature information represents points issuance information of the points issuing terminal for the first user terminal; the points issuance information includes a preset number of points to be issued, the account of the first user terminal, and a first count value corresponding to the account of the first user terminal, wherein the first count value represents the transaction sequence number of the points issuance logic in the smart contract called by the account of the first user terminal to execute the points issuance. The transceiver unit is configured to: send the signature information of the points issuing terminal, so that the first user terminal sends a transaction request to the blockchain node to invoke the smart contract based on the obtained signature information of the points issuing terminal, so that the blockchain node invokes the points issuance logic in the smart contract to issue points to the first user terminal based on the points issuance information according to the transaction request; wherein, the transaction request is a transaction request to invoke the smart contract sent by the first user terminal after obtaining the signature information of the points issuing terminal, the transaction request includes the signature information of the points issuing terminal and the payment information of the first user terminal, the payment information indicates that the account of the first user terminal pays a preset amount of fees to the blockchain node, the smart contract is a contract that the points issuing terminal requests to create in the blockchain node, and the users of the blockchain node include the first user terminal and the points issuing terminal; The blockchain node, based on the transaction request, invokes the points issuance logic in the smart contract to issue points to the first user based on the points issuance information, including: Verify whether the preset amount of fees meets the preset payment requirements corresponding to the blockchain node; The signature information is validated to determine whether the signer who generated the signature information is the points issuing end. Verify whether the first count value of the first user account recorded in the smart contract is consistent with the first count value in the transaction request; After all the above verifications pass, the first count value corresponding to the first client recorded in the smart contract is updated to the second count value, and points are issued to the first user client according to the points issuance information.
22. A blockchain-based points issuance device, characterized in that, Applied to a first user terminal, the device includes: The transceiver unit is used to: obtain signature information from the points issuing terminal, wherein the signature information represents points issuance information issued by the points issuing terminal for the first user terminal; the points issuance information includes a preset number of points to be issued, the account of the first user terminal, and a first count value corresponding to the account of the first user terminal, wherein the first count value represents the transaction sequence number of the points issuance logic called by the account of the first user terminal in the smart contract to execute the points issuance. The processing unit is configured to: generate a transaction request to invoke a smart contract based on the signature information of the points issuing terminal and the payment information of the first user terminal, wherein the transaction request is a transaction request to invoke a smart contract sent by the first user terminal after obtaining the signature information of the points issuing terminal, and the transaction request includes the signature information of the points issuing terminal and the payment information of the first user terminal; the payment information indicates that the account of the first user terminal pays a preset amount of fees to the blockchain node; the smart contract is a contract that the points issuing terminal requests to be created in the blockchain node; the users of the blockchain node include the first user terminal and the points issuing terminal. The transceiver unit is further configured to: send the transaction request to the blockchain node to invoke the smart contract, so that the blockchain node, according to the transaction request, invokes the points issuance logic in the smart contract to issue points to the first user terminal according to the points issuance information, including: Verify whether the preset amount of fees meets the preset payment requirements corresponding to the blockchain node; The signature information is validated to determine whether the signer who generated the signature information is the points issuing end. Verify whether the first count value of the first user account recorded in the smart contract is consistent with the first count value in the transaction request; After all the above verifications pass, the first count value corresponding to the first client recorded in the smart contract is updated to the second count value, and points are issued to the first user client according to the points issuance information.
23. An electronic device, characterized in that, include: The memory and the processor are coupled; The memory is used to store one or more computer instructions; The processor is configured to execute one or more computer instructions to implement the method as described in any one of claims 1 to 19.
24. A computer-readable storage medium having stored thereon one or more computer instructions, characterized in that, The instruction is executed by the processor to implement the method as described in any one of claims 1 to 19.