WO2021190010A1 - 非正常挖矿账户的识别方法和惩罚方法、设备和存储介质 - Google Patents

非正常挖矿账户的识别方法和惩罚方法、设备和存储介质 Download PDF

Info

Publication number
WO2021190010A1
WO2021190010A1 PCT/CN2020/138883 CN2020138883W WO2021190010A1 WO 2021190010 A1 WO2021190010 A1 WO 2021190010A1 CN 2020138883 W CN2020138883 W CN 2020138883W WO 2021190010 A1 WO2021190010 A1 WO 2021190010A1
Authority
WO
WIPO (PCT)
Prior art keywords
block
account
mining
ballot
abnormal
Prior art date
Application number
PCT/CN2020/138883
Other languages
English (en)
French (fr)
Inventor
何玉斌
王志文
吴思进
Original Assignee
江苏复杂美科技有限公司
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 江苏复杂美科技有限公司 filed Critical 江苏复杂美科技有限公司
Publication of WO2021190010A1 publication Critical patent/WO2021190010A1/zh

Links

Images

Classifications

    • 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
    • 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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3827Use of message hashing
    • 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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/401Transaction verification
    • G06Q20/4014Identity check for transactions

Definitions

  • This application relates to technical fields such as blockchain, and specifically relates to an identification method and punishment method, equipment, and storage medium for abnormal mining accounts.
  • ticket1 is imported to node1, node2, and node3 for mining, and the transactions in the node1, node2, and node3 transaction pools are different; when ticket1 is successfully mined with a block height of 50, node1 generates block(50)_1 and node2.
  • Block(50)_2 and node3 generated block(50)_3 are different from each other, resulting in a fork; since the blocks generated according to ticket1 are all correct blocks, it is possible that node4 and node1 will continue after block(50)_1
  • node5 and node2 will continue to mine after block(50)_2
  • node6 and node3 will continue to mine after block(50)_3; in the end, only one chain will be the main chain, assuming the final block(50)_1 If the chain is the main chain, node5 and node6 will lose profits when mining on the side chain; and the above mechanism will cause more forks in the blockchain network, reducing the stability of the blockchain network.
  • the present invention provides a method for identifying abnormal mining accounts suitable for blockchain nodes. Ballots are used as mining credentials for generating blocks when mining is successful.
  • the above methods include:
  • the first account holding the first ballot is identified as an abnormal mining account.
  • the present invention provides a punishment method applicable to abnormal mining accounts of blockchain nodes, including:
  • the broadcast of the third block is delayed according to the pre-configured delayed broadcast rule.
  • the present invention also provides a device that includes one or more processors and a memory, where the memory contains instructions executable by the one or more processors to make the one or more processors execute each of the processors according to the present invention.
  • the identification method and punishment method of abnormal mining account provided in the embodiment.
  • the present invention also provides a storage medium storing a computer program that causes the computer to execute the method for identifying abnormal mining accounts and the method of punishment provided according to various embodiments of the present invention.
  • the identification method and penalty method, equipment and storage medium of abnormal mining account receive the first block and judge whether there is a block with the same height and block hash as the first block locally.
  • Fig. 1 is a flowchart of a method for identifying abnormal mining accounts according to an embodiment of the present invention.
  • Fig. 2 is a flowchart of a punishment method for abnormal mining accounts according to an embodiment of the present invention.
  • FIG. 3 is a schematic structural diagram of a device provided by an embodiment of the present invention.
  • Fig. 1 is a flowchart of a method for identifying abnormal mining accounts according to an embodiment of the present invention.
  • the present invention provides a method for identifying abnormal mining accounts of blockchain nodes. Ballots are used as mining credentials for generating blocks when mining is successful. Methods include:
  • S121 Receive the first block, and determine whether there is a second block with the same block height as the first block and a different block hash locally:
  • step S122 determine whether the second ballot used to generate the second block and the first ballot used to generate the first block are the same ballot:
  • step S1221 mark the first account holding the first ballot as an abnormal mining account.
  • node1 there are 7 nodes node1 ⁇ node7 in the blockchain network; user A holds ticket1, and user A imports ticket1 into node1 and node2 for mining; when ticket1 is successfully mined with a block height of 50, node1 is generated
  • the block hash of block(50)_1 and block(50)_1 is hash(block(50)_1), node2 generates block(50)_2, and the block hash of block(50)_2 is hash(block(50)_2 )_2),;
  • node7 receives block(50)_1 first
  • node3 ⁇ node6 receives block(50)_2 first
  • hash(block(50)_1) is different from hash(block(50)_2), and block(50)_1 and block(50)_2 are different; but because of block(50) _1 and block(50)_2 are both generated based on ticket1, so block(50)_1 and block(50)_2 are both correct blocks;
  • node1 and node7 continue to mine after block(50)_1, while node2 ⁇ node6 continue to mine after block(50)_2; and only one chain will be the main chain in the end, assuming that the final block(50)_2
  • the chain where )_2 is located is the main chain, so all the proceeds of the block generated by node7 after block(50)_1 will be lost;
  • node7 executes step S121, receives block(50)_2, and judges whether there is a block with a block height of 50 and a block hash other than hash(block(50)_2) locally:
  • step S122 is executed to determine whether it is used Whether the ballot for generating block(50)_2 and the ballot for generating block(50)_1 are the same ballot:
  • step S1221 is executed: the account of user A is identified as an abnormal mining account.
  • hash(block(50)_1) is the same as hash(block(50)_2); then when node7 receives block(50)_2, it is judged that the same block ( The block height is the same and the block hash is the same), node7 discards block(50)_2.
  • user B holds ticket2, user B imports ticket2 into node3 for mining; ticket2 also successfully mines a block with a block height of 50, node3 generates block(50)_3; node7 receives block(50 )_1, node4 ⁇ node6 receive block(50)_2 first;
  • node7 executes step S121, receives block(50)_3, and judges whether there is a block with a block height of 50 locally:
  • step S122 is executed to determine whether the votes used to generate block(50)_3 and the votes used to generate b lock(50)_1 Whether the ballots are the same ballots:
  • node7 discards block(50)_3 and continues mining after block(50)_1.
  • the received block (51) will be processed according to the existing technology (for example, the highest block height in node7) When it is 50, store block(51), and continue mining after block(51)).
  • the block hash in step S121 can also be configured as other parameters according to actual needs, for example, configured as a state hash (step S121: receive the first block, and determine whether there is a local The second block with the same block height and different state hash) can achieve the same technical effect.
  • the foregoing embodiment can identify abnormal mining accounts, and cooperate with corresponding punishment methods to punish the accounts identified as abnormal mining accounts, thereby ensuring the mining income of miners and enhancing the stability of the blockchain network.
  • step S122 in the method shown in FIG. 1 includes:
  • step S122 in the method shown in FIG. 1 includes:
  • the method shown in FIG. 1 further includes:
  • how to select the optimal block can also be configured according to actual needs, for example, the configuration is:
  • the above embodiment enables the blockchain node to correct the optimal block according to the most reasonable method when receiving blocks mined by different votes at the same height, and mine based on this block, and stop the blockchain node from mining on the side chain in time. Waste and loss of resources caused by mines.
  • Fig. 2 is a flowchart of a punishment method for abnormal mining accounts according to an embodiment of the present invention.
  • the present invention provides a punishment method applicable to abnormal mining accounts of blockchain nodes, and the above method includes:
  • step S222 Determine whether to punish the third account according to the pre-configured penalty rule:
  • step S2221 delay broadcasting the third block according to the pre-configured delayed broadcasting rule.
  • the identifier of the abnormal mining account also includes the number of abnormal mining times in the first time period
  • S222 includes judging whether to punish the Three accounts
  • S2221 includes delaying the broadcast of the third block according to the third number of abnormal mining times and the pre-configured first value
  • the pre-configured penalty rule is that the first threshold is configured to 5, if the account’s number of abnormal mining times When the first threshold is reached, the user will be punished
  • the pre-configured delayed broadcast rule is that if the number of abnormal mining times of the account is [0,5), when the block generated by the vote held by the account is received , Broadcast the block immediately.
  • the block generated by the vote held by the account will be delayed for 5s when the block is broadcast.
  • the normal number of mining times is [10,+ ⁇ ), then when the block generated by the vote held by the account is received, the block will be broadcast after 60s as an example;
  • node7 executes step S221, before broadcasting block (100), it determines whether the third account that generates the third block is an abnormal mining account identified by the method for identifying abnormal mining accounts as shown in FIG. 1:
  • step S222 is executed to determine whether to punish the third account according to the pre-configured first threshold and the third number of abnormal mining times of the third account:
  • step S2221 is executed. Since the number of abnormal mining times of the user C's account is 10, the block (100) is broadcast with a delay of 60 seconds.
  • the identifier of the abnormal mining account further includes the number of abnormal mining times in the first time period.
  • S222 includes judging whether to punish the Three accounts, S2221 includes delaying the broadcast of the third block according to the third number of abnormal mining times and the pre-configured first value; the pre-configured penalty rule is that the first threshold is configured to 5, if the account’s number of abnormal mining times When the first threshold is reached, the user will be punished; the pre-configured delayed broadcast rule is that if the number of abnormal mining times of the account is [0,5), when the block generated by the vote held by the account is received , Broadcast the block immediately.
  • the block generated by the vote held by the account will be delayed for 5s when the block is broadcast.
  • the normal mining times are [10,+ ⁇ ), then when the block generated by the vote held by the account is received, the block is delayed for 60s.
  • the punishment principle of the abnormal mining account in this embodiment is carried out. Detailed elaboration.
  • the first cycle time can also be configured to other values according to actual requirements, such as 48h, which can achieve the same technical effect.
  • the pre-configured penalty rules can also be configured according to actual needs.
  • the first threshold in the penalty rules is configured to 1, which can achieve the same Technical effect.
  • the pre-configured delayed broadcast rule can also be configured according to actual needs. For example, if the number of abnormal mining times of an account is [0,1), then the vote held by the account will be received When the block is generated, the block will be broadcast immediately. If the number of abnormal mining times of the account is [1,10), the block generated by the vote held by the account will be delayed for 5s to broadcast the block Block, if the number of abnormal mining times of the account is [10,+ ⁇ ), when the block generated by the vote held by the account is received, the block will be broadcast after 60s, which can achieve the same technical effect.
  • the punishment method for abnormal mining accounts can also be configured according to actual needs, as long as the abnormal mining accounts can be punished, so as to ensure the income of users of normal mining accounts, thereby improving the stability of the blockchain network , Can achieve the same technical effect.
  • it can be configured to deduct the margin paid by the third account when the third account needs to be punished.
  • the above method of deducting margin can also be associated with the number of abnormal mining times of the account. For example, it can be configured to When the block is generated, the deposit is not deducted.
  • the deposit paid by the account will be deducted when the block generated by the vote held by the account is received 10%
  • the number of abnormal mining times of the account is [10,+ ⁇ )
  • 50% of the deposit paid by the account will be deducted when the block generated by the vote held by the account is received, and the same can be achieved Technical effect.
  • the identifier of the abnormal mining account further includes the number of abnormal mining times in the first time period, and step S222 of the method shown in FIG. 2 includes:
  • Step S2221 of the method shown in FIG. 2 includes:
  • the broadcast of the third block is delayed according to the third number of abnormal mining times and the pre-configured first value.
  • the above method further includes:
  • the third account is identified as an abnormal mining account
  • the third account is identified as a normal mining account.
  • the information of each abnormal mining account will be published on the official website.
  • the blockchain node will generate early warning information and send the early warning information to the user holding the first account through a pre-configured contact method.
  • FIG. 3 is a schematic structural diagram of a device provided by an embodiment of the present invention.
  • the present application also provides a device 300, including one or more central processing units (CPU) 301, which can be based on a program stored in a read-only memory (ROM) 302 or The program loaded from the storage section 308 into the random access memory (RAM) 303 executes various appropriate actions and processing.
  • ROM read-only memory
  • RAM random access memory
  • various programs and data required for the operation of the device 300 are also stored.
  • the CPU301, the ROM302, and the RAM303 are connected to each other through a bus 304.
  • An input/output (I/O) interface 305 is also connected to the bus 304.
  • the following components are connected to the I/O interface 305: an input part 306 including a keyboard, a mouse, etc.; an output part 307 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and speakers, etc.; a storage part 308 including a hard disk, etc. ; And a communication section 309 including a network interface card such as a LAN card, a modem, and the like. The communication section 309 performs communication processing via a network such as the Internet.
  • the driver 310 is also connected to the I/O interface 305 as needed.
  • a removable medium 311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 310 as needed, so that the computer program read from it is installed into the storage portion 308 as needed.
  • an embodiment of the present disclosure includes a computer program product, which includes a computer program tangibly embodied on a machine-readable medium, and the computer program includes program code for executing any of the above-mentioned methods.
  • the computer program may be downloaded and installed from the network through the communication part 309, and/or installed from the removable medium 311.
  • the present application also provides a computer-readable storage medium.
  • the computer-readable storage medium may be the computer-readable storage medium included in the device of the above-mentioned embodiment;
  • the computer-readable storage medium stores one or more programs, and the programs are used by one or more processors to execute the methods described in this application.
  • each block in the flowchart or block diagram can represent a module, program segment, or part of code, and the module, program segment, or part of code contains one or more for realizing the specified logic function.
  • Executable instructions can also occur in a different order from the order marked in the drawings. For example, two blocks shown one after the other may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved.
  • each block in the block diagram and/or flowchart, and the combination of the blocks in the block diagram and/or flowchart can be implemented by a dedicated hardware-based system that performs the specified functions or operations Or it can be realized by a combination of dedicated hardware and computer instructions.
  • the units or modules involved in the embodiments described in the present application can be implemented in software or hardware.
  • the described units or modules may also be arranged in the processor.
  • each of the described units may be a software program arranged in a computer or a mobile smart device, or may be a separately configured hardware device.
  • the names of these units or modules do not constitute a limitation on the units or modules themselves under certain circumstances.

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Physics & Mathematics (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Technology Law (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种非正常挖矿账户的识别方法和惩罚方法、设备和存储介质,该方法包括:接收第一区块,判断本地是否存有与第一区块的区块高度相同、区块哈希不同的第二区块(S121):是,则在用于生成第二区块的第二选票与用于生成第一区块的第一选票为相同选票时(S122),将持有第一选票的第一账户标识为非正常挖矿账户(S1221)。通过上述非正常挖矿账户的识别方法识别出非正常挖矿账户,配合相应的惩罚方法对标识为非正常挖矿账户的账户进行惩罚,在保证矿工的挖矿收益同时增强了区块链网络的稳定性。

Description

非正常挖矿账户的识别方法和惩罚方法、设备和存储介质 技术领域
本申请涉及区块链等技术领域,具体涉及一种非正常挖矿账户的识别方法和惩罚方法、设备和存储介质。
背景技术
现有方案中,是否能挖到矿取决于选票;而不同节点的交易池中的交易不一定完全相同(交易本身可能不同,即使交易相同,存储交易的顺序也不一定相同)。
例如,ticket1被导入到node1、node2、node3进行挖矿,node1、node2、node3交易池中的交易不同;在ticket1挖区块高度为50的矿成功时,node1生成block(50)_1与node2生成block(50)_2与node3生成block(50)_3都彼此不同,产生分叉;由于根据ticket1所生成的区块都是正确的区块,因此可能node4、node1会在block(50)_1后继续挖矿,node5、node2会在block(50)_2后继续挖矿,node6、node3会在block(50)_3后继续挖矿;而最终只有一条链会是主链,假设最终block(50)_1所在的链为主链,则node5、node6在侧链挖矿将损失收益;且上述机制将导致区块链网络产生更多分叉,降低了区块链网络的稳定性。
发明内容
鉴于现有技术中的上述缺陷或不足,期望提供一种保证矿工收益,提高区块链网络稳定性的非正常挖矿账户的识别方法和惩罚方法、设备和存储介质。
第一方面,本发明提供一种适用于区块链节点的非正常挖矿账户的识别方法,选票用于作为挖矿成功时生成区块的挖矿凭证,上述方法包括:
接收第一区块,判断本地是否存有与第一区块的区块高度相同、区块哈希不同的第二区块:
是,则判断用于生成第二区块的第二选票与用于生成第一区块的第一选票是否为相同选票:
是,则将持有第一选票的第一账户标识为非正常挖矿账户。
第二方面,本发明提供一种适用于区块链节点的非正常挖矿账户的惩罚方法,包括:
在广播第三区块前,判断生成第三区块的第三账户是否为如第一方面的非正常挖矿账户的识别方法所标识的非正常挖矿账户:
是,则根据预配置的惩罚规则判断是否惩罚第三账户:
是,则根据预配置的延迟广播规则延迟广播第三区块。
第三方面,本发明还提供一种设备,包括一个或多个处理器和存储器,其中存储器包含可由该一个或多个处理器执行的指令以使得该一个或多个处理器执行根据本发明各实施例提供的非正常挖矿账户的识别方法和惩罚方法。
第四方面,本发明还提供一种存储有计算机程序的存储介质,该计算机程序使计算机执行根据本发明各实施例提供的非正常挖矿账户的识别方法和惩罚方法。
本发明诸多实施例提供的非正常挖矿账户的识别方法和惩罚方法、设备和存储介质通过接收第一区块,判断本地是否存有与第一区块的区块高度相同、区块哈希不同的第二区块:是,则在用于生成第二区块的第二选票与用于生成第一区块的第一选票为相同选票时,将持有第一选票的第一账户标识为非正常挖矿账户的方法识别出非正常挖矿账户,配合相应的惩罚方法对标识为非正常挖矿账户的账户进行惩罚,在保证矿工的挖矿收益同时增强了区块链网络的稳定性。
附图说明
通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本申请的其它特征、目的和优点将会变得更明显:
图1为本发明一实施例提供的一种非正常挖矿账户的识别方法的 流程图。
图2为本发明一实施例提供的一种非正常挖矿账户的惩罚方法的流程图。
图3为本发明一实施例提供的一种设备的结构示意图。
具体实施方式
下面结合附图和实施例对本申请作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释相关发明,而非对该发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与发明相关的部分。
需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本申请。
图1为本发明一实施例提供的一种非正常挖矿账户的识别方法的流程图。如图1所示,在本实施例中,本发明提供一种适用于区块链节点的非正常挖矿账户的识别方法,选票用于作为挖矿成功时生成区块的挖矿凭证,上述方法包括:
S121:接收第一区块,判断本地是否存有与第一区块的区块高度相同、区块哈希不同的第二区块:
是,则执行步骤S122:判断用于生成第二区块的第二选票与用于生成第一区块的第一选票是否为相同选票:
是,则执行步骤S1221:将持有第一选票的第一账户标识为非正常挖矿账户。
具体地,假设区块链网络中共有7个节点node1~node7;用户A持有ticket1,用户A将ticket1导入node1和node2进行挖矿;在ticket1挖区块高度为50的矿成功时,node1生成block(50)_1,block(50)_1的区块哈希为hash(block(50)_1),node2生成block(50)_2,block(50)_2的区块哈希为hash(block(50)_2),;
在第一场景中,node1和node2交易池中的交易不同,node7优先收到block(50)_1,node3~node6优先收到block(50)_2;
由于node1和node2交易池中的交易不同,因此hash(block(50)_1)与hash(block(50)_2)不同,block(50)_1和block(50)_2不同;但由于block(50)_1和block(50)_2都是根据ticket1所生成,因此block(50)_1和block(50)_2都是正确的区块;
在现有技术中,node1与node7在block(50)_1后继续挖矿,而node2~node6在block(50)_2后继续挖矿;而最终只有一条链会是主链,假设最终block(50)_2所在的链为主链,则后续node7在block(50)_1后所生成的块的收益将全部损失;
假设当前区块链节点为node7;
node7执行步骤S121,接收block(50)_2,判断本地是否存有区块高度为50、区块哈希不为hash(block(50)_2)的区块:
由于node7优先收到block(50)_1,node7的本地已存有block(50)_1,hash(block(50)_1)与hash(block(50)_2)不同,则执行步骤S122,判断用于生成block(50)_2的选票与用于生成block(50)_1的选票是否为相同选票:
由于block(50)_2和block(50)_1均由ticket1生成,则执行步骤S1221:将用户A的账户标识为非正常挖矿账户。
若node1和node2交易池中的交易相同,则hash(block(50)_1)与hash(block(50)_2)相同;那么node7接收block(50)_2时,判断本地已有相同的区块(区块高度相同且区块哈希相同),node7丢弃block(50)_2。
在第二场景中,用户B持有ticket2,用户B将ticket2导入node3进行挖矿;ticket2也成功挖到区块高度为50的块,node3生成block(50)_3;node7优先收到block(50)_1,node4~node6优先收到block(50)_2;
假设当前区块链节点为node7;
node7执行步骤S121,接收block(50)_3,判断本地是否存有区块高度为50的区块:
由于node7优先收到block(50)_1,node7的本地已存有block(50)_1,则执行步骤S122,判断用于生成block(50)_3的选票与用于生成b lock(50)_1的选票是否为相同选票:
由于block(50)_3由ticket2生成,block(50)_1由ticket1生成,则node7丢弃block(50)_3,在block(50)_1后继续挖矿。
若node7所接收的第一区块为block(51),本地不存在区块高度为51的区块,则以现有技术处理所接收的block(51)(例如在node7本地的最高区块高度为50时,存储block(51),并在block(51)后继续挖矿)。
在更多实施例中,步骤S121中的区块哈希还可以根据实际需求配置为其它参数,例如配置为状态哈希(步骤S121:接收第一区块,判断本地是否存有与第一区块的区块高度相同、状态哈希不同的第二区块),可实现相同的技术效果。
上述实施例能识别出非正常挖矿账户,配合相应的惩罚方法对标识为非正常挖矿账户的账户进行惩罚,在保证矿工的挖矿收益同时增强了区块链网络的稳定性。
优选地,选票的选票信息存储于区块的挖矿交易中,图1所示方法中步骤S122包括:
解析第二区块的第二挖矿交易以获取第二选票;
解析第一区块的第一挖矿交易以获取第一选票;
判断第二选票与第一选票是否为相同选票。
在更多实施例中,还可以根据实际需求配置选票的选票信息的获取方式,例如在选票的选票信息存储于区块的区块头中时,图1所示方法中步骤S122包括:
解析第二区块的第二区块头以获取第二选票;
解析第一区块的第一区块头以获取第一选票;
判断第二选票与第一选票是否为相同选票。
优选地,图1所示方法还包括:
在第二选票与第一选票为不同选票时,判断第一区块中的第一交易总数和第二区块中的第二交易总数是否相同:
否,则选取交易总数较大的区块为正确的区块;
是,则解析第一区块的第一区块哈希和第二区块的第二区块哈希,将区块哈希较小的区块确定为正确的区块。
在更多实施例中,在第二选票与第一选票为不同选票时,如何选择到最优的块的方式还可以根据实际需求进行配置,例如配置为:
在第二选票与第一选票为不同选票时,判断第一区块中的第一交易总数和第二区块中的第二交易总数是否相同:
否,则选取交易总数较大的区块为正确的区块;
是,则解析第一区块的第一状态哈希和第二区块的第二状态哈希,将状态哈希较小的区块确定为正确的区块。
上述实施例使得区块链节点在同一高度收到不同选票所挖到的块时,根据最合理的方式纠正到最优的块并基于此块挖矿,及时制止区块链节点在侧链挖矿而造成的资源浪费以及损失。
图2为本发明一实施例提供的一种非正常挖矿账户的惩罚方法的流程图。如图2所示,在本实施例中,本发明提供一种适用于区块链节点的非正常挖矿账户的惩罚方法,上述方法包括:
S221:在广播第三区块前,判断生成第三区块的第三账户是否为如图1所示的非正常挖矿账户的识别方法所标识的非正常挖矿账户:
是,则执行步骤S222:根据预配置的惩罚规则判断是否惩罚第三账户:
是,则执行步骤S2221:根据预配置的延迟广播规则延迟广播第三区块。
具体地,以非正常挖矿账户的标识还包括第一时间周期内的非正常挖矿次数,S222包括根据预配置的第一阈值和第三账户的第三非正常挖矿次数判断是否惩罚第三账户,S2221包括根据第三非正常挖矿次数和预配置的第一数值延迟广播第三区块;预配置的惩罚规则为,将第一阈值配置为5,若账户的非正常挖矿次数到达第一阈值,则惩罚该用户;预配置的延迟广播规则为,若账户的非正常挖矿次数为[0,5),则在收到该账户所持有的选票所生成的区块时,立即广播该区块,若账户的非正常挖矿次数为[5,10),则在收到该账户所持有的选票所生成的区块时延迟5s广播该区块,若账户的非正常挖矿次数为[10,+∞),则在收到该账户所持有的选票所生成的区块时延迟60s广播该区块为例;
假设用户C的账户为非正常挖矿账户,且在第一时间周期内(假设为24h)用户C的账户的非正常挖矿次数为10,用户C所持有的ticket5生成block(100);
假设当前区块链节点为node7;
node7执行步骤S221,在广播block(100)前,判断生成第三区块的第三账户是否为如图1所示的非正常挖矿账户的识别方法所标识的非正常挖矿账户:
由于用户C的账户为非正常挖矿账户,则执行步骤S222,根据预配置的第一阈值和第三账户的第三非正常挖矿次数判断是否惩罚第三账户:
由于第一阈值为5,用户C的账户的非正常挖矿次数为10,则执行步骤S2221,由于用户C的账户的非正常挖矿次数为10,则延迟60s广播该block(100)。
上述实施例以非正常挖矿账户的标识还包括第一时间周期内的非正常挖矿次数,S222包括根据预配置的第一阈值和第三账户的第三非正常挖矿次数判断是否惩罚第三账户,S2221包括根据第三非正常挖矿次数和预配置的第一数值延迟广播第三区块;预配置的惩罚规则为,将第一阈值配置为5,若账户的非正常挖矿次数到达第一阈值,则惩罚该用户;预配置的延迟广播规则为,若账户的非正常挖矿次数为[0,5),则在收到该账户所持有的选票所生成的区块时,立即广播该区块,若账户的非正常挖矿次数为[5,10),则在收到该账户所持有的选票所生成的区块时延迟5s广播该区块,若账户的非正常挖矿次数为[10,+∞),则在收到该账户所持有的选票所生成的区块时延迟60s广播该区块为例对本实施例的非正常挖矿账户的惩罚原理进行了详细阐述。
在更多实施例中,第一周期时间还可以根据实际需求配置为其它数值,例如48h,可实现相同的技术效果。
在更多实施例中,预配置的惩罚规则还可以根据实际需求进行配置,例如在需要特别严格惩罚非正常挖矿账户的情况下,将惩罚规则中的第一阈值配置为1,可实现相同的技术效果。
在更多实施例中,预配置的延迟广播规则还可以根据实际需求进 行配置,例如配置为若账户的非正常挖矿次数为[0,1),则在收到该账户所持有的选票所生成的区块时,立即广播该区块,若账户的非正常挖矿次数为[1,10),则在收到该账户所持有的选票所生成的区块时延迟5s广播该区块,若账户的非正常挖矿次数为[10,+∞),则在收到该账户所持有的选票所生成的区块时延迟60s广播该区块,可实现相同的技术效果。
在更多实施例中,还可以根据实际需求配置非正常挖矿账户的惩罚方法,只要能够惩罚非正常挖矿账户,从而保证正常挖矿账户的用户的收益,从而提高区块链网络稳定性,可实现相同的技术效果。例如可以配置为,在需要惩罚第三账户的情况下,扣除第三账户所缴纳的保证金。上述扣除保证金的方法也可以与账户的非正常挖矿次数进行关联,例如可以配置为,若账户的非正常挖矿次数为[0,5),则在收到该账户所持有的选票所生成的区块时,不扣除保证金,若账户的非正常挖矿次数为[5,10),则在收到该账户所持有的选票所生成的区块时扣除该账户所缴纳的保证金的10%,若账户的非正常挖矿次数为[10,+∞),则在收到该账户所持有的选票所生成的区块时扣除该账户所缴纳的保证金的50%,可实现相同的技术效果。
优选地,非正常挖矿账户的标识还包括第一时间周期内的非正常挖矿次数,图2所示方法的步骤S222包括:
根据预配置的第一阈值和第三账户的第三非正常挖矿次数判断是否惩罚所述第三账户;
图2所示方法的步骤S2221包括:
根据所述第三非正常挖矿次数和预配置的第一数值延迟广播所述第三区块。
上述实施例的非正常挖矿账户的惩罚原理可参考图2所示的方法,此处不再赘述。
优选地,在图2所示方法的一种优选实施方式中,上述方法还包括:
在第三非正常挖矿次数为零,且第三账户标识为非正常挖矿账户时,将第三账户标识为正常挖矿账户。
优选地,各非正常挖矿账户的信息将被公布于官网。
优选地,在第一账户被标识为非正常挖矿账户时,区块链节点将生成预警信息,并通过预配置的联系方式将该预警信息发送至持有第一账户的用户。
图3为本发明一实施例提供的一种设备的结构示意图。
如图3所示,作为另一方面,本申请还提供了一种设备300,包括一个或多个中央处理单元(CPU)301,其可以根据存储在只读存储器(ROM)302中的程序或者从存储部分308加载到随机访问存储器(RAM)303中的程序而执行各种适当的动作和处理。在RAM303中,还存储有设备300操作所需的各种程序和数据。CPU301、ROM302以及RAM303通过总线304彼此相连。输入/输出(I/O)接口305也连接至总线304。
以下部件连接至I/O接口305:包括键盘、鼠标等的输入部分306;包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分307;包括硬盘等的存储部分308;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分309。通信部分309经由诸如因特网的网络执行通信处理。驱动器310也根据需要连接至I/O接口305。可拆卸介质311,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器310上,以便于从其上读出的计算机程序根据需要被安装入存储部分308。
特别地,根据本公开的实施例,上述任一实施例描述的方法可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括有形地包含在机器可读介质上的计算机程序,所述计算机程序包含用于执行上述任一方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分309从网络上被下载和安装,和/或从可拆卸介质311被安装。
作为又一方面,本申请还提供了一种计算机可读存储介质,该计算机可读存储介质可以是上述实施例的装置中所包含的计算机可读存储介质;也可以是单独存在,未装配入设备中的计算机可读存储介质。计算机可读存储介质存储有一个或者一个以上程序,该程序被一个或 者一个以上的处理器用来执行描述于本申请提供的方法。
附图中的流程图和框图,图示了按照本发明各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这根据所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以通过执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以通过专用硬件与计算机指令的组合来实现。
描述于本申请实施例中所涉及到的单元或模块可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的单元或模块也可以设置在处理器中,例如,各所述单元可以是设置在计算机或移动智能设备中的软件程序,也可以是单独配置的硬件装置。其中,这些单元或模块的名称在某种情况下并不构成对该单元或模块本身的限定。
以上描述仅为本申请的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本申请中所涉及的发明范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离本申请构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本申请中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。

Claims (8)

  1. 一种非正常挖矿账户的识别方法,其特征在于,选票用于作为挖矿成功时生成区块的挖矿凭证,所述方法适用于区块链节点,所述方法包括:
    接收第一区块,判断本地是否存有与所述第一区块的区块高度相同、区块哈希不同的第二区块:
    是,则判断用于生成所述第二区块的第二选票与用于生成所述第一区块的第一选票是否为相同选票:
    是,则将持有所述第一选票的第一账户标识为非正常挖矿账户。
  2. 根据权利要求1所述的方法,其特征在于,选票的选票信息存储于区块的挖矿交易中,所述判断用于生成所述第二区块的第二选票与用于生成所述第一区块的第一选票是否为相同选票包括:
    解析所述第二区块的第二挖矿交易以获取所述第二选票;
    解析所述第一区块的第一挖矿交易以获取所述第一选票;
    判断所述第二选票与所述第一选票是否为相同选票。
  3. 根据权利要求1所述的方法,其特征在于,还包括:
    在所述第二选票与所述第一选票为不同选票时,判断所述第一区块中的第一交易总数和所述第二区块中的第二交易总数是否相同:
    否,则选取交易总数较大的区块为正确的区块;
    是,则解析所述第一区块的第一区块哈希和所述第二区块的第二区块哈希,将区块哈希较小的区块确定为正确的区块。
  4. 一种非正常挖矿账户的惩罚方法,其特征在于,包括:
    在广播第三区块前,判断生成所述第三区块的第三账户是否为如权利要求1-3任一项所述的非正常挖矿账户的识别方法所标识的非正常挖矿账户:
    是,则根据预配置的惩罚规则判断是否惩罚所述第三账户:
    是,则根据预配置的延迟广播规则延迟广播所述第三区块。
  5. 根据权利要求4所述的方法,其特征在于,所述非正常挖矿账户的标识还包括第一时间周期内的非正常挖矿次数,所述根据预配置的惩罚规则判断是否惩罚所述第三账户包括:
    根据预配置的第一阈值和第三账户的第三非正常挖矿次数判断是否惩罚所述第三账户;
    所述根据预配置的延迟广播规则延迟广播所述第三区块包括:
    根据所述第三非正常挖矿次数和预配置的第一数值延迟广播所述第三区块。
  6. 根据权利要求5所述的方法,其特征在于,还包括:
    在所述第三非正常挖矿次数为零,且所述第三账户标识为非正常挖矿账户时,将所述第三账户标识为正常挖矿账户。
  7. 一种设备,其特征在于,所述设备包括:
    一个或多个处理器;
    存储器,用于存储一个或多个程序,
    当所述一个或多个程序被所述一个或多个处理器执行时,使得所述一个或多个处理器执行如权利要求1-6中任一项所述的方法。
  8. 一种存储有计算机程序的存储介质,其特征在于,该程序被处理器执行时实现如权利要求1-6中任一项所述的方法。
PCT/CN2020/138883 2020-03-26 2020-12-24 非正常挖矿账户的识别方法和惩罚方法、设备和存储介质 WO2021190010A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010224745.1A CN111415258A (zh) 2020-03-26 2020-03-26 非正常挖矿账户的识别方法和惩罚方法、设备和存储介质
CN202010224745.1 2020-03-26

Publications (1)

Publication Number Publication Date
WO2021190010A1 true WO2021190010A1 (zh) 2021-09-30

Family

ID=71491451

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/138883 WO2021190010A1 (zh) 2020-03-26 2020-12-24 非正常挖矿账户的识别方法和惩罚方法、设备和存储介质

Country Status (2)

Country Link
CN (1) CN111415258A (zh)
WO (1) WO2021190010A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111415258A (zh) * 2020-03-26 2020-07-14 杭州复杂美科技有限公司 非正常挖矿账户的识别方法和惩罚方法、设备和存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107424066A (zh) * 2017-07-19 2017-12-01 武汉凤链科技有限公司 一种基于价值量建立共识机制的方法及其系统
CN107507006A (zh) * 2017-08-11 2017-12-22 杭州秘猿科技有限公司 一种基于许可链的共识分叉处理方法
CN108846750A (zh) * 2018-08-01 2018-11-20 杭州复杂美科技有限公司 一种股权证明共识方法
US20190379546A1 (en) * 2018-06-12 2019-12-12 Chunghwa Telecom Co., Ltd. Method for reaching consensus on public distributed ledgers and system using the same
CN111415258A (zh) * 2020-03-26 2020-07-14 杭州复杂美科技有限公司 非正常挖矿账户的识别方法和惩罚方法、设备和存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107424066A (zh) * 2017-07-19 2017-12-01 武汉凤链科技有限公司 一种基于价值量建立共识机制的方法及其系统
CN107507006A (zh) * 2017-08-11 2017-12-22 杭州秘猿科技有限公司 一种基于许可链的共识分叉处理方法
US20190379546A1 (en) * 2018-06-12 2019-12-12 Chunghwa Telecom Co., Ltd. Method for reaching consensus on public distributed ledgers and system using the same
CN108846750A (zh) * 2018-08-01 2018-11-20 杭州复杂美科技有限公司 一种股权证明共识方法
CN111415258A (zh) * 2020-03-26 2020-07-14 杭州复杂美科技有限公司 非正常挖矿账户的识别方法和惩罚方法、设备和存储介质

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
NIELS WANG: "Detailed explanation of POC consensus mechanism", 5 June 2019 (2019-06-05), pages 1 - 3, XP009531182, Retrieved from the Internet <URL:https://blog.csdn.net/weiyiq/article/details/90965526> *

Also Published As

Publication number Publication date
CN111415258A (zh) 2020-07-14

Similar Documents

Publication Publication Date Title
US11902441B2 (en) Systems and methods for parallel verification of blockchain transactions
US10764325B2 (en) Method for adjusting mining difficulty of a cryptocurrency blockchain system by monitoring malicious forks and implementing a miners blockchain
CN108269090B (zh) 基于无协商随机抽签的用于区块链系统的共识方法和装置
US11483129B2 (en) Method and apparatus for reaching blockchain consensus
CN108596623B (zh) 一种区块链共识达成方法
US11410171B2 (en) Blockchain consensus method and device and electronic equipment
CN110535970B (zh) 司法链的证据存证和处理方法、装置、设备和介质
US20200134578A1 (en) Blockchain consensus systems and methods involving a time parameter
WO2021190010A1 (zh) 非正常挖矿账户的识别方法和惩罚方法、设备和存储介质
CN112953981A (zh) 节点选择方法、区块链共识方法及装置、系统、设备
CN115859343A (zh) 一种交易数据处理方法、装置以及可读存储介质
CN108648082B (zh) 一种用于区块链共识达成的计算机系统
CN111368008B (zh) 基于区块链的数据处理方法、装置、设备及可读存储介质
CN107635012B (zh) 一种消息匹配方法、服务器和计算机可读存储介质
WO2019075835A1 (zh) 货币基金系统自动化清算方法、装置、设备及存储介质
CN110336677B (zh) 区块打包、广播方法和系统、设备及存储介质
CN111967061A (zh) 基于区块链的可信账户转账交易方法及装置
WO2022148199A1 (zh) 一种硬件钱包数字货币选取方法及硬件钱包
CN111078696A (zh) 区块生成方法、设备和存储介质
CN114004608A (zh) 一种基于区块链的交易费用结算方法、装置及电子设备
CN107767192B (zh) 一种电子票据的验证方法、装置及系统
CN114331446B (zh) 区块链的链外服务实现方法、装置、设备和介质
CN113554509B (zh) 一种线上支付业务的处理方法、装置、介质及电子设备
CN114997576A (zh) 一种达标提示对象的确定方法、装置、设备、介质及产品
CN113542047B (zh) 异常请求的检测方法、装置、电子设备及计算机可读介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20928011

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20928011

Country of ref document: EP

Kind code of ref document: A1