CN110570310A - 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
CN110570310A
CN110570310A CN201910874806.6A CN201910874806A CN110570310A CN 110570310 A CN110570310 A CN 110570310A CN 201910874806 A CN201910874806 A CN 201910874806A CN 110570310 A CN110570310 A CN 110570310A
Authority
CN
China
Prior art keywords
lease
account
money
currency
block
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.)
Granted
Application number
CN201910874806.6A
Other languages
Chinese (zh)
Other versions
CN110570310B (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

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 delegation rights and interests certification (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 mechanism is also dependent 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 the users of the banknotes can participate in the consensus process of determining the block nodes, the DPoS method may have the problem of bribing.
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;
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, 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 blockchain, where the method is applied to a blockchain node, and the method includes:
Receiving a currency lease transaction request;
Executing the currency lease transaction request to record that lease currency is leased to a lease account by a 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 equity weight value according to a distance between a set of blocks and a current block, the distance corresponding to a 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.
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 a 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 right and interest value calculation module is used for calculating the right and interest 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 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.
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 content of the first and second substances,
The memory stores instructions executable by the at least one processor to enable the at least one processor to perform a method of transferring and a consensus implementation 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 intended to limit 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 field-based data record, and in general, the UTXO includes at least three fields, and one field records a money transfer account; another field records the transfer of money to the account; 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 money lease transaction request in a field form according to a recording manner 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, txid1, 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, the 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 resulting money lease transaction request includes at least: 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 points may obtain the money lease intelligent contract, and use the money lease transaction request as input data, and invoke the virtual machine to run the relevant program code related to processing the money lease transaction request in the money lease intelligent contract, 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 in the money lease transaction request may be obtained as the money lease transaction data. 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 normal transfer transaction request, i.e., a transaction request requesting a preset amount of money transferred from an account to be transferred to an 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 a money lease transaction exists in this embodiment, and lease money acquired by a lease account in the money lease transaction process does not have transfer use authority, after receiving the transfer transaction request, a block chain node in this embodiment does not directly process the received transfer transaction request, but first determines whether money to be transferred (i.e., money to be transferred) of an export account in the transfer transaction request is 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 an export account of the transfer transaction request, and if not, because the lease account has no export 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 the rental account, the determination may be performed based on an intelligent contract, for example, which money is the rental money and which account is the rental account may be predefined in the intelligent contract, and at this time, the determination may be performed whether the money to be transferred is the rental money recorded in the blockchain and whether the transfer account is the rental account through the predefined intelligent contract. 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 currency acquired by a non-rental transaction under a rental account, the rental account has spending and dominating right on holding currency (such as being used for transferring money), and the holding currency can be used for calculating the right value of an account to which the holding currency belongs; 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 local disk of the block link point stores the transfer transaction data and the money leasing transaction data, the holding money and the leasing money under the leasing 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 has higher 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 equity weight value is increased in proportion to the duration, and the equity 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 account renting 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, according to a rule such as rotation, preset time, and 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 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.
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, the mapping relationship between the distance between the block set and the current block and the equity weight value may be preset in this embodiment, 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. Since each block in the block chain is linked according to the time sequence, the duration of each currency recorded in the block under the account rented 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 rented 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 tile of each tile set.
Specifically, the blocks in each block set may be sequentially traversed to check whether data in the form of the UTXO is recorded therein, and if so, the data in the form of the 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 transfer account field records the transaction data identifier of the renting account, the UTXO and the renting account, the data in the TUXO form is the money renting transaction data, and the transfer money in the data can be determined to be the renting 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 equity weight value of each block set is already calculated in S304, S305 also determines the amount of the held currency and/or the amount of the leased currency, i.e. the amount of the transferred currency, of each block in each block set, at this time, for each block set, the amount of each held currency and/or leased currency recorded in each block is multiplied by the equity weight value of the block set to obtain the equity value corresponding to the held currency and/or the leased currency, and then the equity values corresponding to the held currency and/or the leased currency in the block set are summed up to obtain the equity value of the held currency and/or the leased currency of the block set as the equity value of the block set.
S307, the equity value of each block set is accumulated to determine the equity 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 holding currency and the renting currency are determined in S307, the interest values of the holding currency and the renting currency determined in S307 are accumulated at this time to serve as the interest values of the renting 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 apparatus 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 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 the sets 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 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.
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). In fig. 6, one processor 601 is taken as an example.
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 of the blockchain in the embodiments of the present application (e.g., first rental receipt module 401, first rental execution module 402, and transfer request receipt module 403 shown in fig. 4, or second rental receipt module 501, second rental execution module 502, equity value calculation module 503, and out-of-block competition initiation 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 can 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 the present invention is not limited thereto 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;
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, invalidating the transfer transaction request.
2. The method of claim 1, wherein the currency lease transaction request outputs a UTXO for an unspent transaction and a transfer account field of the UTXO is populated with 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 that lease currency is leased to a lease account by a 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.
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 set of blocks according to a distance between each set of blocks and a current block, the distance corresponding to a 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 the 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 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.
9. An apparatus for transferring blockchain information, the apparatus being configured 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;
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.
10. An apparatus for implementing block chain consensus 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;
The right and interest value calculation module is used for calculating the right and interest 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.
11. an electronic device, comprising:
At least one processor; and
A memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
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 true CN110570310A (en) 2019-12-13
CN110570310B 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)

Cited By (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 (9)

* 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
CN107194778A (en) * 2017-05-25 2017-09-22 金立彦 Equipment leasing method and system based on block chain
KR101856038B1 (en) * 2017-11-07 2018-06-21 주식회사 올아이티탑 System for dealing a digital currency with block chain with preventing security and hacking
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
CN109784885A (en) * 2018-12-29 2019-05-21 杨鉴 A kind of block chain ballot common recognition method and system based on equity
US20190188657A1 (en) * 2017-12-19 2019-06-20 Mastercard International Incorporated Method and system for outside guarantees for a blockchain transaction
CN109949139A (en) * 2019-03-31 2019-06-28 杭州复杂美科技有限公司 Borrow or lend money rent method, equipment and storage medium

Patent Citations (10)

* 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
WO2018120057A1 (en) * 2016-12-30 2018-07-05 深圳前海达闼云端智能科技有限公司 Currency management method and system based on block chain
CN107194778A (en) * 2017-05-25 2017-09-22 金立彦 Equipment leasing method and system based on block chain
KR101856038B1 (en) * 2017-11-07 2018-06-21 주식회사 올아이티탑 System for dealing a digital currency with block chain with preventing security and hacking
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
CN109784885A (en) * 2018-12-29 2019-05-21 杨鉴 A kind of block chain ballot common recognition method and system based on equity
CN109949139A (en) * 2019-03-31 2019-06-28 杭州复杂美科技有限公司 Borrow or lend money rent method, equipment and storage medium

Cited By (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

Also Published As

Publication number Publication date
CN110570310B (en) 2023-02-17

Similar Documents

Publication Publication Date Title
JP7254120B2 (en) Blockchain payment processing method, device, device and medium
KR102240939B1 (en) Blockchain system with consensus algorithm based on proof-of -transaction and method there of
CN109150971B (en) Super node voting and election method and device and network node
CN111741026B (en) Cross-chain transaction request processing method, device, equipment and storage medium
US20200258152A1 (en) Systems and methods for storage of cryptocurrencies and transactions thereof
Aldweesh et al. Performance benchmarking of smart contracts to assess miner incentives in Ethereum
CN111866085B (en) Data storage method, system and device based on block chain
CN106656839A (en) Resource transfer method and apparatus
CN108112038B (en) Method and device for controlling access flow
EP3852040B1 (en) Blockchain transfer processing method and apparatus, device, and medium
JP7280300B2 (en) Blockchain transaction processing method, device, equipment and medium
JP7158522B2 (en) Transaction request processing method, apparatus, device, medium, and program in blockchain
CN109472656B (en) Virtual article display method and device and storage medium
CN111695886A (en) Accounting method and device for virtual currency, electronic equipment and readable 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
Sun et al. Games of miners
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
EP3869732B1 (en) Method and apparatus for processing resource of block chain, device, medium and computer program product
US10991045B2 (en) Blockchain-based settlement method, apparatus, and electronic device
CN114490406A (en) Test coverage item management method, device, equipment and medium
CN111429092B (en) Method, apparatus, device and computer readable medium for paying an accumulation fund
CN113837593B (en) Virtual data distribution method, device, equipment and storage medium

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