CN110570310B - Block chain transfer method and consensus realization method, device, equipment and medium - Google Patents

Block chain transfer method and consensus realization method, device, equipment and medium Download PDF

Info

Publication number
CN110570310B
CN110570310B CN201910874806.6A CN201910874806A CN110570310B CN 110570310 B CN110570310 B CN 110570310B CN 201910874806 A CN201910874806 A CN 201910874806A CN 110570310 B CN110570310 B CN 110570310B
Authority
CN
China
Prior art keywords
lease
money
account
currency
transaction request
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910874806.6A
Other languages
Chinese (zh)
Other versions
CN110570310A (en
Inventor
朱月俊
孙君意
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201910874806.6A priority Critical patent/CN110570310B/en
Publication of CN110570310A publication Critical patent/CN110570310A/en
Application granted granted Critical
Publication of CN110570310B publication Critical patent/CN110570310B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Computer Security & Cryptography (AREA)
  • General Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • Technology Law (AREA)
  • Strategic Management (AREA)
  • Marketing (AREA)
  • Economics (AREA)
  • Development Economics (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The application discloses a transfer method of a block chain, a consensus realization method, a device, equipment and a medium, and relates to the technical field of block chains. The specific implementation scheme is as follows: receiving a currency lease transaction request; executing the money lease transaction request to form money lease transaction data and recording the money lease transaction data into a block, wherein the money lease transaction data at least comprises a lease account, lease money and a lease account; receiving a transfer transaction request, and if the money to be transferred in the transfer transaction request is the leasing money recorded in the blockchain and the transfer account is not the leasing account, invalidating the transfer transaction request. Through the technical scheme of this application, can avoid the brie and select the problem, optimize rights and interests recognition mechanism, reduce the simple dependence to virtual currency quantity.

Description

Block chain transfer method and consensus realization method, device, equipment and medium
Technical Field
The application relates to the technical field of computers, in particular to a block chain technology, and particularly relates to a block chain transfer method, a block chain consensus realization method, a block chain transfer device, a block chain consensus realization device and a block chain consensus realization medium.
Background
The blockchain system is used as a decentralized network node system, and the consistency of operation needs to be realized through a consensus mechanism.
The PoS (Proof of authority) is a consensus mechanism, which is a block chain consensus mechanism that does not depend on energy consumption and achieves on-chain consensus through Proof of authority. PoS agrees on the age of the similar currency, and determines the amount of interest a user has by the amount of virtual currency in the blockchain. The Proof of delegation rights and interests (DPoS) is a consensus mechanism that a user jointly selects some super nodes for block-out by exchanging virtual currency into votes, and the root of the Proof of delegation rights and interests depends on the number of the virtual currency.
However, users with a small coin-holding capacity in the PoS mode have little right to participate in the consensus process of determining the block nodes. While all of the money-bearing users can participate in the consensus process of determining a block node in the DPoS approach, a briberbering problem may arise.
Disclosure of Invention
The embodiment of the application provides a block chain transfer method, a block chain consensus realization method, a block chain transfer device, a block chain consensus realization device and a block chain consensus realization medium, so that the briberation problem is avoided, an equity consensus mechanism is optimized, and the simple dependence on the number of virtual currencies is reduced.
In a first aspect, an embodiment of the present application discloses a block chain transfer method, which is applied to a block chain node, and the method includes:
receiving a currency lease transaction request;
executing the money lease transaction request to form money lease transaction data and recording the money lease transaction data into a block, wherein the money lease transaction data at least comprises a lease account, lease money and a lease account;
and receiving a transfer transaction request, and if the money to be transferred in the transfer transaction request is the lease money recorded in the blockchain and the transfer-out account is not the lease account, invalidating the transfer transaction request.
One embodiment in the above application has the following advantages or benefits: and receiving and executing a money lease transaction request, recording the lease account, the lease money and the lease account as money lease transaction data in a block, and after receiving the transfer transaction request, if the money to be transferred is the lease money recorded in the block chain and the transfer account is not the lease account, determining that the transfer transaction request is invalid. A new money lease transaction mode is provided, under the money lease transaction mode, the use authority of a lease account to the lease money under the name is limited, and the lease money cannot be used for transfer transaction.
Optionally, the money lease transaction request is an unspent transaction output UTXO, and a transfer account field of the UTXO records a lease account, a transaction data identifier of the UTXO, and the lease account.
The above alternative has the following advantages or benefits: by modifying the field recording mode of the UTXO, generating the money lease transaction request based on the UTXO and recording the transaction data of the money lease transaction request in the form of the field, whether the money to be transferred in the transfer transaction is lease money or not can be conveniently, quickly and accurately determined in the follow-up process, and the execution efficiency of the transfer transaction request is improved.
In a second aspect, an embodiment of the present application further provides a method for implementing consensus of a block chain, where the method is applied to a block chain node, and the method includes:
receiving a currency lease transaction request;
executing the currency lease transaction request to record the lease currency leased to the lease account by the lease account;
calculating the interest value of the rented account according to the holding currency and the rented currency of the rented account;
and initiating a block-out node competition transaction request based on the interest value according to the interest value of the leased account.
One embodiment in the above application has the following advantages or benefits: after receiving and executing the currency lease transaction request, calculating the interest value of the lease account according to the lease account holding currency and the lease currency, and initiating a block outlet node competition transaction request based on the interest value. When the rent-out account leases money to the rent-in account, the rent-out account votes for the rent-in account, but because the use authority of the rent-in account to the lease money under the name of the rent-in account is limited in the money lease transaction mode, the lease money cannot be used for transfer transaction, even if a malicious node leases a large amount of lease money from other nodes, the lease money cannot be transferred after the equity value is increased, the cost of malicious attack is high, and further the frequent attack of the malicious node to the consensus mechanism is reduced.
Optionally, calculating the interest value of the leased account according to the holding currency and the lease currency of the leased account includes:
determining a equity weight value according to the holding currency of the rented account and/or the duration of the rented currency in the rented account;
calculating a equity value of the held currency and/or the leased currency according to the quantity of the held currency and/or the leased currency and the equity weight value;
and accumulating the interest values of the holding currency and the renting currency to be used as the interest value of the renting account.
Optionally, the equity weight value increases in proportion to the duration, and the equity weight value does not exceed a set upper limit value.
The above alternative has the following advantages or benefits: when the equity value of the rented account is calculated, the equity value of the rented user is calculated in a weighting mode instead of simply accumulating the held money and the rented money of the rented account, the equity weight value is determined according to the duration of the held money and the rented money under the rented account, and the equity value of the rented user is calculated, so that the equity value of a malicious node is prevented from being increased by transferring or leasing money in a large amount in a short period, the malicious node holds a large amount of transferred or leased money in a long period, the cost of malicious attack is increased, and the frequent attack of the malicious node on the consensus mechanism is reduced.
Optionally, the determining the equity weight value according to the holding currency of the leased account and/or the duration of the leased currency in the leased account includes:
dividing blocks of a block chain into a plurality of block sets by taking a set number of blocks as a unit;
determining the weight value according to a distance between the block set and the current block, wherein the distance corresponds to duration;
correspondingly, calculating the interest value of the held currency and/or the rented currency according to the quantity of the held currency and/or the rented currency and the interest weight value comprises the following steps:
determining the amount of transferred money recorded by each block in each block set, wherein the amount of transferred money comprises the amount of held money and/or the amount of rented money;
calculating the interest value of the centralized held currency and/or the rented currency of each block according to the amount of the transferred currency recorded by each block in each block set and the interest weight value of the block set;
the equity values for the sets of blocks are accumulated to determine equity values for the held currency and/or the rented currency.
The above alternative has the following advantages or benefits: when the equity weight value is determined, the set number of blocks are used as a unit, the block chain is divided into a plurality of block sets, and an equity weight value is determined for the transferred currency in each block set, so that the calculation amount of the equity weight value is greatly reduced. And representing the duration of the money transferred into the block sets by the distance between each block set and the current block, wherein the larger the distance is, the larger the corresponding equity weight value is, and further calculating the equity value of each block set. The method and the device can quickly and accurately determine the rights and interests weighted value of each block set, well prevent the condition that the rights and interests of malicious nodes are improved by frequently transferring or leasing money in a short period, and reduce the frequent attack of the malicious nodes on the consensus mechanism.
Optionally, the money lease transaction request is an unspent transaction output UTXO, and a transfer account field of the UTXO records a lease account, a transaction data identifier of the UTXO, and the lease account.
Optionally, determining the amount of the rental currency of each block record in each block set includes:
extracting UTXO recorded by each block in each block set;
if the transfer account field of the UTXO records a rental account, the transaction data identification of the UTXO and the rental account, determining that the transfer currency of the UTXO is rental currency;
and calculating the amount of the rented money according to the UTXO.
The above alternative has the following advantages or benefits: the currency lease transaction request is generated based on the UTXO, and the lease currency and the holding currency in the transfer currency are quickly and accurately distinguished by checking the transfer account field in the UTXO, so that the efficiency of calculating the equity value is improved.
In a third aspect, an embodiment of the present application further provides a device for transferring a blockchain, where the device is configured at a blockchain node, and the device includes:
a first lease receiving module for receiving a money lease transaction request;
the first lease execution module is used for executing the currency lease transaction request to form currency lease transaction data and recording the currency lease transaction data into a block, wherein the currency lease transaction data at least comprises an lease account, lease currency and a lease account;
and the transfer request receiving module is used for receiving a transfer transaction request, and if the money to be transferred in the transfer transaction request is the leasing money recorded in the blockchain and the transfer-out account is not the leasing-out account, the transfer transaction request is invalid.
One embodiment in the above application has the following advantages or benefits: and receiving and executing a money lease transaction request, recording the lease account, the lease money and the lease account as money lease transaction data in a block, and after receiving the transfer transaction request, if the money to be transferred is the lease money recorded in the block chain and the transfer account is not the lease account, determining that the transfer transaction request is invalid. A new money lease transaction mode is provided, under the money lease transaction mode, the use authority of a lease account to the lease money under the name is limited, and the lease money cannot be used for transfer transaction.
In a fourth aspect, an embodiment of the present application further provides an apparatus for implementing consensus of a blockchain, where the apparatus is configured at a blockchain node, and the apparatus includes:
a second lease receiving module for receiving a monetary lease transaction request;
the second lease execution module is used for executing the currency lease transaction request so as to record that the lease currency is leased into the lease account by the lease account;
the equity value calculation module is used for calculating the equity value of the rented account according to the holding currency and the rented currency of the rented account;
and the out-block competition initiating module is used for initiating out-block node competition transaction requests based on the equity value according to the equity value of the leased account.
One embodiment in the above application has the following advantages or benefits: after receiving and executing the currency lease transaction request, calculating the interest value of the lease account according to the lease account holding currency and the lease currency, and initiating a block output node competition transaction request based on the interest value. When the rent-out account rents money to the rent-in account, the rent-out account votes for the rent-in account, but because the use authority of the rent-in account to the rent-in money under the name of the rent-in account is limited in a money rent transaction mode, the rent-in money cannot be used for transfer transaction, even if malicious nodes rent a large amount of rent money from other nodes, the rent money cannot be transferred after the rights and interests are improved, so that the cost of malicious attack is high, and further, the frequent attack of the malicious nodes on a common recognition mechanism is reduced.
In a fifth aspect, an embodiment of the present application further discloses an electronic device, including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to cause the at least one processor to perform a method of transferring and a consensus realization of a blockchain as described in any embodiment of the present application.
In a sixth aspect, embodiments of the present application further disclose a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform a block chain transfer method and a consensus implementation method as described in any of the embodiments of the present application.
One embodiment in the above application has the following advantages or benefits: a new money lease transaction mode is provided, under the money lease transaction mode, the use authority of a lease account to the lease money under the name is limited, and the lease money cannot be used for transfer transaction. Meanwhile, when the block chain node initiates a block output node competition transaction request, the equity value of the leased account is calculated according to the leased account holding currency and the leased currency, and the block output node competition transaction request is initiated based on the equity value. Because the use authority of the rental account on the name of the rental money is limited in the money rental transaction mode, the rental money cannot be used for transfer transaction, even if a malicious node rents a large amount of rental money from other nodes, the rental money cannot be transferred after the equity value is increased, the malicious attack cost is high, and further the frequent attack of the malicious node on the consensus mechanism is reduced.
Other effects of the above-described alternative will be described below with reference to specific embodiments.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be considered limiting of the present application. Wherein:
fig. 1 is a flowchart of a block chain transfer method according to a first embodiment of the present application;
fig. 2A is a flowchart of a block chain consensus implementation method according to a second embodiment of the present application;
FIG. 2B is a graphical illustration of a currency duration versus equity weight value according to a second embodiment of the present application;
fig. 3 is a flowchart of a block chain consensus implementation method according to a third embodiment of the present application;
FIG. 4 is a view illustrating a configuration of a blockchain transfer device according to a fourth embodiment of the present application;
fig. 5 is a schematic structural diagram of an apparatus for implementing block chain consensus according to a fifth embodiment of the present application;
fig. 6 is a block diagram of an electronic device for implementing a block chain transfer method and a consensus implementation method according to an embodiment of the application.
Detailed Description
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application for the understanding of the same, which are to be considered exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
First embodiment
Fig. 1 is a flowchart of a method for transferring a blockchain according to a first embodiment of the present disclosure, where the present embodiment is suitable for processing a transfer transaction request in a blockchain network, and is particularly suitable for processing a transfer transaction request when money to be transferred in the transfer transaction request is rental money. The method may be performed by a block link point, which may be a block exit node in the block link network, or may be another node in the block link network, such as any node that does not currently have block generation permission. The method may be performed by a blockchain transfer device, which may be implemented in software and/or hardware. As shown in fig. 1, the method for transferring block chains according to this embodiment may include:
s101, a currency lease transaction request is received.
The money lease transaction request may be a transaction request requesting that a preset amount of lease money for a leased account be leased to a leased account. The money lease transaction request can be initiated after any one of two leasing parties completes money lease transaction negotiation with the other party; or initiated by a third party delegated by the two leasing parties after the two leasing parties complete the money lease transaction negotiation. Alternatively, the initiating node of the money lease transaction request may be a full node or a lightweight node of the blockchain network.
Optionally, the money lease transaction request of this embodiment may be an intelligent contract or an unspent transaction output UTXO, and when the money lease transaction request is an intelligent contract, the initiating node may obtain the money lease intelligent contract after completing the money lease transaction negotiation, use the money lease transaction as input data, and invoke the virtual machine to run a relevant program code in the money lease intelligent contract regarding generation of the money lease transaction request, so as to obtain the money lease transaction request corresponding to the money lease transaction.
Optionally, when the money lease transaction request is an unspent transaction output UTXO, the transfer-in account field of the UTXO of the present application records a lease account, a transaction data identifier of the UTXO, and the lease account. It should be noted that, the UTXO is a data record in the form of fields, and in general, the UTXO includes at least three fields, and one field records a money transfer account; another field records the account to which money is transferred; there is also a field to record currency data such as time, amount, etc. of money transferred. In this embodiment, a field record manner of a general UTXO may be modified for the money lease transaction request, and a transfer account field of the UTXO is recorded with not only a lease account representing a transfer account but also a transaction data identifier (txid) of the UTXO. The transaction data identifier is a unique data identifier for distinguishing each UTXO. The initiating node of the money lease transaction request may generate a field-type money lease transaction request according to the recording mode of each field of the UTXO based on the money lease transaction after the money lease transaction negotiation is completed. For example, if the money lease transaction is that a leases B10 lease money, the generated money lease transaction request may be represented as, based on the record mode of each field of the UTXO, where the field of the roll-out account is the lease account a; the fields transferred to the account are: rent account B, txid, rent out account a; the currency data fields are: 10 rental currencies. When the initiating node generates a currency lease transaction request, the generated currency lease transaction request is sent to the block chain network, and the block chain node receives the currency lease transaction request.
S102, executing the money lease transaction request to form money lease transaction data and recording the money lease transaction data into the block.
Optionally, after receiving the money lease transaction request, the block link node processes the lease transaction request to obtain money lease transaction data, where the money lease transaction data at least includes a lease account, lease money, and a lease account. The rental money may include the rental money amount, rental time, and the like. For example, if the money lease transaction request is that a leases B10 lease money, then after processing the money lease transaction request, the obtained money lease transaction request at least includes: rent account B, 10 lease currencies, rent out account a. Optionally, the money lease transaction request may also be included in the money lease transaction data.
Specifically, when executing the money lease transaction request, if the money lease transaction request is an intelligent contract, the block link node may obtain the money lease intelligent contract, and call the virtual machine to run the relevant program code related to processing the money lease transaction request in the money lease intelligent contract, using the money lease transaction request as input data, so as to obtain the transaction data of the money lease transaction request. If the money lease transaction request is UTXO, then the data recorded in each field of the money lease transaction request may be obtained as money lease transaction data at this time. Optionally, in this embodiment, while the money lease transaction data is recorded in the current block, the money lease transaction data is also recorded in the local disk, so that the advantage of avoiding traversing the block every time when subsequently searching for the money lease transaction data is achieved is that the efficiency of subsequently searching for the money lease transaction data is improved.
Optionally, the money lease transaction manner in this embodiment is performed based on the online lease transaction request, and is recorded in the blockchain, so that the reliability and traceability of the money lease transaction are improved, and the bribing problem caused by the online operation is avoided.
S103, receiving the transfer transaction request, and if the money to be transferred in the transfer transaction request is the leasing money recorded in the block chain and the transferred account is not a leased account, invalidating the transfer transaction request.
The transfer transaction request may be an existing ordinary transfer transaction request, that is, a transaction request for transferring a preset amount of money from the transfer-out account to the transfer-in account. May be initiated by either of the parties or by a third party delegated by the parties. The initiator may be a full node or a lightweight node of the blockchain network. The transfer transaction request of the embodiment may also be a smart contract or non-spending transaction output UTXO, and when the transfer transaction request is the UTXO, only the transfer account is recorded in the transfer account field of the UTXO. It should be noted that, similar to the money lease transaction request in this embodiment, the transfer transaction request requests money transfer from one party to another party, but the difference is that the money transferred to the transfer account based on the transfer transaction request can be paid by the transfer user at will, i.e. a transfer or other transaction can be performed, while the money transferred to the transfer user based on the money lease transaction request is limited in the usage right, e.g. limited to calculating the right value of the account when competing for a block node, and cannot be used for the money transfer, i.e. a transfer or other transaction. The purpose of setting the use permission of the rental money in the embodiment is to prevent the situation that the rental money is immediately transferred out after a malicious node attacks the consensus mechanism by frequently increasing the interest value of the rental money.
Optionally, after a transfer transaction request is generated by a generation node of the transfer transaction request, the transfer transaction request is sent to the blockchain network, and a node in the blockchain network receives the transfer transaction request. However, because there is a money lease transaction in this embodiment, and lease money acquired by an lease account in the money lease transaction process does not have a transfer use authority, after receiving the transfer transaction request, the block chain node in this embodiment does not directly process the received transfer transaction request, but first determines whether the money to be transferred (i.e., money to be transferred) of the transfer transaction request is the money acquired by the lease transaction (i.e., whether the money to be transferred) or not, if so, further determines whether a lease account corresponding to the lease money is a transfer-out account of the transfer transaction request, and if not, since the lease account has no transfer authority for the lease money, the transfer transaction request received this time is invalid, and the transfer transaction request is not executed; otherwise, the received transfer transaction request is valid, the transfer transaction request is executed, and the obtained transfer transaction data is recorded in the blockchain, optionally, the transfer transaction data is also stored in the local disk while being recorded in the blockchain.
Optionally, in this embodiment, when determining whether the money to be transferred in the transfer transaction request is the rental money recorded in the blockchain and determining whether the transfer account is an account to be rented, the determination may be performed based on an intelligent contract, for example, which money is reserved in the intelligent contract as the rental money and which account is an account to be rented, and at this time, the determination whether the money to be transferred is the rental money recorded in the blockchain and whether the transfer account is an account to be rented may be performed by using the intelligent contract reserved in advance. Optionally, because the money lease transaction request and the transfer transaction request of the embodiment may also be UTXO, when determining whether the money to be transferred is lease money, the embodiment may check whether the UTXO corresponding to the money to be transferred further includes a lease account in a corresponding transfer account field, and if yes, indicate that the money to be transferred is lease money; when judging whether the transfer-out account is a rent-out account, the transfer-out account of the transfer transaction request can be obtained from the transfer-out account field of the transfer transaction request, the rent-out account of the rent money can be obtained from the transfer-out account field in the UTXO corresponding to the money to be transferred, and then whether the transfer-out account is consistent with the rent-out account is judged.
According to the technical scheme, the money lease transaction request is received and executed, the lease account, the lease money and the lease account are taken as money lease transaction data to be recorded in the block, and after the transfer transaction request is received, if the money to be transferred is the lease money recorded in the block chain and the transfer account is not the lease account, the transfer transaction request is regarded as invalid. A new money lease transaction mode is provided, under the money lease transaction mode, the use authority of a lease account to the lease money under the name is limited, and the lease money cannot be used for transfer transaction.
Second embodiment
Fig. 2A is a flowchart illustrating a block chain consensus method according to a second embodiment of the present application, and fig. 2B is a graph illustrating a relationship between a currency duration and an equity weight value according to the second embodiment of the present application. The embodiment is suitable for the implementation process of the consensus mechanism of the blockchain network, and is particularly suitable for the implementation process of the POS consensus mechanism of the blockchain network. The method may be performed by a block link point, which may be a block exit node in the block link network, or may be another node in the block link network, such as any node that does not currently have block generation permission. The method may be performed by a block chain consensus implementation apparatus, which may be implemented in software and/or hardware. As shown in fig. 2A-2B, the method for implementing block chain consensus provided in this embodiment may include:
s201, a currency lease transaction request is received.
Optionally, the execution process of S201 may be similar to the execution process of S101 in the first embodiment, and is not described herein again.
S202, executing the currency lease transaction request to record that the lease currency is leased to the lease account by the lease account.
Alternatively, the execution process of S202 may be similar to the execution process of S102 in the first embodiment described above, that is, the process of recording the lease money from the lease account to the lease account in this embodiment is equivalent to the process of forming and recording the money lease transaction data including the lease account, the lease money, and the lease account in the block in S102 in the first embodiment. This is described in detail herein.
And S203, calculating the interest value of the rented account according to the holding currency and the rented currency of the rented account.
The money under the rental account includes two types, one is holding money, and the other is rental money. Holding currency refers to the currency acquired by non-lease transaction under an account which has spending dominance (such as being used for transferring money) on holding currency, and the holding currency can also be used for calculating the equity value of the account; the lease money is money acquired by a lease transaction under a lease account, the lease account has no spending dominance such as transfer account and the like, and for the lease user, the lease money can only be used for calculating the equity value of the account to which the lease money belongs.
Optionally, in this embodiment, the manner of distinguishing whether the money under the rental account is the held money or the rented money may be to distinguish the money by using an intelligent contract, or may distinguish the money by using a UTXO, which has been described in the foregoing first embodiment, and this embodiment is not described in detail herein.
Alternatively, in this embodiment, each block in the block chain may be traversed from back to front in sequence, and the holding currency and the lease currency under the lease account recorded in each block may be searched. If the transfer transaction data and the money lease transaction data are stored in the local disk of the block link point, the holding money and the lease money under the lease account can be searched from the local disk, and compared with the method for searching the data from the block, the method for searching the data from the local disk is high in efficiency and takes less time. After the holding currency and the rental currency of the rental account are found, there are many ways to calculate the equity value of the rental account according to the holding currency and the rental currency of the rental account, and this embodiment is not limited. The total amount of the held money and the rented money under the rented account can be directly calculated in an accumulation mode, and the accumulated total amount of the money is used as the equity value of the rented account.
In order to prevent a malicious node from frequently transferring or leasing money in a short period of time to improve the equity value of the malicious node, another possible implementation manner of the embodiment in calculating the equity value of a leased account can be realized by the following sub-steps:
s2031, determining a equity weight value according to the holding currency of the rented account and/or the duration of the rented currency in the rented account.
Specifically, for the held currency and/or the rented currency under the rented account, the equity weight value of each currency in the various currencies can be determined according to the duration of each currency in the various currencies under the rented account. Wherein, the duration of the money in the account renting can be a time interval from the time when the money is transferred to the account renting to the current time. The rights weight value increases in proportion to the duration, and the rights weight value does not exceed a set upper limit value. As shown in fig. 2B, the abscissa h represents the duration of the money under the rental account, and the ordinate price represents the equity weight value of the money; when the duration h of the currency under the renting account is less than or equal to the set upper limit N, the corresponding right and interest weight value price is correspondingly increased along with the increase of the duration h; when the duration h of the currency under the account renting condition is longer than the set upper limit N, the corresponding right and interest weight value price is not increased along with the increase of the duration h, and the fixed right and interest weight value 1 is kept unchanged. Optionally, the embodiment may be a unified curve relationship diagram set for the held currency and the rental currency; it is also possible to set different two curve relations for the holding currency and the leasing currency, respectively.
Optionally, when determining the equity weight value of each currency in the leased account according to the duration of the currency in the leased account, the equity weight value may be determined by looking up a table or calculating according to a preset formula, in addition to the above description, and this embodiment is not limited.
S2032, calculating the equity value of the held money and/or the rented money according to the amount of the held money and/or the rented money and the equity weight value.
Specifically, in S2031, the equity weight value of each held currency and/or each rented currency is calculated, and at this time, when the equity value of the held currency and/or the rented currency is calculated, the equity value corresponding to each currency may be obtained by multiplying the number of each held currency and/or each rented currency by the corresponding equity weight value. According to the method, a equity value corresponding to each currency (including holding currency and rental currency) under a rental account is calculated.
S2033, the equity value of the held money and the rented money is accumulated as the equity value of the rented account.
Specifically, the calculated equity value of each piece of held money and the equity value of each piece of rented money under the rented account in S2032 are summed, and the summed result is used as the current equity value of the rented account.
It should be noted that, when the equity value of the leased account is calculated, the equity weight value is determined according to the duration of the held currency and the leased currency under the leased account, the equity value of the leased user is calculated in a weighting mode, and the values of the held currency and the leased currency are increased along with time, so that the equity value of a malicious node is prevented from being improved by transferring or leasing a large amount of virtual currency in a short period, and the malicious node holds a large amount of transferred or leased currency for a long period, so that the cost of malicious attack is increased, and the frequent attack of the malicious node on the consensus mechanism is reduced.
And S204, initiating a block-out node competition transaction request based on the interest value according to the interest value of the leased account.
The block-out node competition transaction request may be a transaction request for competing the block node, which is initiated by a node where the node is located when the current equity value of a node user who is not the block-out node reaches the standard for competing for the block node and the node user wants to compete for the block node.
Optionally, a certain number of slots may be preset in the blockchain network for recording the block node, for example, a table may be recorded in the blockchain, where the table includes a set number (e.g., 15) of slots, each slot in the table records an identifier of a block node, and the block nodes perform block outputting according to a preset rule, for example, a rule such as rotation rule, preset time rule, or the like. When a user of a node wants to compete out a block node, the user selects a node that the user wants to compete out from the block node identifiers recorded in the slots in the table as a target block node (optionally, in order to succeed in competition as much as possible, the user usually selects the block node with the lowest interest value as the target block node). And then obtaining a block competition intelligent contract, using competition data as input data, calling a virtual machine to run a related program code related to generation of a block node competition transaction request in the block competition intelligent contract, and initiating the block node competition transaction request based on the interest value. The competition data may include, but is not limited to, a target block-out node that wants to compete, a rights value of the leased account, and a competition cost (where the competition cost refers to a fixed cost of money, also referred to as a competition cost, regardless of whether the competition is successful). It should be noted that, in addition to initiating the outbound node competition transaction request based on the interest value in a manner based on the intelligent contract, the present embodiment may also initiate in other manners, which is not limited in this embodiment.
Optionally, after initiating a block out node competition transaction request based on the equity value, the embodiment may execute a process of the block out node competition transaction request, for example, after all nodes having the equity value receive the block out node competition transaction request, determine whether a lease-in account equity value of a block out node to be contended in the request satisfies a minimum block out election condition (e.g., whether the equity value reaches a preset minimum equity threshold value); and judging whether the interest value of the leased account is larger than the interest value of the target block-out node, judging whether the leased account is a non-block-out node or not, and the like, if so, indicating that the leased account is successful in election, replacing the target block-out node with the leased account, and recording the transaction data of the execution of the competition transaction request in a block chain.
According to the technical scheme of the embodiment of the application, after the currency lease transaction request is received and executed, the interest value of the lease account is calculated according to the money held by the lease account and the lease money, and the block node competition transaction request is initiated based on the interest value. When the rent-out account leases money to the rent-in account, the rent-out account votes for the rent-in account, but because the use authority of the rent-in account to the lease money under the name of the rent-in account is limited in the money lease transaction mode, the lease money cannot be used for transfer transaction, even if a malicious node leases a large amount of lease money from other nodes, the lease money cannot be transferred after the equity value is increased, the cost of malicious attack is high, and further the frequent attack of the malicious node to the consensus mechanism is reduced.
Third embodiment
Fig. 3 is a flowchart of a block chain consensus implementation method according to a third embodiment of the present application, and this embodiment specifically gives a detailed process description how to calculate the equity value of the leased account according to the holding currency and the lease currency of the leased account based on the above embodiments. As shown in fig. 3, the method for implementing block chain consensus provided in this embodiment may include:
s301, a currency lease transaction request is received.
And outputting the UTXO for the non-cost transaction by the currency lease transaction request, wherein a transfer-in account field of the UTXO is recorded with a lease account, a transaction data identifier of the UTXO and the lease account.
S302, executing the money lease transaction request to record that the lease money is leased to the lease account by the lease account.
S303, the blocks of the block chain are divided into a plurality of block sets by using the set number of blocks as a unit.
Optionally, in the embodiment of the present application, when the equity value of the rented account is calculated, the equity weight value of each currency of the rented account needs to be calculated, but because the number of times of the currency transaction of the rented account is large, if an equity weight is determined for each currency, the workload is large. Therefore, the present embodiment may divide the blocks in the block chain into at least one block set by taking the set number of blocks as a unit. For example, a block chain network may generate approximately 8 ten thousand blocks a day, 2 ten thousand blocks may be used as a unit of a preset number of blocks, a block set may be divided by every 2 ten thousand blocks of the blocks in the block chain according to the block link order, and a block generated a day may be divided into 4 block sets.
S304, determining a rights weight value of each block set according to the distance between each block set and the current block, wherein the distance corresponds to the duration.
Optionally, in this embodiment, a mapping relationship between the distance between the tile set and the current tile and the right weight value may be preset, and optionally, the mapping relationship may be represented by a table, a formula, or a graph (as shown in fig. 2B). Then, according to each block set divided in S303, the distance between the block set and the current block is calculated for each block set, and further, a right weight value corresponding to the currently calculated distance is determined as a right weight value corresponding to the block set by presetting a mapping relationship between the distance between the block set and the current block and the right weight value. Because the blocks in the block chain are linked according to the time sequence, the duration of each currency in the block under the account renting is represented by calculating the distance between each block set and the current block, the transaction time of each currency does not need to be checked, the effect that the value of each currency under the account renting is increased along with the time can be achieved, and the calculation amount for judging the duration of each currency is greatly reduced.
Optionally, in the present embodiment, when calculating the distance between each block set and the current block, the number of blocks separated between the reference block and the current block of each block set may be used as the distance between the block set and the current block. The reference block may be the first block, the last block, or an intermediate block in the block set. For example, if the reference block of the block set is the 10001 th block of the block chain and the current block is the 20001 blocks of the block chain, the distance between the block set and the current block is 10000.
S305, determining the amount of transferred money recorded by each block in each block set, wherein the amount of transferred money comprises the amount of held money and/or the amount of rented money.
Where the transfer currency may be currency associated with the transfer transaction, such as may include holding currency obtained through transfer transactions, and rental currency obtained through rental transactions.
Optionally, since the equity value of the rented account needs to be determined based on all transferred-in currencies of the rented account, and each transferred-in currency of the rented account and the transfer transaction request and the currency rental transaction request corresponding to the transferred-in currency are recorded in the blocks of the block chain, the amount value of each transferred-in currency needs to be searched and determined from each block of each block set. Specifically, in this embodiment, the data recorded in each block set may be sequentially traversed, the data of the transfer transaction and/or the data of the lease transaction recorded in the data may be searched, and then the data of the transfer transaction and/or the data of the lease transaction may be analyzed and calculated, so as to determine the amount of held money corresponding to the transfer transaction, and/or determine the amount of lease money corresponding to the lease transaction.
Optionally, the currency lease transaction request of this embodiment outputs UTXO for an unspent transaction, and the transfer-in account field of the UTXO records a lease account, a transaction data identifier of the UTXO, and the lease account. Therefore, when determining the amount of the rental money recorded by each tile in each tile set, the present embodiment can be implemented by the following sub-steps:
s3051, extracting UTXO recorded in each block of each block set.
Specifically, each block in each block set may be sequentially traversed to check whether data in the form of UTXO is recorded therein, and if the data in the form of UTXO is recorded, the data in the form of UTXO is acquired. Optionally, the data in the form of the UTXO may have a uniform field identifier, and at this time, it may be determined whether each data in the block record includes the field identifier, and if so, the data is the data in the form of the UTXO. It should be noted that in the present embodiment, the data in the form of UTXO may include money lease transaction data and transfer transaction data in the form of UTXO.
S3052, if the transfer-in account field of the UTXO records the rent account, the transaction data identification of the UTXO and the rent-out account, determining that the transfer-in currency of the UTXO is rent-in currency.
Specifically, the account to be rented, the transaction data identifier of the UTXO, and the account to be rented are recorded in the account to be transferred field in the transaction data of the UTXO of the present embodiment. And the transferred account field in the transfer transaction data in the common UTXO form only records the transferred account. Therefore, the present embodiment may check the transferred account field of the data in the form of UTXO extracted in S3501, and if only the transferred account field has a transferred account, it indicates that the data in the form of TUXO is transfer transaction data, and may determine that the transferred money in the data is held money; if the account field of the transferred account is recorded with the transaction data identification of the rented account, the UTXO and the rented account, the TUXO form data is the money renting transaction data, and the transferred money in the data can be determined to be the rented money.
And S3053, calculating the amount of the rented money according to the UTXO.
Specifically, the amount value of the rental currency may be acquired from the currency data field of the currency rental transaction data in the form of UTXO.
Alternatively, if the money recorded in the UTXO extracted at S3501 is held money, the amount value of held money may be acquired from the money data field of the transfer transaction data in the form of UTXO.
S306, calculating the interest value of the money and/or the rented money in each block set according to the amount of the transferred money recorded in each block set and the interest weight value of the block set.
Optionally, since the interest value of each block set is already calculated in S304, and S305 also determines the amount of held money and/or rental money, that is, the amount of transferred money, of each block in each block set, at this time, for each block set, the product of the amount of each held money and/or rental money recorded in each block and the interest value of the block set may be obtained, and then the interest values corresponding to the held money and/or rental money in the block set are accumulated and summed, so as to obtain the interest value of the held money and/or rental money in the block set as the interest value of the block set.
S307, the interest value of each block set is accumulated to determine the interest value of the held currency and/or the rented currency.
Optionally, the interest values of the block sets determined in S306 are accumulated, that is, the interest values of the held money of the block sets are accumulated to determine the interest value of the held money; and/or accumulating the interest values of the rented money of the block sets to determine the interest value of the rented money.
S308, the interest value of the held currency and the interest value of the rented currency are accumulated to be used as the interest value of the rented account.
Optionally, if the interest values of the held currency and the rented currency are determined in S307, the interest values of the held currency and the rented currency determined in S307 are added as the interest values of the rented account; if the determined value of the interest in the held money is only the value of the interest in the held money in S307, the value of the interest in the held money determined in S307 may be directly used as the value of the interest in the leased account; if the determined S307 is only the interest value of the rental money, the interest value of the rental money determined in S307 may be directly used as the interest value of the rental account.
S309, according to the interest value of the leased account, initiating a block-out node competition transaction request based on the interest value.
According to the technical scheme of the embodiment of the application, when the equity weight value is determined, the block chain is divided into a plurality of block sets by taking the set number of blocks as a unit, and the equity weight value is determined for the transferred money in each block set, so that the calculation amount for calculating the equity weight value is greatly reduced. And representing the duration of the money transferred into the block set by the distance between each block set and the current block, wherein the larger the distance is, the larger the corresponding equity weight value is. The condition that the rights and interests of the malicious nodes are improved by frequently transferring or leasing the money in a short period is well prevented, and the frequent attack of the malicious nodes on the consensus mechanism is reduced. And when the equity value is calculated, the rented money and the held money in the transferred money are quickly and accurately distinguished by checking the transferred account field in the UTXO, so that the equity value calculating efficiency is further improved.
Fourth embodiment
FIG. 4 is a view illustrating a configuration of a blockchain transfer device according to a fourth embodiment of the present application; the transfer device of the block chain can execute the transfer method of the block chain provided by the first embodiment of the application, and has corresponding functional modules and beneficial effects of the execution method. Alternatively, the apparatus may be implemented in software and/or hardware, and may be integrated in an electronic device that carries nodes in a blockchain network. As shown in fig. 4, the blockchain transfer device 400 may include:
a first lease receiving module 401 for receiving a money lease transaction request;
a first lease execution module 402, configured to execute the money lease transaction request to form money lease transaction data and record the money lease transaction data into a block, where the money lease transaction data at least includes a lease account, a lease money, and a lease account;
a transfer request receiving module 403, configured to receive a transfer transaction request, and if the money to be transferred in the transfer transaction request is the lease money recorded in the blockchain and the transfer account is not the lease account, the transfer transaction request is invalid.
According to the technical scheme, the money lease transaction request is received and executed, the lease account, the lease money and the lease account are taken as money lease transaction data to be recorded in the block, and after the transfer transaction request is received, if the money to be transferred is the lease money recorded in the block chain and the transfer account is not the lease account, the transfer transaction request is regarded as invalid. A new money lease transaction mode is provided, under the money lease transaction mode, the use authority of a lease account to the lease money under the name is limited, and the lease money cannot be used for transfer transaction.
Further, the currency lease transaction request outputs UTXO for an unspent transaction, and a transfer account field of the UTXO records a lease account, a transaction data identifier of the UTXO, and the lease account.
Fifth embodiment
Fig. 5 is a schematic structural diagram of an apparatus for implementing block chain consensus according to a fifth embodiment of the present application; the block chain consensus realization device can execute the block chain consensus realization methods provided by the second embodiment and the third embodiment of the application, and has corresponding functional modules and beneficial effects of the execution methods. Alternatively, the apparatus may be implemented in software and/or hardware, and may be integrated in an electronic device that carries nodes in a blockchain network. As shown in fig. 5, the block chain consensus making device 500 may include:
a second lease receiving module 501 for receiving a money lease transaction request;
a second lease execution module 502, configured to execute the money lease transaction request, so as to record that a lease money is leased to a lease account by a lease account;
a equity value calculating module 503, configured to calculate an equity value of the leased account according to the holding currency and the lease currency of the leased account;
and an out-block competition initiating module 504, configured to initiate an out-block node competition transaction request based on the equity value according to the equity value of the leased account.
According to the technical scheme of the embodiment of the application, after the currency lease transaction request is received and executed, the equity value of the lease account is calculated according to the money held by the lease account and the lease money, and the block outlet node competition transaction request is initiated based on the equity value. When the rent-out account leases money to the rent-in account, the rent-out account votes for the rent-in account, but because the use authority of the rent-in account to the lease money under the name of the rent-in account is limited in the money lease transaction mode, the lease money cannot be used for transfer transaction, even if a malicious node leases a large amount of lease money from other nodes, the lease money cannot be transferred after the equity value is increased, the cost of malicious attack is high, and further the frequent attack of the malicious node to the consensus mechanism is reduced.
Further, the illustrated equity value calculation module 503 includes:
a weight value determining unit, configured to determine a equity weight value according to the holding currency of the leased account and/or the duration of the leased currency in the leased account;
a sub-equity value calculating unit for calculating equity values of the held money and/or the leased money according to the number of the held money and/or the leased money and equity weight values;
and the total equity value calculating unit is used for accumulating the equity values of the holding currency and the renting currency to be used as the equity value of the renting account.
Further, the equity weight value is increased in proportion to the duration, and the equity weight value does not exceed a set upper limit value.
Further, the weight value determining unit is specifically configured to:
dividing blocks of a block chain into a plurality of block sets by taking a set number of blocks as a unit;
determining a weight value of each set of blocks according to a distance between each set of blocks and a current block, the distance corresponding to a duration;
correspondingly, the sub-equity value calculating unit is specifically configured to:
determining the amount of transferred money recorded by each block in each block set, wherein the amount of transferred money comprises the amount of held money and/or the amount of rented money;
calculating the interest value of the money held in the block set and/or the rented money according to the amount of the transferred money recorded by each block in each block set and the interest weight value of the block set;
the equity values for each set of blocks are accumulated to determine equity values for the held currency and/or the rented currency.
Further, the currency lease transaction request outputs UTXO for an unspent transaction, and a transfer account field of the UTXO records a lease account, a transaction data identifier of the UTXO, and the lease account.
Further, when the sub-equity value calculating unit determines the amount of money transferred into each block record in each block set, the sub-equity value calculating unit is specifically configured to:
extracting UTXO recorded by each block in each block set;
if the transfer account field of the UTXO records the rented account, the transaction data identification of the UTXO and the rented account, determining the transfer currency of the UTXO as the rented currency;
and calculating the amount of the rented money according to the UTXO.
According to an embodiment of the present application, an electronic device and a readable storage medium are also provided.
Sixth embodiment
As shown in fig. 6, the block diagram is a block diagram of an electronic device for a block chain transfer method and a consensus implementation method according to an embodiment of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application that are described and/or claimed herein.
As shown in fig. 6, the electronic apparatus includes: one or more processors 601, memory 602, and interfaces for connecting the various components, including a high-speed interface and a low-speed interface. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions for execution within the electronic device, including instructions stored in or on the memory to display graphical information of a GUI on an external input/output apparatus (such as a display device coupled to the interface). In other embodiments, multiple processors and/or multiple buses may be used, along with multiple memories and multiple memories, as desired. Also, multiple electronic devices may be connected, with each device providing portions of the necessary operations (e.g., as a server array, a group of blade servers, or a multi-processor system). One processor 601 is illustrated in fig. 6.
The memory 602 is a non-transitory computer readable storage medium as provided herein. Wherein the memory stores instructions executable by at least one processor to cause the at least one processor to perform the block chain transfer method and consensus implementation method provided herein. The non-transitory computer readable storage medium of the present application stores computer instructions for causing a computer to perform the block chain transfer method and consensus implementation method provided herein.
Memory 602, which is a non-transitory computer-readable storage medium, may be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as program instructions/modules corresponding to the transfer method and consensus implementation method for a block chain in embodiments of the present application (e.g., first lease receiving module 401, first lease executing module 402, and transfer request receiving module 403 shown in fig. 4, or second lease receiving module 501, second lease executing module 502, entitlement value calculating module 503, and block out competition initiating module 504 shown in fig. 5). The processor 601 executes various functional applications of the server and data processing, i.e., a transfer method and a consensus realization method of the blockchain in the above-described method embodiments, by executing non-transitory software programs, instructions, and modules stored in the memory 602.
The memory 602 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the electronic device for implementing the transfer method and consensus implementation method of the block chain, and the like. Further, the memory 602 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory 602 optionally includes memory located remotely from the processor 601, and these remote memories may be connected over a network to an electronic device used to implement the block chain transfer method and consensus implementation method. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device for implementing the transfer method and the consensus implementing method of the blockchain may further include: an input device 603 and an output device 604. The processor 601, the memory 602, the input device 603 and the output device 604 may be connected by a bus or other means, and fig. 6 illustrates the connection by a bus as an example.
The input device 603 may receive input numeric or character information and generate key signal inputs related to user settings and function controls of the electronic device used to implement the transfer method and consensus implementation method of the blockchain, such as an input device like a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointer stick, one or more mouse buttons, a track ball, a joystick, etc. The output devices 604 may include a display device, auxiliary lighting devices (e.g., LEDs), and tactile feedback devices (e.g., vibrating motors), among others. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device can be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
These computer programs (also known as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user may provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
According to the technical scheme of the embodiment of the application, a new money lease transaction form is provided, the use authority of a lease account on lease money under the name of the lease account is limited in the money lease transaction form, the lease money cannot be used for transfer transaction, the lease means is carried out based on online transaction requests, the reliability and traceability of the money lease transaction are improved, and the bribery problem caused by offline operation is avoided. Meanwhile, when the block chain node initiates a block output node competition transaction request, the equity value of the leased account is calculated according to the leased account holding currency and the leased currency, and the block output node competition transaction request is initiated based on the equity value. Because the use authority of the rental account on the name of the rental money is limited in the money rental transaction mode, the rental money cannot be used for transfer transaction, even if a malicious node rents a large amount of rental money from other nodes, the rental money cannot be transferred after the equity value is increased, the malicious attack cost is high, and further the frequent attack of the malicious node on the consensus mechanism is reduced.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present application can be achieved.
The above-described embodiments should not be construed as limiting the scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (12)

1. A block chain transfer method is applied to a block chain node, and comprises the following steps:
receiving a currency lease transaction request;
executing the money lease transaction request to form money lease transaction data and recording the money lease transaction data into a block, wherein the money lease transaction data at least comprises a lease account, lease money and a lease account; wherein the money lease transaction request is a transaction request requesting to lease a preset amount of lease money of the leased account to the leased account; wherein the rental currency sets a usage right;
receiving a transfer transaction request, judging whether money to be transferred in the transfer transaction request is lease money or not, and if the money to be transferred in the transfer transaction request is the lease money recorded in a block chain and a transfer-out account is not the lease account, invalidating the transfer transaction request; the lease money is money obtained by a lease transaction under the lease account, and the lease account does not have transfer authority for the lease money.
2. The method of claim 1, wherein the monetary lease transaction request is an unspent transaction output UTXO and wherein a transfer account field of the UTXO carries a lease account, a transaction data identification of the UTXO, and the lease account.
3. A block chain consensus realization method is applied to a block chain node, and the method comprises the following steps:
receiving a currency lease transaction request;
executing the currency lease transaction request to record the lease currency leased to the lease account by the lease account; wherein the money lease transaction request is a transaction request requesting to lease a preset amount of lease money of the leased account to the leased account; the lease money is money obtained by lease transaction under the lease account, and the lease account does not have transfer authority to the lease money; wherein the rental currency sets a usage right; for the rented user, the usage rights of the rental currency only include calculating a rights value for the account of the rented user;
judging whether the money under the rented account is the held money or the rented money, and calculating the equity value of the rented account according to the held money and the rented money of the rented account;
and initiating a block outlet node competition transaction request based on the interest value according to the interest value of the leased account.
4. The method of claim 3, wherein calculating the equity value for the leased account based on the holding currency and the lease currency of the leased account comprises:
determining a equity weight value according to the holding currency of the rented account and/or the duration of the rented currency in the rented account;
calculating a equity value of the held currency and/or the leased currency according to the quantity of the held currency and/or the leased currency and the equity weight value;
and accumulating the interest values of the holding currency and the renting currency to be used as the interest value of the renting account.
5. The method of claim 4, wherein the equity weight value increases in proportion to the duration, and wherein the equity weight value does not exceed a set upper limit.
6. The method of claim 4 or 5, wherein determining the equity weight value based on the holding currency of the leased account and/or the duration of the lease currency in the leased account comprises:
dividing blocks of a block chain into a plurality of block sets by taking a set number of blocks as a unit;
determining a weight value of each block set according to a distance between each block set and a current block, wherein the distance corresponds to duration;
correspondingly, calculating the interest value of the held currency and/or the rented currency according to the quantity of the held currency and/or the rented currency and the interest weight value comprises the following steps:
determining the amount of transferred money recorded by each block in each block set, wherein the amount of transferred money comprises the amount of held money and/or the amount of rented money;
calculating the interest value of the money held in the block set and/or the rented money according to the amount of the transferred money recorded by each block in each block set and the interest weight value of the block set;
the equity values for the sets of blocks are accumulated to determine equity values for the held currency and/or the rented currency.
7. The method of claim 6, wherein the currency lease transaction request outputs a UTXO for an unspent transaction and wherein a transfer-in account field of the UTXO is populated with a lease account, a transaction data identification of the UTXO, and the lease account.
8. The method of claim 7, wherein determining an amount of rental currency for each tile record in each tile set comprises:
extracting UTXO recorded by each block in each block set;
if the transfer account field of the UTXO records the rented account, the transaction data identification of the UTXO and the rented account, determining the transfer currency of the UTXO as the rented currency;
and calculating the amount of the rented money according to the UTXO.
9. An apparatus for transferring funds in a blockchain, the apparatus configured to be located at a blockchain node, the apparatus comprising:
a first lease receiving module for receiving a money lease transaction request;
the first lease execution module is used for executing the currency lease transaction request to form currency lease transaction data and recording the currency lease transaction data into a block, wherein the currency lease transaction data at least comprises a lease account, lease currency and a lease account; wherein the money lease transaction request is a transaction request requesting to lease a preset amount of lease money of the leased account to the leased account; wherein the rental currency sets a usage right;
the transfer request receiving module is used for receiving a transfer transaction request, judging whether money to be transferred in the transfer transaction request is lease money or not, and if the money to be transferred in the transfer transaction request is the lease money recorded in the block chain and a transfer-out account is not the lease account, invalidating the transfer transaction request; the lease money is money obtained by a lease transaction under the lease account, and the lease account does not have transfer authority for the lease money.
10. An apparatus for implementing block chain consensus, configured at a block chain node, the apparatus comprising:
a second lease receiving module for receiving a monetary lease transaction request;
the second lease execution module is used for executing the currency lease transaction request so as to record that the lease currency is leased into the lease account by the lease account; wherein the money lease transaction request is a transaction request requesting to lease a preset amount of lease money of the leased account to the leased account; the lease money is money obtained by lease transaction under the lease account, and the lease account does not have transfer authority on the lease money; wherein the rental currency sets a usage right; for the rented user, the usage rights of the rental currency only include calculating a rights value for the account of the rented user;
the equity value calculation module is used for judging whether the money under the rented account is the held money or the rented money and calculating the equity value of the rented account according to the held money and the rented money of the rented account;
and the out-block competition initiating module is used for initiating out-block node competition transaction requests based on the equity value according to the equity value of the leased account.
11. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a method of transferring a blockchain according to any one of claims 1 to 2 or to perform a method of consensus implementation of a blockchain according to any one of claims 3 to 8.
12. A non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the method for transferring a blockchain of any one of claims 1-2 or the method for consensus implementation of blockchains of any one of claims 3-8.
CN201910874806.6A 2019-09-17 2019-09-17 Block chain transfer method and consensus realization method, device, equipment and medium Active CN110570310B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910874806.6A CN110570310B (en) 2019-09-17 2019-09-17 Block chain transfer method and consensus realization method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910874806.6A CN110570310B (en) 2019-09-17 2019-09-17 Block chain transfer method and consensus realization method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN110570310A CN110570310A (en) 2019-12-13
CN110570310B true CN110570310B (en) 2023-02-17

Family

ID=68780414

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910874806.6A Active CN110570310B (en) 2019-09-17 2019-09-17 Block chain transfer method and consensus realization method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN110570310B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111598571A (en) * 2020-07-20 2020-08-28 百度在线网络技术(北京)有限公司 Transaction processing method, device, equipment and storage medium of block chain

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106097006A (en) * 2016-06-09 2016-11-09 杭州复杂美科技有限公司 Block chain charge mode
CN107077675A (en) * 2016-12-30 2017-08-18 深圳前海达闼云端智能科技有限公司 Block chain based currency management method and system
KR101856038B1 (en) * 2017-11-07 2018-06-21 주식회사 올아이티탑 System for dealing a digital currency with block chain with preventing security and hacking
CN109784885A (en) * 2018-12-29 2019-05-21 杨鉴 A kind of block chain ballot common recognition method and system based on equity

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107194778A (en) * 2017-05-25 2017-09-22 金立彦 Equipment leasing method and system based on block chain
US20190188657A1 (en) * 2017-12-19 2019-06-20 Mastercard International Incorporated Method and system for outside guarantees for a blockchain transaction
CN109447605A (en) * 2018-10-24 2019-03-08 百度在线网络技术(北京)有限公司 A kind of chain currency conversion method, apparatus, equipment and medium based on block chain
CN109670802A (en) * 2018-12-21 2019-04-23 百度在线网络技术(北京)有限公司 A kind of chain currency conversion method, apparatus, equipment and medium based on block chain
CN109949139A (en) * 2019-03-31 2019-06-28 杭州复杂美科技有限公司 Borrow or lend money rent method, equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106097006A (en) * 2016-06-09 2016-11-09 杭州复杂美科技有限公司 Block chain charge mode
CN107077675A (en) * 2016-12-30 2017-08-18 深圳前海达闼云端智能科技有限公司 Block chain based currency management method and system
KR101856038B1 (en) * 2017-11-07 2018-06-21 주식회사 올아이티탑 System for dealing a digital currency with block chain with preventing security and hacking
CN109784885A (en) * 2018-12-29 2019-05-21 杨鉴 A kind of block chain ballot common recognition method and system based on equity

Also Published As

Publication number Publication date
CN110570310A (en) 2019-12-13

Similar Documents

Publication Publication Date Title
JP7254120B2 (en) Blockchain payment processing method, device, device and medium
CN111741026B (en) Cross-chain transaction request processing method, device, equipment and storage medium
CN111866085B (en) Data storage method, system and device based on block chain
US20200258152A1 (en) Systems and methods for storage of cryptocurrencies and transactions thereof
EP3852040B1 (en) Blockchain transfer processing method and apparatus, device, and medium
CN111695886B (en) Virtual currency accounting method and device, electronic equipment and readable storage medium
CN106656839A (en) Resource transfer method and apparatus
CN108112038B (en) Method and device for controlling access flow
CN111260474B (en) Asset transaction method, device, equipment, system and storage medium of cross-blockchain
CN111640020A (en) Transaction request processing method, device, equipment and medium in block chain
CN109447605A (en) A kind of chain currency conversion method, apparatus, equipment and medium based on block chain
CN113641677A (en) Data processing method and device, electronic equipment and storage medium
CN110570310B (en) Block chain transfer method and consensus realization method, device, equipment and medium
CN115421922A (en) Current limiting method, device, equipment, medium and product of distributed system
EP3869732B1 (en) Method and apparatus for processing resource of block chain, device, medium and computer program product
CN111339187A (en) Data processing method, device, equipment and storage medium based on intelligent contract
CN112288412A (en) Block chain-based digital legal note management method and device
EP4020873A2 (en) Method and apparatus for blockchain community governance, device and storage medium
JP2023007389A (en) Site selection method based on block chain, device, apparatus, and storage medium
US20200202437A1 (en) Blockchain-based settlement method, apparatus, and electronic device
CN113989001A (en) Virtual asset settlement method, device, electronic equipment and storage medium
CN113657943A (en) Virtual asset allocation system, method, electronic device and storage medium
CN113837593B (en) Virtual data distribution method, device, equipment and storage medium
CN110809776B (en) Transaction product management system and method for managing transaction products
Ye et al. Dynamic Spectrum Sharing Based on the Rentable NFT Standard ERC4907

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant