Multi-stage prepaid transaction method, system and storage medium based on blockchain
Through the multi-stage prepaid transaction method of the blockchain platform and trusted funds custodian, the problems of difficulty in consumer evidence collection, information leakage and frequent transactions have been solved, and an efficient and secure prepaid consumption model has been realized to meet the needs of real-time high-frequency transactions.
Patent Information
- Application Number
- CN202210295763.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-24
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2042-03-24
AI Technical Summary
In the existing prepaid consumption model, consumers find it difficult to obtain evidence in service quality disputes, merchants have absolute authority over data, and there is a high risk of consumer information leakage. Blockchain solutions cannot meet the needs of real-time high-frequency transactions, and improper fund balance management leads to frequent recharges or financial risks.
A multi-stage prepaid transaction method is designed. By building a platform through blockchain, a trusted fund custodian is introduced, and off-chain payment channels and smart contracts are used. Consumers and merchants conduct two-way auctions, funds are settled in batches, transaction records are processed in stages, and multi-person payment channels are constructed using Hyperledger Fabric.
It protects consumer rights, reduces the risk of information leakage, increases transaction throughput, meets real-time high-frequency transaction needs, prevents merchants from running away, and improves transaction efficiency and security.
Smart Images

Figure CN114881639B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of blockchain financial technology, and in particular relates to a blockchain-based multi-stage prepaid transaction method, system, storage medium, device and terminal. Background Art
[0002] Currently, the prepaid consumption model is a profit-making commercial consumption model that involves purchasing goods or services within the scope set by the issuing institution. It takes various forms, including transportation cards, shopping cards, and merchant membership cards. The prepaid model helps merchants quickly recover funds and maintain a stable customer base, while also offering consumers preferential discounts. Therefore, this business model is highly popular among merchants and consumers. However, while prepaid cards bring convenience to people's daily lives, they also present numerous problems. 1) When consumers purchase prepaid cards, only the consumer and the merchant are involved, making it difficult for consumers to obtain evidence when disputes arise regarding service quality or other issues. 2) Consumption records are often centrally stored at the merchant, where only the merchant has access to data and other operational permissions, making it difficult for consumers to review and verify them. 3) Consumers' prepaid payments are directly deposited into the merchant's account. In the event of a merchant's malicious closure, consumer rights cannot be effectively protected. 4) Consumers are required to provide personal information to the merchant every time they purchase a prepaid service, which can easily lead to personal information leaks. Problems with current prepaid card management schemes undermine consumers' rights to be informed, to be protected, and to fair trade.
[0003] Blockchain, with its decentralized, immutable, unforgeable, verifiable, and anonymous nature, presents an opportunity for upgrading prepaid consumption models. Leveraging blockchain's immutability and traceability, it helps make prepaid consumption trustworthy, convenient, efficient, and secure. However, currently, mainstream blockchain solutions fail to meet the demands of real-time, high-frequency transaction applications. Off-chain scaling does not directly alter the blockchain's rules; instead, it offloads transactions unsuitable for on-chain processing, such as high-frequency, low-volume transactions, to a secure off-chain environment, ultimately recording the settlement results of multiple transactions on-chain. Off-chain payment channels are a key technology for improving blockchain transaction performance. They enable two blockchain nodes to conduct high-frequency, small-value payments without submitting all transactions to the blockchain, ensuring real-time and eventual consistency, while reducing transaction costs and improving blockchain scalability. By allowing participants to make payments directly through a network of peer-to-peer payment channels, the overhead of global consensus protocols and on-chain transaction confirmation can be avoided. For example, various improved off-chain payment methods, such as Bitcoin Lightning, Ethereum Raiden, and XRP, such as Pleple, Flare, Sprites, and Vevist, all reduce the load on the underlying blockchain and significantly increase transaction throughput, thereby completing transactions in sub-seconds rather than minutes or hours. However, existing work has focused on improving the scalability of public blockchain architectures. Applying payment channel technology to consortium blockchain systems presents certain technical difficulties due to the many differences between public and permissioned blockchains in terms of underlying architecture, application scenarios, and privacy.
[0004] In a prepaid consumption model, establishing a payment channel between consumers and merchants requires determining the initial balance. Low funds necessitate frequent channel top-ups, leading to increased blockchain access. On the other hand, locking up funds in the channel beyond payment requirements is unnecessary, as it increases the financial risk for consumers.
[0005] Through the above analysis, the problems and defects of the existing technology are as follows:
[0006] (1) When consumers purchase prepaid cards, there are only two roles involved: consumers and merchants. When disputes arise regarding service quality or other issues, it is difficult for consumers to obtain evidence. Consumption records are often centrally stored on the merchant side, and only merchants have data access rights and other data operation permissions, making it inconvenient for consumers to view and verify them.
[0007] (2) Consumers’ prepaid payments go directly into the merchant’s account. Once the merchant maliciously closes down, the consumer’s rights and interests cannot be effectively protected. Consumers need to provide personal information to the merchant every time they purchase prepaid services, which can easily lead to the leakage of personal information. The problems existing in the current prepaid card management scheme undermine the consumer’s right to know the truth, the right to security and the right to fair trade.
[0008] (3) Currently, various mainstream blockchain solutions cannot meet the actual real-time and high-frequency transaction application needs; existing work is aimed at improving the scalability of public blockchain architectures, and there are certain technical difficulties in applying payment channel technology to consortium blockchain systems.
[0009] (4) In the prepaid consumption model, the key issue is to decide how much funds should be deposited in the channel as the initial balance; when there is less funds, the channel needs to be recharged frequently, resulting in more blockchain access; locking funds in the channel that exceed payment needs is unnecessary and will increase consumers' financial risks.
[0010] Generally speaking, traditional prepaid payment management systems are centralized, with each merchant independently managing the equipment, hardware, and systems. This lacks effective oversight mechanisms, and consumers pay prepaid fees directly to the merchant, lacking oversight from a trusted third party. The introduction of blockchain technology can establish a decentralized, tamper-proof, and verifiable blockchain-based information storage and management system between merchants and consumers. However, compared to centralized storage systems, blockchain's inherent consensus mechanism inherently reduces transaction throughput, making it inadequate for real-time, high-frequency transactions. Therefore, improvements in blockchain scalability are needed.
[0011] The difficulty of solving the above problems and defects is:
[0012] It is necessary to design a multi-stage prepaid consumption transaction model based on blockchain, which can process consumers' recharge records and consumption records separately. Low-frequency recharge records can be directly uploaded to the blockchain, while high-frequency consumption records can be processed through off-chain payment channels and regularly packaged and uploaded to the blockchain.
[0013] It is necessary to design a new multi-stage pre-settlement auction algorithm to use a trusted third-party fund custodian to deliver prepaid cards to merchants in batches.
[0014] Currently, there is no offline payment channel network for the consortium blockchain Hyperledger Fabric. Therefore, it is necessary to build a multi-person payment channel network based on the characteristics of Hyperledger Fabric, including a transaction module, a consensus module, and a channel balance deposit strategy.
[0015] The significance of resolving the above problems and deficiencies lies in the following: the present invention records the recharge, consumption, and settlement sub-processes of the prepaid consumption model on the blockchain, resolving the problem of merchants having excessive access to data and the possibility of data tampering in traditional prepaid consumption processes. Introducing a trusted third-party fund custodian during the settlement process and utilizing an auction mechanism to settle prepaid card payments to merchants in stages resolves the problem of merchants absconding with funds in traditional prepaid consumption models. Furthermore, an offline multi-person payment channel supporting Hyperledger Fabric is designed, resolving the issue of limited blockchain transaction throughput. This enables the blockchain-based multi-stage prepaid transaction method, system, storage medium, device, and terminal involved in the present invention to meet the real-time, high-frequency transaction requirements of practical application systems. Summary of the Invention
[0016] In response to the many risks faced by consumers under the existing traditional prepaid consumption model, the present invention provides a multi-stage prepaid transaction method, system, storage medium, device and terminal, and in particular, relates to a multi-stage prepaid transaction method, system, storage medium, device and terminal based on blockchain.
[0017] The present invention is implemented as follows: a multi-stage prepaid transaction method based on blockchain, the multi-stage prepaid transaction method based on blockchain comprising the following steps:
[0018] Step 1: Build a blockchain-based multi-stage prepaid transaction system platform involving merchants, consumers, operator platforms, and fund custodians. The operator platforms and fund custodians configure storage media, and each merchant configures corresponding equipment and terminals.
[0019] Step 2: The merchant registers on the platform. The merchant information, reputation value, and historical rating information will be stored in the blockchain and made public. The merchant starts the execution program on the local computer equipment and terminal, and joins the blockchain Fabric network after passing the authentication.
[0020] Step 3: Multiple merchants issue prepaid products on the platform and publicly auction the settlement amount of each stage of the products in the platform's auction room;
[0021] Step 4: The consumer purchases the prepaid product through a terminal installed with the app. The recharge generated by the purchase is transferred to the public regulatory account of the fund custodian, and the recharge contract is recorded on the blockchain distributed ledger.
[0022] Step 5: Multiple consumers and multiple merchants conduct a two-way auction on the platform's auction site for the settlement amount of each stage of the prepaid product. After the auction, the set of successfully matched consumers and merchants is returned;
[0023] Step 6: Based on the auction results, the fund custodian automatically transfers the auction settlement amount to the merchant through the smart contract;
[0024] Step 7: Using smart contracts, the platform establishes an off-chain multi-person payment channel between consumers and merchants. Consumers deposit tokens corresponding to the settlement amount at each stage in the payment channel as initial funds.
[0025] Step 8: The payment channel is divided into multiple version cycles of equal length based on the time process. During each version cycle, consumers and merchants can freely trade through the channel. After each version cycle, the payment channel submits the transaction status information to the blockchain.
[0026] Step 9: When the consumer's balance in the payment channel is insufficient, the smart contract will be triggered to enter the next stage of the auction, and steps 5 to 8 will be executed repeatedly until the consumer's recharge amount is used up.
[0027] Furthermore, in step 5, multiple consumers and multiple merchants conduct a two-way auction on the platform's auction site for the settlement amount of each stage of the prepaid product. After the auction is completed, the set of successfully matched consumers and merchants returned includes:
[0028] (1) Each consumer i’s bid information for the prepaid product he wants to buy is expressed as To prepay the price of the product, Indicates the degree of discount expected by consumers. Indicates the pre-settlement ratio accepted by consumers, It represents the expected use value of the auctioned goods;
[0029] (2) After each merchant j is legally registered with the platform operator, the denomination of The discount level is The minimum pre-settlement ratio is The cost is The quantity is Prepaid products
[0030] (3) The platform operator creates an auction site for different product denominations based on the same type of prepaid products released by merchants, and then bids the products based on the consumers’ bidding information. and the merchant's asking price information distribute them to different auction houses;
[0031] (4) When the qualified consumer set b and merchant set s enter the same auction site, according to The value of pre-eliminates some merchants that do not meet the requirements
[0032] (5) Consumers and merchants who meet their needs are matched through a two-way auction.
[0033] Furthermore, the bidding strategies of the buyers and sellers after entering the auction house include:
[0034] Since the parties involved in the auction are unaware of each other's pricing strategies, the outcome of the competition will not be known until the end of the auction. This is a static game process with incomplete information, and there exists a Bayesian-Nash equilibrium (BNE). According to the Harsanyi transformation theory, in traditional auctions, the expected utility maximization of incomplete information is obtained through the analysis of BNE, which is expressed as:
[0035]
[0036] Among them, P suc (b i ) is the probability that the buyer wins the auction, is the expected value of the auctioned item, b i It is the bid placed by the buyer for the product.
[0037] The buyer's goal is to maximize the expected return by giving the optimal bid, so the optimization problem is described as:
[0038] O1:
[0039] The seller focuses on finding the optimal asking price to maximize expected returns, so the optimization problem is expressed as:
[0040] O2:
[0041] Without loss of generality, we consider that both consumer buyers and merchant sellers adopt a linear strategy to provide prices; before buyers participate in the auction, the prepaid product value is considered as part of the bid, which is expressed as:
[0042]
[0043] in, is the expected value of the auctioned item, and φ b and is a fixed parameter.
[0044] Similarly, sellers consider their costs As a component of the asking price, it is expressed as:
[0045]
[0046] in, is the cost of the auctioned item, and φ s and is a fixed parameter.
[0047] For prepaid products with a denomination of M, based on the platform operator's analysis of historical data and considering auction efficiency, the proportion of consumers' starting price each time that is not less than the total price of the denomination is set as P. min , the upper limit of the auction price does not exceed P max , that is, the maximum auction price allowed by auction site M is price max =M*P max , the minimum auction price allowed is price min =M*P min , the expected value of the product and cost Obey the following uniform distribution:
[0048]
[0049]
[0050] Solving the joint formula yields the optimal buyer's bid and seller's bid. The buyer's optimal bid is linearly related to the expected value, and the seller's optimal asking price is linearly related to the cost:
[0051]
[0052]
[0053] The process of the double auction matching between consumers and merchants in step (5) includes:
[0054] 1) n buyers bid according to b(v i ) values are arranged in descending order, i.e. b(v (1) )≥b(v (2) )≥…≥b(v (n) ); m sellers’ asking prices are calculated as s(c m ) in ascending order as s(c (1) )≤s(c (2) )≤…≤s(c (m) );
[0055] 2) If you find a condition b(v (k) )≥s(c (k') ) and b(v (k+1) )<s(c (k'+1) ) value k, the auction is successful;
[0056] 3) Determine the auction price between buyer k and seller k' as
[0057] 4) After the transaction is completed, the successful consumer will exit the market first, and the merchant When k meets the conditions, the merchant exits the auction market, otherwise repeats the above process with other participants; when no k meets the conditions, the platform operator notifies the remaining consumers and merchants to reconsider their prices.
[0058] Furthermore, the blockchain-based off-chain multi-party payment channel in step seven determines whether a payment channel corresponding to the auction house already exists based on the result set returned by the auction house. If the payment channel does not exist, the smart contract is triggered to create a multi-party payment channel, and the buyers and sellers in the result set will enter the payment channel to conduct off-chain transactions; if the payment channel already exists, the buyers and sellers in the result set will be directly added to the channel.
[0059] The multi-person payment channel consists of two basic modules: on-chain smart contracts and off-chain transaction protocols.
[0060] On-chain smart contracts are used to manage the funds of all participants in the off-chain multi-person payment channel and act as dispute arbitrators to ensure that the latest version of the transaction status agreed upon by all participants is always accepted;
[0061] The off-chain transaction protocol is used to support concurrent and flexible off-chain transactions. It includes multiple version cycles, each of which is divided into two phases: the transaction phase and the consensus phase.
[0062] During the transaction phase, participants in the payment center can freely transfer transactions. The consumption and receipt of tokens are separate. That is, participants' consumption cannot exceed their initial funds in the current version cycle, and received tokens cannot be consumed until the next period.
[0063] Consensus phase: During the consensus phase, all participants cooperate to reach a consensus on the final state of the current version cycle, which serves as a checkpoint for off-chain execution. If a dispute occurs, honest participants submit the latest version state to the on-chain smart contract to ensure the safety of their own funds.
[0064] Furthermore, the payment channel in step 8 is divided into multiple version cycles of equal length according to the time process. In each version cycle, consumers and merchants conduct free transactions through the channel. After each version cycle, the payment channel submits transaction status information to the blockchain, including:
[0065] (1) The platform operator generates a corresponding payment channel instance for each auction site. Consumers and merchants who win the auction enter the corresponding payment channel. The same consumer or merchant can enter multiple different payment channels.
[0066] (2) Initialize the consumer's initial funds to the pre-settlement amount of this round of auction, and the merchant's initial funds default to 0;
[0067] (3) Randomly select one platform operator from among the multiple operators to serve as the leader of the release cycle;
[0068] (4) After the version cycle begins, participants in the payment channel enter the transaction phase, and all participants trade freely;
[0069] (5) At the end of the version cycle, all participants cooperate to reach a consensus on the final state of the current version cycle and submit the final state to the blockchain;
[0070] (6) Enter the next version cycle.
[0071] Furthermore, after the version cycle in step (4) begins, participants in the payment channel enter the transaction phase, and all participants freely trade including:
[0072] 1) Consumer B i To initiate a transaction, first send it to the leader p l Request transaction number t id ;
[0073] 2)p l Check consumer b i Is there a duplicate transaction? If not, assign a monotonically increasing t with its own signature. id Give B i ; otherwise, t is not allocated id ;
[0074] 3)b i Get t id Then send a message carrying t id The transaction request is given to the merchant s j ;
[0075] 4)s j Verified t id After signing, give b i Return a signed response message to indicate agreement;
[0076] 5)b i After receiving the response message, send the complete transaction message tx=(v,t id ,b i ,s j ,m) give p l , v is the current version cycle, and m is the transaction amount.
[0077] At the end of the version cycle in step (5), all participants cooperate to reach a consensus on the final state of the current version cycle and submit the final state to the blockchain, including:
[0078] 1) Leader p lBased on the transaction information collected in the current cycle, the current version cycle state information state(v) is calculated and broadcast to all participants in the payment channel;
[0079] 2) When all consumers and merchants in the channel receive the broadcasted status information, they verify their own account balances and transaction details. After verification, they sign the state (v) and send it back to the leader p. l ;
[0080] 3) When p l After all signatures are collected, the version state confirmation message containing state(v) and all signatures will be broadcast to all participants to complete the current era;
[0081] 4)p l Submit the current version cycle status information state(v) to the blockchain, and participants in the payment channel enter the next version cycle.
[0082] Another object of the present invention is to provide a multi-stage prepaid transaction system that applies the blockchain-based multi-stage prepaid transaction method, wherein the multi-stage prepaid transaction system includes consumers, merchants, alliance blockchains, operators, and third-party funds custodian institutions; it is assumed that merchants, consumers, and regulators all send and receive messages to the blockchain smart contract, and each participant has a public-private key pair for signing the content sent by itself to ensure the uniqueness and non-repudiation of the transaction content.
[0083] The functions of each role are as follows:
[0084] Platform operators develop agents by region and are responsible for marketing, attracting merchants and customers to use the platform to manage prepaid consumer services and helping merchants promote their offerings. Platform operators provide infrastructure services for the entire system, including network, intelligent applications, database services, and blockchain services.
[0085] Merchants, as sellers of prepaid products or services, are composed of multiple stores, and different merchants contain the same store;
[0086] Consumers are buyers of pre-sale goods or services and choose appropriate pre-sale goods or services based on their needs;
[0087] The fund custodian is composed of financial institutions with payment licenses, including banks, Alipay, and WeChat Pay. They are responsible for the custody of consumers' recharge funds and execute automatic transfer functions based on the system's smart contracts.
[0088] The blockchain referred to herein is Hyperledger Fabric, an open source, enterprise-grade permissioned distributed ledger technology (DLT) platform with differentiated capabilities compared to other popular distributed ledger or blockchain platforms. Fabric's participants are permissioned; participants are known to each other but not fully trustworthy, but the network operates under a governance model established by the trust that exists between participants.
[0089] The payment channel is an overlay network built on the Fabric blockchain. The payment channel network provides the ability to open payment channels and process payments off-chain. Off-chain payment channels facilitate a large number of small payments between two blockchain nodes, eliminating the need to submit each payment to the blockchain. When two nodes agree to open a payment channel, a smart contract is created, locking cryptographic tokens as the channel balance. Once the channel is established, transactions are conducted through the channel, and the channel balance is maintained.
[0090] Another object of the present invention is to provide a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the following steps:
[0091] A trusted fund custodian is introduced to carry out fund custody. The recharge amount that consumers use to purchase prepaid services is transferred to a third-party public supervision account, and the recharge contract is recorded on the blockchain distributed ledger. Consumers and merchants conduct two-way auctions on the auction market provided by the platform operator. Merchants formulate different pre-settlement discount plans based on their marketing strategies, and consumers choose the appropriate pre-settlement amount based on the pre-settlement discount plans. When the two parties in the auction reach a transaction, the merchant is automatically settled, and the settlement amount is transferred to the merchant from the bank's public supervision account. At the same time, an equal number of tokens are deposited into the payment channel as initial funds.
[0092] Through the blockchain's smart contract mechanism, a payment channel is established between consumers and merchants. Consumers deposit a certain number of tokens in the payment channel as initial funds; consumers and merchants conduct transactions through the channel and maintain a channel balance; each purchase made by consumers at a merchant will consume a corresponding number of tokens, and the details of the purchase will be encrypted and stored in the platform operator's global database. When the channel balance is insufficient to continue consumption, the smart contract is triggered to record the current channel balance of the consumer and merchant in the blockchain and execute a second round of two-way auction.
[0093] Merchants register on the platform and pay a risk reserve. If a merchant ceases operations and cannot continue to provide services, the platform operator will verify the situation and activate the smart contract to refund the customer's unused balance. Consumers can freely and safely purchase prepaid consumption services from any merchant joining the platform.
[0094] Another object of the present invention is to provide a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor performs the following steps:
[0095] A trusted fund custodian is introduced to carry out fund custody. The recharge amount that consumers use to purchase prepaid services is transferred to a third-party public supervision account, and the recharge contract is recorded on the blockchain distributed ledger. Consumers and merchants conduct two-way auctions on the auction market provided by the platform operator. Merchants formulate different pre-settlement discount plans based on their marketing strategies, and consumers choose the appropriate pre-settlement amount based on the pre-settlement discount plans. When the two parties in the auction reach a transaction, the merchant is automatically settled, and the settlement amount is transferred to the merchant from the bank's public supervision account. At the same time, an equal number of tokens are deposited into the payment channel as initial funds.
[0096] Through the blockchain's smart contract mechanism, a payment channel is established between consumers and merchants. Consumers deposit a certain number of tokens in the payment channel as initial funds; consumers and merchants conduct transactions through the channel and maintain a channel balance; each purchase made by consumers at a merchant will consume a corresponding number of tokens, and the details of the purchase will be encrypted and stored in the platform operator's global database. When the channel balance is insufficient to continue consumption, the smart contract is triggered to record the current channel balance of the consumer and merchant in the blockchain and execute a second round of two-way auction.
[0097] Merchants register on the platform and pay a risk reserve. If a merchant ceases operations and cannot continue to provide services, the platform operator will verify the situation and activate the smart contract to refund the customer's unused balance. Consumers can freely and safely purchase prepaid consumption services from any merchant joining the platform.
[0098] Another object of the present invention is to provide an information data processing terminal, which is used to implement the multi-stage prepaid transaction system.
[0099] Combining all the above technical solutions, the advantages and positive effects of the present invention are as follows: The traditional prepaid management system is centralized, with the equipment, hardware, or systems managed independently by each merchant, lacking an effective supervision mechanism. The prepaid payments made by consumers are directly paid to the merchant, lacking oversight by a trusted third party. The present invention provides a blockchain-based multi-stage prepaid consumption transaction model that records the recharge, consumption, and settlement processes in the prepaid consumption model on the blockchain, resolving the problem of merchants having excessive access to data and being able to tamper with it in the traditional prepaid consumption model. A multi-stage pre-settlement method based on a two-way bidding auction is provided, which introduces a trusted fund custodian to perform fund custody. Consumers pay prepaid payments to merchants in batches using a multi-stage pre-settlement method. A two-way auction is used to determine the amount to be settled by consumers to the merchant in each stage. After the auction, the fund custodian automatically pays the merchant the settlement amount for that stage through a smart contract. The prepaid card is settled to the merchant in stages through the auction mechanism, resolving the problem of merchants absconding with funds in the traditional prepaid consumption model. It also allows honest merchants to receive partial early repayments for further development. In order to address the shortcoming that blockchain cannot meet the actual real-time and high-frequency transaction application needs due to its own consensus mechanism, an off-chain payment channel supporting multi-party participation is established between consumers and merchants through smart contracts, and a number of tokens equal to the settlement amount of the consumer in the stage auction is deposited into the payment channel as initial funds. After that, consumers and merchants can trade freely in the payment channel. The payment channel submits all transaction records to the blockchain every version cycle to achieve arbitration and traceability of transactions. By transferring high-frequency transactions and a large number of small transactions to the off-chain payment channel for processing, the transaction processing capacity and efficiency of the entire system are improved.
[0100] The present invention provides a blockchain-based multi-stage prepaid consumption transaction model. The model records the recharge, consumption, and settlement sub-processes of the prepaid consumption transaction process on the blockchain, eliminating the possibility of excessive data management authority and data tampering that exist in traditional prepaid consumption models. The present invention introduces a trusted third-party fund custodian into the settlement process, providing a multi-stage pre-settlement method based on a double auction. The pre-settlement-double auction algorithm is used to determine the amount that consumers must pay to merchants at each stage. After the auction, the fund custodian automatically pays the merchant the settlement amount for that stage via a smart contract, resolving the issue of merchants absconding with funds in traditional prepaid consumption models. Furthermore, an offline multi-person payment channel supporting Hyperledger Fabric is designed, and a number of tokens equal to the consumer's settlement amount at each auction stage are deposited into the payment channel as initial funds. This addresses the issue of limited blockchain transaction throughput, enabling the blockchain-based multi-stage prepaid transaction method, system, storage medium, device, and terminal disclosed herein to meet the real-time, high-frequency transaction requirements of practical application systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0101] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0102] Figure 1 This is a flow chart of a multi-stage prepaid transaction method based on blockchain provided by an embodiment of the present invention.
[0103] Figure 2 This is a model diagram of a multi-stage prepaid transaction system based on blockchain provided by an embodiment of the present invention.
[0104] Figure 3 This is a flow chart of the payment channel transaction phase provided by an embodiment of the present invention.
[0105] Figure 4 This is a schematic diagram of the payment channel consensus phase process provided by an embodiment of the present invention.
[0106] Figure 5 It is an algorithm implementation diagram provided by an embodiment of the present invention.
[0107] Figure 6 This is a simulation diagram of an auction average transaction rate experiment provided by an embodiment of the present invention.
[0108] Figure 7 This is a simulation diagram of an auction average transaction price experiment provided by an embodiment of the present invention.
[0109] Figure 8 This is a simulation diagram of an average benefit experiment between buyers and sellers provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0110] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0111] In response to the problems existing in the prior art, the present invention provides a multi-stage prepaid transaction method, system, storage medium, device and terminal based on blockchain. The present invention is described in detail below with reference to the accompanying drawings.
[0112] like Figure 1 As shown, the multi-stage prepaid transaction method based on blockchain provided by an embodiment of the present invention includes the following steps:
[0113] S101: Build a blockchain-based multi-stage prepaid transaction system platform involving merchants, consumers, operator platforms, and fund custodians;
[0114] S102: The merchant registers on the platform. The merchant information, reputation value, and historical rating information will be stored in the blockchain and made public.
[0115] S103, multiple merchants issue prepaid products on the platform and conduct public auctions on the platform's auction site for the settlement amount of each stage of the products;
[0116] S104: The recharge amount of the consumer who purchased the prepaid product is transferred to the public supervision account of the fund custodian, and the recharge contract is recorded on the blockchain distributed ledger;
[0117] S105: Multiple consumers and multiple merchants conduct a two-way auction on the platform's auction site for the settlement amount of each stage of the prepaid product. After the auction is completed, a set of successfully matched consumers and merchants is returned.
[0118] S106: Based on the auction result set, the fund custodian automatically transfers the auction settlement amount to the merchant through the smart contract;
[0119] S107, using smart contracts, the platform establishes an off-chain multi-person payment channel between consumers and merchants. Consumers deposit tokens corresponding to the settlement amount of each stage in the payment channel as initial funds;
[0120] S108: The payment channel is divided into multiple version cycles of equal length based on the time process. During each version cycle, consumers and merchants can freely trade through the channel. After each version cycle, the payment channel submits transaction status information to the blockchain.
[0121] S109: When the consumer's balance in the payment channel is insufficient, the smart contract will be triggered to enter the next stage of auction, and S105 to S108 will be executed in a loop until the consumer's recharge money is used up.
[0122] The technical solution of the present invention is further described below in conjunction with specific embodiments.
[0123] This paper proposes a decentralized, multi-stage prepaid transaction method and system based on consortium blockchain and smart contract technology. First, a trusted custodian (such as a bank or Alipay) is introduced to manage funds. This ensures that consumers' prepaid service top-up payments are not paid directly to the merchant but instead deposited into a third-party public custodial account. The top-up contract is then recorded on the blockchain's distributed ledger.
[0124] Consumers and merchants then engage in a two-way auction on the platform operator's auction market. Merchants develop different pre-settlement discount plans based on their marketing strategies, and consumers choose the appropriate pre-settlement amount accordingly. Once the auctioneers reach a deal, the merchant is automatically paid, with the settlement proceeds transferred from the bank's publicly regulated account. Simultaneously, an equal number of tokens are deposited into the payment channel as initial funding.
[0125] Finally, through the blockchain's smart contract mechanism, a payment channel is established between consumers and merchants. Consumers deposit a certain amount of tokens in the payment channel as initial funds. After that, they can conduct transactions through the channel and maintain their own channel balance. Each purchase made by the consumer at the merchant consumes a corresponding number of tokens, and the consumption details are encrypted and stored in the platform operator's global database. When the channel balance is insufficient for further purchases, the smart contract is triggered to record the current channel balance of the consumer and merchant on the blockchain and execute a second round of double auction.
[0126] Merchants register on the platform and pay a risk reserve. If a merchant ceases operations and cannot continue to provide services, the platform operator, after verification, activates a smart contract to refund the customer's unused balance. Thanks to the confidentiality, immutability, security, and trustworthiness of the blockchain, the platform and its operating mechanisms enable consumers to freely and securely purchase prepaid services from any merchant participating in the platform, significantly reducing the possibility of fraud.
[0127] like Figure 2 As shown in Figure 1, a prepayment model based on a consortium blockchain involves four roles: consumers, merchants, the consortium blockchain, the operator, and a third-party fund custodian. It assumes that merchants, consumers, and regulators can all send and receive messages to the blockchain smart contract. Each participant has a public-private key pair, enabling them to sign their messages and ensure the uniqueness and non-repudiation of transactions. The functions of each role are as follows:
[0128] Platform Operator: Operators can develop regional agents to oversee marketing efforts, attracting merchants and customers to use the platform to manage their prepaid consumer services and helping merchants promote their offerings. Platform operators provide infrastructure services for the entire system, including networks, intelligent applications, database services, and blockchain services.
[0129] Merchant: Merchants are sellers of prepaid products or services. Merchants are composed of multiple stores, and different merchants may include the same stores (such as various food applets).
[0130] Consumers: Consumers are buyers of pre-sale goods or services. They can choose appropriate pre-sale goods or services according to their own needs.
[0131] Fund custodians: These are financial institutions with payment licenses, such as banks, Alipay, and WeChat Pay. They are primarily responsible for the custody of consumer top-up funds and execute automatic transfers based on the system's smart contracts.
[0132] The embodiment of the present invention provides a multi-stage prepaid transaction method based on blockchain, comprising the following steps:
[0133] Step S1: Building a blockchain-based multi-stage prepaid transaction system platform (hereinafter referred to as the platform) that includes merchants, consumers, operator platforms, and fund custodians. The operator platform and fund custodians configure storage media, and each merchant configures corresponding equipment and terminals.
[0134] Step S2: The merchant will register on the platform, and its merchant information, reputation value, historical ratings and other information will be stored in the blockchain and made public. The merchant will start the execution program on the local computer equipment and terminal, and join the blockchain Fabric network after passing the authentication;
[0135] Step S3: Multiple merchants issue prepaid products on the platform and conduct public auctions on the platform’s auction site for the settlement amount of each stage of the products;
[0136] Step S4: The consumer purchases a prepaid product through a terminal installed with the application. The recharge generated by the purchase is transferred to the public supervision account of the fund custodian, and the recharge contract is recorded on the blockchain distributed ledger;
[0137] Step S5: Multiple consumers and multiple merchants conduct a two-way auction on the platform's auction site for the settlement amount of each stage of the prepaid product. After the auction is completed, a set of successfully matched consumers and merchants is returned;
[0138] Step S6: Based on the auction result set, the fund custodian automatically transfers the auction settlement amount to the merchant through the smart contract;
[0139] Step S7: Using smart contracts, the platform establishes an off-chain multi-person payment channel between the consumer and the merchant. The consumer deposits tokens corresponding to the settlement amount at each stage in the payment channel as initial funds.
[0140] Step S8: The payment channel is divided into multiple version cycles of equal length based on the time process. During each version cycle, consumers and merchants can freely trade through the channel. After each version cycle, the payment channel submits transaction status information to the blockchain.
[0141] Step S9: When the consumer's balance in the payment channel is insufficient, the smart contract will be triggered to enter the next stage of auction, and steps S5 to S8 will be executed repeatedly until the consumer's recharge amount is used up.
[0142] It can be understood that when conducting a double auction, step S4 includes the following steps:
[0143] Step S41: The bid information of each consumer i for the prepaid product he wants to buy can be expressed as To prepay the price of the product, Indicates the degree of discount expected by consumers. Indicates the pre-settlement ratio accepted by consumers, Indicates the expected use value of the auctioned goods.
[0144] Step S42: After each merchant j is legally registered with the platform operator, it publishes The discount level is The minimum pre-settlement ratio is The cost is The quantity is Prepaid products
[0145] Step S43: The platform operator creates an auction site for different product denominations based on the same type of prepaid products released by merchants, and bids the products based on the consumers’ bidding information. and the merchant's asking price information Distribute them to different auction houses.
[0146] Step S44: When the qualified consumer set b and merchant set s enter the same auction site, The value of pre-eliminates some merchants that do not meet the requirements
[0147] Step S55: The consumer and the merchant who meet the requirements are matched in a two-way auction.
[0148] It can be understood that when a two-way auction is conducted, after the consumer purchases a prepaid package with a face value of M and completes the payment, the user's payment will be deposited into the bank escrow account, and then the consumer and the merchant will enter the auction site numbered M. After the auction is completed, the amount of the pre-settlement will be transferred by the bank to the merchant's account, and the consumer will receive a corresponding discount. For example, consumer A purchased a prepaid product of 100 yuan from merchant B. The preferential plans given by the merchant are as follows: a 5% discount when the pre-settlement is less than 20%, and a 5% + x discount when it is 20%-50%. x increases linearly with the proportion of pre-transfer, and each merchant's preferential strategy will be different. Taking into account the system's computing load and the consumer's risk, the platform operator will set the proportion of the consumer's starting price at each auction to not less than the total face value price as P. min , the upper limit of the auction price does not exceed P max, so in the auction house M, the bid price is in the price range [M*P min ,M*P max ]conduct.
[0149] Understandably, in a double auction, since each participant is unaware of the others' pricing strategies, the outcome of the competition remains unknown until the auction concludes. Therefore, this is a static game with incomplete information, and a Bayesian-Nash equilibrium (BNE) exists. According to Harsanyi's switching theory, in traditional auctions, analysis of the BNE typically yields the expected utility maximization under incomplete information, which can be expressed as:
[0150]
[0151] Among them, P suc (b i ) is the probability that the buyer wins the auction, is the expected value of the auctioned item, b i It is the bid placed by the buyer for the product.
[0152] Since the buyer’s goal is to maximize his expected return by giving the optimal bid, the optimization problem can be described as:
[0153]
[0154] The sellers focus on finding the optimal asking price to maximize their expected profit, so the optimization problem can be expressed as:
[0155]
[0156] To simplify this process, the present invention assumes that all consumers (buyers) and merchants (sellers) adopt a linear strategy to provide prices. Before a buyer participates in an auction, it first considers the prepaid product value as part of its bid, which can be expressed as:
[0157]
[0158] in, is the expected value of the auctioned goods, which is related to the degree of preferential treatment of the final consumption. b and is a fixed parameter. Similarly, the seller considers its cost As a component of the asking price, it can be expressed as:
[0159]
[0160] in, is the cost of the auctioned item, and φs and is a fixed parameter.
[0161] For prepaid products with a denomination of M, based on the platform operator's analysis of historical data and considering auction efficiency, it is assumed that the maximum auction price allowed by auction site M is price max =M*P max , the minimum auction price allowed is price min =M*P min .
[0162] Therefore, the expected value of the product and cost Obey the following uniform distribution:
[0163]
[0164] Thus, the present invention can obtain b i and s j Obey the following uniform distribution:
[0165]
[0166] Considering the properties of uniform distribution and the definition of auction price, (2) and (3) can be further transformed into:
[0167]
[0168]
[0169] Further, and It can be expressed as:
[0170]
[0171]
[0172] Substituting equations (10) and (11) into equation (8), the present invention can obtain the final form of the optimization problem after simplification:
[0173]
[0174] Similarly, the present invention can obtain the final form of O2':
[0175]
[0176] Let the first-order derivatives of the above two equations be 0, the present invention can obtain:
[0177]
[0178]
[0179] Substituting equations (4) and (5) into (14) and (15) and simplifying them, we can obtain the equilibrium point, namely:
[0180]
[0181]
[0182] Finally, the optimal bid obtained by the present invention is as follows: It can be seen that the buyer's optimal bid is linearly related to the expected value, and the seller's optimal asking price is linearly related to the cost.
[0183]
[0184]
[0185] It can be understood that the process of the two-way auction matching between the consumer and the merchant in step S55 includes the following steps:
[0186] Step S551: n buyers’ bids are calculated based on b(v i ) values are arranged in descending order, i.e. b(v (1) )≥b(v (2) )≥…≥b(v (n) The asking price of m sellers is calculated as s(c m ) in ascending order as s(c (1) )≤s(c (2) )≤…≤s(c (m) ).
[0187] Step S552: If a (k) )≥s(c (k') ) and b(v (k+1) )<s(c (k'+1) ) value k, the auction is successful.
[0188] Step S553: Determine the auction price between buyer k and seller k'
[0189] Step S554: After the transaction is completed, the successful consumer exits the market first, and the merchant When k meets the conditions, the merchant exits the auction market. Otherwise, the above process is repeated with other participants. When no k meets the conditions, the platform operator notifies the remaining consumers and merchants to reconsider their prices.
[0190] It can be understood that the off-chain multi-party payment channel based on the permission chain first determines whether a payment channel corresponding to the auction house already exists based on the result set returned by the auction house. If the payment channel does not exist, the smart contract is triggered to create a multi-party payment channel. The buyers and sellers in the result set will enter the payment channel to conduct off-chain transactions; if the payment channel already exists, the buyers and sellers in the result set will be directly added to the channel.
[0191] The multi-person payment channel consists of two basic building blocks: on-chain smart contracts and off-chain transaction protocols.
[0192] On-chain smart contracts: manage the deposits of all participants in the off-chain multi-person payment channel and act as a dispute resolver. It ensures that the latest version of the transaction state agreed upon by all participants is always accepted.
[0193] Off-chain transaction protocol: mainly to support concurrent and flexible off-chain transactions, including multiple version cycles, each version cycle is divided into two phases, the transaction phase and the consensus phase.
[0194] Transaction Phase: Participants in the payment center can freely conduct transactions and transfers. In addition, the consumption and receipt of tokens are separated, that is, participants' consumption cannot exceed their initial funds in the current version cycle, and their received tokens cannot be consumed until the next period.
[0195] Consensus phase: During the consensus phase, all participants collaborate to reach a consensus on the final state of the current version cycle, which serves as a checkpoint for off-chain execution. If a dispute arises, honest participants can submit the latest version state to the on-chain smart contract to ensure the safety of their own funds.
[0196] It can be understood that step S8 includes the following steps:
[0197] Step S81: The platform operator generates a corresponding payment channel instance for each auction site. Consumers and merchants who successfully bid in the auction enter the corresponding payment channel. The same consumer or merchant can enter multiple different payment channels.
[0198] Step S82: Initialize the consumer's initial funds to the pre-settlement amount of this round of auction, and the merchant's initial funds default to 0.
[0199] Step S83: Randomly select one platform operator from among multiple platform operators to serve as the leader of this release cycle.
[0200] Step S84: After the version cycle begins, participants in the payment channel enter the transaction phase, and all participants can trade freely.
[0201] Step S85: At the end of the version cycle, all participants cooperate to reach a consensus on the final state of the current version cycle and submit the final state to the blockchain.
[0202] Step S86: Enter the next version cycle.
[0203] It can be understood that for step S83, at the beginning of each version cycle, a leader needs to be selected to promote the execution of off-chain transactions. The leader of the version cycle is randomly selected from multiple platform operators. Its tasks include: 1) maintaining the information in the basic information table, as shown in Table 1; 2) issuing transaction t id ; 3) Encourage all participants to reach an agreement on the status of the current version cycle during the consensus phase.
[0204] Table 1 Basic information table maintained by leaders
[0205]
[0206] It can be understood that the payment channel transaction stage flow diagram is as follows Figure 3 As shown, step S84 includes the following steps:
[0207] Step S841: Consumer b i To initiate a transaction, first send it to the leader p l Request transaction number t id .
[0208] Step S842: p l Check consumer b i Is there a duplicate transaction? If not, assign a monotonically increasing t with its own signature. id Give B i ; otherwise, t is not allocated id .
[0209] Step S843: b i Get t id Then send a message carrying t id Transaction request tx req Give to merchants j .
[0210] Step S844: j Verified t id After signing, give b i Returns a signed response message tx rep , expressing agreement.
[0211] Step S845: b i After receiving the response message, send the complete transaction message tx=(v,tid ,b i ,s j ,m) give p l , v is the current version cycle, and m is the transaction amount.
[0212] It can be understood that the payment channel consensus phase process diagram is as follows Figure 4 As shown, step S85 includes the following steps:
[0213] Step S851: Leader p l Based on the transaction information collected in the current cycle, the current version cycle state information state(v) is calculated and broadcast to all participants in the payment channel.
[0214] Step S852: After all consumers and merchants in the channel receive the broadcasted status information, they verify their own account balances and transaction details. After verification, they sign state(v) and send it back to the leader p. l .
[0215] Step S853: When p l Once all signatures are collected, a versioned state confirmation message containing state(v) and all signatures will be broadcast to all participants to complete the current epoch.
[0216] Step S854: p l Submit the current version cycle status information state(v) to the blockchain, and participants in the payment channel enter the next version cycle.
[0217] The technical effects of the present invention are described in detail below with reference to simulations.
[0218] The invention involves a pre-settlement double auction algorithm, the algorithm is as follows Figure 5 As shown in the figure, a simulation experiment was carried out on a computer using Java programming language based on the algorithm. The experimental results are shown in the figure Figure 6-Figure 8 As shown in the figure. In the auction process, the face value of the prepaid product is set to 100, and the bidding range of consumers in the first stage is [20,50]. When the number of sellers in the market is greater than that of buyers, that is, in a buyer's market, as shown in the figure, Figure 6 As shown in , the success rate of the auction increases with the number of sellers. Figure 7 As shown in , the average transaction price will also decrease and eventually reach equilibrium. Figure 7 As shown in the figure, when the number of buyers is 500 and the number of sellers in the market is in the range of [100,400], the average transaction price will be higher. This is determined by the market supply and demand relationship. At this time, the market is in a seller's market.
[0219] like Figure 8As shown in the figure, in a buyer's market, the average individual revenues of buyers and sellers remain stable, with sellers' revenues exceeding buyers' by approximately 3 units. In a seller's market, where demand exceeds supply, both buyers and sellers' revenues increase as the number of buyers increases. This is because buyers with higher bids are more likely to win.
[0220] Simulation experiments show that the pre-settlement double auction algorithm designed in the present invention satisfies market supply and demand. In the above embodiments, they can be implemented in whole or in part through software, hardware, firmware, or any combination thereof. When implemented in whole or in part in the form of a computer program product, the computer program product comprises one or more computer instructions. When the computer program instructions are loaded or executed on a computer, the processes or functions described in accordance with the embodiments of the present invention are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired means (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)), or wireless means (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium accessible by a computer, or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state disk (SSD)).
[0221] The above description is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with this technical field within the technical scope disclosed by the present invention and within the spirit and principles of the present invention should be covered by the scope of protection of the present invention.
Claims
1. A multi-stage prepaid transaction method based on blockchain, characterized in that: The multi-stage prepaid transaction method based on blockchain includes the following steps: Step 1: Build a blockchain-based multi-stage prepaid transaction system platform that includes merchants, consumers, operator platforms, and fund custodians; Step 2: Merchants register on the platform. The merchant information, reputation value, and historical rating information will be stored in the blockchain and made public. Step 3: Multiple merchants issue prepaid products on the platform and publicly auction the settlement amount of each stage of the products in the platform's auction room; Step 4: The recharge amount for prepaid products purchased by consumers is transferred to the public supervision account of the fund custodian, and the recharge contract is recorded on the blockchain distributed ledger; Step 5: Multiple consumers and multiple merchants conduct a two-way auction on the platform's auction site for the settlement amount of each stage of the prepaid product. After the auction, the set of successfully matched consumers and merchants is returned; Step 6: Based on the auction results, the fund custodian automatically transfers the auction settlement amount to the merchant through the smart contract; Step 7: Using smart contracts, the platform establishes an off-chain multi-person payment channel between consumers and merchants. Consumers deposit tokens corresponding to the settlement amount at each stage in the payment channel as initial funds. Step 8: The payment channel is divided into multiple version cycles of equal length based on the time process. During each version cycle, consumers and merchants can freely trade through the channel. After each version cycle, the payment channel submits the transaction status information to the blockchain. Step 9: When the consumer's balance in the payment channel is insufficient, the smart contract will be triggered to enter the next stage of the auction, and steps 5 to 8 will be executed repeatedly until the consumer's recharge funds are used up; In step 5, multiple consumers and multiple merchants conduct a two-way auction on the platform's auction site for the settlement amount of each stage of the prepaid product. After the auction, the set of successfully matched consumers and merchants returned includes: (1) Each consumer i’s bid information for the prepaid product he wants to buy is expressed as To prepay the price of the product, Indicates the degree of discount expected by consumers. Indicates the pre-settlement ratio accepted by consumers, It represents the expected use value of the auctioned goods; (2) After each merchant j is legally registered with the platform operator, the denomination of The discount level is The minimum pre-settlement ratio is The cost is The quantity is Prepaid products (3) The platform operator creates an auction site for different product denominations based on the same type of prepaid products released by merchants, and then bids the products based on the consumers’ bidding information. and the merchant's asking price information distribute them to different auction houses; (4) When the qualified consumer set b and merchant set s enter the same auction site, according to The value of pre-eliminates some merchants that do not meet the requirements (5) Consumers and merchants who meet their needs are matched through a two-way auction.
2. The multi-stage prepaid transaction method based on blockchain as claimed in claim 1, characterized in that: Bidding strategies for buyers and sellers once they enter the auction include: Since the parties involved in the auction are unaware of each other's pricing strategies, the outcome of the competition will not be known until the end of the auction. This is a static game process with incomplete information, and there exists a Bayesian-Nash equilibrium (BNE). According to the Harsanyi transformation theory, in traditional auctions, the expected utility maximization of incomplete information is obtained through the analysis of BNE, which is expressed as: Where Psuc(bi) is the probability that the buyer wins the auction, is the expected value of the auctioned item, and bi is the buyer’s bid for the item; The buyer's goal is to maximize the expected return by giving the optimal bid, so the optimization problem is described as: O1: The seller focuses on finding the optimal asking price to maximize expected returns, so the optimization problem is expressed as: O2: Without loss of generality, consider that both consumer buyers and merchant sellers adopt a linear strategy to provide prices; before the buyer participates in the auction, the prepaid product value is used as part of the bid price, which is expressed as: Among them, is the expected value of the auction item, and φb and are fixed parameters; Similarly, seller costs As a component of the asking price, it is expressed as: in, is the cost of the auctioned goods, and φs and is a fixed parameter; For prepaid products with a denomination of M, based on the platform operator's analysis of historical data and considering auction efficiency, the proportion of consumers' starting price each time not lower than the total price of the denomination is set to Pmin, the upper limit of the auction price does not exceed Pmax, the maximum auction price allowed by the auction site M is pricemax=M*Pmax, the minimum auction price allowed is pricemin=M*Pmin, and the expected value of the product is and cost Obey the following uniform distribution: The optimal buyer's bid and seller's bid are obtained by solving the joint formula. The buyer's optimal bid is linearly related to the expected value, and the seller's optimal asking price is linearly related to the cost: The process of the double auction matching between consumers and merchants in step (5) includes: 1) The bids of n buyers are arranged in descending order according to the value of b(vi), that is, b(v(1))≥b(v(2))≥…≥b(v(n)); the asking prices of m sellers are arranged in ascending order according to s(cm) as s(c(1))≤s(c(2))≤…≤s(c(m)); 2) If a value k is found that satisfies the conditions b(v(k))≥s(c(k')) and b(v(k+1))<s(c(k'+1)), the auction is successful; 3) Determine the auction price between buyer k and seller k' as 4) After the transaction is completed, the successful consumer will exit the market first, and the merchant When k meets the conditions, the merchant exits the auction market, otherwise repeats the above process with other participants; when no k meets the conditions, the platform operator notifies the remaining consumers and merchants to reconsider their prices.
3. The multi-stage prepaid transaction method based on blockchain as claimed in claim 1, characterized in that: The blockchain-based off-chain multi-party payment channel in step 7 determines whether a payment channel corresponding to the auction house already exists based on the result set returned by the auction house. If no such payment channel exists, the smart contract is triggered to create a multi-party payment channel. The buyers and sellers in the result set will enter the payment channel to conduct off-chain transactions. If the payment channel already exists, the buyers and sellers in the result set will be directly added to the channel. The multi-person payment channel consists of two basic modules: the on-chain smart contract and the off-chain transaction protocol; On-chain smart contracts are used to manage the funds of all participants in the off-chain multi-person payment channel and act as dispute arbitrators to ensure that the latest version of the transaction status agreed upon by all participants is always accepted; The off-chain transaction protocol is used to support concurrent and flexible off-chain transactions. It includes multiple version cycles, each of which is divided into two phases: the transaction phase and the consensus phase. During the transaction phase, participants in the payment center freely transfer transactions. The consumption and receipt of tokens are separate. That is, participants' consumption cannot exceed their initial funds in the current version cycle, and received tokens cannot be consumed until the next period. Consensus phase: During the consensus phase, all participants cooperate to reach a consensus on the final state of the current version cycle, which serves as a checkpoint for off-chain execution. If a dispute occurs, honest participants submit the latest version state to the on-chain smart contract to ensure the safety of their own funds.
4. The multi-stage prepaid transaction method based on blockchain as claimed in claim 1, characterized in that: The payment channel in step 8 is divided into multiple version cycles of equal length according to the time process. During each version cycle, consumers and merchants can freely trade through the channel. After each version cycle, the payment channel submits transaction status information to the blockchain, including: (1) The platform operator generates a corresponding payment channel instance for each auction site. Consumers and merchants who win the auction enter the corresponding payment channel. The same consumer or merchant can enter multiple different payment channels. (2) Initialize the consumer's initial funds to the pre-settlement amount of this round of auction, and the merchant's initial funds default to 0; (3) Randomly select one platform operator from among the multiple operators to serve as the leader of the release cycle; (4) After the version cycle begins, participants in the payment channel enter the transaction phase, and all participants trade freely; (5) At the end of the version cycle, all participants cooperate to reach a consensus on the final state of the current version cycle and submit the final state to the blockchain; (6) Enter the next version cycle.
5. The multi-stage prepaid transaction method based on blockchain as claimed in claim 4, characterized in that: After the version cycle in step (4) begins, participants in the payment channel enter the transaction phase, and all participants freely trade, including: 1) Consumer bi initiates a transaction and first requests the transaction number tid from the leader pl; 2) pl checks whether consumer bi has repeated transactions. If not, it assigns a monotonically increasing tid with its own signature to bi; otherwise, it does not assign a tid; 3) After bi obtains tid, it sends a transaction request carrying tid to merchant sj; 4) After sj verifies the signature of tid, it returns a signed response message to bi to indicate its agreement; 5) After receiving the response message, bi sends the complete transaction message tx = (v, tid, bi, sj, m) to pl, where v is the current version cycle and m is the transaction amount; At the end of the version cycle in step (5), all participants cooperate to reach a consensus on the final state of the current version cycle and submit the final state to the blockchain, including: 1) The leader pl calculates the current version cycle state information state(v) based on the transaction information collected in the current cycle and broadcasts it to all participants in the payment channel; 2) After all consumers and merchants in the channel receive the broadcasted status information, they verify their own account balances and transaction details. After verification, they sign state(v) and send it back to the leader pl; 3) When pl collects all signatures, the version state confirmation message containing state(v) and all signatures will be broadcast to all participants to complete the current era; 4) pl submits the current version cycle status information state(v) to the blockchain, and participants in the payment channel enter the next version cycle.
6. A multi-stage prepaid transaction system implementing the multi-stage prepaid transaction method based on blockchain according to any one of claims 1 to 5, characterized in that: The blockchain-based multi-stage prepaid transaction system includes consumers, merchants, a consortium blockchain, operators, and third-party fund custodians. It assumes that merchants, consumers, and regulators all send and receive messages to the blockchain smart contract, and each participant has their own public-private key pair to sign their messages, ensuring the uniqueness and non-repudiation of transaction content. The functions of each role are as follows: Platform operators develop agents by region and are responsible for marketing, attracting merchants and customers to use the platform to manage prepaid consumer services and helping merchants promote their offerings. Platform operators provide infrastructure services for the entire system, including network, intelligent applications, database services, and blockchain services. Merchants, as sellers of prepaid products or services, are composed of multiple stores, and different merchants contain the same store; Consumers are buyers of pre-sale goods or services and choose appropriate pre-sale goods or services based on their needs; Fund custodians, consisting of financial institutions with payment licenses, including banks, Alipay, and WeChat Pay, are responsible for the custody of consumer top-up funds and execute automatic transfer functions based on the system's smart contracts; The blockchain referred to is Hyperledger Fabric, an open-source, enterprise-grade permissioned distributed ledger technology (DLT) platform with differentiated capabilities compared to other popular distributed ledger or blockchain platforms. Fabric's participants are permissioned; participants are known to each other but not fully trustworthy, but the network operates under a governance model established by the trust that exists between participants; The payment channel is an overlay network built on the blockchain Fabric. The payment channel network provides the possibility to open payment channels and process payments off-chain. The payment channel off-chain realizes a large number of small payments between two blockchain nodes without submitting them to the block every time. When two nodes agree to open a payment channel, a smart contract is created and encrypted tokens are locked as the channel balance; after the channel is established, transactions are conducted through the channel and the channel balance is maintained.
7. A computer device, characterized in that: The computer device includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the following steps: Trusted fund custodians are introduced to manage funds. Consumers' recharges for prepaid services are transferred to merchants for a two-way auction on the auction market provided by the platform operator. Merchants formulate different pre-settlement preferential plans based on their marketing strategies, and consumers choose the appropriate pre-settlement amount based on the pre-settlement preferential plans. When the auctioneers reach a deal, the merchant will be automatically paid, with the settlement amount transferred from the bank's public supervision account to the merchant, and an equal number of tokens deposited into the payment channel as initial funds; Through the blockchain's smart contract mechanism, a payment channel is established between consumers and merchants. Consumers deposit a certain amount of tokens in the payment channel as initial funds. Consumers and merchants conduct transactions through the channel and maintain a channel balance. Each purchase made by a consumer at a merchant consumes a corresponding number of tokens, and the consumption details are encrypted and stored in the platform operator's global database. When the channel balance is insufficient for further consumption, the smart contract is triggered to record the current channel balance of the consumer and merchant on the blockchain and execute a second round of two-way auction. Merchants register on the platform and pay a risk reserve. If a merchant ceases operations and cannot continue to provide services, the platform operator will verify the situation and activate the smart contract to refund the customer's unused balance. Consumers can freely and safely purchase prepaid consumption services from any merchant joining the platform.
8. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor performs the following steps: Trusted funds custodians are introduced to manage funds. Consumers' recharges for prepaid services are transferred to a third-party public regulatory account, and the recharge contracts are recorded on the blockchain distributed ledger. Consumers and merchants conduct two-way auctions on the auction market provided by the platform operator. Merchants formulate different pre-settlement preferential plans based on their marketing strategies, and consumers choose the appropriate pre-settlement amount based on the pre-settlement preferential plans. When the auctioneers reach a deal, the merchant will be automatically paid, with the settlement amount transferred from the bank's public supervision account to the merchant, and an equal number of tokens deposited into the payment channel as initial funds; Through the blockchain's smart contract mechanism, a payment channel is established between consumers and merchants. Consumers deposit a certain amount of tokens in the payment channel as initial funds. Consumers and merchants conduct transactions through the channel and maintain a channel balance. Each purchase made by a consumer at a merchant consumes a corresponding number of tokens, and the consumption details are encrypted and stored in the platform operator's global database. When the channel balance is insufficient for further consumption, the smart contract is triggered to record the current channel balance of the consumer and merchant on the blockchain and execute a second round of two-way auction. Merchants register on the platform and pay a risk reserve. If a merchant ceases operations and cannot continue to provide services, the platform operator will verify the situation and activate the smart contract to refund the customer's unused balance. Consumers can freely and safely purchase prepaid consumption services from any merchant joining the platform.
9. An information data processing terminal, characterized in that: The information data processing terminal is used to implement the multi-stage prepaid transaction system based on blockchain as described in claim 6.
Citation Information
Patent Citations
Prepayment consumption management method and system based on block chain and storage medium
CN110163595A
Off-chain security payment method and system based on alliance chain, medium and equipment
CN112241884A
Renewable distributed energy unified price two-way auction transaction method based on super account book
CN112365330A